/* ============================================================================
   Queesales — Application Design System
   Neutral slate surfaces, one blue accent, Inter type, 8px radius scale.

   Sections
     1. Tokens & Bootstrap variable overrides
     2. Base & typography
     3. Utilities (incl. half-step spacing used across views)
     4. App shell: sidebar, top bar, content, footer
     5. Buttons (standard system)
     6. Forms
     7. Cards, page headers, hero
     8. Stats, KPI tiles, badges
     9. Charts, tabs, filters, pipeline
    10. Tables & stacked lists
    11. Kanban, time grid, timeline
    12. Dropdowns, modals, alerts, misc Bootstrap components
    13. Mobile navigation & action sheet
    14. Login
    15. Compact mode
    16. Responsive
   ============================================================================ */

/* ── 1. Tokens ─────────────────────────────────────────────────────────────── */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

    /* Neutrals */
    --gray-25:  #fcfcfd;
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-150: #eaeef3;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Accent */
    --accent:        #2563eb;
    --accent-hover:  #1d4ed8;
    --accent-active: #1e40af;
    --accent-soft:   #eff6ff;
    --accent-soft-2: #dbeafe;
    --accent-text:   #1d4ed8;
    --accent-ring:   rgba(37, 99, 235, 0.22);

    /* Semantic */
    --success: #16a34a;  --success-hover: #15803d;  --success-soft: #f0fdf4;  --success-text: #15803d;  --success-border: #bbf7d0;
    --warning: #d97706;  --warning-hover: #b45309;  --warning-soft: #fffbeb;  --warning-text: #b45309;  --warning-border: #fde68a;
    --danger:  #dc2626;  --danger-hover:  #b91c1c;  --danger-soft:  #fef2f2;  --danger-text:  #b91c1c;  --danger-border:  #fecaca;
    --info:    #0284c7;  --info-hover:    #0369a1;  --info-soft:    #f0f9ff;  --info-text:    #0369a1;  --info-border:    #bae6fd;
    --purple:  #7c3aed;  --purple-soft:   #f5f3ff;

    /* Surfaces & text */
    --canvas:        #f6f7f9;
    --surface:       #ffffff;
    --surface-muted: var(--gray-50);
    --border:        #e4e7ec;
    --border-strong: var(--gray-300);
    --text:          #101828;
    --text-secondary:#475467;
    --text-muted:    #667085;

    /* Sidebar */
    --sidebar-w:      248px;
    --sidebar-bg:     #0f172a;
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-text:   #94a3b8;
    --sidebar-text-strong: #e2e8f0;
    --sidebar-hover:  rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(255, 255, 255, 0.08);
    --topbar-h:       60px;

    /* Shape */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
    --shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, 0.1), 0 8px 8px -4px rgba(16, 24, 40, 0.04);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-smooth: var(--ease);
    --ease-spring: var(--ease);

    /* Legacy token names still referenced by views & inline styles */
    --color-lime: var(--accent);
    --color-lime-hover: var(--accent-hover);
    --color-lime-glow: var(--accent-ring);
    --color-lime-subtle: var(--accent-soft);
    --color-lime-border: var(--accent-soft-2);
    --color-lime-text: #ffffff;
    --color-primary: var(--accent);
    --color-primary-hover: var(--accent-hover);
    --color-primary-light: var(--accent-soft);
    --color-primary-muted: var(--accent-ring);
    --color-sky: var(--info);
    --color-sky-subtle: var(--info-soft);
    --color-sky-border: var(--info-border);
    --color-info: var(--info);
    --color-info-light: var(--info-soft);
    --color-success: var(--success);
    --color-success-light: var(--success-soft);
    --color-warning: var(--warning);
    --color-warning-light: var(--warning-soft);
    --color-amber: var(--warning);
    --color-danger: var(--danger);
    --color-danger-light: var(--danger-soft);
    --color-coral: var(--danger);
    --color-purple: var(--purple);
    --color-purple-light: var(--purple-soft);
    --color-obsidian: var(--gray-900);
    --color-canvas: var(--canvas);
    --color-bg: var(--canvas);
    --color-surface: var(--surface);
    --color-surface-subtle: var(--gray-50);
    --color-surface-muted: var(--gray-100);
    --color-border: var(--border);
    --color-border-subtle: var(--border);
    --color-border-strong: var(--border-strong);
    --color-text-primary: var(--text);
    --color-text-secondary: var(--text-secondary);
    --color-text-muted: var(--text-muted);
    --card-radius-sm: var(--radius-md);
    --card-radius: var(--radius-xl);
    --card-radius-lg: var(--radius-xl);
    --card-radius-full: var(--radius-full);
    --card-shadow: var(--shadow-xs);
    --card-shadow-xs: var(--shadow-xs);
    --card-shadow-hover: var(--shadow-sm);
    --bg-rag-green: var(--success-soft);
    --bg-rag-amber: var(--warning-soft);
    --bg-rag-red: var(--danger-soft);

    /* Bootstrap overrides */
    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: 0.875rem;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--canvas);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-bg: var(--gray-50);
    --bs-border-color: var(--border);
    --bs-border-color-translucent: var(--border);
    --bs-border-radius: var(--radius-md);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-border-radius-xl: var(--radius-xl);
    --bs-border-radius-xxl: var(--radius-xl);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: var(--accent-hover);
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-primary: #2563eb;            --bs-primary-rgb: 37, 99, 235;
    --bs-success: #16a34a;            --bs-success-rgb: 22, 163, 74;
    --bs-warning: #d97706;            --bs-warning-rgb: 217, 119, 6;
    --bs-danger: #dc2626;             --bs-danger-rgb: 220, 38, 38;
    --bs-info: #0284c7;               --bs-info-rgb: 2, 132, 199;
    --bs-secondary: #475467;          --bs-secondary-rgb: 71, 84, 103;
    --bs-dark: #0f172a;               --bs-dark-rgb: 15, 23, 42;
    --bs-primary-bg-subtle: var(--accent-soft);     --bs-primary-text-emphasis: var(--accent-text);   --bs-primary-border-subtle: var(--accent-soft-2);
    --bs-success-bg-subtle: var(--success-soft);    --bs-success-text-emphasis: var(--success-text);  --bs-success-border-subtle: var(--success-border);
    --bs-warning-bg-subtle: var(--warning-soft);    --bs-warning-text-emphasis: var(--warning-text);  --bs-warning-border-subtle: var(--warning-border);
    --bs-danger-bg-subtle: var(--danger-soft);      --bs-danger-text-emphasis: var(--danger-text);    --bs-danger-border-subtle: var(--danger-border);
    --bs-info-bg-subtle: var(--info-soft);          --bs-info-text-emphasis: var(--info-text);        --bs-info-border-subtle: var(--info-border);
    --bs-secondary-bg-subtle: var(--gray-100);      --bs-secondary-text-emphasis: var(--gray-700);    --bs-secondary-border-subtle: var(--gray-200);
    --bs-focus-ring-color: var(--accent-ring);
}

/* ── 2. Base & typography ──────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--canvas) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text);
}
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

.fw-bold, strong, b { font-weight: 600 !important; }
.fw-bolder, .fw-800 { font-weight: 700 !important; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent-soft-2); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code { color: var(--accent-text); font-size: 0.85em; }

hr { border-color: var(--border); opacity: 1; }

/* ── 3. Utilities ──────────────────────────────────────────────────────────── */
.text-slate-700 { color: var(--gray-700) !important; }
.text-slate-800 { color: var(--gray-800) !important; }
.text-slate-900 { color: var(--text) !important; }
.text-lime      { color: var(--accent) !important; }
.text-purple    { color: var(--purple) !important; }
.bg-purple-subtle { background-color: var(--purple-soft) !important; }
.text-muted, .text-body-secondary { color: var(--text-muted) !important; }
.font-semibold  { font-weight: 600; }
.tracking-tight { letter-spacing: -0.015em; }
.fs-7 { font-size: 0.8125rem !important; }
.rounded-4 { border-radius: var(--radius-xl) !important; }
.rounded-3 { border-radius: var(--radius-lg) !important; }
.tabular, .tabular-nums { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0 !important; }

