/* ══════════════════════════════════════════════════════════
   NAFS — Design System & Global Styles
   Personal Transformation Dashboard
   ══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
    /* Background */
    --bg-root: #060a14;
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1629;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-card-solid: #0f172a;
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-input: rgba(15, 23, 42, 0.9);
    --bg-sidebar: rgba(8, 12, 24, 0.95);
    --bg-glass: rgba(15, 23, 42, 0.5);

    /* Accent Colors */
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --violet: #8b5cf6;
    --emerald: #10b981;
    --emerald-dark: #059669;
    --amber: #f59e0b;
    --rose: #f43f5e;
    --sky: #0ea5e9;
    --teal: #14b8a6;
    --orange: #f97316;
    --islamic-green: #059669;
    --islamic-gold: #d4a853;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Borders */
    --border: rgba(51, 65, 85, 0.5);
    --border-light: rgba(71, 85, 105, 0.3);
    --border-accent: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --grad-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --grad-card: linear-gradient(145deg, rgba(15,23,42,0.8) 0%, rgba(10,15,30,0.9) 100%);
    --grad-emerald: linear-gradient(135deg, #059669, #10b981);
    --grad-amber: linear-gradient(135deg, #d97706, #f59e0b);
    --grad-rose: linear-gradient(135deg, #e11d48, #f43f5e);
    --grad-sky: linear-gradient(135deg, #0284c7, #0ea5e9);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99,102,241,0.15);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms var(--ease);
    --transition-slow: 400ms var(--ease);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Layout ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(20px);
    transition: transform var(--transition);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-arabic {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-hero);
    border-radius: var(--radius-md);
    font-size: 22px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    user-select: none;
}

.nav-item:hover {
    background: rgba(99,102,241,0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99,102,241,0.12);
    color: white;
    border-color: var(--border-accent);
    box-shadow: 0 0 20px rgba(99,102,241,0.08);
}

.nav-item.active .nav-icon {
    color: var(--accent-light);
}

.nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-label { white-space: nowrap; }

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--grad-hero);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.day-badge-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.7);
    font-family: var(--font-mono);
}

.day-badge-num {
    font-size: 22px;
    font-weight: 700;
    color: white;
    font-family: var(--font-mono);
    line-height: 1;
}

.sidebar-actions {
    display: flex;
    gap: var(--space-sm);
}

