/* ==========================================================================
   ZENIT — Modern, Professional, Inspiring Daily Planner
   Design System & Unified Stylesheet
   ========================================================================== */

/* ─── DESIGN TOKENS & ROOT THEMES ────────────────────────────────────────── */
:root {
    --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Base radii */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 26px;
    --r-full: 9999px;

    /* Base transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.15s var(--ease-out);
    --t-normal: 0.25s var(--ease-out);

    /* Activity Category Colors (Universal) */
    --c-blue: #38bdf8;
    --c-red: #f43f5e;
    --c-green: #10b981;
    --c-yellow: #f59e0b;
    --c-purple: #a855f7;
    --c-indigo: #6366f1;

    /* Default Theme: DARK OBSIDIAN (Deep, sleek, focused) */
    --bg-main: #0c0e14;
    --bg-surface: #12151f;
    --bg-card: #161a26;
    --bg-card-hover: #1c2232;
    --bg-modal: #131722;
    --bg-input: #0f121a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-focus: #6366f1;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-rgb: 99, 102, 241;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --gap-color: rgba(255, 255, 255, 0.08);
    --bg-gamification: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
    --glass-bg: rgba(12, 14, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.07);
}

/* ─── THEME VARIATIONS ─────────────────────────────────────────────────── */

/* 1. DARK (Default explicit) */
[data-theme="dark"] {
    --bg-main: #0c0e14;
    --bg-surface: #12151f;
    --bg-card: #161a26;
    --bg-card-hover: #1c2232;
    --bg-modal: #131722;
    --bg-input: #0f121a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-focus: #6366f1;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-rgb: 99, 102, 241;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --gap-color: rgba(255, 255, 255, 0.08);
    --bg-gamification: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
    --glass-bg: rgba(12, 14, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.07);
}

/* 2. LIGHT (Clean Nordic Studio) */
[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-modal: #ffffff;
    --bg-input: #f8fafc;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-focus: #4f46e5;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-rgb: 79, 70, 229;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --gap-color: #cbd5e1;
    --bg-gamification: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.06);
}
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(226, 232, 240, 0.8);
}