/* Half-step spacing (used across views; not part of Bootstrap) */
.gap-1\.5  { gap: 0.375rem !important; }
.gap-2\.5  { gap: 0.625rem !important; }
.mt-0\.5   { margin-top: 0.125rem !important; }
.mb-1\.5   { margin-bottom: 0.375rem !important; }
.mt-2\.5   { margin-top: 0.625rem !important; }
.p-1\.5    { padding: 0.375rem !important; }
.p-2\.5    { padding: 0.625rem !important; }
.px-1\.5   { padding-left: 0.375rem !important; padding-right: 0.375rem !important; }
.px-2\.5   { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.py-0\.5   { padding-top: 0.125rem !important; padding-bottom: 0.125rem !important; }
.py-1\.5   { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2\.5   { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }

/* Subtle shadows only — tame Bootstrap's heavier utilities */
.shadow    { box-shadow: var(--shadow-md) !important; }
.shadow-sm { box-shadow: var(--shadow-xs) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xs { box-shadow: var(--shadow-xs) !important; }

.bg-light  { background-color: var(--gray-50) !important; }
.bg-white  { background-color: var(--surface) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--border); }
.border-light-subtle { border-color: var(--border) !important; }

/* ── 4. App shell ──────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content { flex: 1 0 auto; }

/* Sidebar */
.app-sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        width: var(--sidebar-w);
        flex: 0 0 var(--sidebar-w);
        height: 100vh;
        height: 100dvh;
        border-right: 1px solid var(--sidebar-border);
    }
    /* offcanvas-lg leaves these visible on desktop; force flex column layout */
    .app-sidebar.offcanvas-lg { display: flex !important; flex-direction: column; background-color: var(--sidebar-bg) !important; }
}

@media (max-width: 991.98px) {
    .app-sidebar.offcanvas-lg {
        width: min(300px, 86vw) !important;
        background: var(--sidebar-bg) !important;
        border-right: 0 !important;
        box-shadow: var(--shadow-xl);
    }
}

.sidebar-brand {
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 0 1.125rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.brand-logo-sm { width: 26px; height: 26px; font-size: 0.8rem; border-radius: var(--radius-sm); }

.brand-name {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem 0.625rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.sidebar-section-label {
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1.125rem 0.625rem 0.375rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    margin-bottom: 2px;
    border: 0;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    min-height: 36px;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.sidebar-link > i:first-child { font-size: 1rem; width: 1.125rem; text-align: center; opacity: 0.9; }
.sidebar-link > span:not(.sidebar-badge) { flex: 1 1 auto; min-width: 0; }
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.sidebar-link.active { color: #fff; }
a.sidebar-link.active { background: var(--sidebar-active); }
.sidebar-link.active > i:first-child { color: #60a5fa; opacity: 1; }

.sidebar-chevron { font-size: 0.7rem; transition: transform 0.2s var(--ease); opacity: 0.7; }
.sidebar-toggle.collapsed .sidebar-chevron { transform: rotate(-90deg); }

.sidebar-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-full);
}

.sidebar-sub {
    padding: 0.125rem 0 0.375rem 2.375rem;
    position: relative;
}
.sidebar-sub::before {
    content: '';
    position: absolute;
    left: 1.2rem;
    top: 0.25rem;
    bottom: 0.5rem;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-sublink {
    display: block;
    padding: 0.375rem 0.625rem;
    margin-bottom: 1px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-sublink:hover { color: var(--sidebar-text-strong); background: var(--sidebar-hover); }
.sidebar-sublink.active { color: #fff; background: var(--sidebar-active); font-weight: 500; }

.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--sidebar-border);
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.sidebar-user { display: flex; align-items: center; gap: 0.625rem; }
.sidebar-user-text { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.sidebar-user-name { color: #fff; font-size: 0.8125rem; font-weight: 500; }
.sidebar-user-role { color: var(--sidebar-text); font-size: 0.75rem; }

.user-avatar-circle {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-soft-2);
    color: var(--accent-active);
    font-weight: 600;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.app-sidebar .user-avatar-circle { background: #1e3a8a; color: #dbeafe; }

/* Top bar */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}
.topbar-brand:hover { color: var(--text); }

.topbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.375rem; }

.topbar-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 2px #fff;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.375rem 0.125rem 0.125rem;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: transparent;
    margin-left: 0.25rem;
}
.topbar-user:hover, .topbar-user[aria-expanded="true"] { background: var(--gray-100); }

/* Footer */
.app-footer,
.footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    background: transparent;
}

/* ── 5. Buttons ────────────────────────────────────────────────────────────────
   Sizes:    .btn-xs (24px)  .btn-sm (32px)  .btn (36px)  .btn-lg (44px)
   Variants: primary · secondary · outline-* · ghost · success · danger · warning · link
   Shapes:   .btn-icon (square, any size) · .btn-pill (rounded) · .w-100 (block)
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-padding-x: 0.875rem;
    --bs-btn-padding-y: 0.4375rem;
    --bs-btn-font-size: 0.875rem;
    --bs-btn-font-weight: 500;
    --bs-btn-line-height: 1.25rem;
    --bs-btn-border-radius: var(--radius-md);
    --bs-btn-border-width: 1px;
    --bs-btn-box-shadow: none;
    --bs-btn-focus-box-shadow: 0 0 0 3px var(--accent-ring);
    --bs-btn-disabled-opacity: 0.5;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 36px;
    font-family: var(--font-sans);
    letter-spacing: 0;
    user-select: none;
    transition: color 0.15s var(--ease), background-color 0.15s var(--ease),
                border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn > i, .btn > .bi { font-size: 1em; line-height: 1; }
.btn .me-1, .btn .me-2, .btn .ms-1, .btn .ms-2 { margin: 0 !important; } /* gap handles icon spacing */
.btn:focus-visible { outline: 0; box-shadow: var(--bs-btn-focus-box-shadow); }
.btn:disabled, .btn.disabled { pointer-events: none; }

/* Sizes */
.btn-lg {
    --bs-btn-padding-x: 1.125rem;
    --bs-btn-padding-y: 0.625rem;
    --bs-btn-font-size: 0.9375rem;
    --bs-btn-border-radius: var(--radius-md);
    min-height: 44px;
}
.btn-sm, .btn-group-sm > .btn {
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-padding-y: 0.3125rem;
    --bs-btn-font-size: 0.8125rem;
    --bs-btn-line-height: 1.25rem;
    --bs-btn-border-radius: var(--radius-sm);
    min-height: 32px;
    gap: 0.35rem;
}
.btn-xs {
    --bs-btn-padding-x: 0.5rem;
    --bs-btn-padding-y: 0.125rem;
    --bs-btn-font-size: 0.75rem;
    --bs-btn-line-height: 1.125rem;
    --bs-btn-border-radius: var(--radius-xs);
    min-height: 24px;
    gap: 0.25rem;
}

/* Square icon buttons */
.btn-icon { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; width: 36px; height: 36px; min-height: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon.btn-xs, .btn-icon-xs {
    --bs-btn-padding-x: 0; --bs-btn-padding-y: 0;
    width: 26px; height: 26px; min-height: 0;
    --bs-btn-font-size: 0.75rem;
    --bs-btn-border-radius: var(--radius-sm);
    padding: 0;
}
.btn-icon.btn-lg { width: 44px; height: 44px; }

.btn-pill { --bs-btn-border-radius: var(--radius-full); border-radius: var(--radius-full) !important; }
/* Standard shape wins over ad-hoc pill classes on controls */
.btn.rounded-pill, .btn.btn-pill,
.form-control.rounded-pill, .form-select.rounded-pill { border-radius: var(--radius-md) !important; }
.btn-sm.rounded-pill, .btn-sm.btn-pill { border-radius: var(--radius-sm) !important; }
.btn-xs.rounded-pill { border-radius: var(--radius-xs) !important; }

/* Primary */
.btn-primary,
.btn-lime,
.fitmove-btn-lime {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--accent-active);
    --bs-btn-active-border-color: var(--accent-active);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    box-shadow: var(--shadow-xs);
}
.fitmove-btn-lime, .btn-lime { color: #fff !important; }
.fitmove-btn-lime:not(.btn) { /* used on <a> without .btn in a few places */
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-md);
    padding: 0.4375rem 0.875rem; font-weight: 500; font-size: 0.875rem; min-height: 36px;
}
.fitmove-btn-lime:not(.btn):hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Secondary (neutral, bordered) */
.btn-secondary,
.btn-light,
.btn-outline-secondary,
.btn-outline-light,
.fitmove-pill-btn-ghost {
    --bs-btn-color: var(--gray-700);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: var(--gray-50);
    --bs-btn-hover-border-color: var(--gray-400);
    --bs-btn-active-color: var(--text);
    --bs-btn-active-bg: var(--gray-100);
    --bs-btn-active-border-color: var(--gray-400);
    --bs-btn-disabled-color: var(--gray-500);
    --bs-btn-disabled-bg: var(--surface);
    --bs-btn-disabled-border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.btn-light { --bs-btn-border-color: var(--border); }
.fitmove-pill-btn-ghost { color: var(--gray-700); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.fitmove-pill-btn-ghost:not(.btn) { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4375rem 0.875rem; font-weight: 500; font-size: 0.875rem; }
.fitmove-pill-btn-ghost:hover { background: var(--gray-50); color: var(--text); }

/* Outline (tinted) */
.btn-outline-primary {
    --bs-btn-color: var(--accent-text);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--accent-soft-2);
    --bs-btn-hover-color: var(--accent-active);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: #93c5fd;
    --bs-btn-active-color: var(--accent-active);
    --bs-btn-active-bg: var(--accent-soft-2);
    --bs-btn-active-border-color: #93c5fd;
}
.btn-outline-success {
    --bs-btn-color: var(--success-text);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--success-border);
    --bs-btn-hover-color: var(--success-text);
    --bs-btn-hover-bg: var(--success-soft);
    --bs-btn-hover-border-color: #86efac;
    --bs-btn-active-color: var(--success-text);
    --bs-btn-active-bg: #dcfce7;
    --bs-btn-active-border-color: #86efac;
}
.btn-outline-danger {
    --bs-btn-color: var(--danger-text);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--danger-border);
    --bs-btn-hover-color: var(--danger-text);
    --bs-btn-hover-bg: var(--danger-soft);
    --bs-btn-hover-border-color: #fca5a5;
    --bs-btn-active-color: var(--danger-text);
    --bs-btn-active-bg: #fee2e2;
    --bs-btn-active-border-color: #fca5a5;
}
.btn-outline-warning {
    --bs-btn-color: var(--warning-text);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--warning-border);
    --bs-btn-hover-color: var(--warning-text);
    --bs-btn-hover-bg: var(--warning-soft);
    --bs-btn-hover-border-color: #fcd34d;
    --bs-btn-active-color: var(--warning-text);
    --bs-btn-active-bg: #fef3c7;
    --bs-btn-active-border-color: #fcd34d;
}
.btn-outline-info {
    --bs-btn-color: var(--info-text);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--info-border);
    --bs-btn-hover-color: var(--info-text);
    --bs-btn-hover-bg: var(--info-soft);
    --bs-btn-hover-border-color: #7dd3fc;
    --bs-btn-active-color: var(--info-text);
    --bs-btn-active-bg: #e0f2fe;
    --bs-btn-active-border-color: #7dd3fc;
}
.btn-outline-dark {
    --bs-btn-color: var(--text);
    --bs-btn-border-color: var(--gray-400);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--gray-900);
    --bs-btn-hover-border-color: var(--gray-900);
}