.sb-btn {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(51,65,85,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.sb-btn:hover {
    background: rgba(99,102,241,0.15);
    color: var(--accent-light);
    border-color: var(--border-accent);
}

/* ── Menu Toggle (Mobile) ──────────────────────────────── */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 200;
    width: 44px; height: 44px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(10,14,26,0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: var(--space-md);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.topbar-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.topbar-hijri {
    font-size: 12px;
    color: var(--islamic-gold);
    background: rgba(212,168,83,0.1);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(212,168,83,0.2);
}

/* ── App Container ─────────────────────────────────────── */
.app-container {
    padding: var(--space-xl);
    max-width: 1400px;
    animation: fadeIn 0.3s var(--ease);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-title .icon {
    font-size: 18px;
}

.card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
}

/* ── Stats Grid ────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 60px;
    border-radius: 0 0 0 60px;
    opacity: 0.06;
}

.stat-card[data-color="indigo"]::after { background: var(--accent); }
.stat-card[data-color="emerald"]::after { background: var(--emerald); }
.stat-card[data-color="amber"]::after { background: var(--amber); }
.stat-card[data-color="rose"]::after { background: var(--rose); }
.stat-card[data-color="sky"]::after { background: var(--sky); }
.stat-card[data-color="violet"]::after { background: var(--violet); }

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.stat-value[data-color="indigo"] { color: var(--accent-light); }
.stat-value[data-color="emerald"] { color: var(--emerald); }
.stat-value[data-color="amber"] { color: var(--amber); }
.stat-value[data-color="rose"] { color: var(--rose); }
.stat-value[data-color="sky"] { color: var(--sky); }
.stat-value[data-color="violet"] { color: var(--violet); }

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Progress Ring ─────────────────────────────────────── */
.progress-ring-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-ring-wrap .ring-label {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 18px;
}

.progress-ring circle {
    transition: stroke-dashoffset 0.6s var(--ease);
}

/* ── Progress Bar ──────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(51,65,85,0.4);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--grad-hero);
    transition: width 0.6s var(--ease);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

.progress-bar-fill.emerald { background: var(--grad-emerald); }
.progress-bar-fill.amber { background: var(--grad-amber); }
.progress-bar-fill.rose { background: var(--grad-rose); }
.progress-bar-fill.sky { background: var(--grad-sky); }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-hero);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.25);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(51,65,85,0.4);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(99,102,241,0.1);
    color: var(--accent-light);
    border-color: var(--border-accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--accent-light); background: rgba(99,102,241,0.08); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-icon.lg { width: 44px; height: 44px; }

.btn-success { background: var(--grad-emerald); color: white; }
.btn-danger { background: var(--grad-rose); color: white; }
.btn-amber { background: var(--grad-amber); color: #1a1a1a; }

/* ── Form Elements ─────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 16px; /* >=16px prevents iOS Safari auto-zoom on focus */
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

/* ── Checklist ─────────────────────────────────────────── */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    background: rgba(15,23,42,0.4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 14px;
    user-select: none;
}

.check-item:hover { border-color: var(--border-accent); }

.check-item.done {
    background: rgba(16,185,129,0.06);
    border-color: rgba(16,185,129,0.2);
}

.check-item.done .check-label { color: var(--text-muted); text-decoration: line-through; }

.check-box {
    width: 20px; height: 20px;
    border: 2px solid var(--text-dim);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.check-item.done .check-box {
    background: var(--emerald);
    border-color: var(--emerald);
    color: white;
}

.check-label { flex: 1; }
.check-time { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

/* ── Tags & Chips ──────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid;
}

.tag-indigo { color: var(--accent-light); border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.1); }
.tag-emerald { color: var(--emerald); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.1); }
.tag-amber { color: var(--amber); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); }
.tag-rose { color: var(--rose); border-color: rgba(244,63,94,0.3); background: rgba(244,63,94,0.1); }
.tag-sky { color: var(--sky); border-color: rgba(14,165,233,0.3); background: rgba(14,165,233,0.1); }

/* ── Section Grid ──────────────────────────────────────── */
.section-grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* ── Big Counter ───────────────────────────────────────── */
.big-counter {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.big-counter-num {
    font-family: var(--font-mono);
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.big-counter-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
}

/* ── Streak Display ────────────────────────────────────── */
.streak-row {
    display: flex;
    gap: 4px;
}

.streak-dot {
    width: 14px; height: 14px;
    border-radius: 3px;
    background: rgba(51,65,85,0.5);
    transition: background var(--transition);
}

.streak-dot.active { background: var(--emerald); }
.streak-dot.missed { background: var(--rose); opacity: 0.5; }

/* ── Prayer Grid ───────────────────────────────────────── */
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.prayer-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border-light);
    background: rgba(15,23,42,0.4);
}

.prayer-cell.on-time { background: rgba(5,150,105,0.2); border-color: rgba(5,150,105,0.4); color: var(--emerald); }
.prayer-cell.late { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: var(--amber); }
.prayer-cell.missed { background: rgba(244,63,94,0.1); border-color: rgba(244,63,94,0.2); color: var(--rose); }
.prayer-cell.header { background: transparent; border: none; color: var(--text-muted); font-size: 10px; cursor: default; }

/* ── Water Tracker ─────────────────────────────────────── */
.water-glasses {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.water-glass {
    width: 36px; height: 44px;
    border-radius: 0 0 8px 8px;
    border: 2px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
    position: relative;
}

.water-glass.filled {
    border-color: rgba(14,165,233,0.5);
}

.water-glass .fill {
    width: 100%;
    background: linear-gradient(180deg, rgba(14,165,233,0.3), rgba(14,165,233,0.6));
    transition: height var(--transition);
    border-radius: 0 0 6px 6px;
}

/* ── Meal Card ─────────────────────────────────────────── */
.meal-card {
    padding: var(--space-md);
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: border-color var(--transition);
}

.meal-card:hover { border-color: var(--border-accent); }

.meal-time {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.meal-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.meal-cal {
    font-size: 11px;
    color: var(--accent-light);
    font-family: var(--font-mono);
    margin-top: 4px;
}

/* ── Journal Entry ─────────────────────────────────────── */
.journal-entry {
    padding: var(--space-lg);
    background: rgba(15,23,42,0.4);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: var(--space-md);
}

.journal-date {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-bottom: var(--space-sm);
}

.journal-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Roadmap Timeline ──────────────────────────────────── */
.roadmap {
    position: relative;
    padding-left: 32px;
}

.roadmap::before {
    content: '';
    position: absolute;
    left: 11px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}

.roadmap-item {
    position: relative;
    padding: var(--space-md) 0;
}

.roadmap-item::before {
    content: '';
    position: absolute;
    left: -27px; top: 20px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg-card-solid);
    border: 2px solid var(--text-dim);
    z-index: 1;
}

.roadmap-item.done::before { background: var(--emerald); border-color: var(--emerald); }
.roadmap-item.active::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(99,102,241,0.4); }

.roadmap-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.roadmap-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Outfit Card ───────────────────────────────────────── */
.outfit-card {
    padding: var(--space-md);
    background: rgba(15,23,42,0.4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-align: center;
}

.outfit-day {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-light);
    margin-bottom: var(--space-sm);
}

.outfit-items {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Color Swatch ──────────────────────────────────────── */
.color-grid {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.color-swatch {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2px;
}

.color-swatch span {
    font-size: 8px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
}

/* ── Tables ────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px var(--space-md);
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.data-table tr:hover td { background: rgba(99,102,241,0.04); }

/* ── Canvas Charts ─────────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn 0.2s var(--ease);
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s var(--ease);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px; height: 32px;
    background: rgba(51,65,85,0.4);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover { background: rgba(244,63,94,0.2); color: var(--rose); }

.modal-body { padding: var(--space-lg); }

.modal-footer {
    padding: 0 var(--space-lg) var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s var(--ease);
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--emerald); }
.toast.error { border-left: 3px solid var(--rose); }
.toast.info { border-left: 3px solid var(--accent); }

/* ── Section Header ────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-desc {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.6;
}

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(15,23,42,0.5);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
}

.tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.tab:hover:not(.active) { color: var(--text-primary); }

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-dim);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: var(--space-lg);
}

/* ── Hero Card (Dashboard feature) ─────────────────────── */
.hero-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.08) 100%);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.1), transparent 70%);
    pointer-events: none;
}

.hero-info { flex: 1; }

.hero-greeting {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-fade-in { animation: fadeIn 0.4s var(--ease); }
.anim-slide-up { animation: slideUp 0.4s var(--ease); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .topbar {
        padding-left: 68px;
    }

    .app-container {
        padding: var(--space-md);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        flex-direction: column;
        text-align: center;
    }

    .topbar-right {
        display: none;
    }

    .big-counter-num {
        font-size: 48px;
    }
}

/* ── Utility Classes ───────────────────────────────────── */
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-xs { margin-bottom: var(--space-xs); }

/* ══════════════════════════════════════════════════════════
   ENHANCED COMPONENTS v2
   ══════════════════════════════════════════════════════════ */

/* ── Achievement Badge ─────────────────────────────────── */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
}

.achievement-badge {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.achievement-badge.unlocked {
    border-color: rgba(212,168,83,0.4);
    background: linear-gradient(135deg, rgba(212,168,83,0.08), rgba(99,102,241,0.05));
}

.achievement-badge.unlocked::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--islamic-gold), var(--accent));
}