/* 3. PASTEL (Calm Almond & Sage) */
[data-theme="pastel"] {
    --bg-main: #faf7f2;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f0e6;
    --bg-modal: #ffffff;
    --bg-input: #f7f3eb;
    --border-color: #e8dfd2;
    --border-subtle: #f2ebe0;
    --border-focus: #f472b6;
    --text-main: #44403c;
    --text-muted: #78716c;
    --text-faint: #a8a29e;
    --primary-color: #f472b6;
    --primary-hover: #ec4899;
    --primary-rgb: 244, 114, 182;
    --primary-glow: rgba(244, 114, 182, 0.25);
    --gap-color: #d6cbbe;
    --bg-gamification: linear-gradient(135deg, #f472b6 0%, #a78bfa 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 2px 8px rgba(68, 64, 60, 0.05);
    --shadow-md: 0 8px 24px rgba(68, 64, 60, 0.08);
    --shadow-lg: 0 16px 36px rgba(68, 64, 60, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(232, 223, 210, 0.8);
}

/* 4. VIBRANT (Electric Aurora) */
[data-theme="vibrant"] {
    --bg-main: #07090e;
    --bg-surface: #0f1422;
    --bg-card: #121829;
    --bg-card-hover: #182037;
    --bg-modal: #121829;
    --bg-input: #0a0e18;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-focus: #06b6d4;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --primary-color: #06b6d4;
    --primary-hover: #0891b2;
    --primary-rgb: 6, 182, 212;
    --primary-glow: rgba(6, 182, 212, 0.35);
    --gap-color: rgba(255, 255, 255, 0.15);
    --bg-gamification: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 50%, #ec4899 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
    --glass-bg: rgba(15, 20, 34, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* 5. SUNSET (Dusk Amber) */
[data-theme="sunset"] {
    --bg-main: #140d1f;
    --bg-surface: #1e132e;
    --bg-card: #251838;
    --bg-card-hover: #2f1e47;
    --bg-modal: #251838;
    --bg-input: #170e24;
    --border-color: rgba(249, 115, 22, 0.2);
    --border-subtle: rgba(249, 115, 22, 0.08);
    --border-focus: #f97316;
    --text-main: #fed7aa;
    --text-muted: #fca5a5;
    --text-faint: #c084fc;
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --primary-rgb: 249, 115, 22;
    --primary-glow: rgba(249, 115, 22, 0.3);
    --gap-color: rgba(249, 115, 22, 0.25);
    --bg-gamification: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 19, 46, 0.8);
    --glass-border: rgba(249, 115, 22, 0.2);
}

/* 6. CYBERPUNK (Neon Matrix) */
[data-theme="cyberpunk"] {
    --bg-main: #06080d;
    --bg-surface: #0c101a;
    --bg-card: #101524;
    --bg-card-hover: #161e33;
    --bg-modal: #101524;
    --bg-input: #080a11;
    --border-color: rgba(0, 240, 255, 0.25);
    --border-subtle: rgba(0, 240, 255, 0.1);
    --border-focus: #00f0ff;
    --text-main: #00f0ff;
    --text-muted: #67e8f9;
    --text-faint: #0891b2;
    --primary-color: #ff0055;
    --primary-hover: #d90048;
    --primary-rgb: 255, 0, 85;
    --primary-glow: rgba(255, 0, 85, 0.35);
    --gap-color: rgba(0, 240, 255, 0.25);
    --bg-gamification: linear-gradient(135deg, #00f0ff 0%, #ff0055 100%);
    --text-gamification: #06080d;
    --shadow-sm: 0 2px 8px rgba(0, 240, 255, 0.1);
    --shadow-md: 0 8px 24px rgba(0, 240, 255, 0.15);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(12, 16, 26, 0.85);
    --glass-border: rgba(0, 240, 255, 0.25);
}

/* 7. OCEAN (Deep Marine) */
[data-theme="ocean"] {
    --bg-main: #05131f;
    --bg-surface: #0a2033;
    --bg-card: #0e2a44;
    --bg-card-hover: #133657;
    --bg-modal: #0e2a44;
    --bg-input: #071929;
    --border-color: rgba(56, 189, 248, 0.2);
    --border-subtle: rgba(56, 189, 248, 0.08);
    --border-focus: #38bdf8;
    --text-main: #e0f2fe;
    --text-muted: #7dd3fc;
    --text-faint: #0284c7;
    --primary-color: #38bdf8;
    --primary-hover: #0284c7;
    --primary-rgb: 56, 189, 248;
    --primary-glow: rgba(56, 189, 248, 0.3);
    --gap-color: rgba(56, 189, 248, 0.25);
    --bg-gamification: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #14b8a6 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 2px 8px rgba(5, 19, 31, 0.3);
    --shadow-md: 0 8px 24px rgba(5, 19, 31, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(10, 32, 51, 0.8);
    --glass-border: rgba(56, 189, 248, 0.2);
}

/* 8. NATURE (Emerald Forest) */
[data-theme="nature"] {
    --bg-main: #06150e;
    --bg-surface: #0c2419;
    --bg-card: #102e20;
    --bg-card-hover: #163d2b;
    --bg-modal: #102e20;
    --bg-input: #081a11;
    --border-color: rgba(34, 197, 94, 0.2);
    --border-subtle: rgba(34, 197, 94, 0.08);
    --border-focus: #22c55e;
    --text-main: #dcfce7;
    --text-muted: #86efac;
    --text-faint: #15803d;
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
    --primary-rgb: 34, 197, 94;
    --primary-glow: rgba(34, 197, 94, 0.3);
    --gap-color: rgba(34, 197, 94, 0.25);
    --bg-gamification: linear-gradient(135deg, #15803d 0%, #22c55e 50%, #84cc16 100%);
    --text-gamification: #ffffff;
    --shadow-sm: 0 2px 8px rgba(6, 21, 14, 0.3);
    --shadow-md: 0 8px 24px rgba(6, 21, 14, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(12, 36, 25, 0.8);
    --glass-border: rgba(34, 197, 94, 0.2);
}

/* ─── GLOBAL RESET & BASE TYPOGRAPHY ───────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle modern scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── AUTH SCREEN (SPLIT-SCREEN MODERN SAAS) ───────────────────────────── */
.auth-screen {
    display: flex;
    min-height: 100vh;
    background: var(--bg-main);
    width: 100%;
}

.auth-brand-panel {
    flex: 0 0 45%;
    background: linear-gradient(145deg, #0f172a 0%, #020617 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    bottom: -60px;
    right: -60px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 2;
    color: #ffffff;
    max-width: 380px;
}

.auth-brand-icon {
    margin-bottom: 24px;
}

.auth-brand-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.auth-brand-sub {
    font-size: 16px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 36px;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #e2e8f0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-md);
    backdrop-filter: blur(6px);
}

.auth-feature i {
    color: #38bdf8;
    font-size: 16px;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    background: var(--bg-main);
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    padding: 36px 32px;
    border-radius: var(--r-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.auth-top-tabs {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--r-md);
    padding: 4px;
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
}

.auth-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
}

.auth-tab-btn.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-panel-content {
    animation: fadeIn var(--t-normal);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.auth-input-wrap > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    text-align: center;
    color: var(--text-faint);
    font-size: 15px;
    pointer-events: none;
    z-index: 3;
    transition: color var(--t-fast);
}

.auth-input-wrap input,
.auth-input-wrap input[type="text"],
.auth-input-wrap input[type="email"],
.auth-input-wrap input[type="password"] {
    width: 100% !important;
    padding-left: 48px !important;
    padding-right: 48px !important;
    padding-top: 13px !important;
    padding-bottom: 13px !important;
    height: 48px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    border-radius: var(--r-md) !important;
    border: 1.5px solid var(--border-color) !important;
    background: var(--bg-input) !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    outline: none !important;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast) !important;
}

.auth-input-wrap input:focus,
.auth-input-wrap input[type="text"]:focus,
.auth-input-wrap input[type="email"]:focus,
.auth-input-wrap input[type="password"]:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background: var(--bg-surface) !important;
}

.auth-input-wrap input:focus + i,
.auth-input-wrap:focus-within > i {
    color: var(--primary-color) !important;
}

.auth-input-wrap input:-webkit-autofill,
.auth-input-wrap input:-webkit-autofill:hover,
.auth-input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-input) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-eye-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    z-index: 3;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: color var(--t-fast), background-color var(--t-fast);
}

.auth-eye-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.auth-eye-btn i {
    pointer-events: none;
}

.auth-forgot-row {
    text-align: right;
    margin-top: -6px;
}

.auth-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--t-fast);
}

.auth-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.auth-error {
    font-size: 13px;
    color: var(--c-red);
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-weight: 500;
}

.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--r-md);
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--primary-glow);
    transition: transform var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
    margin-top: 6px;
}

.auth-submit-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-forgot-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-forgot-header h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.auth-forgot-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: color var(--t-fast);
}

.btn-back:hover {
    color: var(--text-main);
}

@media (max-width: 860px) {
    .auth-screen {
        flex-direction: column;
    }
    .auth-brand-panel {
        flex: none;
        padding: 36px 24px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .auth-brand-inner {
        max-width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .auth-brand-title {
        font-size: 32px;
    }
    .auth-brand-sub, .auth-brand-features {
        display: none;
    }
    .auth-form-panel {
        padding: 28px 16px;
    }
    .auth-form-inner {
        padding: 24px 20px;
    }
}

/* ─── APP HEADER & LOGO ────────────────────────────────────────────────── */
#app-content {
    min-height: 100vh;
    width: 100%;
    margin: 0 auto;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    display: none;
}

.app-main-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: max(14px, calc(6px + env(safe-area-inset-top))) 12px 14px;
    margin: 0 -16px 8px -16px;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.logo-hex {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform var(--t-fast), filter var(--t-fast);
    flex-shrink: 0;
}

.logo-hex:hover {
    transform: scale(1.06);
    filter: brightness(1.12);
}

.zennit-logo-svg,
.zennit-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform var(--t-fast);
}

.logo-hex-large .zennit-logo-img {
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
}

.logo-text {
    display: none;
}

.logo-l {
    display: none;
}

.logo-hex-large {
    width: 76px;
    height: 76px;
    border-radius: var(--r-md);
    margin: 0 auto 16px auto;
}

.logo-hex-large .logo-text {
    font-size: 22px;
}

.app-brand-info {
    display: flex;
    flex-direction: column;
}

