/* ═══════════════════════════════════════════════════════════
   KEKA DASHBOARD — styles.css
   Design tokens mirror popup.html; adapted for full-page layout
   ═══════════════════════════════════════════════════════════ */

/* ── Google Font (Inter loaded via HTML) ── */

/* ── Design Tokens ── */
:root {
    --bg:           #0d1117;
    --bg-elevated:  #161b27;
    --bg-card:      rgba(255,255,255,0.04);
    --bg-card-hover:rgba(255,255,255,0.07);
    --border:       rgba(255,255,255,0.08);
    --border-focus: rgba(255,255,255,0.2);
    --text:         #f0f4ff;
    --text-muted:   rgba(240,244,255,0.5);
    --text-faint:   rgba(240,244,255,0.3);
    --divider:      rgba(255,255,255,0.07);
    --sidebar-w:    220px;

    --green:  #2ecc71;
    --orange: #f39c12;
    --blue:   #3498db;
    --cyan:   #00f2fe;

    --glow-green:  0 8px 28px rgba(46,204,113,0.22);
    --glow-orange: 0 8px 28px rgba(243,156,18,0.22);
    --glow-blue:   0 8px 28px rgba(52,152,219,0.22);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --ring-c: 213.6; /* 2π × 34 */
}

:root.light {
    --bg:           #f0f4f8;
    --bg-elevated:  #ffffff;
    --bg-card:      rgba(0,0,0,0.03);
    --bg-card-hover:rgba(0,0,0,0.055);
    --border:       rgba(0,0,0,0.08);
    --border-focus: rgba(0,0,0,0.18);
    --text:         #1e293b;
    --text-muted:   #64748b;
    --text-faint:   #94a3b8;
    --divider:      rgba(0,0,0,0.07);
    --glow-green:  0 8px 28px rgba(46,204,113,0.18);
    --glow-orange: 0 8px 28px rgba(243,156,18,0.18);
    --glow-blue:   0 8px 28px rgba(52,152,219,0.18);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

.screen { min-height: 100vh; }

/* ══════════════════════════════════════════════════════════
   SETUP SCREEN
   ══════════════════════════════════════════════════════════ */
#screen-setup {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 20%, rgba(52,152,219,0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(46,204,113,0.08) 0%, transparent 50%),
                var(--bg);
    padding: 24px;
}

.setup-wrap {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Logo */
.setup-logo {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.setup-logo-ring {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.setup-ring-anim {
    animation: ring-spin 2.5s linear infinite;
    transform-origin: 18px 18px;
}
@keyframes ring-spin {
    to { stroke-dashoffset: -100.5; }
}
.setup-logo-k {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
}

.setup-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-align: center;
}
.setup-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.6;
}

.setup-card {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.setup-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: -6px;
}

.setup-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.setup-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 44px 12px 14px;
    font-family: 'Inter', monospace;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}
.setup-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.12);
}
.setup-input::placeholder { color: var(--text-faint); }
.setup-input-icon {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.setup-input-icon:hover { color: var(--text); }

.setup-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--blue), #2980b9);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}
.setup-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.setup-btn:active { transform: translateY(0); }

.btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.setup-error {
    font-size: 12px;
    color: #e74c3c;
    background: rgba(231,76,60,0.1);
    border: 1px solid rgba(231,76,60,0.2);
    border-radius: 6px;
    padding: 10px 12px;
    text-align: center;
}