.achievement-badge.locked {
    opacity: 0.4;
    filter: grayscale(0.8);
}

.achievement-icon {
    font-size: 36px;
    margin-bottom: var(--space-sm);
    display: block;
}

.achievement-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.achievement-date {
    font-size: 10px;
    color: var(--islamic-gold);
    font-family: var(--font-mono);
    margin-top: var(--space-sm);
}

/* ── Schedule Block ────────────────────────────────────── */
.schedule-timeline {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.schedule-block {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--space-md);
    padding: 12px var(--space-md);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
    transition: all var(--transition);
    background: rgba(15,23,42,0.3);
}

.schedule-block:hover {
    background: rgba(15,23,42,0.6);
    border-left-color: var(--accent);
}

.schedule-block[data-type="prayer"] { border-left-color: var(--islamic-green); }
.schedule-block[data-type="health"] { border-left-color: var(--emerald); }
.schedule-block[data-type="food"] { border-left-color: var(--amber); }
.schedule-block[data-type="work"] { border-left-color: var(--sky); }
.schedule-block[data-type="study"] { border-left-color: var(--violet); }
.schedule-block[data-type="sleep"] { border-left-color: var(--text-dim); }

.schedule-time {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.schedule-activity {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.schedule-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ── Settings Panel ────────────────────────────────────── */
.settings-section {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.settings-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ── Sleep Quality Dots ────────────────────────────────── */
.sleep-quality {
    display: flex;
    gap: 6px;
    align-items: center;
}

.sleep-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    background: rgba(15,23,42,0.5);
}

.sleep-dot.selected {
    border-color: var(--accent);
    background: rgba(99,102,241,0.15);
    transform: scale(1.15);
}

/* ── Dua Card ──────────────────────────────────────────── */
.dua-card {
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(5,150,105,0.05), rgba(212,168,83,0.03));
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    position: relative;
}

.dua-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,168,83,0.3), transparent);
}