.app-brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* Date Navigator Pill */
.date-navigator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 6px;
    border-radius: var(--r-full);
    box-shadow: var(--shadow-sm);
}

.date-display {
    position: relative;
    text-align: center;
    padding: 2px 12px;
    cursor: pointer;
    min-width: 140px;
}

.date-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.date-display h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.date-calendar-hint {
    font-size: 12px;
    color: var(--primary-color);
    opacity: 0.8;
}

.date-display p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
    white-space: nowrap;
}

.date-display input[type="date"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
}

.icon-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-pill-btn {
    width: auto;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.header-pill-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.header-btn-text {
    font-size: 13px;
}

/* Sync Status Badge */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--r-full);
    opacity: 0;
    transform: scale(0.9);
    transition: all var(--t-normal);
    pointer-events: none;
    user-select: none;
}

.sync-status.visible {
    opacity: 1;
    transform: scale(1);
}

.sync-status.saving {
    color: var(--primary-color);
    background: var(--primary-glow);
}

.sync-status.saved {
    color: var(--c-green);
    background: rgba(16, 185, 129, 0.15);
}

.sync-status.offline {
    color: var(--c-yellow);
    background: rgba(245, 158, 11, 0.15);
}

.sync-status.error {
    color: var(--c-red);
    background: rgba(244, 63, 94, 0.15);
}

/* ─── SEGMENTED NAVIGATION TABS ────────────────────────────────────────── */
.app-tabs {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: 5px;
    margin: 8px 0 20px 0;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    background: transparent;
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
}

.tab-btn i {
    font-size: 15px;
    transition: transform var(--t-fast);
}

.tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.tab-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.tab-btn.active i {
    transform: scale(1.1);
}

/* ─── VIEW CONTAINERS & HEADINGS ───────────────────────────────────────── */
.view-container {
    flex: 1;
    display: none;
    padding-bottom: 110px;
    animation: fadeIn var(--t-normal);
}

.view-container.active {
    display: block;
}

.view-page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 19px;
    color: var(--primary-color);
    opacity: 0.9;
}

.activity-icon-badge {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: var(--r-xs);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.activity-item.completed .activity-icon-badge {
    color: var(--text-muted);
    opacity: 0.5;
}

.modal-handle {
    display: none;
    width: 38px;
    height: 4px;
    border-radius: var(--r-full);
    background: var(--border-color);
    margin: 0 auto 16px auto;
}

/* ─── TIMELINE (AGENDA VIEW) ───────────────────────────────────────────── */
.timeline-container {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 4px;
}

/* Activity Card Item */
.activity-item {
    display: flex;
    position: relative;
    margin-bottom: 4px;
    transition: opacity var(--t-fast), transform var(--t-fast);
}

.activity-item.completed {
    opacity: 0.55;
}

.activity-time {
    width: 64px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    padding-top: 18px;
    font-variant-numeric: tabular-nums;
}

.activity-line-wrapper {
    width: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px;
}

.activity-dot {
    width: 14px;
    height: 14px;
    border-radius: var(--r-full);
    margin-top: 20px;
    z-index: 2;
    box-shadow: 0 0 0 3px var(--bg-main), 0 0 10px currentColor;
    flex-shrink: 0;
}

.activity-line {
    width: 2px;
    flex: 1;
    background: var(--border-color);
    margin-top: 4px;
}

.activity-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    margin: 6px 0 12px 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.activity-content:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.16);
}

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

.activity-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.activity-item.completed .activity-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.activity-duration {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.activity-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.action-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--r-sm);
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--t-fast);
}

.action-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.action-btn.check:hover,
.activity-item.completed .action-btn.check {
    color: var(--c-green);
    border-color: var(--c-green);
    background: rgba(16, 185, 129, 0.12);
}

.action-btn.delete {
    color: var(--text-muted);
}

.action-btn.delete:hover {
    color: var(--c-red);
    border-color: var(--c-red);
    background: rgba(244, 63, 94, 0.12);
}

/* Free time Gap Item */
.gap-item {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 2px 0;
}

.gap-time {
    width: 64px;
    flex-shrink: 0;
}

.gap-line-wrapper {
    width: 22px;
    display: flex;
    justify-content: center;
    margin: 0 8px;
    height: 100%;
}

.gap-line {
    width: 2px;
    height: 100%;
    border-left: 2px dashed var(--gap-color);
    background: none;
}

.gap-content {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--r-full);
    padding: 5px 14px;
    margin: 4px 0;
    width: fit-content;
}

/* ─── GAMIFICATION & HABITS VIEW ───────────────────────────────────────── */
.gamification-banner {
    background: var(--bg-gamification);
    color: var(--text-gamification);
    border-radius: var(--r-xl);
    padding: 24px 26px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.gamification-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--r-full);
    pointer-events: none;
}

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

.peak-header h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.peak-header i {
    font-size: 26px;
    color: #facc15;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.peak-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: 14px;
    padding: 2px;
}

.progress-bar-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--r-full);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.peak-desc {
    font-size: 13px;
    opacity: 0.92;
    line-height: 1.5;
}

/* Habits List */
.habits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.habit-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}

.habit-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow-md);
}

.habit-item.completed {
    opacity: 0.65;
}

.habit-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.habit-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.habit-details h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.habit-streak {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
    padding: 2px 8px;
    border-radius: var(--r-full);
}

.habit-streak i {
    color: #f97316;
}

.habit-check {
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: transparent;
    transition: all var(--t-bounce);
    margin-right: 8px;
}

.habit-check:hover {
    border-color: var(--c-green);
    transform: scale(1.08);
}

.habit-item.completed .habit-check {
    background: var(--c-green);
    border-color: var(--c-green);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.habit-edit, .habit-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--r-xs);
    transition: color var(--t-fast);
}

.habit-edit:hover {
    color: var(--primary-color);
}

.habit-delete:hover {
    color: var(--c-red);
}

/* ─── HABIT FREQUENCY & WEEKDAY CONFIGURATION ─── */
.habit-freq-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.freq-preset-btn {
    flex: 1;
    min-width: 90px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--r-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
    text-align: center;
}

.freq-preset-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
}

.freq-preset-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.habit-weekdays-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 6px;
}

