/* Split from style.css (M10) — section order preserved; @media-wrapped sections rebalanced. */

/* ── Reset & Variables ──────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2130;
    --bg-card-hover: #252839;
    --bg-input: #161825;
    --border-color: #2a2d3e;
    --border-focus: #5b6abf;
    --border-hover: #353853;
    --text-primary: #e4e6f0;
    --text-secondary: #8a8fa8;
    --text-muted: #5a5f78;
    --accent: #5b6abf;
    --accent-hover: #6e7dd4;
    --accent-bg: rgba(91, 106, 191, 0.15);
    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.1);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.1);
    --yellow: #fbbf24;
    --yellow-bg: rgba(251, 191, 36, 0.1);
    --blue: #60a5fa;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 -8px 40px rgba(0, 0, 0, 0.4);
    --t-fast: 0.15s;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Global confirm modal & toasts ──────────────────────────────────── */
.g-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.g-confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.g-confirm-msg {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

.g-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.g-fade-enter { transition: opacity 0.15s ease, transform 0.15s ease; }
.g-fade-enter-start { opacity: 0; }
.g-fade-enter-end { opacity: 1; }

/* Toasts */
.g-toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9998;
}

.g-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    min-width: 240px;
    max-width: 360px;
    box-shadow: var(--shadow);
    animation: g-toast-in 0.2s ease;
}

@keyframes g-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.g-toast--error   { background: #3a1f1f; border: 1px solid var(--red);    color: var(--red); }
.g-toast--info    { background: #1a2035; border: 1px solid var(--blue);   color: var(--blue); }
.g-toast--success { background: #1a2e25; border: 1px solid var(--green);  color: var(--green); }

.g-toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    flex-shrink: 0;
}
.g-toast-close:hover { opacity: 1; }

/* ── Scrollbars ─────────────────────────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: #2e3249 transparent;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #2e3249;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: #404669; }
::-webkit-scrollbar-corner { background: transparent; }

/* ── Navbar ────────────────────────────────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon {
    font-size: 20px;
    opacity: 0.8;
}

.nav-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link--logout {
    color: var(--text-muted);
    margin-left: 8px;
}

.nav-link--logout:hover {
    color: var(--red);
    background: var(--red-bg);
}

/* ── Container ─────────────────────────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.lan-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.lan-info code {
    font-family: var(--font-mono);
    background: var(--bg-input);
    padding: 1px 6px;
    border-radius: 3px;
}

/* ── Empty state ───────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.empty-text {
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Toast Notifications ───────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    animation: slideIn 0.2s ease-out;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    max-width: 360px;
}

.toast.success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.toast.error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.toast.info {
    background: rgba(96, 165, 250, 0.1);
    color: var(--blue);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Dashboard Placeholder ─────────────────────────────────────────── */

.dashboard-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 8px;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    max-width: 420px;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        height: 85vh;
    }
}

/* ── Modal overlay ─────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-row {
    display: flex;
    gap: 12px;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.modal-field--icon {
    flex: 0 0 64px;
}

.modal-field--grow {
    flex: 1;
}

.modal-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.modal-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 10px;
    font-family: var(--font-sans);
    transition: border-color 0.15s;
    width: 100%;
}

.modal-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.modal-input--icon {
    text-align: center;
    font-size: 20px;
    padding: 6px 4px;
}

.modal-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 10px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: border-color 0.15s;
    width: 100%;
}

.modal-select:focus {
    outline: none;
    border-color: var(--border-focus);
}

.modal-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-color-picker {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}

.modal-color-hex {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    min-width: 60px;
}

.modal-color-swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.modal-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.modal-swatch:hover {
    transform: scale(1.15);
}

.modal-swatch--active {
    border-color: var(--text-primary);
    transform: scale(1.15);
}

/* Goal icon picker */
.goal-icon-preview-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
}
.goal-icon-preview-btn:hover { border-color: var(--accent); }