.setup-hint {
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
    line-height: 1.7;
}
.setup-hint strong { color: var(--text-muted); font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   DASHBOARD SCREEN — shell
   ══════════════════════════════════════════════════════════ */
#screen-dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-right: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    gap: 8px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 6px;
}
.sidebar-logo-icon {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--blue), var(--green));
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px; color: #fff;
    flex-shrink: 0;
}
.sidebar-logo-text {
    font-weight: 800; font-size: 15px; letter-spacing: -0.3px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s, color 0.18s;
    width: 100%;
    position: relative;
}
.sidebar-nav-item:hover { background: var(--bg-card); color: var(--text); }
.sidebar-nav-item.active {
    background: rgba(52,152,219,0.12);
    color: var(--blue);
}
.nav-badge {
    font-size: 8px;
    color: var(--orange);
    margin-left: auto;
    animation: pulse-badge 1.5s ease infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

.sidebar-bottom {
    border-top: 1px solid var(--divider);
    padding-top: 12px;
    display: flex;
    gap: 4px;
}
.sidebar-icon-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s, transform 0.15s;
}
.sidebar-icon-btn:hover {
    background: var(--bg-card);
    color: var(--text);
    transform: scale(1.1);
}
.sidebar-logout:hover { color: #e74c3c !important; }

/* ── Main content ── */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
}

/* scrollbar */
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.view { display: flex; flex-direction: column; gap: 24px; max-width: 780px; }

/* ── Content header ── */
.content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.content-title { font-size: 22px; font-weight: 900; letter-spacing: -0.4px; }
.content-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 4px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(46,204,113,0.12);
    border: 1px solid rgba(46,204,113,0.3);
    border-radius: 99px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
}
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: live-pulse 1.2s ease infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.7); }
}
.last-updated { font-size: 11px; color: var(--text-faint); }

/* ── Progress Rings ── */
.rings-row {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
}
.ring-divider {
    width: 1px;
    height: 64px;
    background: var(--divider);
    margin: 0 32px;
    flex-shrink: 0;
}
.ring-panel {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}
.ring-panel-right { justify-content: flex-end; }
.ring-panel-ring { position: relative; display: flex; align-items: center; justify-content: center; }
.ring-svg { transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--divider); stroke-width: 5; }
.ring-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 213.6;
    stroke-dashoffset: 213.6;
    transition: stroke-dashoffset 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring-fill-blue {
    stroke: var(--blue);
    filter: drop-shadow(0 0 4px rgba(52,152,219,0.5));
}
.ring-fill-green {
    stroke: var(--green);
    filter: drop-shadow(0 0 4px rgba(46,204,113,0.5));
}
.ring-label {
    position: absolute;
    font-size: 13px;
    font-weight: 900;
    color: var(--text);
    pointer-events: none;
}
.ring-panel-info { display: flex; flex-direction: column; gap: 4px; }
.ring-panel-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: var(--text-muted);
}
.ring-panel-sub {
    font-size: 12px;
    color: rgba(255, 200, 80, 0.9);
    font-weight: 700;
    min-height: 18px;
}

/* ── Stat Cards ── */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow  0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-focus);
}
.stat-card:hover::before { opacity: 1; }

/* status variants */
.stat-card.status-live {
    background: linear-gradient(135deg, rgba(243,156,18,0.12) 0%, rgba(243,156,18,0.03) 100%);
    border-color: rgba(243,156,18,0.35);
    box-shadow: var(--glow-orange);
}
.stat-card.status-live:hover { box-shadow: 0 12px 32px rgba(243,156,18,0.3); border-color: rgba(243,156,18,0.55); }
.stat-card.status-met {
    background: linear-gradient(135deg, rgba(46,204,113,0.12) 0%, rgba(46,204,113,0.03) 100%);
    border-color: rgba(46,204,113,0.35);
    box-shadow: var(--glow-green);
}
.stat-card.status-met:hover { box-shadow: 0 12px 32px rgba(46,204,113,0.3); border-color: rgba(46,204,113,0.55); }
.stat-card.status-pending {
    background: linear-gradient(135deg, rgba(52,152,219,0.12) 0%, rgba(52,152,219,0.03) 100%);
    border-color: rgba(52,152,219,0.35);
    box-shadow: var(--glow-blue);
}
.stat-card.status-pending:hover { box-shadow: 0 12px 32px rgba(52,152,219,0.3); border-color: rgba(52,152,219,0.55); }