/* Solid semantic */
.btn-success {
    --bs-btn-color: #fff; --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--success-hover); --bs-btn-hover-border-color: var(--success-hover);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #166534; --bs-btn-active-border-color: #166534;
    --bs-btn-disabled-bg: var(--success); --bs-btn-disabled-border-color: var(--success);
    box-shadow: var(--shadow-xs);
}
.btn-danger {
    --bs-btn-color: #fff; --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--danger-hover); --bs-btn-hover-border-color: var(--danger-hover);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #991b1b; --bs-btn-active-border-color: #991b1b;
    --bs-btn-disabled-bg: var(--danger); --bs-btn-disabled-border-color: var(--danger);
    box-shadow: var(--shadow-xs);
}
.btn-warning {
    --bs-btn-color: #fff; --bs-btn-bg: var(--warning); --bs-btn-border-color: var(--warning);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--warning-hover); --bs-btn-hover-border-color: var(--warning-hover);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #92400e; --bs-btn-active-border-color: #92400e;
    box-shadow: var(--shadow-xs);
}
.btn-info {
    --bs-btn-color: #fff; --bs-btn-bg: var(--info); --bs-btn-border-color: var(--info);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--info-hover); --bs-btn-hover-border-color: var(--info-hover);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #075985; --bs-btn-active-border-color: #075985;
}
.btn-dark {
    --bs-btn-color: #fff; --bs-btn-bg: var(--gray-900); --bs-btn-border-color: var(--gray-900);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--gray-800); --bs-btn-hover-border-color: var(--gray-800);
}

/* Ghost (no border; toolbars, icon actions) */
.btn-ghost {
    --bs-btn-color: var(--text-secondary);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: var(--gray-100);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--text);
    --bs-btn-active-bg: var(--gray-150);
    --bs-btn-active-border-color: transparent;
}
.btn-ghost-light { /* ghost on dark surfaces */
    --bs-btn-color: var(--sidebar-text);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(255, 255, 255, 0.12);
    --bs-btn-active-border-color: transparent;
}

/* Link */
.btn-link {
    --bs-btn-color: var(--accent);
    --bs-btn-hover-color: var(--accent-hover);
    --bs-btn-active-color: var(--accent-active);
    --bs-btn-disabled-color: var(--gray-400);
    text-decoration: none;
    box-shadow: none;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Toggle buttons (btn-check) */
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-secondary {
    background: var(--accent-soft);
    color: var(--accent-active);
    border-color: #93c5fd;
}
.btn-check:checked + .btn-outline-success { background: var(--success-soft); color: var(--success-text); border-color: #86efac; }
.btn-check:checked + .btn-outline-danger  { background: var(--danger-soft);  color: var(--danger-text);  border-color: #fca5a5; }
.btn-check:checked + .btn-outline-warning { background: var(--warning-soft); color: var(--warning-text); border-color: #fcd34d; }

/* Button groups: keep seams crisp */
.btn-group > .btn { box-shadow: none; }
.btn-group { box-shadow: var(--shadow-xs); border-radius: var(--radius-md); }

.btn-close { --bs-btn-close-focus-shadow: 0 0 0 3px var(--accent-ring); opacity: 0.45; }
.btn-close:hover { opacity: 0.8; }

/* ── 6. Forms ──────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    min-height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    padding: 0.4375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
    background-color: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm {
    min-height: 32px;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}
.form-select-sm { padding-right: 2rem; }
.form-control-lg, .form-select-lg { min-height: 44px; font-size: 0.9375rem; }
textarea.form-control { min-height: 80px; }
.form-control::placeholder { color: var(--gray-400); }
.form-control:hover:not(:focus):not(:disabled), .form-select:hover:not(:focus):not(:disabled) { border-color: var(--gray-400); }
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    background-color: var(--surface);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled {
    background-color: var(--gray-50);
    color: var(--text-secondary);
}
.form-control-color { min-height: 36px; padding: 0.25rem; }

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}
.form-text { color: var(--text-muted); font-size: 0.75rem; }

.input-group-text {
    background: var(--gray-50);
    border-color: var(--border-strong);
    color: var(--text-muted);
    font-size: 0.875rem;
}
.input-group > .form-control, .input-group > .form-select { box-shadow: none; }
.input-group { box-shadow: var(--shadow-xs); border-radius: var(--radius-md); }
.input-group-sm > .input-group-text { font-size: 0.8125rem; }

.form-check-input {
    border-color: var(--border-strong);
    width: 1rem;
    height: 1rem;
    margin-top: 0.2rem;
}
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.form-switch .form-check-input { width: 2rem; }
.form-check-label { color: var(--gray-700); }

/* ── 7. Cards, page headers, hero ──────────────────────────────────────────── */
.card {
    --bs-card-border-color: var(--border);
    --bs-card-border-radius: var(--radius-xl);
    --bs-card-inner-border-radius: calc(var(--radius-xl) - 1px);
    --bs-card-cap-bg: var(--surface);
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs) !important;
}
.card.border-0 { border: 1px solid var(--border) !important; }
.card-header {
    background-color: var(--surface) !important;
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
}
.card-header:first-child { border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0; }
.card-header h5, .card-header h6, .card-header .h5, .card-header .h6 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0; }
.card-body { padding: 1.25rem; }
.card-footer { background: var(--gray-50); border-top: 1px solid var(--border); padding: 0.75rem 1.25rem; }
.card-title { font-weight: 600; }

/* Generic content card */
.bento-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Dark card — kept for emphasis panels */
.bento-card-dark {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Page header */
.bento-page-header {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 0 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    position: relative;
}
.bento-page-header .page-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    line-height: 1.3;
}
.bento-page-header .page-title > i { color: var(--text-muted); font-size: 0.85em; }
.bento-page-header .page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0;
    line-height: 1.5;
    max-width: 72ch;
}
.bento-page-header .page-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid var(--border);
    background: var(--gray-50);
    color: var(--text-secondary);
    vertical-align: middle;
}
.bento-page-header .page-badge-primary,
.bento-page-header .page-badge-lime    { background: var(--accent-soft);  color: var(--accent-text);  border-color: var(--accent-soft-2); }
.bento-page-header .page-badge-sky     { background: var(--info-soft);    color: var(--info-text);    border-color: var(--info-border); }
.bento-page-header .page-badge-amber   { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.bento-page-header .page-badge-emerald { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }

.bento-page-header-dark { background: transparent; color: var(--text); }
.bento-page-header-dark .page-title { color: var(--text); }
.bento-page-header-dark .page-subtitle { color: var(--text-muted); }

/* Dashboard hero — solid navy panel, no decorative glow */
.dashboard-hero,
.bento-hero {
    background: var(--gray-900);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-800);
    margin-bottom: 1.5rem;
    box-shadow: none;
}
.dashboard-hero::before, .bento-hero::before,
.dashboard-hero::after,  .bento-hero::after { content: none; }