.habit-weekdays-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.habit-weekdays-grid {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.weekday-pill {
    flex: 1;
    height: 38px;
    border-radius: var(--r-sm);
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    user-select: none;
}

.weekday-pill:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
}

.weekday-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.habit-summary-box {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Habit card frequency indicators */
.habit-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.habit-freq-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2px 7px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.habit-week-progress {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.12);
    padding: 2px 8px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.habit-week-progress.completed {
    color: var(--c-green);
    background: rgba(16, 185, 129, 0.12);
}

.habit-day-status {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--r-full);
}

.habit-day-status.due {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
}

.habit-day-status.rest {
    color: var(--text-faint);
    background: var(--bg-surface);
}

/* ─── PURPOSES & KANBAN VIEW ───────────────────────────────────────────── */
.purposes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.purpose-card {
    background: var(--bg-card);
    border-radius: var(--r-xl);
    border: 1px solid var(--border-color);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}

.purpose-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-color, var(--primary-color));
}

.purpose-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.16);
}

.purpose-card-header {
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.purpose-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.purpose-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.purpose-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r-xs);
    transition: all var(--t-fast);
}

.purpose-menu-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.purpose-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.purpose-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    align-self: flex-start;
}

.purpose-progress-row {
    margin-bottom: 16px;
}

.purpose-progress-bar {
    height: 8px;
    background: var(--bg-surface);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-top: 8px;
}

.purpose-progress-fill {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 0.5s ease;
}

.sub-purposes-list {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-purpose-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    transition: opacity var(--t-fast);
}

.sub-purpose-item.completed {
    opacity: 0.5;
}

.sub-purpose-item.completed .sub-purpose-title {
    text-decoration: line-through;
}

.sub-purpose-check {
    cursor: pointer;
    font-size: 16px;
    color: var(--primary-color);
}

.sub-purpose-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.sub-purpose-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
}

.sub-purpose-delete:hover {
    color: var(--c-red);
}

.add-sub-purpose {
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--t-fast);
}

.add-sub-purpose:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-schedule-milestone {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-rgb, 99, 102, 241), 0.3);
    border-radius: var(--r-xs);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-schedule-milestone:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.milestone-badge-date {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.milestone-badge-task {
    font-size: 11px;
    color: var(--c-green);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ─── KANBAN BOARD (MODAL) ─────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 12px;
}

.kanban-column {
    flex: 1;
    min-width: 270px;
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.kanban-col-title {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    color: var(--text-muted);
}

.kanban-list {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast);
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
}

.kanban-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-main);
}

.kanban-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.kanban-move-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: var(--r-xs);
    transition: color var(--t-fast);
}

.kanban-move-btn:hover {
    color: var(--primary-color);
}

.kanban-agenda-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--r-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--t-fast);
}

.kanban-agenda-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* ─── INBOX (BRAIN DUMP) ───────────────────────────────────────────────── */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inbox-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: var(--r-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast);
}

.inbox-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
}

.inbox-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    flex: 1;
    margin-right: 12px;
    line-height: 1.4;
}

.inbox-actions {
    display: flex;
    gap: 6px;
}

.inbox-actions .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.inbox-actions .icon-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ─── CALENDAR VIEW ────────────────────────────────────────────────────── */
.calendar-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-controls h2 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    min-width: 160px;
    text-align: center;
}

.calendar-toggle {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-full);
    padding: 3px;
}

.view-toggle-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 0 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-cell {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    height: 110px;
    padding: 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.calendar-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.calendar-cell.today {
    border: 1.5px solid var(--primary-color);
    box-shadow: 0 0 12px var(--primary-glow);
}

.calendar-cell.other-month {
    opacity: 0.35;
    background: var(--bg-surface);
}

.calendar-cell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.calendar-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.calendar-cell.today .calendar-date {
    background: var(--primary-color);
    color: #ffffff;
    border-radius: var(--r-full);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.calendar-badge-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-full);
    padding: 1px 6px;
}

.calendar-cell-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    min-height: 0;
}

.calendar-grid.week-view .calendar-cell {
    height: 250px;
}

.calendar-item {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: var(--r-xs);
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.calendar-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── MODALS & FORMS ───────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal.active {
    display: flex;
    animation: fadeIn var(--t-fast);
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    border-radius: var(--r-xl);
    padding: 28px;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleUp var(--t-normal);
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.close-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 15px;
}

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

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="time"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Color Picker */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: var(--r-full);
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform var(--t-fast);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: var(--text-main);
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Inline Icon / Category Picker */
.inline-emoji-container {
    width: 100%;
    margin-top: 6px;
}

.inline-emoji-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 6px 2px 10px 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.inline-icon-option,
.inline-emoji-option {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--r-sm);
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--t-fast);
    padding: 0;
    user-select: none;
    outline: none;
}

.inline-icon-option:hover,
.inline-emoji-option:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.inline-icon-option.selected,
.inline-emoji-option.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: scale(1.05);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--r-md);
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 16px var(--primary-glow);
    transition: all var(--t-fast);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    padding: 10px 16px;
    border-radius: var(--r-full);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--t-fast);
}

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

.btn-outline.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* Settings Modal */
.settings-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* ─── SETTINGS MODAL & MINIMALIST PREFERENCES ───────────────────────── */
#modal-settings .modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

@media (min-width: 769px) {
    #modal-settings .modal-content {
        max-width: 600px;
        max-height: 86vh;
        border-radius: var(--r-xl);
        min-height: 0;
    }
}

@media (max-width: 768px) {
    #modal-settings .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 24px 24px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
}

#modal-settings .modal-handle {
    margin: 10px auto 4px auto;
}

#modal-settings .modal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-modal);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 20px 12px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#modal-settings .modal-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

#modal-settings .settings-scroll-area {
    padding: 16px 20px calc(80px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    margin-bottom: 14px;
    transition: border-color var(--t-fast);
}

.settings-group:hover {
    border-color: var(--border-color);
}

.settings-group h3 {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Theme picker grid with color swatches */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 8px;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
}