.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-type { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 800; }
.stat-card-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-orange { background: var(--orange); box-shadow: 0 0 6px rgba(243,156,18,0.6); }
.dot-green  { background: var(--green);  box-shadow: 0 0 6px rgba(46,204,113,0.6); }

.stat-card-time { font-size: 32px; font-weight: 900; letter-spacing: -1px; margin-bottom: 14px; }
.stat-card-gross   .stat-card-time { color: var(--orange); }
.stat-card-effective .stat-card-time { color: var(--green); }

.stat-card-meta { display: flex; flex-direction: column; gap: 6px; }
.stat-card-meta-row { display: flex; justify-content: space-between; align-items: center; }
.meta-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-muted); font-weight: 800; }
.meta-val   { font-size: 13px; font-weight: 800; color: var(--text); }

/* ── Timeline ── */
.timeline-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}
.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.timeline-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; color: var(--text-muted); }
.timeline-break-row { display: flex; align-items: center; gap: 6px; }
.timeline-break-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 800; }
.timeline-break-val { font-size: 13px; font-weight: 800; color: var(--orange); }

.timeline-track {
    height: 10px;
    background: var(--divider);
    border-radius: 5px;
    display: flex;
    overflow: visible;
    position: relative;
    margin-bottom: 8px;
}
.timeline-seg {
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: filter 0.2s;
}
.timeline-seg:first-child { border-radius: 5px 0 0 5px; }
.timeline-seg:last-child  { border-radius: 0 5px 5px 0; }
.timeline-seg.seg-work  { background: var(--green); }
.timeline-seg.seg-break { background: var(--orange); opacity: 0.75; }
.timeline-seg:hover { filter: brightness(1.2); }

/* Tooltip */
.timeline-seg:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18,22,33,0.97);
    color: #fff;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
}
.timeline-seg:first-child:hover::after { left: 0; transform: none; }
.timeline-seg:last-child:hover::after  { left: auto; right: 0; transform: none; }
.light .timeline-seg:hover::after {
    background: rgba(255,255,255,0.98);
    color: #1e293b;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.timeline-times { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-faint); font-weight: 600; }

/* ── Footer ── */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-faint);
    padding-top: 4px;
    border-top: 1px solid var(--divider);
    margin-top: 4px;
}
.footer-email { font-family: monospace; font-size: 10px; color: var(--text-faint); }

/* ══════════════════════════════════════════════════════════
   NOTIFICATIONS VIEW
   ══════════════════════════════════════════════════════════ */
.notif-permission-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(52,152,219,0.08);
    border: 1px solid rgba(52,152,219,0.25);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}
/* Was an inline style="display:flex; gap:8px". Needs to wrap: once
   notifications are enabled the button grows to "✓ Notifications Enabled"
   and a second button appears, and the pair (346px) overflowed the card
   below ~380px. Shrinkable + wrapping, so the buttons stack instead. */
.notif-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}
.notif-permission-icon {
    width: 40px; height: 40px;
    background: rgba(52,152,219,0.15);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--blue);
    flex-shrink: 0;
}
.notif-permission-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notif-permission-text strong { font-size: 13px; font-weight: 700; }
.notif-permission-text span   { font-size: 12px; color: var(--text-muted); }
.notif-enable-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.notif-enable-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.notif-enable-btn.enabled {
    background: rgba(46,204,113,0.15);
    color: var(--green);
    border: 1px solid rgba(46,204,113,0.3);
}
.notif-test-btn {
    background: rgba(52,152,219,0.15);
    color: var(--blue);
    border: 1px solid rgba(52,152,219,0.35);
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.notif-test-btn:hover {
    background: rgba(52,152,219,0.25);
    transform: translateY(-1px);
}

/* In-app toast fallback */
.notif-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-focus);
    box-shadow: 0 12px 36px rgba(0,0,0,0.4);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 10000;
    max-width: 340px;
    animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-toast-icon { font-size: 20px; }
.notif-toast-content strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.notif-toast-content span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }


.notif-config-card, .notif-preview-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.notif-config-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: -6px;
}

.notif-config-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--divider);
}
.notif-config-row:last-of-type { border-bottom: none; padding-bottom: 0; }
.notif-config-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.notif-config-label span:first-child { font-size: 13px; font-weight: 600; }
.notif-config-hint { font-size: 11px; color: var(--text-muted); }

/* Days picker */
.days-picker { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.day-btn {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}
.day-btn:hover { border-color: var(--border-focus); color: var(--text); }
.day-btn.active {
    background: rgba(52,152,219,0.15);
    border-color: rgba(52,152,219,0.4);
    color: var(--blue);
}

/* Time range */
.time-range-wrap { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.time-input-group { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.time-input-group label { font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.time-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    /* Wide enough for the native control's "07:00 PM" in 12h locales —
       110px clipped it to "07:00 PI". */
    width: 132px;
    min-width: 132px;
}
.time-input:focus { border-color: var(--border-focus); }
/* Fix time input colors in light/dark */
.time-input::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; }

.time-range-sep { color: var(--text-muted); font-size: 16px; margin-top: 18px; }

/* Interval picker */
.interval-picker { display: flex; gap: 6px; }
.interval-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}
.interval-btn:hover { border-color: var(--border-focus); color: var(--text); }
.interval-btn.active {
    background: rgba(46,204,113,0.12);
    border-color: rgba(46,204,113,0.35);
    color: var(--green);
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    width: 44px; height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 99px;
    position: relative;
    transition: background 0.25s, border-color 0.25s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--text-faint);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s;
}
.toggle-switch input:checked + .toggle-track {
    background: rgba(46,204,113,0.2);
    border-color: rgba(46,204,113,0.4);
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
    background: var(--green);
}