.bento-hero .text-lime, .bento-card-dark .text-lime { color: #93c5fd !important; }
.bento-hero .text-white-50, .bento-card-dark .text-white-50 { color: #94a3b8 !important; }
.bento-hero .badge.rounded-pill[style] { background: rgba(255,255,255,0.08) !important; color: #cbd5e1 !important; border: 1px solid rgba(255,255,255,0.12) !important; }
.bento-hero .progress { background: rgba(255,255,255,0.12) !important; }
.bento-hero .progress-bar { background: #60a5fa !important; }

/* Buttons on dark hero */
.bento-hero .fitmove-pill-btn-ghost,
.bento-card-dark .fitmove-pill-btn-ghost {
    --bs-btn-color: #e2e8f0;
    --bs-btn-bg: rgba(255, 255, 255, 0.06);
    --bs-btn-border-color: rgba(255, 255, 255, 0.14);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.12);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.22);
    --bs-btn-active-bg: rgba(255, 255, 255, 0.16);
    --bs-btn-active-color: #fff;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}
.bento-hero .fitmove-btn-lime { box-shadow: none; }

.hero-greeting {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}

.hero-badge-tier {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-weight: 500;
    padding: 0.2rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
}

.hero-metric-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    display: inline-flex;
    flex-direction: column;
}

/* ── 8. Stats, KPI tiles, badges ───────────────────────────────────────────── */
.stat-card-modern,
.bento-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.125rem 1.25rem;
    height: 100%;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.stat-icon-wrapper {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--border);
}
.stat-card-modern.accent-lime .stat-icon-wrapper,
.bento-stat-card.accent-lime .stat-icon-wrapper,
.stat-card-modern.accent-primary .stat-icon-wrapper { background: var(--accent-soft);  color: var(--accent);  border-color: var(--accent-soft-2); }
.stat-card-modern.accent-success .stat-icon-wrapper { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.stat-card-modern.accent-warning .stat-icon-wrapper { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.stat-card-modern.accent-danger  .stat-icon-wrapper { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger-border); }
.stat-card-modern.accent-info    .stat-icon-wrapper { background: var(--info-soft);    color: var(--info);    border-color: var(--info-border); }
.stat-card-modern.accent-purple  .stat-icon-wrapper { background: var(--purple-soft);  color: var(--purple);  border-color: #ddd6fe; }

.bento-stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 1.2;
    margin: 0.25rem 0;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
    min-width: 0;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
    margin: 0.25rem 0 0.125rem;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
    min-width: 0;
}
.bento-stat-unit { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }

.bento-trend-pill {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.5;
    border: 1px solid transparent;
}
.bento-trend-pill.positive { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.bento-trend-pill.neutral  { background: var(--gray-100);     color: var(--text-secondary); border-color: var(--border); }
.bento-trend-pill.alert    { background: var(--danger-soft);  color: var(--danger-text);  border-color: var(--danger-border); }
.bento-trend-pill.alert { padding: 0.125rem 0.5rem; margin: 0; border-radius: var(--radius-full); font-size: 0.75rem; position: static; }

/* KPI tiles */
.kpi-tile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.kpi-tile-card::before {
    content: '';
    position: absolute;
    left: -1px; top: 12px; bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gray-300);
}
.kpi-tile-card.kpi-green::before { background: var(--success); }
.kpi-tile-card.kpi-amber::before { background: var(--warning); }
.kpi-tile-card.kpi-red::before   { background: var(--danger); }
.kpi-tile-card.kpi-green, .kpi-tile-card.kpi-amber, .kpi-tile-card.kpi-red, .kpi-tile-card.kpi-exempt { border-top: 1px solid var(--border); background: var(--surface); }

.kpi-tile-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.kpi-progress-bar {
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--gray-100);
    overflow: hidden;
    margin-top: 0.625rem;
}
.kpi-progress-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.5s var(--ease); }