.theme-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.theme-btn::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.theme-btn[data-theme="light"]::before { background: #ffffff; border-color: #cbd5e1; }
.theme-btn[data-theme="dark"]::before { background: #0c0e14; border-color: #475569; }
.theme-btn[data-theme="pastel"]::before { background: #78909c; }
.theme-btn[data-theme="vibrant"]::before { background: #6366f1; }
.theme-btn[data-theme="sunset"]::before { background: #f97316; }
.theme-btn[data-theme="cyberpunk"]::before { background: #06b6d4; }
.theme-btn[data-theme="ocean"]::before { background: #0284c7; }
.theme-btn[data-theme="nature"]::before { background: #059669; }

/* Font selector */
#font-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--t-fast);
}

#font-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Celebration Modal */
.celebration-content {
    text-align: center;
    padding: 40px 24px;
}

.celebration-icon {
    font-size: 54px;
    color: #facc15;
    margin-bottom: 16px;
    animation: bounce 1.5s infinite;
}

.celebration-content h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.celebration-content p {
    color: var(--text-muted);
    font-size: 15px;
}

/* ─── FLOATING ACTION BUTTON (FAB) ─────────────────────────────────────── */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 58px;
    height: 58px;
    border-radius: var(--r-full);
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    font-size: 22px;
    box-shadow: 0 8px 24px var(--primary-glow);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: transform var(--t-bounce), box-shadow var(--t-fast);
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.fab:active {
    transform: scale(0.95);
}

/* ─── ANIMATIONS ───────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ─── RESPONSIVE: TABLET & DESKTOP ADJUSTMENTS (< 768px) ───────────────── */
@media (max-width: 768px) {
    #app-content {
        padding: 0 12px;
    }

    .purposes-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ─── RESPONSIVE: MOBILE FIRST DESIGN (< 768px) ────────────────────────── */
@media (max-width: 768px) {
    /* 2-tier Clean Header Grid */
    .app-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: 
            "logo space actions"
            "date date date";
        row-gap: 8px;
        column-gap: 8px;
        align-items: center;
        padding: max(10px, calc(6px + env(safe-area-inset-top))) 12px 10px;
        margin: 0 -12px 12px -12px;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-subtle);
    }

    .app-logo {
        grid-area: logo;
        display: flex;
        align-items: center;
    }

    .app-brand-info {
        display: none;
    }

    .logo-hex {
        width: 34px;
        height: 34px;
    }

    .logo-text {
        font-size: 11px;
    }

    .space-selector-wrap {
        grid-area: space;
        justify-self: start;
        min-width: 0;
    }

    .space-selector-btn {
        padding: 5px 10px;
        font-size: 12px;
        font-weight: 600;
        gap: 6px;
        max-width: 135px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--r-full);
    }

    #space-current-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
    }

    /* Actions on Mobile: Always fully visible, aligned to top right */
    .app-header-actions {
        grid-area: actions;
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .header-btn-text {
        display: none !important;
    }

    .header-pill-btn {
        width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: var(--r-full) !important;
    }

    .icon-btn {
        width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        font-size: 15px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: var(--r-full) !important;
    }

    /* Settings Button on Header: Always 100% visible and accessible */
    #btn-settings {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: var(--text-main);
        background: var(--bg-card);
        border: 1px solid var(--border-color);
    }

    #btn-settings:active, #btn-settings:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background: var(--bg-card-hover);
    }

    /* Date Navigator: Centered on row 2 */
    .date-navigator {
        grid-area: date;
        justify-self: center;
        width: 100%;
        max-width: 250px;
        margin: 2px auto 0;
        padding: 3px 8px;
        gap: 4px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: none;
    }

    .date-display {
        min-width: 100px;
        padding: 2px 6px;
    }

    .date-display h1 {
        font-size: 13.5px;
    }

    .date-display p {
        font-size: 10px;
    }

    /* Hide date navigator on mobile views that do not need date controls */
    body[data-active-view="purposes-view"] .date-navigator,
    body[data-active-view="notes-view"] .date-navigator,
    body[data-active-view="habits-view"] .date-navigator,
    body[data-active-view="someday-view"] .date-navigator,
    body[data-active-view="stats-view"] .date-navigator {
        display: none !important;
    }

    /* Fixed Native-Style Bottom Navigation Bar (7 tabs) */
    .app-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 95;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid var(--border-subtle);
        background: var(--glass-bg);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
        gap: 2px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.2);
    }

    .tab-btn {
        flex: 1;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
        padding: 5px 2px;
        border-radius: var(--r-sm);
        background: transparent;
        border: none;
        color: var(--text-muted);
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--t-fast);
    }

    .tab-btn i {
        font-size: 15px;
    }

    .tab-btn span {
        font-size: 9.5px;
        font-weight: 600;
        letter-spacing: -0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .tab-btn.active {
        box-shadow: none;
        background: rgba(var(--primary-rgb), 0.12);
        color: var(--primary-color);
        border: 1px solid rgba(var(--primary-rgb), 0.22);
    }

    .tab-btn:hover {
        color: var(--text-main);
    }

    .view-container {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }

    .view-page-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    /* FAB above Bottom Nav Bar */
    .fab {
        bottom: calc(76px + env(safe-area-inset-bottom));
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 20px;
        z-index: 96;
        box-shadow: var(--shadow-md);
    }

    /* Timeline on Mobile */
    .timeline-container {
        padding-left: 0;
    }

    .activity-time {
        width: 44px;
        font-size: 12px;
        padding-top: 13px;
    }

    .activity-line-wrapper {
        width: 14px;
        margin: 0 4px;
    }

    .activity-dot {
        width: 10px;
        height: 10px;
        margin-top: 17px;
        box-shadow: 0 0 0 2px var(--bg-main);
    }

    .activity-content {
        padding: 12px 14px;
        margin: 4px 0 8px 0;
        border-radius: var(--r-md);
    }

    .activity-title {
        font-size: 14.5px;
        gap: 6px;
    }

    .activity-duration {
        font-size: 12px;
        margin-top: 4px;
    }

    .activity-actions {
        margin-top: 10px;
        padding-top: 8px;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .action-btn {
        padding: 5px 8px;
        font-size: 12px;
        border-radius: var(--r-xs);
        flex-shrink: 0;
    }

    .action-btn.edit .action-btn-text,
    .action-btn.duplicate .action-btn-text {
        display: none;
    }

    .action-btn i {
        font-size: 12px;
    }

    .gap-time {
        width: 44px;
    }

    .gap-line-wrapper {
        width: 14px;
        margin: 0 4px;
    }

    .gap-content {
        font-size: 11px;
        padding: 3px 10px;
    }

    /* Habits on Mobile */
    .gamification-banner {
        padding: 16px 18px;
        border-radius: var(--r-lg);
        margin-bottom: 16px;
    }

    .peak-header h2 {
        font-size: 16px;
    }

    .peak-header i {
        font-size: 20px;
    }

    .peak-info {
        font-size: 12.5px;
        margin-bottom: 8px;
    }

    .progress-bar-bg {
        height: 8px;
        margin-bottom: 10px;
    }

    .peak-desc {
        font-size: 12px;
        line-height: 1.4;
    }

    .habit-item {
        padding: 12px 14px;
        border-radius: var(--r-md);
        gap: 10px;
    }

    .habit-info {
        gap: 12px;
    }

    .habit-icon {
        width: 38px;
        height: 38px;
        font-size: 15px;
        border-radius: var(--r-sm);
    }

    .habit-details h3 {
        font-size: 14.5px;
    }

    .habit-streak {
        font-size: 11px;
        padding: 1px 6px;
    }

    .habit-check {
        width: 34px;
        height: 34px;
        font-size: 14px;
        margin-right: 4px;
    }

    .habit-edit, .habit-delete {
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Purposes on Mobile */
    .purpose-card {
        padding: 16px;
        border-radius: var(--r-lg);
    }

    .purpose-title {
        font-size: 16px;
    }

    .purpose-description {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* Kanban Modal on Mobile */
    #modal-purpose-kanban .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 92vh !important;
        max-height: 92vh !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 16px 14px calc(20px + env(safe-area-inset-bottom)) !important;
    }

    .kanban-board {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 8px;
    }

    .kanban-column {
        min-width: 82vw;
        max-width: 82vw;
        scroll-snap-align: center;
        border-radius: var(--r-md);
    }

    .kanban-col-title {
        padding: 10px 14px;
        font-size: 12px;
    }

    /* Calendar on Mobile */
    .calendar-header-wrapper {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .calendar-controls {
        justify-content: space-between;
        width: 100%;
    }

    .calendar-controls h2 {
        font-size: 15px;
    }

    .calendar-toggle {
        width: 100%;
        display: flex;
    }

    .view-toggle-btn {
        flex: 1;
        text-align: center;
        padding: 6px 8px;
        font-size: 12px;
    }

    .calendar-weekdays {
        font-size: 11px;
        padding: 6px 0;
    }

    .calendar-weekdays .day-extra {
        display: none;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-cell {
        min-height: 52px;
        height: auto;
        padding: 3px;
        border-radius: var(--r-xs);
    }

    .calendar-date {
        font-size: 11px;
    }

    .calendar-badge-count {
        font-size: 8.5px;
        padding: 1px 3px;
        min-width: 14px;
        height: 14px;
    }

    .calendar-cell-body {
        max-height: 36px;
        gap: 2px;
    }

    .calendar-item {
        font-size: 9px;
        padding: 1px 3px;
        border-radius: 2px;
        margin-bottom: 1px;
    }

    .calendar-item .cal-item-icon {
        display: none;
    }

    .calendar-grid.week-view .calendar-cell {
        min-height: 120px;
    }

    /* Native Bottom Sheet Modals */
    .modal {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 22px 22px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        padding: 16px 18px calc(24px + env(safe-area-inset-bottom));
        max-height: 90vh;
        animation: slideUpSheet 0.28s var(--ease-out);
    }

    .modal-handle {
        display: block;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Inputs 16px on mobile to avoid iOS Safari auto-zoom */
    input[type="text"],
    input[type="time"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px;
        padding: 11px 14px;
    }
}

/* ─── EXTRA SMALL SCREENS (< 380px) ────────────────────────────────────── */
@media (max-width: 380px) {
    .date-navigator {
        max-width: 145px;
        padding: 2px 4px;
    }

    .date-display {
        min-width: 80px;
        padding: 1px 2px;
    }

    .date-display h1 {
        font-size: 12px;
    }

    .action-btn.check .action-btn-text {
        display: none;
    }

    .action-btn.check {
        padding: 5px 6px;
    }
}

/* ==========================================================================
   FASE 1: ESPACIOS, TAREAS RICAS, CAPTURA RÁPIDA, LAYOUT RESPONSIVE Y DESHACER
   ========================================================================== */

/* ─── DESKTOP THREE-COLUMN / TWO-PANE LAYOUT ───────────────────────────── */
@media (min-width: 992px) {
    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: 250px;
        flex-shrink: 0;
        background: var(--bg-surface);
        border-right: 1px solid var(--border-color);
        padding: 24px 16px;
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
        z-index: 100;
    }

    .app-main-pane {
        max-width: 1180px;
        padding: 0 32px 60px;
    }

    .hide-desktop {
        display: none !important;
    }

    .app-tabs {
        display: none !important; /* On desktop, navigation happens from sidebar */
    }

    .view-container {
        padding-bottom: 40px;
    }
}

@media (max-width: 991px) {
    .hide-mobile {
        display: none !important;
    }
}

/* ─── SIDEBAR ELEMENTS ─────────────────────────────────────────────────── */
.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.sidebar-quick-btn-wrap {
    margin-bottom: 24px;
}

.sidebar-qc-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 14px;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: all var(--t-fast);
}

.sidebar-qc-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.sidebar-qc-btn kbd {
    margin-left: auto;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
}

.sidebar-section {
    margin-bottom: 26px;
}

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 6px;
}

.sidebar-add-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: var(--r-xs);
    transition: color var(--t-fast);
}

.sidebar-add-btn:hover {
    color: var(--primary-color);
}

.sidebar-spaces-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-space-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
    text-align: left;
}