.goal-icon-picker {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.goal-icon-group-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.goal-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.goal-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, border-color 0.1s;
}
.goal-icon-btn:hover { background: var(--surface-3, #2a2a3a); }
.goal-icon-btn--active {
    background: var(--accent-dim, rgba(91,106,191,0.25));
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 6px;
}

/* Modal transition classes (Alpine.js x-transition) */
.modal-enter { transition: opacity 0.15s ease, transform 0.15s ease; }
.modal-enter-start { opacity: 0; transform: scale(0.97); }
.modal-enter-end { opacity: 1; transform: scale(1); }
.modal-leave { transition: opacity 0.1s ease; }
.modal-leave-start { opacity: 1; }
.modal-leave-end { opacity: 0; }

/* ── Danger button ─────────────────────────────────────────────────── */

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
}

/* ── 1. Hamburger nav button (hidden on desktop) ─────────────────────── */

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    border-radius: var(--radius);
    -webkit-tap-highlight-color: transparent;
}

.nav-hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: background 0.15s;
}

.nav-hamburger:hover .nav-hamburger-bar,
.nav-hamburger:focus .nav-hamburger-bar {
    background: var(--text-primary);
}

@media (max-width: 768px) {

    /* ── 2. Remove zoom on mobile — causes layout/scroll issues ─────────── */
    main {
        zoom: 1;
    }

    /* ── 8. Reduce main padding ─────────────────────────────────────────── */
    .container {
        padding: 12px;
    }

    /* ── 8. Reduce large headings by ~15% ───────────────────────────────── */
    .page-header h1,
    .stats-header h1 {
        font-size: 24px;
    }

    /* ── 2. Hamburger — show button, collapse links ──────────────────────── */
    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        /* Hidden by default on mobile */
        display: none;
        position: absolute;
        top: 56px; /* navbar height */
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 8px;
        gap: 2px;
        z-index: 99;
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    }

    .nav-links--open {
        display: flex;
    }

    .nav-links .nav-link {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: var(--radius);
        /* 44px touch target */
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Keep navbar itself as a row */
    .navbar {
        flex-wrap: wrap;
        position: relative; /* so the dropdown can be positioned absolutely */
    }

    /* ── 3. Dashboard — stack single column (already done in existing CSS) ─ */
    /* .dash-grid already has grid-template-columns: 1fr at 768px             */

    /* ── 4. Touch targets — buttons ≥ 44px tall ─────────────────────────── */
    .btn-sm {
        min-height: 44px;
        padding: 10px 14px;
    }

    /* Task checkboxes */
    .task-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    /* Goal dots */
    .goal-dot {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }

    /* Icon-only buttons */
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Priority picker trigger buttons inside task rows */
    .task-item .priority-picker-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    /* Group/category picker trigger buttons inside task rows */
    .group-picker-btn {
        width: 32px;
        height: 32px;
        opacity: 1; /* always visible on touch, no hover */
    }

    /* Always show task action buttons on touch (no hover) */
    .task-item .task-delete-btn,
    .task-item .task-backlog-btn,
    .task-item .backlog-schedule-btn,
    .task-item .backlog-date-label {
        opacity: 1;
    }

    .ttp-list-entry-actions {
        opacity: 1;
    }

    .tt-entry-actions {
        opacity: 1;
    }

    .tasks-group-action-btn {
        opacity: 1;
    }

    /* ── 5. Modals — bottom sheet on mobile ─────────────────────────────── */
    /* Match the .m-sheet feel so every modal on the phone behaves the same:
       the backdrop fades while the box itself slides up from the bottom. */
    .modal-box {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
        border-bottom: none;
        animation: modal-sheet-up 0.28s cubic-bezier(.4, 0, .2, 1);
    }

    @keyframes modal-sheet-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end; /* sheet from bottom feels more natural */
    }

    /* The transition classes sit on the overlay — keep it a pure fade so the
       backdrop doesn't slide or scale along with the sheet. */
    .modal-enter-start { opacity: 0; transform: none; }
    .modal-enter-end   { opacity: 1; transform: none; }

    /* Global confirm box */
    .g-confirm-box {
        width: 95vw;
        max-width: 95vw;
        padding: 20px;
    }

    /* ── 6. Stats page — already stacks at 768px, verify donut size ─────── */
    /* .stats-charts-row already has grid-template-columns: 1fr at 768px     */
    /* But the donut should not be huge alone — cap it */
    .stats-charts-row .stats-chart-card:last-child {
        max-height: 280px;
    }

    /* ── 7. Time tracker — make calendar horizontally scrollable ─────────── */
    /* Wrap the calendar in an overflow-x container */
    .ttp-calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Give the inner header and body a fixed min-width so they scroll */
    .ttp-cal-header,
    .ttp-cal-body {
        min-width: 560px; /* 70px gutter + 7 * ~70px columns */
    }

    /* Timer bar on time tracker page — stack vertically */
    /* (already handled by 900px breakpoint above but add 768px too) */
    .ttp-timer-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ttp-timer-right {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }

    .ttp-timer-project {
        flex: 1;
        min-width: 120px;
    }

    .ttp-week-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ttp-week-label {
        min-width: 0;
    }

    .ttp-project-filter {
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    /* ── Toast positioning on mobile ────────────────────────────────────── */
    .g-toasts {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .g-toast {
        min-width: 0;
        max-width: 100%;
    }

    /* ── Summary bar shortcuts — hide keyboard hints on mobile ──────────── */
    .dash-summary-shortcuts {
        display: none;
    }

    .dash-timer-hint {
        display: none;
    }

    /* ── Tasks panel — make input row and tabs wrap ─────────────────────── */
    .tasks-input-row {
        flex-wrap: wrap;
    }

    .tasks-new-input {
        min-width: 0;
    }

    .tasks-tabs-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tasks-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 100%;
    }

    /* ── Time tracker list — make entry rows wrap on very small screens ──── */
    .ttp-list-entry {
        flex-wrap: wrap;
        gap: 6px;
    }

    .ttp-list-entry-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* ── Manual form — stack time pickers vertically ─────────────────────── */
    .ttp-manual-form-times {
        grid-template-columns: 1fr;
    }

    .ttp-modal-times {
        grid-template-columns: 1fr;
    }

    /* ── Settings — stack detail grid to 1 col ──────────────────────── */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* ── Modal rows — stack side-by-side fields vertically ──────────── */
    .modal-row {
        flex-direction: column;
    }

    /* ── Work — sprint picker fits in available space ────────────────── */
    .work-header {
        flex-direction: column;
        align-items: stretch;
    }
    .work-header-right {
        display: flex;
        justify-content: flex-start;
    }
    .work-sprint-picker-btn {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
    }
    .work-sprint-picker-menu {
        min-width: 0;
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        right: auto;
        left: 0;
    }

    /* ── Bank — cover the 700px–768px gap ───────────────────────────── */
    .bank-mid {
        grid-template-columns: 1fr;
    }
    .bank-balance-amount {
        font-size: 2.2rem;
    }
    .bank-balance-stats {
        gap: .6rem;
    }
    .bank-balance-card {
        padding: 1.25rem;
    }

} /* end @media (max-width: 768px) */