.dua-arabic {
    font-size: 18px;
    line-height: 2;
    color: var(--islamic-gold);
    text-align: right;
    direction: rtl;
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.dua-translation {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.dua-source {
    font-size: 11px;
    color: var(--islamic-green);
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
}

.dua-category {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
}

/* ── Product Inventory ─────────────────────────────────── */
.product-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    background: rgba(15,23,42,0.4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.product-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(99,102,241,0.1);
    flex-shrink: 0;
}

.product-info { flex: 1; min-width: 0; }

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.product-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── 30-Day Heatmap ────────────────────────────────────── */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(51,65,85,0.3);
    position: relative;
}

.heatmap-cell[data-level="1"] { background: rgba(99,102,241,0.15); }
.heatmap-cell[data-level="2"] { background: rgba(99,102,241,0.3); }
.heatmap-cell[data-level="3"] { background: rgba(99,102,241,0.5); }
.heatmap-cell[data-level="4"] { background: rgba(99,102,241,0.7); }

/* ── Notification Banner ───────────────────────────────── */
.notif-banner {
    padding: 12px var(--space-lg);
    background: linear-gradient(135deg, rgba(212,168,83,0.1), rgba(99,102,241,0.05));
    border: 1px solid rgba(212,168,83,0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    animation: slideUp 0.4s var(--ease);
}

.notif-banner .notif-icon { font-size: 24px; }
.notif-banner .notif-text { font-size: 13px; color: var(--text-secondary); flex: 1; }
.notif-banner .notif-title { font-weight: 600; color: var(--islamic-gold); }

/* ── Additional Tags ───────────────────────────────────── */
.tag-gold { color: var(--islamic-gold); border-color: rgba(212,168,83,0.3); background: rgba(212,168,83,0.1); }
.tag-teal { color: var(--teal); border-color: rgba(20,184,166,0.3); background: rgba(20,184,166,0.1); }

/* ── Zakat Info Card ───────────────────────────────────── */
.zakat-card {
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(5,150,105,0.08), rgba(212,168,83,0.05));
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: var(--radius-lg);
}

.zakat-amount {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--islamic-green);
}

/* ── Range Slider ──────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(51,65,85,0.5);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

/* ══════════════════════════════════════════════════════════
   v3 COMPONENTS — Timer, Goals, Review, Streaks
   ══════════════════════════════════════════════════════════ */

/* ── Focus Timer ───────────────────────────────────────── */
.timer-display {
    text-align: center;
    padding: var(--space-2xl);
    position: relative;
}

.timer-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
}

.timer-circle svg {
    position: absolute;
    top: 0; left: 0;
    transform: rotate(-90deg);
}

.timer-circle .timer-num {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1;
}

.timer-circle .timer-label {
    position: absolute;
    bottom: 40px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 1;
}

.timer-controls {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
}

.timer-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all var(--transition);
}

