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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 2200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    opacity: 0.8;
    font-size: 1.1em;
}

.dashboard {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .value {
    font-size: 2em;
    font-weight: bold;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    height: 400px;
    position: relative;
}

.chart-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.chart-wrapper {
    position: relative;
    height: 320px;
    width: 100%;
}

.room-states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.room-state-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.room-state-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.room-state-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.room-state-info div {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
}

.room-state-info .label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.room-state-info .value {
    font-size: 1.1em;
    font-weight: bold;
    color: #2c3e50;
}

.room-state-timestamp {
    background: #e8f4fd;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
    color: #2c3e50;
}

.mac-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mac-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.mac-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.mac-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.mac-info div {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.mac-info .label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.mac-info .value {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background: #27ae60;
}

.status-inactive {
    background: #e74c3c;
}

.refresh-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .dashboard {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .room-states-grid {
        grid-template-columns: 1fr;
    }
    
    .mac-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 350px;
    }
    
    .chart-wrapper {
        height: 270px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 300px;
    }
    
    .chart-wrapper {
        height: 220px;
    }
}

.room-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.room-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.room-card h3 {
    margin: 0 0 10px;
    font-size: 1.1em;
    color: #2c3e50;
}

.room-card small {
    display: block;
    margin-bottom: 10px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.mac-list {
    max-height: 150px;
    overflow-y: auto;
    padding-left: 5px;
}

.mac-list label {
    display: block;
    margin: 5px 0;
    font-size: 0.9em;
}

.btn {
    margin: 10px 5px;
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

/* Pause button */
.btn-pause {
    background: #3498db;
}

.btn-pause:hover {
    background: #2980b9;
}

/* Refresh button */
.btn-refresh {
    background: #27ae60;
}

.btn-refresh:hover {
    background: #1e8449;
}

.btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-clear:hover {
    background: #c0392b;
}

.room-selection {
    margin: 20px;
}

.room-cards-grid {
    margin: 10px 0;
}

.config-options {
    margin: 15px 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.config-field {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.config-field label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.config-field input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.config-field input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.4);
}
