/* =====================================================================
   Cultivee Hidroponia — Dark Mode Design System
   ===================================================================== */

:root {
    --bg: hsl(210, 20%, 8%);
    --bg-card: hsl(210, 18%, 12%);
    --bg-card-hover: hsl(210, 18%, 15%);
    --bg-input: hsl(210, 18%, 14%);
    --text: hsl(210, 20%, 90%);
    --text-muted: hsl(210, 15%, 55%);
    --text-dim: hsl(210, 15%, 40%);
    --primary: hsl(142, 71%, 45%);
    --primary-hover: hsl(142, 71%, 38%);
    --primary-glow: hsla(142, 71%, 45%, 0.15);
    --danger: hsl(0, 72%, 51%);
    --danger-glow: hsla(0, 72%, 51%, 0.15);
    --warning: hsl(38, 92%, 50%);
    --border: hsl(210, 15%, 20%);
    --border-focus: hsl(142, 71%, 45%);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }

/* =====================================================================
   Auth Screen
   ===================================================================== */

.screen { min-height: 100vh; }

#auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, hsl(210, 25%, 6%), hsl(142, 30%, 10%));
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-card);
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.auth-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text);
    transition: var(--transition);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.auth-card input::placeholder {
    color: var(--text-dim);
}

.pass-group {
    position: relative;
}

.pass-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-70%);
    font-size: 0.75rem;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}

.auth-card button {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-card button:hover { background: var(--primary-hover); }

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-error {
    text-align: center;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--danger-glow);
    border-radius: var(--radius);
}

/* =====================================================================
   Navbar
   ===================================================================== */

.navbar {
    background: linear-gradient(135deg, hsl(210, 25%, 10%), hsl(210, 20%, 14%));
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.08em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-divider {
    width: 1px;
    height: 1rem;
    background: var(--border);
}

/* =====================================================================
   Module Bar
   ===================================================================== */

.module-bar {
    max-width: 600px;
    margin: 0 auto;
    padding: 0.75rem 1rem 0;
}

.modules-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 0.5rem; }

.btn-add {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-add:hover { border-color: var(--primary); background: var(--primary-glow); }

/* Module compact card */

.module-compact {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.module-compact:hover { background: var(--bg-card-hover); }

.module-compact-offline { opacity: 0.6; }

.module-compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-compact-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.module-compact-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-compact-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.module-compact-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.module-chevron {
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

/* Status dot */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary);
    animation: pulse-dot 2s infinite;
}

.status-dot.offline {
    background: var(--danger);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Module details (expanded) */

.module-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.module-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    color: var(--text-muted);
}

.stat-item svg { flex-shrink: 0; margin-top: 2px; }

.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 0.8rem; color: var(--text); font-weight: 500; }
.stat-label { font-size: 0.65rem; color: var(--text-dim); }

/* RSSI bars */

.rssi-bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 12px; }
.rssi-bar { width: 3px; background: var(--text-dim); border-radius: 1px; }
.rssi-bar:nth-child(1) { height: 3px; }
.rssi-bar:nth-child(2) { height: 6px; }
.rssi-bar:nth-child(3) { height: 9px; }
.rssi-bar:nth-child(4) { height: 12px; }
.rssi-bar.filled { background: var(--primary); }

/* Setup button */

.btn-setup-small {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-setup-small:hover { background: var(--primary-glow); }

/* =====================================================================
   Dashboard Hidroponia
   ===================================================================== */

#section-dashboard {
    max-width: 600px;
    margin: 0 auto;
    padding: 0.5rem 1rem 1rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-card);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.card-title h2 {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Stats grid */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-card {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

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

.stat-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.25rem;
}

.stat-card .value.small {
    font-size: 1.1rem;
}

/* Controls */

.controls-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ctrl-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.ctrl-btn.on {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px var(--primary-glow);
}

.ctrl-btn.off {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.ctrl-btn.off:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.ctrl-btn.danger-on {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 12px var(--danger-glow);
}

.ctrl-btn-mode {
    width: 100%;
    padding: 0.65rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.ctrl-btn-mode:hover { border-color: var(--primary); color: var(--primary); }

.ctrl-btn-mode.auto {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}

/* Phase progress bar */

.phase-progress {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    height: 28px;
    margin: 0.75rem 0;
    border: 1px solid var(--border);
}

.phase-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-input);
    transition: var(--transition);
    overflow: hidden;
    white-space: nowrap;
    padding: 0 4px;
}

.phase-segment.active {
    background: var(--primary);
    color: #fff;
}

/* Phase list */

.phase-item {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--border);
    transition: var(--transition);
}