.timer-btn.play {
    background: var(--grad-hero);
    color: white;
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.timer-btn.play:hover { transform: scale(1.08); }

.timer-btn.pause {
    background: var(--grad-amber);
    color: #1a1a1a;
}

.timer-btn.reset {
    background: rgba(51,65,85,0.4);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.timer-btn.reset:hover { border-color: var(--rose); color: var(--rose); }

.timer-btn.skip {
    background: rgba(51,65,85,0.4);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

@keyframes timerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}

.timer-running .timer-circle {
    animation: timerPulse 2s infinite;
}

.timer-session-count {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: var(--space-lg);
}

.timer-session-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(51,65,85,0.5);
}

.timer-session-dot.done {
    background: var(--emerald);
}

/* ── Goal Card ─────────────────────────────────────────── */
.goal-card {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.goal-card:hover { border-color: var(--border-accent); }

.goal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
}

.goal-card[data-priority="high"]::before { background: var(--rose); }
.goal-card[data-priority="medium"]::before { background: var(--amber); }
.goal-card[data-priority="low"]::before { background: var(--emerald); }

.goal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.goal-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.goal-deadline {
    color: var(--amber);
    font-family: var(--font-mono);
}

/* ── Weekly Review ─────────────────────────────────────── */
.review-domain-row {
    display: grid;
    grid-template-columns: 120px 1fr 50px;
    align-items: center;
    gap: var(--space-md);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.review-domain-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.review-score-display {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.review-summary-card {
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.03));
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.review-overall {
    font-family: var(--font-mono);
    font-size: 42px;
    font-weight: 700;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Streak Summary Bar ────────────────────────────────── */
.streak-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.streak-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: rgba(15,23,42,0.5);
}

.streak-item .streak-emoji { font-size: 16px; }

.streak-item .streak-num {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.streak-item .streak-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Workout Template ──────────────────────────────────── */
.workout-template {
    padding: var(--space-md);
    background: rgba(16,185,129,0.04);
    border: 1px solid rgba(16,185,129,0.15);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.workout-template-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--emerald);
    margin-bottom: var(--space-sm);
}

.workout-exercise {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(51,65,85,0.2);
}

.workout-exercise:last-child { border: none; }
.workout-exercise .sets { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

/* ── Quran Surah Card ──────────────────────────────────── */
.surah-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    background: rgba(15,23,42,0.3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all var(--transition);
}

.surah-card:hover { border-color: rgba(5,150,105,0.3); }

.surah-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--islamic-gold);
    background: rgba(212,168,83,0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.surah-info { flex: 1; min-width: 0; }

.surah-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.surah-ayahs {
    font-size: 11px;
    color: var(--text-muted);
}

.surah-status {
    font-size: 12px;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   v4 COMPONENTS — Analytics, Panic Mode, PWA
   ══════════════════════════════════════════════════════════ */

/* ── Panic Mode (Full-Screen) ──────────────────────────── */
.panic-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(180deg, #0a0e1a 0%, #0f172a 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.panic-overlay.active {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.panic-breathing-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.2), rgba(99,102,241,0.05));
    border: 3px solid rgba(99,102,241,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 12s ease-in-out infinite;
    margin-bottom: var(--space-xl);
}

@keyframes breathe {
    0%, 100% { transform: scale(0.6); border-color: rgba(99,102,241,0.3); }
    21% { transform: scale(1); border-color: rgba(99,102,241,0.7); }
    58% { transform: scale(1); border-color: rgba(16,185,129,0.5); }
    75% { transform: scale(0.6); border-color: rgba(99,102,241,0.3); }
}

.panic-breathing-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-light);
    animation: breatheText 12s ease-in-out infinite;
}

@keyframes breatheText {
    0%, 75%, 100% { content: 'Breathe Out'; }
    5% { content: 'Breathe In'; }
    25% { content: 'Hold'; }
}

.panic-instruction {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.8;
    max-width: 400px;
    margin-top: var(--space-xl);
}

.panic-step {
    padding: 10px 16px;
    background: rgba(15,23,42,0.6);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
    max-width: 380px;
}

.panic-step .step-num {
    color: var(--rose);
    font-weight: 700;
    font-family: var(--font-mono);
    margin-right: var(--space-sm);
}

.panic-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(51,65,85,0.4);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.panic-close:hover { background: rgba(244,63,94,0.2); color: var(--rose); }

.panic-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.panic-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* ── Analytics Charts ──────────────────────────────────── */
.chart-card {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-top: var(--space-md);
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.bar-fill {
    width: 100%;
    max-width: 28px;
    border-radius: 4px 4px 0 0;
    background: var(--grad-hero);
    transition: height 0.6s var(--ease);
    min-height: 2px;
}

.bar-fill.emerald { background: var(--grad-emerald); }
.bar-fill.amber { background: var(--grad-amber); }
.bar-fill.rose { background: var(--grad-rose); }
.bar-fill.sky { background: linear-gradient(180deg, #0ea5e9, #0284c7); }

.bar-label {
    font-size: 9px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    text-align: center;
}

.bar-value {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Insight Card ──────────────────────────────────────── */
.insight-card {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.insight-icon { font-size: 28px; }

.insight-content { flex: 1; }

.insight-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-value {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.insight-trend {
    font-size: 11px;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 2px;
}

.insight-trend.up { color: var(--emerald); }
.insight-trend.down { color: var(--rose); }
.insight-trend.neutral { color: var(--text-muted); }

/* ── Consistency Meter ─────────────────────────────────── */
.consistency-meter {
    display: flex;
    gap: 2px;
}

.consistency-day {
    width: 12px;
    height: 40px;
    border-radius: 3px;
    background: rgba(51,65,85,0.3);
    position: relative;
    display: flex;
    align-items: flex-end;
}

.consistency-fill {
    width: 100%;
    border-radius: 3px;
    background: var(--grad-hero);
    transition: height 0.4s var(--ease);
}

/* ══════════════════════════════════════════════════════════
   v4+ — Dhikr Counter & Habit Tracker
   ══════════════════════════════════════════════════════════ */

/* ── Dhikr Counter ─────────────────────────────────────── */
.dhikr-tap-area {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(5,150,105,0.15), rgba(5,150,105,0.03));
    border: 3px solid rgba(5,150,105,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    margin: 0 auto var(--space-lg);
}

.dhikr-tap-area:active {
    transform: scale(0.93);
    border-color: var(--islamic-green);
    background: radial-gradient(circle, rgba(5,150,105,0.25), rgba(5,150,105,0.08));
}

@keyframes dhikrPulse {
    0% { box-shadow: 0 0 0 0 rgba(5,150,105,0.3); }
    100% { box-shadow: 0 0 0 20px rgba(5,150,105,0); }
}

.dhikr-tap-area.pulsing {
    animation: dhikrPulse 0.4s ease-out;
}

.dhikr-count {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 800;
    color: var(--islamic-green);
    line-height: 1;
}

.dhikr-target {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 4px;
}

.dhikr-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-sm);
}

.dhikr-arabic {
    font-size: 24px;
    color: var(--islamic-gold);
    text-align: center;
    margin-bottom: var(--space-xl);
    direction: rtl;
    line-height: 1.8;
}

.dhikr-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
}

.dhikr-preset {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.dhikr-preset:hover { border-color: var(--islamic-green); color: var(--islamic-green); }
.dhikr-preset.active { border-color: var(--islamic-green); background: rgba(5,150,105,0.1); color: var(--islamic-green); font-weight: 600; }

.dhikr-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.dhikr-session-item:last-child { border-bottom: none; }

/* ── Habit Tracker Grid ────────────────────────────────── */
.habit-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.habit-day {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(51,65,85,0.15);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.habit-day:hover { opacity: 0.8; }
.habit-day[data-done="true"] { background: var(--emerald); }
.habit-day.today { outline: 2px solid var(--accent-light); outline-offset: 1px; }
.habit-day.future { opacity: 0.3; pointer-events: none; }

.habit-card-wrap {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.habit-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.habit-streak {
    display: flex;
    gap: var(--space-md);
}

.habit-streak-val {
    text-align: center;
}

.habit-streak-num {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
}

.habit-streak-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.habit-day-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 3px;
}

.habit-day-label {
    text-align: center;
    font-size: 9px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.btn-delete-habit {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    background: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition);
}

.btn-delete-habit:hover { border-color: var(--rose); color: var(--rose); background: rgba(244,63,94,0.1); }

/* ── Guides / Knowledge Hub (v5) ───────────────────────── */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    transition: all var(--transition);
}
.guide-card:hover { border-color: var(--accent); transform: translateY(-2px); background: rgba(99,102,241,0.06); }
.guide-icon { font-size: 30px; }
.guide-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.guide-content { line-height: 1.7; color: var(--text-secondary); font-size: 14px; }
.guide-content h4 { color: var(--text-primary); font-size: 14px; font-weight: 700; }
.guide-list { margin: 0 0 4px; padding-left: 18px; }
.guide-list li { margin-bottom: 6px; }

/* ── Backup reminder banner (v5) ───────────────────────── */
.backup-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.04));
    border: 1px solid rgba(245,158,11,0.35);
    color: var(--text-secondary);
    font-size: 14px;
}
.backup-banner.active { display: flex; }

/* ── Light theme (v6) ──────────────────────────────────── */
body[data-theme="light"] {
    --bg-root: #eef2f7;
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-solid: #ffffff;
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --bg-input: rgba(255, 255, 255, 0.95);
    --bg-sidebar: rgba(255, 255, 255, 0.96);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --border: rgba(148, 163, 184, 0.4);
    --border-light: rgba(148, 163, 184, 0.25);
    --shadow-card: 0 4px 20px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.12);
}
body[data-theme="light"] { background: var(--bg-primary); color: var(--text-primary); }

/* ── Progress Photos (v6) ──────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.photo-card {
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: transform var(--transition);
}
.photo-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.photo-thumb { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--bg-secondary); }
.photo-date { font-size: 11px; color: var(--text-muted); text-align: center; padding: 6px 4px; }
.photo-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-img { width: 100%; border-radius: var(--radius-md); object-fit: cover; background: var(--bg-secondary); }

/* ── Calendar (v6) ─────────────────────────────────────── */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 4px 0; }
.cal-day {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px; font-family: var(--font-mono, monospace);
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.cal-day.empty { background: none; }
.cal-day[data-level="1"] { background: rgba(244, 63, 94, 0.25); }
.cal-day[data-level="2"] { background: rgba(245, 158, 11, 0.3); }
.cal-day[data-level="3"] { background: rgba(16, 185, 129, 0.35); }
.cal-day[data-level="4"] { background: rgba(16, 185, 129, 0.6); color: #fff; }
.cal-day:not(.empty):hover { transform: scale(1.08); }

/* ── Vision board (v6) ─────────────────────────────────── */
.vision-board { display: flex; flex-direction: column; gap: 8px; }
.vision-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.06); border: 1px solid var(--border-light);
    font-size: 14px;
}
.vision-emoji { font-size: 20px; }
.vision-del {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px;
}
.vision-del:hover { color: var(--rose); }

/* ── Panic WHY (v6) ────────────────────────────────────── */
.panic-why {
    max-width: 460px; margin: 20px auto 0; padding: 0 20px;
    font-style: italic; font-size: 16px; line-height: 1.6;
    color: var(--islamic-gold); text-align: center;
}
.panic-why-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; font-style: normal; }

/* ── Level / XP card (v7) ──────────────────────────────── */
.level-card {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 18px; margin-bottom: 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.08));
    border: 1px solid var(--border-accent);
}
.level-badge {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono, monospace); font-size: 22px; font-weight: 700; color: #fff;
    background: var(--grad-hero); box-shadow: var(--shadow-glow);
}
.level-info { flex: 1; min-width: 0; }
.level-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.level-xp { font-size: 12px; color: var(--text-secondary); margin: 2px 0 6px; }
.xp-bar { height: 8px; border-radius: var(--radius-full); background: rgba(100,116,139,0.25); overflow: hidden; }
.xp-bar-fill { height: 100%; background: var(--grad-hero); border-radius: var(--radius-full); transition: width .4s; }
.level-next { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Command Palette (v7) ──────────────────────────────── */
.cmd-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.cmd-overlay.open { display: flex; }
.cmd-palette {
    width: min(560px, 92vw); background: var(--bg-card-solid);
    border: 1px solid var(--border-accent); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.cmd-input {
    width: 100%; padding: 16px 18px; border: none; outline: none;
    background: transparent; color: var(--text-primary); font-size: 16px;
    border-bottom: 1px solid var(--border);
}
.cmd-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmd-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; color: var(--text-secondary);
}
.cmd-item.sel, .cmd-item:hover { background: var(--accent-glow); color: var(--text-primary); }
.cmd-icon { font-size: 18px; width: 22px; text-align: center; }
.cmd-label { flex: 1; }
.cmd-tag { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.cmd-empty { padding: 18px; text-align: center; color: var(--text-muted); font-size: 14px; }
.topbar-search-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-muted); cursor: pointer; font-size: 13px; transition: all var(--transition);
}
.topbar-search-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.topbar-search-hint { font-family: var(--font-mono, monospace); font-size: 11px; opacity: 0.7; }