/* RAG badges */
.badge-rag-soft-green, .badge-fitmove-green,
.badge-rag-soft-amber, .badge-fitmove-amber,
.badge-rag-soft-red,   .badge-fitmove-red,
.badge-rag-soft-exempt {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0;
    border: 1px solid;
    border-radius: var(--radius-full);
    line-height: 1.5;
}
.badge-rag-soft-green, .badge-fitmove-green { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.badge-rag-soft-amber, .badge-fitmove-amber { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.badge-rag-soft-red,   .badge-fitmove-red   { background: var(--danger-soft);  color: var(--danger-text);  border-color: var(--danger-border); }
.badge-rag-soft-exempt { background: var(--gray-100); color: var(--text-muted); border-color: var(--border); }

.badge-lime-pill {
    background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-soft-2);
    font-size: 0.6875rem; font-weight: 500; padding: 0.1rem 0.45rem; border-radius: var(--radius-full);
}
.badge-overdue-dot {
    background: var(--danger); color: #fff; font-size: 0.6875rem; font-weight: 600;
    padding: 0.15rem 0.4rem; border-radius: var(--radius-full); line-height: 1;
}

/* Bootstrap badges */
.badge {
    --bs-badge-font-weight: 500;
    --bs-badge-font-size: 0.75rem;
    --bs-badge-padding-x: 0.5rem;
    --bs-badge-padding-y: 0.2rem;
    letter-spacing: 0;
    line-height: 1.25;
}
.badge.bg-primary { background-color: var(--accent-soft) !important; color: var(--accent-text) !important; box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.badge.bg-success { background-color: var(--success-soft) !important; color: var(--success-text) !important; box-shadow: inset 0 0 0 1px var(--success-border); }
.badge.bg-warning { background-color: var(--warning-soft) !important; color: var(--warning-text) !important; box-shadow: inset 0 0 0 1px var(--warning-border); }
.badge.bg-danger  { background-color: var(--danger-soft) !important;  color: var(--danger-text) !important;  box-shadow: inset 0 0 0 1px var(--danger-border); }
.badge.bg-info    { background-color: var(--info-soft) !important;    color: var(--info-text) !important;    box-shadow: inset 0 0 0 1px var(--info-border); }
.badge.bg-secondary, .badge.bg-light { background-color: var(--gray-100) !important; color: var(--gray-700) !important; box-shadow: inset 0 0 0 1px var(--border); }
.badge.bg-dark    { background-color: var(--gray-800) !important; color: #fff !important; }
/* Counter badges sitting on top of icons stay solid */
.position-absolute.badge.bg-danger, .translate-middle.badge.bg-danger { background-color: var(--danger) !important; color: #fff !important; box-shadow: 0 0 0 2px #fff; }

/* ── 9. Charts, tabs, filters, pipeline ────────────────────────────────────── */
.chart-card,
.bento-chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chart-card-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--surface);
}
.chart-card-header h5, .chart-card-header h6 { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.chart-card-body { padding: 1.25rem; flex-grow: 1; min-width: 0; }
.chart-card-body canvas { max-width: 100%; }

.chart-pill-tabs {
    display: inline-flex;
    background: var(--gray-100);
    padding: 2px;
    border-radius: var(--radius-md);
    gap: 2px;
    border: 1px solid var(--border);
}
.chart-pill-btn {
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.2rem 0.625rem;
    border-radius: var(--radius-sm);
}
.chart-pill-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* Agenda rows */
.agenda-task-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.agenda-task-item:hover { background: var(--gray-50); border-color: var(--border-strong); }
.agenda-time-pill {
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-variant-numeric: tabular-nums;
}

/* Segmented tab bar */
.reporting-tabs-nav,
.reporting-tab-nav {
    display: flex;
    gap: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}
.reporting-tabs-nav::-webkit-scrollbar, .reporting-tab-nav::-webkit-scrollbar { display: none; }
.reporting-tab-pill {
    padding: 0.625rem 0.875rem;
    margin-bottom: -1px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.reporting-tab-pill:hover { color: var(--text); border-bottom-color: var(--gray-300); }
.reporting-tab-pill.active { color: var(--accent-text); border-bottom-color: var(--accent); background: transparent; box-shadow: none; }
.reporting-tab-pill.active i { color: var(--accent); }

/* Bootstrap nav tabs & pills in the same language */
.nav-tabs { border-bottom: 1px solid var(--border); gap: 0.25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    color: var(--text-muted); font-weight: 500; padding: 0.625rem 0.75rem; white-space: nowrap;
}
.nav-tabs .nav-link:hover { color: var(--text); border-bottom-color: var(--gray-300); }
.nav-tabs .nav-link.active { color: var(--accent-text); border-bottom-color: var(--accent); background: transparent; }
.nav-pills .nav-link { color: var(--text-secondary); font-weight: 500; border-radius: var(--radius-md); }
.nav-pills .nav-link.active { background: var(--accent-soft); color: var(--accent-text); }

/* CRM KPI ribbon */
.crm-kpi-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.crm-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    box-shadow: var(--shadow-xs);
    position: relative;
}
.crm-kpi-card.kpi-pipeline, .crm-kpi-card.kpi-won, .crm-kpi-card.kpi-rate,
.crm-kpi-card.kpi-open, .crm-kpi-card.kpi-stale { border-top: 1px solid var(--border); }
.crm-kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}
.crm-kpi-label i { font-size: 0.95rem; }
.crm-kpi-card.kpi-pipeline .crm-kpi-label i { color: var(--accent); }
.crm-kpi-card.kpi-won      .crm-kpi-label i { color: var(--success); }
.crm-kpi-card.kpi-rate     .crm-kpi-label i { color: var(--info); }
.crm-kpi-card.kpi-open     .crm-kpi-label i { color: var(--warning); }
.crm-kpi-card.kpi-stale    .crm-kpi-label i { color: var(--danger); }
.crm-kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.125rem;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}
.crm-kpi-sub { font-size: 0.75rem; color: var(--text-muted); }

/* Filter chips */
.filter-pills-bar { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.filter-pill {
    padding: 0.25rem 0.75rem;
    min-height: 30px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.filter-pill:hover { background: var(--gray-50); color: var(--text); border-color: var(--gray-400); }
.filter-pill.active { background: var(--accent-soft); color: var(--accent-text); border-color: #93c5fd; }
.filter-pill .badge { background: var(--gray-100) !important; color: var(--text-secondary) !important; box-shadow: none; }
.filter-pill.active .badge { background: var(--accent-soft-2) !important; color: var(--accent-text) !important; }

/* Pipeline stage bar */
.pipeline-bar {
    display: flex;
    overflow-x: auto;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    gap: 0.25rem;
    scrollbar-width: thin;
}
.pipeline-step {
    flex: 1;
    min-width: 108px;
    text-align: center;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.pipeline-step:hover { background: var(--gray-100); color: var(--text); }
.pipeline-step.completed   { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.pipeline-step.active      { background: var(--accent); color: #fff; border-color: var(--accent); }
.pipeline-step.active-won  { background: var(--success); color: #fff; border-color: var(--success); }
.pipeline-step.active-lost { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Stage pill dropdown */
.stage-dropdown-btn {
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}
.stage-dropdown-btn:hover { filter: brightness(0.97); }

/* Bulk selection toolbar */
.bulk-toolbar {
    position: sticky;
    bottom: 1rem;
    z-index: 100;
    background: var(--gray-900);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 0.625rem 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: slideUp 0.2s var(--ease);
}
.bulk-toolbar .btn-light, .bulk-toolbar .btn-outline-light {
    --bs-btn-bg: rgba(255,255,255,0.08); --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,0.16);
    --bs-btn-hover-bg: rgba(255,255,255,0.14); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgba(255,255,255,0.24);
    box-shadow: none;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── 10. Tables & stacked lists ────────────────────────────────────────────── */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--gray-50);
    --bs-table-striped-bg: var(--gray-25);
    --bs-table-border-color: var(--border);
    margin-bottom: 0;
    color: var(--text);
    font-size: 0.875rem;
}
.table > :not(caption) > * > * { border-bottom-color: var(--border); }
.table > thead > tr > th {
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    padding: 0.625rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}
.table > tbody > tr > th, .table > tfoot > tr > th { color: var(--text); font-weight: 500; font-size: 0.875rem; padding: 0.75rem 1rem; vertical-align: middle; }
.table td { padding: 0.75rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--gray-50); }
.table-light, .table > thead.table-light > tr > th { --bs-table-bg: var(--gray-50); --bs-table-color: var(--text-muted); }
.table-primary   { --bs-table-bg: var(--accent-soft) !important;  --bs-table-color: var(--text); }
.table-secondary { --bs-table-bg: var(--gray-100) !important;     --bs-table-color: var(--text); }
.table-success   { --bs-table-bg: var(--success-soft) !important; --bs-table-color: var(--text); }
.table-warning   { --bs-table-bg: var(--warning-soft) !important; --bs-table-color: var(--text); }
.table-danger    { --bs-table-bg: var(--danger-soft) !important;  --bs-table-color: var(--text); }
.table-bordered > :not(caption) > * > * { border-color: var(--border); }
.table-sm > :not(caption) > * > * { padding: 0.4rem 0.625rem; }

/* Tables inside cards sit flush */
.card > .table-responsive, .card-body.p-0 > .table-responsive { border-radius: 0 0 calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px); }
.table-responsive { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }

.table-sticky-col-first th:first-child,
.table-sticky-col-first td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: var(--surface);
    box-shadow: 1px 0 0 var(--border);
}
.table-sticky-col-first thead th:first-child { background-color: var(--gray-50); z-index: 4; }

/* Compact data table (CRM) */
.table-crm-compact { font-size: 0.8125rem; margin-bottom: 0; }
.table-crm-compact thead th {
    position: sticky;
    top: 0;
    background: var(--gray-50);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    z-index: 5;
    white-space: nowrap;
}
.table-crm-compact td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.table-crm-compact tbody tr:hover { background-color: var(--gray-50); }
.table-crm-compact tbody tr.selected-row { background-color: var(--accent-soft) !important; }
.table-quick-actions { display: inline-flex; align-items: center; gap: 0.25rem; }

/* Stacked list rows */
.stacked-card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    overflow: visible;
}
.stacked-card-item:first-child {
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}
.stacked-card-item:last-child {
    border-bottom: 0;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}
.stacked-card-item {
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 1rem 1.25rem;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: background-color 0.15s var(--ease);
}
.stacked-card-item:last-child { border-bottom: 0; }
.stacked-card-item:hover { background: var(--gray-25); }
/* Items used alone (not inside a list) still look like a card */
:not(.stacked-card-list) > .stacked-card-item:only-child { border: 1px solid var(--border); border-radius: var(--radius-xl); }

.stacked-card-item.is-selected,
.stacked-card-item.selected-row { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.stacked-card-item.is-overdue  { box-shadow: inset 3px 0 0 var(--danger); }
.stacked-card-item.is-won      { box-shadow: inset 3px 0 0 var(--success); }
.stacked-card-item.is-lost     { box-shadow: inset 3px 0 0 var(--gray-400); opacity: 0.85; }
.stacked-card-item.is-holiday  { background: var(--warning-soft); box-shadow: inset 3px 0 0 var(--warning); }

.stacked-card-left { display: flex; align-items: flex-start; gap: 0.875rem; flex: 1 1 320px; min-width: 0; }
.stacked-card-check { padding-top: 0.5rem; flex-shrink: 0; }
.stacked-card-check .form-check-input { width: 1.05rem; height: 1.05rem; cursor: pointer; margin: 0; }

.stacked-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--border);
}
.stacked-avatar-lime,
.stacked-avatar-primary { background: var(--accent-soft);  color: var(--accent-text);  border-color: var(--accent-soft-2); }
.stacked-avatar-sky     { background: var(--info-soft);    color: var(--info-text);    border-color: var(--info-border); }
.stacked-avatar-success { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.stacked-avatar-warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.stacked-avatar-danger  { background: var(--danger-soft);  color: var(--danger-text);  border-color: var(--danger-border); }
.stacked-avatar-purple  { background: var(--purple-soft);  color: var(--purple);       border-color: #ddd6fe; }
.stacked-avatar-neutral { background: var(--gray-100);     color: var(--gray-600);     border-color: var(--border); }

.stacked-card-content { flex: 1; min-width: 0; }
.stacked-card-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.25rem; }
.stacked-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
    word-break: break-word;
}
.stacked-card-title a { color: var(--text); }
.stacked-card-title a:hover { color: var(--accent); }
.stacked-card-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}
.stacked-card-meta-item { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; }
.stacked-card-meta-item i { color: var(--text-muted); }
.stacked-card-sub-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; font-size: 0.8125rem; }