/* ── missing design tokens ─────────────────────────────────────────── */
:root {
    --accent-bg: rgba(91, 106, 191, 0.1);
    --border-hover: #353853;
}

/* ── bottom-sheet slide-up transition ──────────────────────────────── */
.m-sheet-enter { transition: transform 0.28s cubic-bezier(.4, 0, .2, 1); }
.m-sheet-enter-start { transform: translateY(100%); }
.m-sheet-enter-end   { transform: translateY(0); }

/* ── pulse for live-timer dots ─────────────────────────────────────── */
@keyframes m-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── desktop: hide mobile-only elements ────────────────────────────── */
@media (min-width: 769px) {
    .nav-drawer-brand          { display: none !important; }
    .tasks-mobile-add-trigger  { display: none !important; }
    .m-sheet-overlay           { display: none !important; }
    .m-sheet                   { display: none !important; }
    .ttp-mobile-view           { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════
   @media (max-width: 768px)
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

}
@media (max-width: 768px) {
/* ── 1. NAVBAR: sticky top bar ─────────────────────────────────────── */

.navbar {
    position: sticky !important;
    top: 0;
    z-index: 100;
    padding: 0 12px;
    flex-wrap: nowrap;
}

/* Hamburger first */
.nav-hamburger {
    order: -1;
    margin-left: 0;
}

.nav-brand {
    margin-right: auto;
}

}
@media (max-width: 768px) {
/* ── 2. NAV DRAWER: side slide-in ──────────────────────────────────── */

.nav-mobile-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 97;
}

/* Convert top dropdown → fixed side drawer */
.nav-links {
    display: flex !important;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 74%;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    flex-direction: column;
    padding: 56px 0 0;
    gap: 0;
    z-index: 99;
    box-shadow: none;
    overflow-y: auto;
    pointer-events: none;
}

.nav-links--open {
    transform: translateX(0) !important;
    pointer-events: auto;
}

/* Brand row at top of drawer */
.nav-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
    flex-shrink: 0;
}

