* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    color: #333;
    font-size: 1.8em;
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.boxes-count {
    background: #48bb78;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.update-info {
    color: #666;
    font-size: 0.9em;
}

.btn-refresh, .btn-back {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-refresh:hover, .btn-back:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-back {
    background: #48bb78;
}

.btn-back:hover {
    background: #38a169;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card-header {
    background: #f7fafc;
    padding: 15px 20px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 {
    color: #2d3748;
    font-size: 1.3em;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-ok {
    background: #c6f6d5;
    color: #22543d;
}

.status-warning {
    background: #feebc8;
    color: #7b341e;
}

.status-critical {
    background: #fed7d7;
    color: #742a2a;
}

.status-offline {
    background: #e2e8f0;
    color: #4a5568;
}

.status-disabled {
    background: #e9d8fd;
    color: #44337a;
}

.card-body {
    padding: 20px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.param {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.param-label {
    color: #718096;
}

.param-value {
    font-weight: 600;
    color: #2d3748;
}

.warning-value {
    color: #e53e3e;
    font-weight: 700;
}

.alarms-warning {
    margin-top: 15px;
    padding: 8px 12px;
    background: #feebc8;
    border-radius: 8px;
    color: #7b341e;
    font-size: 0.85em;
}

.card-footer {
    background: #f7fafc;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: #a0aec0;
    min-height: 52px;
}

.timestamp {
    color: #a0aec0;
}

.btn-detail {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-detail:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.disabled-btn {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    background: #a0aec0;
}

.disabled-btn:hover {
    transform: none;
    background: #a0aec0;
}

.offline-body {
    text-align: center;
    padding: 25px 20px !important;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.offline-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    opacity: 0.5;
}

.offline-message {
    font-size: 0.95em;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
}

.offline-time {
    font-size: 0.75em;
    color: #a0aec0;
}

.disabled-text {
    text-align: center;
    padding: 25px;
    color: #a0aec0;
    font-style: italic;
}

.loading, .info, .error {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 15px;
    color: #718096;
}

.error {
    color: #e53e3e;
    border: 1px solid #fed7d7;
    background: #fff5f5;
}

.detail-content {
    min-height: 500px;
    margin-bottom: 30px;
}

.top-info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.top-info-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.top-info-label {
    display: block;
    font-size: 0.85em;
    color: #718096;
    margin-bottom: 5px;
}

.top-info-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #2d3748;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.side-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.side-a {
    border-top: 4px solid #4299e1;
}

.side-b {
    border-top: 4px solid #48bb78;
}

.side-header {
    background: #f7fafc;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.side-header h2 {
    font-size: 1.3em;
    color: #2d3748;
}

.mode-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.mode-auto {
    background: #c6f6d5;
    color: #22543d;
}

.mode-manual {
    background: #fed7d7;
    color: #742a2a;
}

.side-body {
    padding: 20px;
}

.temp-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.temp-item {
    text-align: center;
}

.temp-label {
    display: block;
    font-size: 0.8em;
    color: #718096;
    margin-bottom: 5px;
}

.temp-value {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
    color: #2d3748;
}

.params-grid-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.param-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #edf2f7;
}

.param-label-detail {
    font-size: 0.85em;
    color: #718096;
}

.param-value-detail {
    font-weight: 600;
    color: #2d3748;
}

.alarms-section {
    margin-top: 15px;
    padding: 12px;
    background: #fff5f5;
    border-radius: 10px;
}

.alarms-title {
    font-weight: 600;
    color: #c53030;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.no-alarms-side {
    margin-top: 15px;
    padding: 12px;
    background: #f0fff4;
    border-radius: 10px;
    color: #38a169;
    text-align: center;
    font-weight: 600;
}

.alarm-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 0.85em;
}

.alarm-item.critical {
    background: #fed7d7;
    color: #742a2a;
    border-left: 3px solid #e53e3e;
}

.alarm-item.warning {
    background: #feebc8;
    color: #7b341e;
    border-left: 3px solid #ed8936;
}

.common-equipment {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 25px;
}

.common-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.common-card-header {
    background: #edf2f7;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.common-card-header h2 {
    font-size: 1.2em;
    color: #2d3748;
    margin: 0;
}

.common-card-body {
    padding: 20px;
}

.fans-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.fan-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-radius: 12px;
    background: #f7fafc;
    min-width: 180px;
}

.fan-item.fan-on {
    background: #c6f6d5;
    border-left: 4px solid #38a169;
}

.fan-item.fan-off {
    background: #fed7d7;
    border-left: 4px solid #e53e3e;
}

.fan-icon {
    font-size: 2em;
}

.fan-info {
    flex: 1;
}

.fan-name {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 4px;
}

.fan-status {
    font-size: 0.85em;
}

.fan-fault {
    font-size: 0.8em;
    color: #e53e3e;
    margin-top: 4px;
}

.cooling-tower-card {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tower-header {
    background: rgba(0,0,0,0.2);
    padding: 15px 20px;
}

.tower-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.tower-body {
    padding: 20px;
}

.tower-params {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.tower-param {
    text-align: center;
}

.tower-label {
    display: block;
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.tower-value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
}

.tower-fans {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.tower-fans-title {
    display: block;
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.tower-fans-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tower-fan-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
}

.tower-fan-item.fan-on {
    background: rgba(72, 187, 120, 0.3);
}

.tower-fan-item.fan-off {
    background: rgba(229, 62, 62, 0.3);
}

.tower-extra {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.extra-item {
    display: inline-flex;
    gap: 15px;
    align-items: center;
    padding: 8px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
}

.extra-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.extra-value {
    font-weight: bold;
}

.common-alarms-card {
    background: #fed7d7;
    border-left: 4px solid #e53e3e;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.common-alarms-header {
    font-weight: bold;
    color: #742a2a;
    margin-bottom: 10px;
}

.common-alarms-list .alarm-item {
    margin-bottom: 5px;
}

.additional-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-card-a {
    border-top: 4px solid #4299e1;
}

.info-card-b {
    border-top: 4px solid #48bb78;
}

.info-card h3 {
    font-size: 1.1em;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

.info-group {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #edf2f7;
}

.info-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-group-title {
    font-size: 0.8em;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-group .info-row {
    padding: 4px 0;
    font-size: 0.85em;
}

.info-group .info-row span:first-child {
    color: #718096;
    font-size: 0.85em;
}

.info-group .info-row span:last-child {
    font-weight: 600;
    color: #2d3748;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85em;
    border-bottom: 1px solid #f7fafc;
}

.info-row span:first-child {
    color: #718096;
}

.info-row span:last-child {
    font-weight: 600;
    color: #2d3748;
}

.automation-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 0;
}

.automation-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top: 4px solid #9f7aea;
}

.automation-card h3 {
    font-size: 1.1em;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.automation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

.auto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #f7fafc;
}

.auto-label {
    color: #718096;
}

.auto-value {
    font-weight: 600;
    color: #2d3748;
}

.auto-value.status-on {
    color: #38a169;
}

.auto-value.status-off {
    color: #a0aec0;
}

.auto-value.status-alarm {
    color: #e53e3e;
}

.error-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.error-card.offline-error {
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.error-card h2 {
    color: #e53e3e;
    margin-bottom: 15px;
}

.error-message {
    color: #718096;
    margin-bottom: 20px;
}

.error-tips {
    background: #f7fafc;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

.error-tips p {
    font-weight: bold;
    margin-bottom: 10px;
    color: #4a5568;
}

.error-tips ul {
    margin-left: 20px;
    color: #718096;
}

.error-tips li {
    margin: 8px 0;
}

.error-time {
    font-size: 0.85em;
    color: #a0aec0;
    margin: 20px 0;
}

/* ============================================ */
/* СТИЛИ ДЛЯ СТАТИСТИКИ ВОРКЕРОВ */
/* ============================================ */

.workers-stats-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.workers-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.workers-stats-header h2 {
    color: #2d3748;
    font-size: 1.2em;
    margin: 0;
}

.workers-update {
    font-size: 0.8em;
    color: #a0aec0;
}

.workers-stats-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.worker-container-stat {
    background: #f7fafc;
    border-radius: 10px;
    padding: 12px 15px;
    text-align: center;
    border-left: 3px solid #a0aec0;
    min-width: 0;
    transition: all 0.2s;
}

.worker-container-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.worker-container-stat .container-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9em;
    white-space: nowrap;
}

.worker-container-stat .container-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #2d3748;
}

.worker-container-stat .container-active {
    color: #38a169;
}

.worker-container-stat .container-inactive {
    color: #ed8936;
}

.worker-container-stat .container-dead {
    color: #e53e3e;
}

.worker-container-stat.has-issues {
    border-left-color: #e53e3e;
    background: #fff5f5;
}

.worker-container-stat .status-dots {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

.worker-container-stat .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.worker-container-stat .status-dot.active {
    background: #38a169;
}

.worker-container-stat .status-dot.inactive {
    background: #ed8936;
}

.worker-container-stat .status-dot.dead {
    background: #e53e3e;
}

.worker-container-stat:last-child {
    border-left-color: #667eea;
    background: #ebf4ff;
}

/* ============================================ */
/* СТИЛИ ДЛЯ ДЕТАЛЬНОЙ СТРАНИЦЫ ВОРКЕРОВ */
/* ============================================ */

.workers-detail-block {
    background: white;
    border-radius: 15px;
    padding: 20px 25px;
    margin-top: 0;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.workers-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.workers-detail-header h2 {
    color: #2d3748;
    font-size: 1.2em;
    margin: 0;
}

.workers-detail-update {
    font-size: 0.8em;
    color: #a0aec0;
}

.workers-side-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.worker-side-card {
    border-radius: 10px;
    padding: 15px;
    background: #f7fafc;
}

.worker-side-card.side-a {
    border-left: 4px solid #4299e1;
}

.worker-side-card.side-b {
    border-left: 4px solid #48bb78;
}

.worker-side-card .side-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1em;
}

.worker-side-card .side-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.worker-side-card .side-stat {
    font-size: 0.85em;
}

.worker-side-card .side-stat .stat-value {
    font-weight: 600;
}

.worker-side-card .side-stat.active .stat-value {
    color: #38a169;
}

.worker-side-card .side-stat.inactive .stat-value {
    color: #ed8936;
}

.worker-side-card .side-stat.dead .stat-value {
    color: #e53e3e;
}

.worker-ips-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85em;
}

.worker-ip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 5px;
}

.worker-ip-item:hover {
    background: #edf2f7;
}

.worker-ip-item .ip-status {
    font-size: 0.75em;
    padding: 1px 8px;
    border-radius: 10px;
}

.worker-ip-item .ip-status.active {
    background: #c6f6d5;
    color: #22543d;
}

.worker-ip-item .ip-status.inactive {
    background: #feebc8;
    color: #7b341e;
}

.worker-ip-item .ip-status.dead {
    background: #fed7d7;
    color: #742a2a;
}

.worker-ip-item .ip-hashrate {
    color: #718096;
    font-size: 0.8em;
}

.no-workers {
    color: #a0aec0;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.workers-error {
    color: #e53e3e;
    text-align: center;
    padding: 20px;
}

/* ============================================ */
/* СТИЛИ ДЛЯ СОБЫТИЙ */
/* ============================================ */

.event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.event-item:hover {
    background: #f7fafc;
}

.event-item .event-icon {
    font-size: 1.2em;
}

.event-item .event-message {
    flex: 1;
    color: #2d3748;
}

.event-item .event-time {
    color: #a0aec0;
    font-size: 0.8em;
}

.event-item .event-badge {
    padding: 1px 10px;
    border-radius: 12px;
    font-size: 0.7em;
    text-transform: uppercase;
    color: white;
}

.event-badge.emergency {
    background: #e53e3e;
}

.event-badge.critical {
    background: #ed8936;
}

.event-badge.warning {
    background: #d69e2e;
}

.event-badge.info {
    background: #3182ce;
}

#eventsHistoryList::-webkit-scrollbar {
    width: 6px;
}

#eventsHistoryList::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#eventsHistoryList::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#eventsHistoryList::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ============================================ */
/* АДАПТИВНОСТЬ - ТОЛЬКО ДЛЯ СТАТИСТИКИ ВОРКЕРОВ */
/* ============================================ */

@media (max-width: 1024px) {
    .workers-stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }

    .worker-container-stat {
        padding: 8px 10px !important;
    }

    .worker-container-stat .container-label {
        font-size: 0.75em !important;
    }

    .worker-container-stat .container-total {
        font-size: 1em !important;
    }

    .worker-container-stat .status-dots {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .workers-stats-card {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        padding: 12px 15px !important;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .workers-stats-header h2 {
        font-size: 0.95em !important;
    }

    .workers-update {
        font-size: 0.6em !important;
    }

    .workers-stats-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding: 4px 0 12px 0 !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: thin !important;
    }

    .workers-stats-grid::-webkit-scrollbar {
        height: 3px !important;
    }

    .workers-stats-grid::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.05) !important;
        border-radius: 4px !important;
    }

    .workers-stats-grid::-webkit-scrollbar-thumb {
        background: #667eea !important;
        border-radius: 4px !important;
    }

    .worker-container-stat {
        flex: 0 0 85px !important;
        min-width: 75px !important;
        padding: 8px 10px !important;
        border-radius: 10px !important;
        scroll-snap-align: start !important;
        border-left: 3px solid #a0aec0 !important;
        background: rgba(247, 250, 252, 0.8) !important;
        backdrop-filter: blur(5px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .worker-container-stat .container-label {
        font-size: 0.65em !important;
        white-space: nowrap !important;
        color: #4a5568 !important;
    }

    .worker-container-stat .container-total {
        font-size: 0.9em !important;
        margin: 2px 0 !important;
        color: #2d3748 !important;
    }

    .worker-container-stat > div:last-child {
        font-size: 0.55em !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1px !important;
        align-items: center !important;
    }

    .worker-container-stat .container-active,
    .worker-container-stat .container-inactive,
    .worker-container-stat .container-dead {
        font-size: 0.6em !important;
        white-space: nowrap !important;
        padding: 1px 4px !important;
        border-radius: 3px !important;
        background: rgba(255,255,255,0.5);
    }

    .worker-container-stat .status-dots {
        display: none !important;
    }

    .worker-container-stat.has-issues {
        border-left-color: #e53e3e !important;
        background: rgba(255, 245, 245, 0.9) !important;
    }

    .worker-container-stat:last-child {
        flex: 0 0 95px !important;
        min-width: 85px !important;
        border-left-color: #667eea !important;
        background: rgba(235, 244, 255, 0.9) !important;
    }
}

@media (max-width: 480px) {
    .workers-stats-card {
        padding: 10px 12px !important;
    }

    .workers-stats-header h2 {
        font-size: 0.85em !important;
    }

    .worker-container-stat {
        flex: 0 0 70px !important;
        min-width: 65px !important;
        padding: 6px 8px !important;
    }

    .worker-container-stat .container-label {
        font-size: 0.55em !important;
    }

    .worker-container-stat .container-total {
        font-size: 0.8em !important;
    }

    .worker-container-stat > div:last-child {
        font-size: 0.5em !important;
    }

    .worker-container-stat .container-active,
    .worker-container-stat .container-inactive,
    .worker-container-stat .container-dead {
        font-size: 0.5em !important;
        padding: 0px 3px !important;
    }

    .worker-container-stat:last-child {
        flex: 0 0 80px !important;
        min-width: 75px !important;
    }
}

@media (max-width: 360px) {
    .worker-container-stat {
        flex: 0 0 60px !important;
        min-width: 55px !important;
        padding: 4px 6px !important;
        border-radius: 8px !important;
    }

    .worker-container-stat .container-label {
        font-size: 0.5em !important;
    }

    .worker-container-stat .container-total {
        font-size: 0.7em !important;
    }

    .worker-container-stat > div:last-child {
        font-size: 0.45em !important;
    }

    .worker-container-stat .container-active,
    .worker-container-stat .container-inactive,
    .worker-container-stat .container-dead {
        font-size: 0.45em !important;
    }

    .worker-container-stat:last-child {
        flex: 0 0 70px !important;
        min-width: 65px !important;
    }
}

/* ============================================ */
/* ОСТАЛЬНАЯ АДАПТИВНОСТЬ (ОБЩАЯ) */
/* ============================================ */

@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .temp-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .temp-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .temp-label {
        margin-bottom: 0;
    }

    .temp-value {
        font-size: 1.1em;
    }

    .params-grid-detail {
        grid-template-columns: 1fr;
    }

    .top-info-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .additional-info {
        grid-template-columns: 1fr;
    }

    .automation-block {
        grid-template-columns: 1fr;
    }

    .automation-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .workers-side-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }

    .header-info {
        justify-content: center;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .card-header {
        flex-direction: column;
        text-align: center;
    }

    .top-info-bar {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.2em;
    }
}



/* Дополнительные стили для статистики майнеров */
.worker-ip-item .ip-hashrate {
    color: #718096;
    font-size: 0.75em;
    margin-left: 5px;
}

.worker-ip-item .ip-status {
    font-size: 0.75em;
    padding: 1px 8px;
    border-radius: 10px;
}

.worker-ip-item .ip-status.active {
    background: #c6f6d5;
    color: #22543d;
}

.worker-ip-item .ip-status.inactive {
    background: #feebc8;
    color: #7b341e;
}

.worker-ip-item .ip-status.dead {
    background: #fed7d7;
    color: #742a2a;
}