.sidebar-space-item:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.sidebar-space-item.active {
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    border-color: var(--border-color);
}

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

.sidebar-work-only-toggle {
    margin-top: 10px;
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: var(--r-sm);
    border: 1px solid var(--border-color);
}

.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.switch-label input {
    cursor: pointer;
}

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

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
    text-align: left;
}

.sidebar-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.sidebar-nav-item.active {
    background: var(--primary-glow);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13.5px;
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
    text-align: left;
}

.sidebar-footer-btn:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
    text-align: left;
}

.sidebar-action-btn:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.badge-count {
    margin-left: auto;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--r-full);
}

/* ─── SELECTOR DE ESPACIO (HEADER) ─────────────────────────────────────── */
.space-selector-wrap {
    position: relative;
    display: inline-block;
}

.space-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-full);
    padding: 6px 14px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
}

.space-selector-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-card-hover);
}

.space-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

.space-caret {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--t-fast);
}

.space-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 250;
    animation: scaleUp var(--t-fast);
}

.space-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.icon-btn-subtle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--r-xs);
}

.icon-btn-subtle:hover {
    color: var(--primary-color);
}

.space-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t-fast);
}

.space-dropdown-item:hover {
    background: var(--bg-card-hover);
}

.space-dropdown-item.active {
    background: var(--primary-glow);
    color: var(--primary-color);
    font-weight: 600;
}