.stacked-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gray-50);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.stacked-chip:hover, .stacked-chip-link:hover { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-text); }
.stacked-chip-link { color: var(--accent-text); }
.stacked-chip-phone {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--success-soft);
    border-color: var(--success-border);
}
.stacked-chip-phone:hover { background: #dcfce7; border-color: #86efac; color: var(--success-text); }

.stacked-card-right { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin-left: auto; }
.stacked-card-stat-group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.stacked-card-stat-pill {
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.375rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
    text-align: center;
}
.stacked-card-stat-pill .stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.2;
    margin-bottom: 0.125rem;
    white-space: nowrap;
}
.stacked-card-stat-pill .stat-val {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.stacked-card-actions { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }

/* ── 11. Kanban, time grid, timeline ───────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 0.875rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
    scrollbar-width: thin;
}
.kanban-column {
    flex: 0 0 300px;
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
}
.kanban-cards-container { overflow-y: auto; flex-grow: 1; min-height: 120px; }
.kanban-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-xs);
    cursor: grab;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.kanban-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }

.week-grid-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; min-width: 800px; }
.week-grid-table th, .week-grid-table td {
    padding: 0.375rem;
    font-size: 0.8125rem;
    vertical-align: top;
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.week-grid-table th { background: var(--gray-50); }
.time-slot-cell { height: 38px; cursor: pointer; background-color: var(--surface); transition: background-color 0.1s var(--ease); }
.time-slot-cell:hover { background-color: var(--accent-soft); }
.time-block-pill {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline { border-left: 1px solid var(--border); padding-left: 1.25rem; position: relative; margin-left: 0.5rem; }
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1.25rem - 5px);
    top: 0.35rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 2px solid var(--accent);
}

/* Click-to-call helpers */
.call-trigger-btn { box-shadow: var(--shadow-xs); }
.verify-badge-btn { cursor: pointer; user-select: none; transition: opacity 0.15s var(--ease); }
.verify-badge-btn:hover { opacity: 0.8; }
.pulse-call-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    animation: callPulse 1.8s infinite;
}
@keyframes callPulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ── 12. Dropdowns, modals, alerts, misc ───────────────────────────────────── */
.dropdown-menu {
    --bs-dropdown-min-width: 13rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.3125rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
}
.dropdown-menu.shadow, .dropdown-menu.border-0 { border: 1px solid var(--border) !important; }
.dropdown-header {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.625rem 0.25rem;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 400;
    padding: 0.4375rem 0.625rem;
    border-radius: var(--radius-sm);
}
.dropdown-item > i { color: var(--text-muted); width: 1rem; text-align: center; margin: 0 !important; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--gray-100); color: var(--text); }
.dropdown-item:active, .dropdown-item.active { background: var(--accent-soft); color: var(--accent-text); }
.dropdown-item.text-danger > i { color: var(--danger); }
.dropdown-divider { border-color: var(--border); margin: 0.3125rem 0; opacity: 1; }
.fitmove-dropdown { /* legacy dark menu → standard light */ background: var(--surface); }

.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}
.modal-content.border-0 { border: 1px solid var(--border) !important; }
.modal-header { border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--border); padding: 0.75rem 1.25rem; background: var(--gray-50); border-radius: 0 0 var(--radius-xl) var(--radius-xl); gap: 0.5rem; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { opacity: 0.4; }
.modal-backdrop { --bs-backdrop-bg: #0f172a; }

.alert {
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border: 1px solid;
    box-shadow: none !important;
}
.alert-success { background: var(--success-soft); color: #14532d; border-color: var(--success-border); }
.alert-danger  { background: var(--danger-soft);  color: #7f1d1d; border-color: var(--danger-border); }
.alert-warning { background: var(--warning-soft); color: #78350f; border-color: var(--warning-border); }
.alert-info    { background: var(--info-soft);    color: #0c4a6e; border-color: var(--info-border); }
.alert-primary { background: var(--accent-soft);  color: #1e3a8a; border-color: var(--accent-soft-2); }
.alert-secondary, .alert-light { background: var(--gray-50); color: var(--gray-700); border-color: var(--border); }
.alert-dismissible .btn-close { padding: 0.95rem 1rem; }

.progress {
    --bs-progress-height: 6px;
    --bs-progress-bg: var(--gray-100);
    --bs-progress-border-radius: var(--radius-full);
    --bs-progress-bar-bg: var(--accent);
}

.list-group { --bs-list-group-border-color: var(--border); --bs-list-group-border-radius: var(--radius-lg); }
.list-group-item { color: var(--text); }
.list-group-item-action:hover { background: var(--gray-50); }
.list-group-item.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-soft-2); }

.pagination { --bs-pagination-color: var(--gray-700); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--gray-50);
    --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-font-size: 0.8125rem;
    --bs-pagination-border-radius: var(--radius-md); gap: 0.25rem; }
.page-link { border-radius: var(--radius-md) !important; min-width: 32px; text-align: center; }

.tooltip { --bs-tooltip-bg: var(--gray-900); --bs-tooltip-font-size: 0.75rem; --bs-tooltip-border-radius: var(--radius-sm); }
.popover { --bs-popover-border-color: var(--border); --bs-popover-border-radius: var(--radius-lg); --bs-popover-box-shadow: var(--shadow-lg); }

.accordion { --bs-accordion-border-color: var(--border); --bs-accordion-border-radius: var(--radius-lg);
    --bs-accordion-active-bg: var(--gray-50); --bs-accordion-active-color: var(--text); --bs-accordion-btn-focus-box-shadow: 0 0 0 3px var(--accent-ring); }

.offcanvas { --bs-offcanvas-border-color: var(--border); }

/* ── 13. Mobile navigation & action sheet ──────────────────────────────────── */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
body.offcanvas-open .mobile-bottom-nav,
body.modal-open .mobile-bottom-nav { transform: translateY(100%); opacity: 0; pointer-events: none; }

.mobile-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    border: 0;
    background: transparent;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item i { font-size: 1.25rem; line-height: 1; }
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item:hover { color: var(--text); }
.mobile-nav-item.active:hover { color: var(--accent); }

.mobile-nav-action-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: var(--shadow-sm);
}
.mobile-nav-action:active .mobile-nav-action-btn { background: var(--accent-hover); }

.mobile-nav-badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 2px #fff;
}

.action-list { display: flex; flex-direction: column; }
.action-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text);
}
.action-list-item:hover { background: var(--gray-50); color: var(--text); }
.action-list-item strong { display: block; font-weight: 500; font-size: 0.875rem; }
.action-list-item small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.action-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; border: 1px solid;
}
.tone-primary { background: var(--accent-soft);  color: var(--accent);  border-color: var(--accent-soft-2); }
.tone-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.tone-info    { background: var(--info-soft);    color: var(--info);    border-color: var(--info-border); }
.tone-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.tone-neutral { background: var(--gray-100);     color: var(--gray-600); border-color: var(--border); }
.mobile-action-sheet .list-group-item { padding: 0.75rem 1rem; border: 0; }