/* ── Events (v7) ───────────────────────────────────────── */
.event-card {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-radius: var(--radius-md); border: 1px solid var(--border-light);
    background: var(--bg-card); margin-bottom: 8px;
}
.event-card.overdue { border-left: 3px solid var(--rose); }
.event-card.today { border-left: 3px solid var(--emerald); }
.event-cat { font-size: 22px; width: 30px; text-align: center; }
.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.event-meta { font-size: 12px; color: var(--text-muted); }

/* ── Notes (v7) ────────────────────────────────────────── */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.note-card {
    background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.note-card.pinned { border-color: var(--islamic-gold); background: rgba(212,168,67,0.06); }
.note-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.note-foot { display: flex; align-items: center; justify-content: space-between; }
.note-btn { background: none; border: none; cursor: pointer; font-size: 15px; opacity: 0.7; }
.note-btn:hover { opacity: 1; }

/* ── Weekly Report (v7) ────────────────────────────────── */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.report-stat { text-align: center; padding: 12px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border-light); }
.report-num { font-family: var(--font-mono, monospace); font-size: 22px; font-weight: 700; color: var(--accent-light); }
.report-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

@media print {
    .sidebar, .menu-toggle, .topbar, .toast-container, .modal-footer, .backup-banner { display: none !important; }
    .modal-overlay { position: static; background: none; display: block; }
    .modal { box-shadow: none; max-width: 100%; }
    body { background: #fff; color: #000; }
}

/* ── RTL (v7) ──────────────────────────────────────────── */
[dir="rtl"] .sidebar { left: auto; right: 0; }
[dir="rtl"] .main-content { margin-left: 0; }
[dir="rtl"] .section-header, [dir="rtl"] .card-header { text-align: right; }
[dir="rtl"] .nav-item { flex-direction: row-reverse; text-align: right; }

/* ── Nav grouping (v8) ─────────────────────────────────── */
.nav-group { margin-bottom: 4px; }
.nav-group-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px 4px; cursor: pointer; user-select: none;
    font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--text-dim);
}
.nav-group-title:hover { color: var(--text-secondary); }
.nav-chevron { font-size: 10px; transition: transform var(--transition); }
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-item { display: none; }
[dir="rtl"] .nav-group-title { flex-direction: row-reverse; }