/* Save row */
.notif-save-row { display: flex; align-items: center; gap: 14px; margin-top: -4px; }
.notif-save-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--blue), #2980b9);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.notif-save-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.notif-save-msg { font-size: 12px; color: var(--green); font-weight: 700; animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* Notification previews */
.notif-preview-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.notif-preview-icon { font-size: 20px; flex-shrink: 0; }
.notif-preview-body { display: flex; flex-direction: column; gap: 3px; }
.notif-preview-body strong { font-size: 13px; font-weight: 700; }
.notif-preview-body span  { font-size: 12px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   BOTTOM NAV BAR  (mobile only)
   ══════════════════════════════════════════════════════════ */
.bottom-nav {
    display: none; /* shown only on mobile via media query */
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner {
    display: flex;
    align-items: stretch;
    height: 58px;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.bottom-nav-item.active { color: var(--blue); }
.bottom-nav-item:active { background: var(--bg-card); }
.bottom-nav-sep {
    width: 1px;
    background: var(--divider);
    margin: 10px 0;
    flex-shrink: 0;
}
.bottom-nav-badge {
    position: absolute;
    top: 8px;
    right: calc(50% - 14px);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--orange);
    animation: pulse-badge 1.5s ease infinite;
}

/* ══════════════════════════════════════════════════════════
   MOBILE  ≤ 640px  — bottom nav, stacked layout
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Hide desktop sidebar, show bottom nav */
    .sidebar { display: none; }
    .bottom-nav { display: block; }

    /* Dashboard shell */
    #screen-dashboard {
        flex-direction: column;
    }
    .main-content {
        padding: 16px 14px;
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 12px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .view { gap: 16px; max-width: 100%; }

    /* Setup screen */
    .setup-wrap { padding: 0 4px; }
    .setup-card { padding: 20px 18px; }
    .setup-title { font-size: 22px; }

    /* Content header — stack on very small screens */
    .content-header { flex-wrap: wrap; gap: 8px; }
    .content-title { font-size: 18px; }
    .header-right { margin-top: 0; }
    .last-updated { display: none; } /* save space */

    /* Rings — stack vertically */
    .rings-row {
        flex-direction: column;
        padding: 18px 20px;
        gap: 20px;
    }
    .ring-divider { width: 100%; height: 1px; margin: 0; }
    .ring-panel {
        width: 100%;
        justify-content: flex-start;
        gap: 16px;
    }
    .ring-panel-right { justify-content: flex-start; flex-direction: row-reverse; }
    .ring-panel-right .ring-panel-info { text-align: left; }

    /* Cards — single column */
    .cards-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-card-time { font-size: 28px; }

    /* Timeline */
    .timeline-section { padding: 16px; }

    /* Notification settings */
    .notif-permission-card { gap: 12px; }
    /* Buttons take the wrapped line and share it, stacking when they can't fit */
    .notif-actions { width: 100%; justify-content: stretch; }
    .notif-actions > button { flex: 1 1 auto; }
    .notif-config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .notif-config-row:last-of-type { padding-bottom: 0; }
    .days-picker { justify-content: flex-start; }
    /* Groups grow to share one line, and stack to full width when two
       132px inputs no longer fit (≈below 390px). The separator is hidden
       here — once the groups wrap it strands at the end of a line, and the
       FROM / TO labels already carry the meaning. */
    .time-range-wrap { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
    .time-input-group { align-items: flex-start; width: auto; flex: 1 1 132px; }
    .time-input { width: 100%; }
    .time-range-sep { display: none; }
    .interval-picker { flex-wrap: wrap; }
    .notif-config-card, .notif-preview-card { padding: 18px 16px; }

    /* Bigger tap targets */
    .day-btn, .interval-btn { padding: 8px 12px; font-size: 12px; }
    .toggle-track { width: 48px; height: 26px; }
    .toggle-track::after { width: 18px; height: 18px; }
    .toggle-switch input:checked + .toggle-track::after { transform: translateX(22px); }
}

/* ══════════════════════════════════════════════════════════
   TABLET  641px – 900px  — icon-only sidebar
   ══════════════════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 900px) {
    :root { --sidebar-w: 64px; }

    .sidebar { padding: 16px 8px; }
    .sidebar-logo { justify-content: center; padding: 8px 0 16px; gap: 0; }
    .sidebar-logo-text { display: none; }
    .sidebar-nav-item { justify-content: center; padding: 12px 8px; }
    .sidebar-nav-item span { display: none; }
    .sidebar-bottom { flex-direction: column; align-items: center; gap: 4px; }

    .main-content { padding: 24px 20px; }
    .view { max-width: 100%; }
    .cards-grid { gap: 12px; }
    .rings-row { padding: 20px 24px; }
    .ring-divider { margin: 0 20px; }

    .notif-config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .days-picker { justify-content: flex-start; }
    .time-range-wrap { flex-direction: row; }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP  > 900px  — full sidebar (default styles apply)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
    .bottom-nav { display: none; }
}

/* ══════════════════════════════════════════════════════════
   STATE LABELS, HINTS & FOCUS
   ══════════════════════════════════════════════════════════ */

/* A card's big slot when there is no clock time to show
   (Goal Met / Yet to Start / Day Off) — smaller, calmer. */
.stat-card-time.stat-card-time-state {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-muted);
}

/* Timeline with no segments yet */
.timeline-track.timeline-track-empty {
    background: repeating-linear-gradient(
        90deg,
        var(--divider) 0 6px,
        transparent 6px 12px
    );
}

/* Inline status hint under the push permission card */
.notif-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 0 2px;
    margin-top: -12px;
}

/* Preview rows double as test triggers */
.notif-preview-item {
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}
.notif-preview-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

/* Disabled buttons should not look clickable */
button:disabled {
    cursor: default;
    opacity: 0.75;
}
.notif-enable-btn:disabled:hover,
button:disabled:hover {
    transform: none;
}

/* Keyboard focus — visible for keyboard users, absent for mouse clicks */
:where(button, a, input, [role="button"], [tabindex]):focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