.space-dropdown-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 6px;
}

.work-only-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-fast);
}

.work-only-btn:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.work-only-btn.active {
    color: #10b981;
    font-weight: 600;
}

/* ─── BADGES EN TARJETAS ───────────────────────────────────────────────── */
.activity-badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.space-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--r-full);
    border: 1px solid transparent;
}

.space-badge.work {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.space-badge.personal {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.priority-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-xs);
}

.priority-pill.urgent {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.priority-pill.high {
    background: rgba(249, 115, 22, 0.16);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.priority-pill.medium {
    background: rgba(234, 179, 8, 0.14);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.priority-pill.low {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.task-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1px 7px;
    border-radius: var(--r-xs);
}

.waiting-badge {
    font-size: 11px;
    color: #c084fc;
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.3);
    padding: 2px 8px;
    border-radius: var(--r-xs);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.subtasks-progress-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2px 7px;
    border-radius: var(--r-xs);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ─── CAPTURA RÁPIDA (QUICK CAPTURE) ───────────────────────────────────── */
.quick-capture-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: var(--primary-color) !important;
}

.modal-quick-capture-content {
    max-width: 580px;
}

.qc-badge-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-glow);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.qc-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.qc-hint code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    color: var(--primary-color);
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.qc-input-wrap textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md);
    color: var(--text-main);
    padding: 14px;
    font-size: 15px;
    font-family: var(--font-family);
    resize: none;
    outline: none;
    transition: border-color var(--t-fast);
}

.qc-input-wrap textarea:focus {
    border-color: var(--primary-color);
}

.qc-chips-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 14px 0 20px;
    min-height: 28px;
}

.qc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--r-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.qc-chip.date {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.qc-chip.priority {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.3);
    color: #fb923c;
}

.qc-chip.space {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.qc-chip.tag {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-muted);
}

.qc-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ─── SUBTAREAS EN MODAL DE TAREA ──────────────────────────────────────── */
.task-subtasks-group, .task-waiting-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 18px;
}

.task-subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.subtask-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    padding: 6px 10px;
}

.subtask-edit-row input[type="checkbox"] {
    cursor: pointer;
}

.subtask-edit-row span {
    flex: 1;
    font-size: 13.5px;
    color: var(--text-main);
}

.subtask-edit-row.done span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-del-btn {
    background: transparent;
    border: none;
    color: var(--c-red);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

.add-subtask-box {
    display: flex;
    gap: 8px;
}

.add-subtask-box input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-main);
}

.add-subtask-box button {
    padding: 6px 14px;
}

/* ─── TOAST DE DESHACER (UNDO) ─────────────────────────────────────────── */
.undo-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.undo-toast {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    padding: 12px 20px;
    border-radius: var(--r-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-size: 14px;
    pointer-events: auto;
    animation: slideUpSheet 0.25s var(--ease-out);
}

.btn-undo {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--r-xs);
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--t-fast);
}

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

/* ─── MENSAJES DE NOTIFICACIÓN TIPO APP (HEADS-UP / SISTEMA) ─────────────────── */
.app-notification-banner-container {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 480px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.incoming-message-card {
    pointer-events: auto;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideDownMessage 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.25s ease, opacity 0.25s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.incoming-message-card.dismissing {
    animation: slideUpMessage 0.25s ease forwards;
}

@keyframes slideDownMessage {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUpMessage {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
}

.incoming-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.incoming-message-app-badge {
    display: flex;
    align-items: center;
    gap: 7px;
}

.incoming-message-app-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    object-fit: cover;
}

.incoming-message-app-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

.incoming-message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.incoming-message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.incoming-message-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.incoming-message-close:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.incoming-message-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.incoming-message-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    color: #fff;
}

.incoming-message-texts {
    flex: 1;
    min-width: 0;
}

.incoming-message-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.incoming-message-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.incoming-message-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.incoming-message-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--r-md);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.incoming-message-btn-primary {
    background: var(--primary-color);
    color: #fff;
}

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

.incoming-message-btn-secondary {
    background: var(--bg-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.incoming-message-btn-secondary:hover {
    filter: brightness(0.95);
}

/* ─── BANNER DE PERMISOS DE NOTIFICACIONES ──────────────────────────────────── */
.notif-permission-banner {
    position: fixed;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 480px;
    z-index: 999;
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideUpSheet 0.3s ease;
}

@media (min-width: 768px) {
    .notif-permission-banner {
        bottom: 24px;
    }
}

/* ─── PROCESAR INBOX ───────────────────────────────────────────────────── */
.modal-process-content {
    max-width: 540px;
}

.process-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.process-note-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 16px;
}

.process-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.process-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* ==========================================================================
   FASE 2: VISTAS (HOY, PRÓXIMOS, ALGÚN DÍA), CIERRE DEL DÍA, PLAN Y BÚSQUEDA
   ========================================================================== */

/* ─── VISTA CABECERA & CIERRE DEL DÍA ─────────────────────────────────── */
.view-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.view-header-row .view-page-title {
    margin-bottom: 0;
}

.btn-day-closure {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.18) 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 15px;
    border-radius: var(--r-full);
    cursor: pointer;
    transition: all var(--t-fast);
}

.btn-day-closure:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
    transform: translateY(-1px);
}

/* ─── BANNERS DE TAREAS VENCIDAS Y EN ESPERA ───────────────────────────── */
.overdue-tasks-section {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    margin-bottom: 22px;
}

.overdue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: #f87171;
}

.overdue-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    margin-bottom: 6px;
    gap: 10px;
}

.waiting-tasks-section {
    background: rgba(192, 132, 252, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    margin-bottom: 22px;
}

.waiting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: #c084fc;
}