/* ── 14. Login ─────────────────────────────────────────────────────────────── */
.login-page-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--canvas);
    padding: 2rem 1rem;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}
.login-card .form-label { color: var(--gray-700); font-weight: 500; font-size: 0.8125rem; text-transform: none; letter-spacing: 0; }
.login-card .form-control { min-height: 40px; }
.demo-creds-card {
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    margin-top: 1.25rem;
}
.demo-creds-card a {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
}
.demo-creds-card a:hover { color: var(--text); background: var(--surface); }

/* ── 15. Compact mode ──────────────────────────────────────────────────────── */
html.compact-mode { font-size: 14px; }
html.compact-mode body { font-size: 0.8125rem; }
html.compact-mode .card-header { padding: 0.5rem 0.875rem; }
html.compact-mode .card-body,
html.compact-mode .bento-card,
html.compact-mode .stat-card-modern,
html.compact-mode .bento-stat-card { padding: 0.75rem 0.875rem; }
html.compact-mode .table th,
html.compact-mode .table td { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }
html.compact-mode .stacked-card-item { padding: 0.625rem 0.875rem; }
html.compact-mode .btn:not(.btn-icon):not(.btn-xs) { min-height: 30px; --bs-btn-padding-y: 0.25rem; --bs-btn-padding-x: 0.625rem; --bs-btn-font-size: 0.8125rem; }
html.compact-mode .form-control, html.compact-mode .form-select { min-height: 30px; padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* ── 16. Responsive ────────────────────────────────────────────────────────── */
@media (min-width: 992px) {
    .app-content > .container-fluid,
    .app-content > .container { padding-left: 2rem !important; padding-right: 2rem !important; }
}

@media (max-width: 991.98px) {
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
    .app-topbar { padding: 0 0.75rem; gap: 0.25rem; height: 56px; }
    .app-footer { display: none; }

    .stacked-card-left { flex: 1 1 100%; }
    .stacked-card-right {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
    }
    .stacked-card-stat-pill { flex: 1 1 auto; min-width: 64px; }
}

@media (max-width: 767.98px) {
    /* Comfortable touch targets */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 36px; }
    .btn-xs { min-height: 28px; }
    .btn-icon { width: 40px; height: 40px; }
    .btn-icon.btn-sm { width: 36px; height: 36px; }
    .btn-icon.btn-xs, .btn-icon-xs { width: 32px; height: 32px; }
    .form-control, .form-select { min-height: 40px; font-size: 1rem; } /* 16px stops iOS zoom on focus */
    .form-control-sm, .form-select-sm { min-height: 36px; font-size: 0.9375rem; }
    .dropdown-item { padding: 0.625rem 0.75rem; }
    .sidebar-link { min-height: 42px; }
    .sidebar-sublink { padding: 0.5rem 0.625rem; }

    /* Page header: stack title and actions, actions fill width */
    .bento-page-header { padding-bottom: 1rem; margin-bottom: 1rem; }
    .bento-page-header .page-title { font-size: 1.1875rem; }
    .bento-page-header .page-subtitle { font-size: 0.8125rem; }
    .bento-page-header .d-flex.flex-wrap.gap-2 { width: 100%; }
    .bento-page-header .d-flex.flex-wrap.gap-2 > .btn,
    .bento-page-header .d-flex.flex-wrap.gap-2 > .dropdown,
    .bento-page-header .d-flex.flex-wrap.gap-2 > form,
    .bento-page-header .d-flex.flex-wrap.gap-2 > a { flex: 1 1 auto; }
    .bento-page-header .d-flex.flex-wrap.gap-2 > .dropdown > .btn,
    .bento-page-header .d-flex.flex-wrap.gap-2 > form > .btn { width: 100%; }

    .dashboard-hero, .bento-hero { padding: 1.125rem; border-radius: var(--radius-lg); }
    .hero-greeting { font-size: 1.25rem; }
    .hero-metric-chip { min-width: 0 !important; max-width: 100% !important; width: 100%; }
    .bento-hero .d-flex.flex-wrap.gap-2 > .btn { flex: 1 1 auto; }

    .bento-stat-value { font-size: 1.5rem; }
    .kpi-tile-value { font-size: 1.3rem; }
    .crm-kpi-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .crm-kpi-card { padding: 0.75rem; }
    .crm-kpi-value { font-size: 1.2rem; }

    .card-header { padding: 0.75rem 1rem; }
    .card-body { padding: 1rem; }
    .chart-card-header { padding: 0.75rem 1rem; }
    .chart-card-body { padding: 1rem; }

    .reporting-tab-pill { padding: 0.625rem 0.75rem; font-size: 0.8125rem; }

    /* Filter forms: full-width submit buttons */
    .card .card-body form.row .btn { width: 100%; }

    /* Filter chips: one swipeable row */
    .filter-pills-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -0.25rem; margin-right: -0.25rem; padding: 0 0.25rem 0.125rem; }
    .filter-pills-bar::-webkit-scrollbar { display: none; }
    .filter-pills-bar > * { flex-shrink: 0; }

    /* Kanban: swipe between columns */
    .kanban-board { scroll-snap-type: x mandatory; gap: 0.625rem; margin-left: -0.75rem; margin-right: -0.75rem; padding-left: 0.75rem; padding-right: 0.75rem; }
    .kanban-column { flex: 0 0 85vw; max-width: 320px; scroll-snap-align: center; max-height: calc(100vh - 240px); }

    /* Modals: full-width sheet from the bottom */
    .modal-dialog:not(.modal-fullscreen) {
        margin: 0;
        max-width: none;
        min-height: 100%;
        display: flex;
        align-items: flex-end;
    }
    .modal.fade .modal-dialog:not(.modal-fullscreen) { transform: translateY(24px); }
    .modal.show .modal-dialog:not(.modal-fullscreen) { transform: none; }
    .modal-dialog:not(.modal-fullscreen) .modal-content {
        width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        border-bottom: 0;
        max-height: 92vh;
        max-height: 92dvh;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .modal-dialog-scrollable .modal-content, .modal-dialog .modal-content { overflow: hidden; }
    .modal-dialog .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .modal-footer { border-radius: 0; }
    .modal-footer > .btn { flex: 1 1 auto; }

    .stacked-card-item { padding: 0.875rem 1rem; gap: 0.75rem; }
    .stacked-card-actions { width: 100%; }
    .stacked-card-actions > .btn, .stacked-card-actions > a.btn, .stacked-card-actions > .dropdown { flex: 1 1 auto; }
    .stacked-card-actions > .dropdown > .btn { width: 100%; }

    .bulk-toolbar { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); border-radius: var(--radius-lg); }

    /* Fixed-width search boxes / inputs stretch to the row on phones */
    .input-group[style*="width"],
    .form-control[style*="width"],
    .form-select[style*="width"] { flex: 1 1 100%; width: 100% !important; min-width: 0 !important; }
    .hero-metric-chip[style*="width"] { min-width: 0 !important; }

    /* Data tables: keep horizontal scroll inside the card, never the page */
    .table-responsive { margin: 0; }
    .table th, .table td { padding: 0.625rem 0.75rem; }
}