.nav-drawer-brand .nav-icon {
    font-size: 20px;
    color: var(--accent);
    opacity: 0.9;
}

.nav-drawer-brand .nav-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Nav links in drawer */
.nav-links .nav-link {
    padding: 13px 14px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 10px;
    min-height: 44px;
    margin: 0 12px 2px;
    display: flex;
    align-items: center;
}

.nav-links .nav-link.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-links .nav-link:not(.active):not(.nav-link--logout) {
    color: var(--text-secondary);
    background: transparent;
}

/* Exclude Apps and Settings from phone nav */
.nav-links .nav-link[href="/apps"],
.nav-links .nav-link[href="/settings"] {
    display: none;
}

/* Sign out pinned to bottom */
.nav-links .nav-link--logout {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 16px 26px;
    color: var(--text-muted);
}

}
@media (max-width: 768px) {
/* ── 12. LOGIN: better mobile padding ──────────────────────────────── */

.login-card {
    padding: 28px 20px !important;
    border-radius: 14px !important;
    max-width: 100%;
}

}
@media (max-width: 768px) {
/* ── 13. Misc page-level tweaks ────────────────────────────────────── */

.dash-page-header { padding-bottom: 6px; }

.tasks-tabs-row { flex-wrap: wrap; gap: 6px; }

/* Toasts: bottom-left on mobile so they don't clash with content */
.g-toasts {
    bottom: 16px;
    right: 12px;
    left: 12px;
}

.g-toast { min-width: 0; }

}

/* ── Shared chrome (used by base.html on every page) ── */
.hidden {
    display: none !important;
}
/* ── Card Actions ──────────────────────────────────────────────────── */

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    outline: none;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.2;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-start {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.btn-start:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.4);
}

.btn-stop {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-stop:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
}

.btn-open {
    background: rgba(96, 165, 250, 0.1);
    color: var(--blue);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.btn-open:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Log Modal ─────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.log-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 960px;
    height: 70vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 4px;
}

.log-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background: #0a0c14;
}

#log-output {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
    color: #b8c4b8;
    white-space: pre-wrap;
    word-break: break-all;
}


/* desktop: hide mobile-only elements (moved from the misfiled stats tail) */
@media (min-width: 769px) {
    .mdash { display: none !important; }
    .cal-mobile-toolbar { display: none !important; }
}

/* ── Mobile bottom-sheet chrome (moved from tasks.css — shared by task add and TT manual entry) ── */
@media (max-width: 768px) {
/* ── 6. TASKS: add-task bottom sheet ───────────────────────────────── */

.m-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
}

.m-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 201;
}

.m-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.m-sheet-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.m-sheet-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.m-sheet-body {
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.m-sheet-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.m-sheet-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.m-sheet-input {
    width: 100%;
    padding: 11px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.m-sheet-input:focus { border-color: var(--border-focus); }

.m-sheet-row {
    display: flex;
    gap: 12px;
}

.m-sheet-row .m-sheet-field { flex: 1; }

.m-sheet-prio-btns {
    display: flex;
    gap: 8px;
}

.m-sheet-prio-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
    min-height: 44px;
}

.m-sheet-prio-btn.active {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.m-sheet-prio-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.m-sheet-footer {
    display: flex;
    gap: 10px;
    padding: 12px 18px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.m-sheet-cancel {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
    min-height: 44px;
}

.m-sheet-submit {
    flex: 1.4;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    min-height: 44px;
}

}

/* ── Generic form chrome (moved from apps.css — used by modals on every page) ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group label small {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}

.form-group textarea {
    font-family: var(--font-mono);
    font-size: 13px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 8px;
}

/* ── Mobile add trigger (moved from tasks.css — also used by the TT manual-entry button) ── */
@media (max-width: 768px) {
/* ── 5. TASKS: mobile add-task trigger ─────────────────────────────── */

.tasks-mobile-add-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px 14px;
    background: var(--accent-bg);
    border: 1px solid rgba(91, 106, 191, 0.3);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.tasks-mobile-add-trigger:hover,
.tasks-mobile-add-trigger:active {
    background: rgba(91, 106, 191, 0.18);
}

/* Hide the desktop inline input row */
.tasks-input-row {
    display: none !important;
}

}