/* ─── CONFLICTOS HORARIOS EN PLAN DEL DÍA ──────────────────────────────── */
.conflict-warning-badge {
    background: rgba(249, 115, 22, 0.12);
    border: 1px dashed rgba(249, 115, 22, 0.4);
    color: #fb923c;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── VISTA PRÓXIMOS (7 DÍAS) Y ALGÚN DÍA ─────────────────────────────── */
.upcoming-group {
    margin-bottom: 26px;
}

.upcoming-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.upcoming-group-header .day-badge {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 2px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    border: 1px solid var(--border-color);
}

.someday-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all var(--t-fast);
}

.someday-item-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* ─── BARRA DE BÚSQUEDA GLOBAL ─────────────────────────────────────────── */
.sidebar-search-wrap {
    margin-bottom: 20px;
}

.sidebar-search-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--t-fast);
}

.sidebar-search-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-main);
}

.sidebar-search-btn kbd {
    margin-left: auto;
    font-size: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
}

.modal-search-content {
    max-width: 620px;
}

.search-category-group {
    margin-bottom: 18px;
}

.search-category-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 8px;
    padding-left: 6px;
}

.search-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--t-fast);
}

.search-item-row:hover {
    border-color: var(--primary-color);
    background: var(--bg-card-hover);
    transform: translateX(2px);
}

.search-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    flex: 1;
}

.search-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── MODAL CIERRE DEL DÍA ─────────────────────────────────────────────── */
.modal-day-closure-content {
    max-width: 580px;
}

.closure-badge-icon {
    width: 32px;
    height: 32px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.closure-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.closure-stat-box {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 14px;
    text-align: center;
}

.closure-stat-box .num {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    display: block;
}

.closure-stat-box .lbl {
    font-size: 12px;
    color: var(--text-muted);
}

.closure-pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 24px;
}

.closure-pending-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* ─── KANBAN HEADERS WITH COUNTERS ─────────────────────────────────────── */
.kanban-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.kanban-col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.kanban-col-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 1px 7px;
    border-radius: var(--r-full);
}

/* ─── FASE 3: NOTAS, BITÁCORA Y PLANTILLAS ────────────────────────────── */

/* Notas tipo Notion */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 16px;
    cursor: pointer;
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.note-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.note-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-card-snippet {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
}

.note-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 11.5px;
    color: var(--text-muted);
}

.btn-note-to-task {
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.btn-note-to-task:hover {
    background: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

/* Bitácora / Logbook */
.logbook-entries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logbook-entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.logbook-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.logbook-category-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-full);
}

.logbook-category-badge.incidencia {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.logbook-category-badge.decision {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.logbook-category-badge.mejora {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.logbook-category-badge.registro {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.logbook-status-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.logbook-status-pill.resolved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.logbook-status-pill.in_progress {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.logbook-status-pill.pending {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.logbook-details-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Plantillas de Checklist */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

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

.template-items-preview {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--r-sm);
    padding: 8px 12px;
}

.template-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}

.template-picker-item:hover {
    background: var(--bg-surface);
    border-color: var(--primary-color);
}

/* ─── FASE 4: ESTADÍSTICAS, REVISIÓN SEMANAL Y PRIVACIDAD ──────────────── */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-card-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.stat-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.stat-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--r-full);
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: var(--r-full);
    transition: width var(--t-normal);
}

.weekly-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================================================
   FASE 5: ONBOARDING, PULIDO VISUAL, ACCESIBILIDAD Y SOPORTE OFFLINE
   ========================================================================== */

/* 1. Accesibilidad y Foco Visible */
:focus-visible {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

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

/* 2. Microinteracciones y Estados Vacíos Pulidos */
.empty-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--r-lg);
    margin: 16px 0;
    transition: border-color var(--t-fast);
}

.empty-state-box:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.5;
    margin-bottom: 18px;
}

/* 3. Onboarding Modal Styling */
.onboarding-spaces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.onboarding-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-fast);
    user-select: none;
    position: relative;
}

.onboarding-option-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.onboarding-option-card.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.onboarding-option-card input[type="checkbox"] {
    margin-top: 4px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.onboarding-option-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.onboarding-option-info {
    flex: 1;
    min-width: 0;
}

.onboarding-option-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.onboarding-option-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Plantillas Onboarding */
.onboarding-templates-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onboarding-template-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-fast);
    user-select: none;
}

.onboarding-template-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.onboarding-template-item.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.06);
}

.onboarding-template-item input[type="checkbox"] {
    accent-color: var(--primary-color);
    cursor: pointer;
}

.onboarding-tpl-icon {
    font-size: 18px;
    width: 32px;
    text-align: center;
}

.onboarding-tpl-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

.onboarding-tpl-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Claves / Tips Onboarding */
.onboarding-tips-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onboarding-tip-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

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

.onboarding-tip-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.onboarding-tip-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Onboarding Vistas Grid */
.onboarding-views-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.onboarding-feature-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--t-fast);
}

.onboarding-feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.onboarding-feature-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.onboarding-feature-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
}

.onboarding-feature-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Onboarding Settings List */
.onboarding-settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onboarding-setting-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

.onboarding-setting-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.onboarding-setting-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.onboarding-setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Notificación badge en tarjeta de tarea */
.notify-badge {
    font-size: 10.5px;
    color: var(--primary-color);
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    padding: 2px 5px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--r-xs);
}

/* Toast de recordatorio de tarea */
.task-reminder-toast {
    animation: slideDownIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Guía de instalación y soporte PWA */
.install-instructions-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: 14px;
}

/* 4. Sincronización Offline y Estado de Red */
.sync-status.offline {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* 5. Ergonomía táctil para móviles */
@media (max-width: 768px) {
    .btn-primary,
    .btn-outline,
    .nav-btn {
        min-height: 42px;
    }

    .tab-btn {
        min-height: 44px;
    }

    .app-header .icon-btn,
    .app-header .header-pill-btn {
        width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        min-width: 36px !important;
    }

    .onboarding-spaces-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── INTERRUPTOR TOGGLE SWITCH MODERNO ─── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    vertical-align: middle;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color, #4b5563);
    transition: 0.25s ease;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color, #3b82f6);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}
.habit-notify-badge {
    font-size: 11px;
    color: var(--primary-color, #3b82f6);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 2px 7px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}