.phase-item.active {
    border-left-color: var(--primary);
    background: hsla(145, 80%, 42%, 0.1);
    border-color: hsla(145, 80%, 42%, 0.25);
    border-left-color: var(--primary);
}

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

.phase-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.phase-badge {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
}

.phase-item-days {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.phase-item-days.phase-done {
    color: var(--primary);
}

.phase-item.past {
    opacity: 0.6;
}

.phase-mini-progress {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin: 0.4rem 0;
    overflow: hidden;
}

.phase-mini-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.5s ease;
    box-shadow: 0 0 6px var(--primary-glow);
}

.phase-item-details {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.4rem;
    line-height: 1.5;
}

/* =====================================================================
   Status Indicators
   ===================================================================== */

.status-indicators {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.status-on {
    background: var(--primary-glow);
    color: var(--primary);
}

.status-indicator.status-on.pump {
    background: hsla(210, 80%, 55%, 0.15);
    color: hsl(210, 80%, 55%);
}

.status-indicator.status-off {
    background: var(--bg-input);
    color: var(--text-dim);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-indicator.status-on .status-indicator-dot {
    box-shadow: 0 0 6px currentColor;
    animation: pulse-dot 2s infinite;
}

.ctrl-btn.pump-on {
    background: hsl(210, 80%, 55%);
    color: #fff;
    box-shadow: 0 0 12px hsla(210, 80%, 55%, 0.3);
}

.ctrl-btn-mode.manual {
    border-color: var(--warning);
    color: var(--warning);
    background: hsla(38, 92%, 50%, 0.1);
}

/* =====================================================================
   Config Button & Modal
   ===================================================================== */

.btn-config {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-config:hover { border-color: var(--primary); background: var(--primary-glow); }

.config-modal-content {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.config-phase {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.config-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.config-phase-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.config-remove {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.config-remove:hover { color: var(--danger); border-color: var(--danger); }

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.config-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.config-field input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition);
    font-family: var(--font);
}

.config-field input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.config-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0.5rem 0 0.25rem;
}

.config-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger-outline {
    padding: 0.65rem 1rem;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.btn-danger-outline:hover { border-color: var(--danger); background: var(--danger-glow); }

.module-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.module-code-label {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.module-code-label strong {
    color: var(--primary);
    font-family: monospace;
    letter-spacing: 0.1em;
}

/* Auto-pair status */
.auto-pair-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
}

.auto-pair-status p { font-size: 0.9rem; }
.auto-pair-hint { color: var(--text-dim); font-size: 0.75rem !important; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button pending state */
.ctrl-btn.pending, .ctrl-btn-mode.pending {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.btn-danger-small {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    justify-content: center;
}

.btn-danger-small:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-glow); }

/* =====================================================================
   Modal
   ===================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

/* Wizard */

.wizard-modal { max-width: 400px; }

.wizard-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.wizard-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--primary);
}

.wizard-header h3 {
    font-size: 1.1rem;
    color: var(--text);
}

.wizard-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.wizard-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: var(--transition);
}

.wizard-option:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.wizard-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.wizard-option strong { display: block; font-size: 0.9rem; }
.wizard-option small { color: var(--text-muted); font-size: 0.75rem; }

.wizard-progress { margin-bottom: 1rem; }

.progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    display: block;
}

.wizard-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.check-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.check-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-note {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.wizard-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* Modal inputs */

.modal-content input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text);
    transition: var(--transition);
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-content input[type="text"]::placeholder {
    color: var(--text-dim);
}

/* =====================================================================
   PWA Banner
   ===================================================================== */

.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    padding: 0.75rem;
}

.pwa-banner-inner {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.pwa-banner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pwa-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.pwa-banner-info strong { display: block; font-size: 0.85rem; }
.pwa-banner-info small { color: var(--text-muted); font-size: 0.7rem; }

.pwa-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pwa-btn-install {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.pwa-btn-install:hover { background: var(--primary-hover); }

.pwa-btn-dismiss {
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Update banner */

.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    padding: 0.75rem;
}

.update-banner-inner {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.update-banner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.update-banner-info strong { display: block; font-size: 0.85rem; color: var(--text); }
.update-banner-info small { color: var(--text-muted); font-size: 0.7rem; }

.update-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* =====================================================================
   Footer
   ===================================================================== */

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 0.7rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 640px) {
    .module-stats { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
    .pwa-banner-inner { flex-direction: column; text-align: center; }
    .pwa-banner-actions { justify-content: center; }
}