@media (max-width: 575.98px) {
    .container-fluid, .container { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
    .app-content > .container-fluid.py-4, .app-content > .container.py-4 { padding-top: 1rem !important; }
    .bento-card, .stat-card-modern, .bento-stat-card { padding: 0.875rem; }
    .stat-value { font-size: 1.3rem; }
    .stat-icon-wrapper { width: 32px; height: 32px; font-size: 0.9rem; }
    .hero-greeting { font-size: 1.125rem; }
    .login-card { padding: 1.5rem 1.25rem; border-radius: var(--radius-lg); }
    .week-grid-table th, .week-grid-table td { font-size: 0.72rem; padding: 0.25rem; }
    .pipeline-step { min-width: 96px; }
    h2, .h2 { font-size: 1.3rem; }
    h3, .h3 { font-size: 1.15rem; }
}

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

@media print {
    .app-sidebar, .app-topbar, .mobile-bottom-nav, .app-footer, .btn { display: none !important; }
    body { background: #fff !important; padding: 0 !important; }
}

/* ── 17. Dashboard ─────────────────────────────────────────────────────────── */
.dash { max-width: 1440px; }

.dash-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dash-eyebrow { color: var(--text-muted); font-size: 0.8125rem; margin: 0 0 0.25rem; }
.dash-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.25rem; }
.dash-sub { color: var(--text-muted); margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0 0.5rem; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--gray-400); display: inline-block; }

/* ── 17.1 Quick Access Toolbar ─────────────────────────────────────────────── */
.quick-access-section {
    margin-bottom: 1.25rem;
}

.quick-access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.quick-access-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.625rem;
}

.quick-access-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s var(--ease);
    min-width: 0;
}

.quick-access-card:hover {
    background: var(--gray-50);
    border-color: var(--border-strong);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.quick-access-card:active {
    transform: translateY(0);
}

.quick-access-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.quick-access-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.quick-access-label {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-access-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Semantic Badges for Quick Access Icons */
.qa-icon-calling { background: #dcfce7; color: #15803d; }
.qa-icon-database { background: #eff6ff; color: #1d4ed8; }
.qa-icon-crm { background: #f5f3ff; color: #7c3aed; }
.qa-icon-eod { background: #fef3c7; color: #b45309; }
.qa-icon-timelog { background: #f0f9ff; color: #0284c7; }
.qa-icon-tasks { background: #ffedd5; color: #c2410c; }
.qa-icon-reports { background: #ecfdf5; color: #047857; }
.qa-icon-team { background: #fdf2f8; color: #be185d; }
.qa-icon-import { background: #f1f5f9; color: #475569; }

@media (max-width: 767.98px) {
    .quick-access-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .quick-access-section {
        margin-bottom: 1rem;
    }
    .quick-access-card {
        padding: 0.5rem 0.625rem;
        gap: 0.5rem;
    }
    .quick-access-icon {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
    }
}

/* One bordered strip, four cells — reads as a single unit, not four cards */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.stat-strip-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 1rem 1.25rem;
    color: var(--text);
    border-left: 1px solid var(--border);
    transition: background-color 0.15s var(--ease);
    min-width: 0;
}
.stat-strip-item:first-child { border-left: 0; }
.stat-strip-item:hover { background: var(--gray-50); color: var(--text); }
.stat-strip-label { font-size: 0.8125rem; color: var(--text-muted); }
.stat-strip-value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-strip-value small { font-size: 0.9375rem; color: var(--text-muted); font-weight: 500; }
.stat-strip-value i { font-size: 1.1rem; }
.stat-strip-meta { font-size: 0.8125rem; color: var(--text-muted); }

.section-title { font-size: 0.9375rem; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.section-sub { font-size: 0.8125rem; color: var(--text-muted); margin: 0.125rem 0 0; }

/* Task rows */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--gray-25); }
.task-row .form-check-input { margin: 0; flex-shrink: 0; width: 1.125rem; height: 1.125rem; cursor: pointer; }
.task-main { flex: 1 1 auto; min-width: 0; cursor: pointer; margin: 0; display: flex; flex-direction: column; }
.task-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { font-size: 0.8125rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-side { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.task-due { font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.task-row.is-done .task-title, .task-row.text-decoration-line-through .task-title { text-decoration: line-through; color: var(--text-muted); }

/* Metric rows (targets, hours, pipeline) */
.metric-list { list-style: none; margin: 0; padding: 0.375rem 0; }
.metric-row { padding: 0.625rem 1.25rem; }
.metric-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.375rem; }
.metric-name { font-size: 0.875rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-figures { font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-figures strong { font-weight: 600; }
.metric-bottom { display: flex; align-items: center; gap: 0.75rem; }
.metric-bottom .meter { flex: 1 1 auto; }
.metric-status { font-size: 0.75rem; font-weight: 500; min-width: 64px; text-align: right; flex-shrink: 0; white-space: nowrap; }

.meter { height: 6px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; }
.meter-fill { height: 100%; border-radius: var(--radius-full); background: var(--gray-400); }
.meter-fill.tone-success { background: var(--success); }
.meter-fill.tone-warning { background: var(--warning); }
.meter-fill.tone-danger  { background: var(--danger); }
.meter-fill.tone-primary { background: var(--accent); }
.meter-fill.tone-neutral { background: var(--gray-300); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.375rem; vertical-align: 0.05em; background: var(--gray-300); border: 0; }
.status-dot.tone-success { background: var(--success); }
.status-dot.tone-warning { background: var(--warning); }
.status-dot.tone-danger  { background: var(--danger); }

.rag-summary { display: inline-flex; gap: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.team-table td, .team-table th { white-space: nowrap; }
.team-name { color: var(--text); font-weight: 500; }
.team-name:hover { color: var(--accent); }

.attention-list { list-style: none; margin: 0; padding: 0.375rem 0; }
.attention-list li { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.5rem 1.25rem; font-size: 0.875rem; }
.attention-list li i { margin-top: 0.15rem; flex-shrink: 0; }
.attention-list strong { font-weight: 500 !important; }

.empty-state { text-align: center; padding: 2rem 1.25rem; color: var(--text-muted); }
.empty-state > i { font-size: 1.5rem; color: var(--gray-400); display: block; margin-bottom: 0.5rem; }
.empty-title { color: var(--text); font-weight: 500; margin: 0 0 0.125rem; }
.empty-text { font-size: 0.875rem; margin: 0 0 0.875rem; }

@media (max-width: 991.98px) {
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-strip-item:nth-child(3) { border-left: 0; }
    .stat-strip-item:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 575.98px) {
    .dash-header { align-items: stretch; margin-bottom: 1rem; }
    .dash-title { font-size: 1.25rem; }
    .dash-actions { width: 100%; }
    .dash-actions .btn { flex: 1 1 0; }
    .stat-strip { margin-bottom: 1rem; }
    .stat-strip-item { padding: 0.75rem 0.875rem; }
    .stat-strip-value { font-size: 1.25rem; }
    .task-row, .metric-row, .attention-list li { padding-left: 1rem; padding-right: 1rem; }
}

/* Sentence case everywhere in the app body — no shouty micro-labels */
.app-content .text-uppercase,
.app-content .dropdown-header { text-transform: none !important; letter-spacing: 0 !important; }
.dropdown-header { text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 500; }
.sidebar-section-label { text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 500; }

/* ── 18. Notifications & form helpers ──────────────────────────────────────── */
.toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(380px, calc(100vw - 2rem));
}
.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    background: var(--gray-900);
    color: #f8fafc;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    animation: slideUp 0.2s var(--ease);
}
.app-toast > span { flex: 1 1 auto; padding-top: 0.05rem; }
.app-toast > i { margin-top: 0.15rem; }
.app-toast-success > i { color: #4ade80; }
.app-toast-error > i { color: #f87171; }
.app-toast-info > i { color: #60a5fa; }
.app-toast-close { background: none; border: 0; color: #94a3b8; padding: 0 0.25rem; line-height: 1; font-size: 1.1rem; }
.app-toast-close:hover { color: #fff; }
.app-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
@media (max-width: 991.98px) {
    .toast-stack { left: 1rem; right: 1rem; max-width: none; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

label.is-required::after { content: ' *'; color: var(--danger); }
.btn .spinner-border-sm { width: 0.875rem; height: 0.875rem; border-width: 0.15em; }