/* ── Entry edit/delete controls (v9) ───────────────────── */
.entry-actions { display: inline-flex; gap: 4px; flex-shrink: 0; opacity: 0.55; transition: opacity var(--transition); }
.entry-actions:hover, .meal-card:hover .entry-actions, .entry-row:hover .entry-actions, tr:hover .entry-actions, .journal-entry:hover .entry-actions, .dua-card:hover .entry-actions, .product-item:hover .entry-actions { opacity: 1; }
.entry-btn {
    background: none; border: none; cursor: pointer; padding: 2px 4px;
    font-size: 13px; line-height: 1; color: var(--text-muted); border-radius: 4px;
}
.entry-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.entry-list { display: flex; flex-direction: column; gap: 2px; }
.entry-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.entry-row:last-child { border-bottom: none; }
.product-item { display: flex; align-items: center; }
.product-item .entry-actions { margin-left: auto; }

/* ── Auth / Login (v12) ────────────────────────────────── */
.auth-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(circle at 30% 20%, #131a2e, #060a14 70%);
}
.auth-card {
    width: min(380px, 92vw);
    background: var(--bg-card-solid); border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 32px 28px; text-align: center;
}
.auth-logo { font-family: var(--font-display, 'Outfit', sans-serif); font-size: 26px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.auth-logo .logo-arabic { color: var(--islamic-gold); margin-right: 6px; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .form-input { margin-bottom: 12px; }
.auth-error { color: var(--rose); font-size: 13px; min-height: 18px; margin-bottom: 10px; }

/* ── Mobile-friendly hardening (v15) ───────────────────── */
* { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
html, body { overflow-x: hidden; max-width: 100%; }

/* charts/images never blow out their card width */
.card svg, .chart-card svg, .insight-card svg { max-width: 100%; height: auto; }

/* wide content scrolls inside its container instead of the whole page */
.bar-chart, .prayer-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* iOS safe areas (notch + home indicator) for the installed PWA */
.sidebar { height: 100dvh; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.topbar { padding-top: env(safe-area-inset-top); }
.app-container { padding-bottom: max(var(--space-md), env(safe-area-inset-bottom)); }
.auth-overlay { min-height: 100dvh; }

/* touch devices: make edit/delete affordances fully visible (no hover) */
@media (hover: none) {
    .entry-actions { opacity: 1; }
}

@media (max-width: 768px) {
    /* keep the command-palette search button reachable; hide only the dates */
    .topbar-right { display: flex; }
    .topbar-date, .topbar-hijri { display: none; }

    /* drawer shouldn't cover the whole screen */
    .sidebar { width: min(280px, 85vw); }

    /* comfortable, tappable targets */
    .nav-item, .check-item { min-height: 44px; }
    .btn { min-height: 40px; }

    /* tall dialogs scroll within the viewport */
    .modal { max-height: 90dvh; overflow-y: auto; }

    /* wide tables scroll instead of overflowing the page */
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}

