:root {
    --bg-color: #0A0A0E;
    --surface-color: #16161D;
    --border-color: #272732;
    --text-primary: #FFFFFF;
    --text-secondary: #8A8A98;
    --accent-blue: #3B82F6;
    --accent-blue-bg: rgba(59, 130, 246, 0.1);
    --success: #34C759;
    --warning: #F59E0B;
    --danger: #EF4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
}

.container { width: 100%; max-width: 800px; display: flex; flex-direction: column; gap: 40px; }

.header { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 8px; }

.pill-badge {
    background-color: var(--accent-blue-bg);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.8125rem;
    margin-bottom: 20px;
}

.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.sensor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

.sensor-track { height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 3px; margin-top: 12px; overflow: hidden; }

.sensor-fill { height: 100%; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* Lists & Stacks */
.list-stack { display: flex; flex-direction: column; gap: 12px; }

.list-card { 
    display: flex; 
    flex-direction: row;
    align-items: center; 
    padding: 16px 20px; 
    gap: 20px; 
}

.list-card.stopped { opacity: 0.6; }
.list-card.loading { pointer-events: none; position: relative; }
.list-card.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

.list-badge {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
    flex-shrink: 0; font-size: 0.8rem;
}

/* Container Stats Sub-section */
.container-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* iOS Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(22px); }
input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* Maintenance Section */
.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.btn-action {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-action:hover {
    border-color: var(--accent-blue);
    background-color: rgba(59, 130, 246, 0.05);
}

.btn-action .label { font-weight: 600; font-size: 0.95rem; }
.btn-action .subtext { font-size: 0.8rem; color: var(--text-secondary); }

.section-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }

.subtitle { color: var(--text-secondary); font-size: 0.95rem; }

@media (max-width: 640px) { 
    .compact-grid { grid-template-columns: 1fr; }
    .maintenance-grid { grid-template-columns: 1fr; }
    .container-stats { flex-wrap: wrap; gap: 12px; }
}
