/* Self-hosted Brand Fonts */
@font-face {
    font-family: 'DM Sans';
    src: url('/fonts/dm-sans-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('/fonts/dm-sans-italic-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Fraunces';
    src: url('/fonts/fraunces-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fraunces';
    src: url('/fonts/fraunces-italic-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

/**
 * VendorPad Members App — Stylesheet
 * Design System: Teal & Amber with Warm Stone Neutrals
 * Mobile-first responsive (375px → 768px → 1024px)
 * BEM naming convention
 *
 * Sections:
 * 1. CSS Custom Properties (Design Tokens)
 * 2. Reset / Base Styles
 * 3. Typography
 * 4. Layout Components (App Shell, Sidebar, Top Bar, Tab Bar)
 * 5. Data Display (Card, Data Table, Badge, Stat Card, Alert Card, Timeline)
 * 6. Form Components (Input, Select, Date, Toggle, Checkbox, Textarea, File Upload)
 * 7. Action Components (Button, FAB, Dropdown Menu)
 * 8. Overlay Components (Modal, Bottom Sheet, Toast, Confirmation)
 * 9. Navigation (Breadcrumbs, Tabs, Pagination, Search)
 * 10. Feedback States (Empty State, Skeleton, Error State, Offline)
 * 11. Utility Classes
 * 12. Responsive Overrides
 * 13. Print Styles
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
    /* Colour Palette */
    --color-primary: #0E7570;
    --color-primary-dark: #065E57;
    --color-primary-light: #DFF3F0;

    --color-accent: #D89B3D;
    --color-accent-light: #FDF3E3;

    --color-success: #22C55E;
    --color-success-light: #DCFCE7;

    --color-danger: #F5403D;
    --color-danger-light: #FEE2E2;

    --color-dark: #1A1410;
    --color-mid: #57534E;
    --color-muted: #525050;
    --color-light: #F5F5F5;
    --color-border: #D9D7D5;
    --color-white: #FFFFFF;
    --color-bg: #F5F5F5;
    --color-secondary: #57534E;
    --color-cream: #F5F5F5;
    --color-text: #1A1410;
    --color-bg-secondary: #F0EDED;
    --color-input-bg: #F0EDED;
    --color-teal-bright: #22B2A0;
    --color-teal-light: #7FD4C4;

    /* Semantic Status Colours */
    --color-info: #2563EB;
    --color-info-light: #DBEAFE;
    --color-warning-dark: #92400E;
    --color-success-dark: #065F46;
    --color-info-dark: #1E40AF;
    --color-success-deep: #15803D;

    /* Typography */
    --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display-family: 'Fraunces', Georgia, serif;
    --font-display: 36px;
    --font-h1: 24px;
    --font-h2: 20px;
    --font-h3: 18px;
    --font-body: 16px;
    --font-body-sm: 14px;
    --font-caption: 12px;

    /* Text size aliases (used by calendar CSS) */
    --text-lg: var(--font-h3);
    --text-base: var(--font-body);
    --text-sm: var(--font-body-sm);
    --text-xs: var(--font-caption);

    /* Semantic aliases (used by marketing/stats card CSS) */
    --surface: var(--color-white);
    --border-color: var(--color-border);
    --text-muted: var(--color-muted);

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Spacing (8px base) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Numeric spacing aliases (Tailwind-style, used by team/compliance/onboarding sections) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px hsl(24 10% 10% / 0.05);
    --shadow-md: 0 4px 6px hsl(24 10% 10% / 0.07);
    --shadow-lg: 0 10px 15px hsl(24 10% 10% / 0.1);
    --shadow-soft: 0 2px 8px -2px hsl(24 10% 10% / 0.1);
    --shadow-card: 0 1px 3px hsl(24 10% 10% / 0.08), 0 4px 12px -4px hsl(24 10% 10% / 0.1);
    --shadow-glow: 0 4px 16px -4px hsl(38 92% 44% / 0.2);
    --shadow-elevated: 0 8px 24px -8px hsl(24 10% 10% / 0.12);
    --shadow-note: 2px 3px 8px hsl(24 10% 10% / 0.1);

    /* Motion — standardize durations + easings across the app */
    --motion-fast: 120ms;
    --motion-default: 180ms;
    --motion-slow: 260ms;
    --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);   /* Material deceleration */
    --motion-ease-out: ease-out;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(175 77% 26%), hsl(175 59% 18%));
    --gradient-accent: linear-gradient(135deg, hsl(38 92% 44%), hsl(38 92% 34%));
    --gradient-card: linear-gradient(180deg, hsl(0 0% 100%), hsl(30 7% 97%));

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --top-bar-height: 56px;
    --tab-bar-height: 56px;
    --content-max-width: 1200px;
}


/* ============================================
   2. RESET / BASE STYLES
   ============================================ */

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: 1.5;
    color: var(--color-dark);
    background-color: var(--color-light);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-dark, #0F766E);
}

/* Card-style anchors never underline — at any state. Prose links keep the
   default hover underline; these tile containers opt out because the whole
   card is the affordance, not the text inside it. */
a.card,
a.team-action-link,
a.settings-card,
a.settings-menu__item,
a.dashboard-action,
a.money-card,
a.money-link-card,
a.lead-card,
a.compliance-item,
a.team-stat,
a.stat-card,
a.stat-card--interactive,
a.dashboard-event,
a.team-card,
a.stock-item,
a.quote-lead-option,
.card a,
.team-action-link a,
.settings-card a,
.dashboard-action a,
.money-card a,
.lead-card a,
.compliance-item a {
    text-decoration: none;
}

a.card:hover,
a.team-action-link:hover,
a.settings-card:hover,
a.settings-menu__item:hover,
a.dashboard-action:hover,
a.money-card:hover,
a.money-link-card:hover,
a.lead-card:hover,
a.compliance-item:hover,
a.team-stat:hover,
a.stat-card:hover,
a.stat-card--interactive:hover,
a.dashboard-event:hover,
a.team-card:hover,
a.stock-item:hover,
a.quote-lead-option:hover,
.card a:hover,
.team-action-link a:hover,
.settings-card a:hover,
.dashboard-action a:hover,
.money-card a:hover,
.lead-card a:hover,
.compliance-item a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary);
}


/* ============================================
   3. TYPOGRAPHY
   ============================================ */

h1, .h1 {
    font-family: var(--font-display-family);
    font-size: var(--font-h1);
    font-weight: var(--weight-semibold);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-dark);
}

h2, .h2 {
    font-family: var(--font-display-family);
    font-size: var(--font-h2);
    font-weight: var(--weight-semibold);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-dark);
}

h3, .h3 {
    font-family: var(--font-display-family);
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-dark);
}

.text-display {
    font-family: var(--font-display-family);
    font-size: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.text-body {
    font-size: var(--font-body);
    line-height: 1.5;
}

.text-body-sm {
    font-size: var(--font-body-sm);
    line-height: 1.5;
}

.text-caption {
    font-size: var(--font-caption);
    line-height: 1.4;
}

p {
    margin-bottom: var(--space-sm);
}

p:last-child {
    margin-bottom: 0;
}


/* ============================================
   4. LAYOUT COMPONENTS
   ============================================ */

/* --- App Shell --- */

.app-body {
    background-color: var(--color-light);
    min-height: 100vh;
}

.auth-body {
    background-color: var(--color-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.app-content {
    flex: 1;
    padding: var(--space-md);
    padding-bottom: calc(var(--tab-bar-height) + var(--space-lg) + env(safe-area-inset-bottom, 0px));
}

/* --- Auth Layout --- */

.auth-layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo__link {
    font-size: var(--font-h1);
    font-weight: var(--weight-bold);
    text-decoration: none;
}

.auth-logo__vendor {
    color: var(--color-primary);
}

.auth-logo__pad {
    color: var(--color-dark);
}

.auth-content {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.auth-footer {
    margin-top: var(--space-xl);
    text-align: center;
}

.auth-footer__text {
    font-size: var(--font-caption);
    color: var(--color-muted);
}

/* --- SSO Buttons --- */

.sso-divider {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.sso-divider__text {
    font-size: var(--font-caption);
    color: var(--color-muted);
    white-space: nowrap;
}

.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.btn--sso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 44px;
    font-weight: var(--weight-medium);
    border-radius: 0.375rem;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sso-icon {
    flex-shrink: 0;
}

.btn--google {
    background: var(--color-white);
    color: var(--color-dark);
    border: 1px solid var(--color-border);
}

.btn--google:hover {
    background: var(--color-light);
    border-color: #dadce0;
}

.btn--apple {
    background: #000;
    color: #fff;
    border: 1px solid #000;
}

.btn--apple:hover {
    background: #1a1a1a;
}

/* --- Sidebar --- */

.sidebar {
    display: none;
    width: var(--sidebar-width);
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__logo {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
}

.sidebar__logo-link {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    text-decoration: none;
}

.sidebar__logo-vendor {
    color: var(--color-primary);
}

.sidebar__logo-pad {
    color: var(--color-dark);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--top-bar-height));
    padding: var(--space-sm) 0;
}

.sidebar__section {
    padding: var(--space-xs) 0;
}

.sidebar__section--bottom {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-sm);
}

.sidebar__heading {
    display: block;
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-sm) var(--space-md);
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    height: 44px;
    color: var(--color-mid);
    text-decoration: none;
    font-size: var(--font-body);
    font-weight: var(--weight-regular);
    border-left: 3px solid transparent;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar__item:hover {
    background-color: var(--color-light);
    text-decoration: none;
}

.sidebar__item--active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: var(--weight-medium);
    border-left-color: var(--color-primary);
}

.sidebar__icon {
    flex-shrink: 0;
}

.sidebar__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    line-height: 18px;
    text-align: center;
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar__badge:empty {
    min-width: 8px;
    height: 8px;
    padding: 0;
}

.sidebar__badge--danger {
    background: var(--color-error);
}

/* --- Top Bar --- */

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

.top-bar__left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.top-bar__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-mid);
    border-radius: var(--radius-sm);
}

.top-bar__menu-btn:hover {
    background-color: var(--color-light);
}

.top-bar__back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--color-dark);
    cursor: pointer;
    border-radius: var(--radius-md);
    text-decoration: none;
}
.top-bar__back-btn:hover {
    background-color: var(--color-light);
}

.top-bar__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.top-bar__business {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    display: none;
}

/* Inline actions: visible on tablet+, hidden on mobile (replaced by overflow menu) */
.top-bar__inline-actions {
    display: none;
    align-items: center;
    gap: var(--space-sm);
}

@media (min-width: 768px) {
    .top-bar__inline-actions {
        display: inline-flex;
    }
    /* On desktop the overflow menu still carries Settings + Log out */
    .top-bar__overflow-mobile-only {
        display: none !important;
    }
}

.top-bar__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-muted);
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.top-bar__action:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
    text-decoration: none;
}

.top-bar__action--bell {
    position: relative;
}

.top-bar__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--color-danger);
    border-radius: 50%;
    border: 2px solid var(--color-surface);
}

button.top-bar__action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

/* --- Global Search Bar (top-bar dropdown) ----------------------------------
   Inserted at runtime by app.js as a sibling immediately after .top-bar.
   Sits sticky just below the top bar, with a tidy bordered input and a close
   button on the right. Submits to /leads?search=… (see app.js IIFE). */

.global-search-bar {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    position: sticky;
    top: var(--top-bar-height);
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.global-search-bar__form {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    max-width: 720px;
    margin: 0 auto;
}

.global-search-bar__input {
    flex: 1;
    min-width: 0;
    height: 2.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    color: var(--color-dark);
    background: var(--color-input-bg);
    transition: border-color var(--motion-fast) var(--motion-ease),
                box-shadow var(--motion-fast) var(--motion-ease);
}

.global-search-bar__input::placeholder {
    color: var(--color-muted);
}

.global-search-bar__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.1);
}

/* Hide the native WebKit clear button — the explicit close button replaces it. */
.global-search-bar__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.global-search-bar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--motion-fast) var(--motion-ease),
                color var(--motion-fast) var(--motion-ease);
}

.global-search-bar__close:hover,
.global-search-bar__close:focus-visible {
    background: var(--color-light);
    color: var(--color-dark);
    outline: none;
}

/* --- Bottom Tab Bar (Mobile) --- */

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    z-index: 100;
}

.tab-bar__tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--tab-bar-height);
    color: var(--color-muted);
    text-decoration: none;
    position: relative;
}

.tab-bar__tab:hover {
    text-decoration: none;
}

.tab-bar__tab--active {
    color: var(--color-primary);
}

.tab-bar__tab--active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.tab-bar__icon {
    flex-shrink: 0;
}

.tab-bar__icon-wrap {
    position: relative;
    display: inline-flex;
}

.tab-bar__badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 3px hsl(24 10% 10% / 0.2);
}

.tab-bar__badge:empty {
    min-width: 10px;
    height: 10px;
    padding: 0;
    top: -2px;
    right: -4px;
}

.tab-bar__badge--danger {
    background: var(--color-error);
}

.tab-bar__label {
    font-size: 12px;
    font-weight: var(--weight-medium);
    line-height: 1;
}


/* ============================================
   5. DATA DISPLAY COMPONENTS
   ============================================ */

/* --- Card --- */

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
    padding: var(--space-md);
}

.card--interactive {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.card--interactive:hover {
    box-shadow: var(--shadow-md);
}

.card--status {
    border-left: 4px solid var(--color-muted);
}

.card--status-success { border-left-color: var(--color-success); }
.card--status-warning { border-left-color: var(--color-accent); }
.card--status-danger  { border-left-color: var(--color-danger); }
.card--status-primary { border-left-color: var(--color-primary); }

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card__header h3 {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    margin: 0;
}

.card__header h3 svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

.card__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
}

.card__subtitle {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 2px;
}

.card__body {
    color: var(--color-mid);
}

.card__footer {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Data Table --- */

.data-table-wrapper {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--color-bg-secondary);
}

.data-table th {
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
    color: var(--color-muted);
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table th--sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th--sortable:hover {
    color: var(--color-primary);
}

.data-table__sort {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.data-table__sort:hover { color: var(--color-primary); text-decoration: none; }
.data-table__sort--active { color: var(--color-primary); }

/* --- Expandable Row Chevron --- */

.expand-chevron {
    display: inline-flex;
    transition: transform 0.2s ease;
    vertical-align: middle;
    margin-right: 4px;
}

.referral-row--expandable:hover {
    background: var(--color-light);
}

.referral-sub-row td {
    background: var(--color-bg, var(--color-light));
    font-size: var(--font-body-sm);
}

.data-table td {
    font-size: var(--font-body-sm);
    color: var(--color-mid);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid hsl(30 7% 93%);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
    background-color: transparent;
}

.data-table tbody tr:hover {
    background-color: var(--color-bg-secondary);
}

.data-table__actions {
    text-align: right;
    white-space: nowrap;
}

/* Mobile: horizontal scroll */
.data-table-scroll {
    overflow-x: auto;

}

/* Responsive stack: on narrow screens, rows become label/value pairs.
   Apply to tables with .data-table--stack-mobile and add data-label="…" to each <td>. */
@media (max-width: 767px) {
    .data-table--stack-mobile {
        display: block;
    }
    .data-table--stack-mobile thead {
        display: none;
    }
    .data-table--stack-mobile tbody,
    .data-table--stack-mobile tr {
        display: block;
    }
    .data-table--stack-mobile tr {
        padding: var(--space-sm);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-sm);
        background: var(--color-white);
    }
    .data-table--stack-mobile tr:last-child {
        margin-bottom: 0;
    }
    .data-table--stack-mobile td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-sm);
        padding: 3px 0;
        border: none;
    }
    .data-table--stack-mobile td::before {
        content: attr(data-label);
        font-weight: var(--weight-semibold);
        color: var(--color-muted);
        font-size: var(--font-caption);
        flex-shrink: 0;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    .data-table--stack-mobile td:not([data-label])::before {
        content: none;
    }
    /* In stacked mode the wrapper border duplicates the row border — drop it */
    .data-table--stack-mobile + *,
    .table-responsive:has(.data-table--stack-mobile) {
        border: none;
        box-shadow: none;
    }
}

/* --- Accordion --- */

.accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion__item {
    border-bottom: 1px solid var(--color-border);
}

.accordion__item:last-child {
    border-bottom: none;
}

.accordion__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-md);
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-body);
    font-weight: var(--weight-medium);
    color: var(--color-dark);
    text-align: left;
    transition: background-color 0.15s;
}

.accordion__trigger:hover {
    background: var(--color-bg-secondary);
}

.accordion__chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease-out;
    color: var(--color-muted);
}

.accordion__item--open .accordion__chevron,
[data-accordion-item].open .accordion__chevron {
    transform: rotate(180deg);
}

.accordion__content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
}

.accordion__item--open .accordion__content,
[data-accordion-item].open .accordion__content {
    opacity: 1;
}

.accordion__body {
    padding: 0 var(--space-md) var(--space-md);
    color: var(--color-muted);
    font-size: var(--font-body-sm);
    line-height: 1.6;
}

/* --- Status Badge --- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    line-height: 1;
    white-space: nowrap;
}

/* Lead/enquiry statuses */
.badge--enquiry    { background: var(--color-light);         color: var(--color-dark); }
.badge--contacted  { background: var(--color-info-light);      color: var(--color-info); }
.badge--quoted     { background: var(--color-accent-light);  color: var(--color-accent); }
.badge--follow-up  { background: var(--color-accent-light);  color: var(--color-accent); }
.badge--booked     { background: var(--color-primary-light); color: var(--color-primary); }

/* Payment statuses */
.badge--deposit-paid  { background: var(--color-success-light); color: var(--color-success); }
.badge--balance-paid  { background: var(--color-success);       color: var(--color-white); }
.badge--completed     { background: var(--color-primary);       color: var(--color-white); }
.badge--lost          { background: var(--color-danger-light);  color: var(--color-danger); }
.badge--cancelled     { background: #E5E7EB;                   color: #6B7280; }
.badge--overdue       { background: var(--color-danger);        color: var(--color-white); }

/* Quote statuses */
.badge--draft    { background: var(--color-light);         color: var(--color-dark); }
.badge--sent     { background: var(--color-primary-light); color: var(--color-primary); }
.badge--accepted { background: var(--color-success);       color: var(--color-white); }
.badge--declined { background: var(--color-danger);        color: var(--color-white); }
.badge--expired  { background: #E5E7EB;                   color: #6B7280; }

/* Compliance / General statuses */
.badge--valid         { background: var(--color-success);       color: var(--color-white); }
.badge--expiring-soon { background: var(--color-accent);        color: var(--color-white); }
.badge--pending       { background: var(--color-accent);        color: var(--color-white); }
.badge--approved      { background: var(--color-success);       color: var(--color-white); }
.badge--rejected      { background: var(--color-danger);        color: var(--color-white); }

/* Generic variants */
.badge--success { background: var(--color-success-light); color: var(--color-success); }
.badge--warning { background: var(--color-accent-light);  color: var(--color-accent); }
.badge--danger  { background: var(--color-danger-light);  color: var(--color-danger); }
.badge--info    { background: var(--color-primary-light); color: var(--color-primary); }

/* --- Stat Card --- */

.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    position: relative;
}

.stat-card--interactive {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.stat-card--interactive:hover {
    box-shadow: var(--shadow-md);
}

.stat-card__icon {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    color: var(--color-primary);
}

.stat-card__value {
    font-size: var(--font-display);
    font-weight: var(--weight-bold);
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-card__label {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: var(--space-xs);
}

.stat-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: var(--font-caption);
    margin-top: var(--space-xs);
}

.stat-card__trend--up { color: var(--color-success); }
.stat-card__trend--down { color: var(--color-danger); }
.stat-card__trend--neutral { color: var(--color-muted); }

.stat-card__sub {
    display: block;
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 2px;
}

/* --- Alert Card (Dashboard) --- */

.alert-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 280px;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--color-white);
    flex-shrink: 0;
}

.alert-card:hover {
    text-decoration: none;
    opacity: 0.95;
}

.alert-card--urgent  { background: var(--color-danger); }
.alert-card--warning { background: var(--color-accent); }
.alert-card--info    { background: var(--color-primary); }
.alert-card--success { background: var(--color-success); }

.alert-card__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.alert-card__content {
    flex: 1;
    min-width: 0;
}

.alert-card__title {
    font-weight: var(--weight-semibold);
    font-size: var(--font-body);
}

.alert-card__detail {
    font-size: var(--font-body-sm);
    opacity: 0.9;
}

.alert-card__chevron {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Horizontal scroll container for alert cards */
.alert-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;

    scrollbar-width: none;
    padding-bottom: var(--space-xs);
}

.alert-scroll::-webkit-scrollbar {
    display: none;
}

/* --- Timeline / Activity Log --- */

.timeline {
    position: relative;
    padding-left: var(--space-lg);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
}

.timeline__item {
    position: relative;
    padding-bottom: var(--space-md);
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__dot {
    position: absolute;
    left: calc(-1 * var(--space-lg) + 3px);
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
}

.timeline__dot--status { background: var(--color-primary); }
.timeline__dot--note   { background: var(--color-accent); }
.timeline__dot--payment { background: var(--color-success); }

.timeline__time {
    font-size: var(--font-caption);
    color: var(--color-muted);
}

.timeline__action {
    font-size: var(--font-body);
    color: var(--color-dark);
}

.timeline__user {
    font-weight: var(--weight-semibold);
}

/* Timeline Date Group Headings */
.timeline-date-heading {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.timeline-date-heading:first-child {
    margin-top: 0;
}


/* ============================================
   6. FORM COMPONENTS
   ============================================ */

/* --- Form Layout --- */

.form-group {
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: var(--space-md);
    /* Clear the floated legend (legend.form-section__title is float:left) so a
       form-row that's the first child after the legend drops below it instead
       of being squeezed alongside it and overflowing the fieldset on the right. */
    clear: left;
}

.form-row > .form-group {
    /* min-width: 0 overrides flex's default `min-width: auto` so a long
       placeholder or value can't blow the column out past its share of
       the row — without this, the input width tracks its content's
       intrinsic min-width and shoves siblings off-screen. */
    flex: 1 1 0;
    min-width: 0;
}

.form-section {
    margin-bottom: var(--space-xl);
    /* Firefox renders <fieldset> with an implicit `min-width: min-content`
       which prevents flex/grid children from shrinking, so wide inputs
       break out of the parent card. Resetting this restores normal block
       sizing across all browsers. */
    min-width: 0;
}

fieldset.form-section {
    background: var(--color-white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 1px var(--color-border), 0 1px 3px hsl(24 10% 10% / 0.06);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.form-section__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-primary-light);
    color: var(--color-dark);
}

/* Make <legend> behave as a normal block heading. Native legends break out
   of fieldset flow and sit on the top "border" — which clashes with our
   1px box-shadow frame on .form-section, producing the title-overlapping-
   the-border look. `display:block; width:100%; float:left;` puts the legend
   back in flow; the clearfix on the fieldset stops the float from leaking. */
legend.form-section__title {
    display: block;
    width: 100%;
    float: left;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-md);
    letter-spacing: -0.01em;
}

fieldset.form-section::after {
    content: "";
    display: table;
    clear: both;
}

/* Belt-and-braces: every sibling of the floated legend (regardless of element
   type) must clear the float. .form-row already does this directly, but a
   single .form-group, a <p>, a <div>, or any custom block placed as the first
   child after the legend would otherwise be squeezed alongside the legend's
   100%-wide float and overflow the right edge of the fieldset. */
fieldset.form-section > legend.form-section__title ~ * {
    clear: left;
}

.form-section[data-collapsible] .form-section__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.form-section__chevron {
    display: flex;
    transition: transform 0.2s ease;
}

.form-section--collapsed .form-section__chevron {
    transform: rotate(-90deg);
}

.form-section__body {
    transition: opacity 0.15s ease;
}

/* Inner cards inside a form-section don't need their own visible frame —
   the fieldset already provides the box-shadow border. A second 1px border
   sitting at the fieldset's content edge made section titles (legends) look
   cramped against the card's left border. Drop the inner border; settings-row
   bottom borders still provide row separation, and the card's own padding
   keeps any non-row body content (e.g. profile.php Account block) intact. */
fieldset.form-section .card {
    box-shadow: none;
    border: none;
}

/* --- Form Label --- */

.form-label {
    display: block;
    font-size: var(--font-body);
    font-weight: var(--weight-medium);
    color: var(--color-dark);
    margin-bottom: var(--space-xs);
}

.form-label--required::after {
    content: ' *';
    color: var(--color-danger);
}

/* --- Text Input --- */

.form-input {
    display: block;
    width: 100%;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    color: var(--color-dark);
    background: var(--color-input-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder {
    color: var(--color-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.1);
}

.form-input--error {
    border-color: var(--color-danger);
}

.form-input--error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input:disabled {
    background: var(--color-light);
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Helper / Error Text --- */

.form-helper {
    display: block;
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: var(--space-xs);
}

.form-error {
    display: block;
    font-size: var(--font-caption);
    color: var(--color-danger);
    margin-top: var(--space-xs);
}

/* --- Select --- */

.form-select {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    color: var(--color-dark);
    background: var(--color-input-bg) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") right 12px center no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.1);
}

.form-select:disabled {
    background-color: var(--color-light);
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Textarea --- */

.form-textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    color: var(--color-dark);
    background: var(--color-input-bg);
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-textarea::placeholder {
    color: var(--color-muted);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.1);
}

/* Monospace variant for code / email templates / HTML editing */
.form-textarea--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    min-height: 280px;
}

/* --- Merge-tag chip row (email templates, quote templates) --- */
.merge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.merge-tags__tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
}

/* --- Settings list rows (email templates, checklists, quotes, staff) --- */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}
.settings-row:last-child { border-bottom: none; }

.settings-row__main {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
    flex: 1;
}

.settings-row__icon {
    flex-shrink: 0;
    color: var(--color-muted);
}

.settings-row__action { flex-shrink: 0; }

/* --- Menu category rows (drag-and-drop reorder, /settings/menu-categories) --- */
.menu-category-row {
    /* sits inside a sortable container; cursor hints reorderability. */
    cursor: default;
}
.menu-category-row[draggable="true"]:hover .menu-category-row__handle { color: var(--color-dark); }
.menu-category-row[draggable="true"]:active { cursor: grabbing; }
.menu-category-row__handle {
    display: inline-flex;
    align-items: center;
    color: var(--color-muted);
    cursor: grab;
    padding: 0 var(--space-xs);
    user-select: none;
    flex-shrink: 0;
}
.menu-category-row--ghost { opacity: 0.4; }
.menu-category-row--drop-target { box-shadow: inset 0 2px 0 0 var(--color-primary); }

/* --- Preset picker cards (Apply preset modal on /settings/menu-categories) --- */
.preset-list {
    display: grid;
    gap: var(--space-sm);
}
.preset-card {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.preset-card:hover { border-color: var(--color-primary); box-shadow: 0 1px 3px hsl(24 10% 10% / 0.06); }
.preset-card__body { padding: var(--space-sm) var(--space-md); }
.preset-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.preset-card__label { font-size: var(--font-body); }
.preset-card__description { margin: 0 0 var(--space-xs) 0; }
.preset-card__sample {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.preset-card__chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-light);
    color: var(--color-mid);
    font-size: var(--font-caption);
}
.preset-card__chip--more {
    background: transparent;
    color: var(--color-muted);
    font-style: italic;
}

/* --- Icon picker (settings/menu-category-edit) --- */
.icon-picker {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.icon-picker__current {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-input-bg);
    color: var(--color-dark);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.icon-picker__current:hover { border-color: var(--color-primary); }
.icon-picker__current:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.1); }
.icon-picker__current-icon { display: inline-flex; color: var(--color-primary); }
.icon-picker__current-label { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.85rem; }
.icon-picker__chevron { display: inline-flex; color: var(--color-muted); }

.icon-picker__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-sm);
}
.icon-picker__option {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-mid);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, transform 0.1s;
}
.icon-picker__option:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: scale(1.05);
}
@media (max-width: 480px) {
    .icon-picker__grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- Toggle Switch --- */

.toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle__track {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background-color 0.2s;
}

.toggle__input:checked + .toggle__track {
    background: var(--color-primary);
}

.toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    transition: transform 0.2s;
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.1);
}

.toggle__input:checked + .toggle__track::after {
    transform: translateX(20px);
}

.toggle__input:focus-visible + .toggle__track {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.toggle__input:disabled + .toggle__track {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle__label {
    font-size: var(--font-body);
    color: var(--color-dark);
}

/* --- Checkbox --- */

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox__input {
    width: 20px;
    height: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.15s, border-color 0.15s;
}

.checkbox__input:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox__input:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid var(--color-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox__input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.checkbox__label {
    font-size: var(--font-body);
    color: var(--color-dark);
}

/* --- File Upload --- */

.file-upload {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    background: var(--color-white);
    transition: border-color 0.2s, background-color 0.2s;
}

.file-upload:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.file-upload__icon {
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.file-upload__text {
    font-size: var(--font-body);
    color: var(--color-mid);
}

.file-upload__hint {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: var(--space-xs);
}

/* --- Media Upload (Logo / Avatar preview + upload) --- */

.media-upload {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.media-upload__preview {
    flex-shrink: 0;
}

.media-upload__preview img {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

.media-upload__placeholder {
    width: 120px;
    height: 60px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    background: var(--color-bg);
}

.media-upload__info {
    flex: 1;
    min-width: 0;
}

.media-upload__label {
    font-size: var(--font-body);
    font-weight: var(--weight-medium, 500);
    color: var(--color-dark);
}

.media-upload__hint {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 2px;
}

.media-upload__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.media-upload__actions .form-input {
    max-width: 260px;
}

.media-upload__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.media-upload__avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: var(--weight-semibold);
    color: var(--color-primary);
}

/* --- Logo Cropper --- */

.logo-cropper {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-bg);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.logo-cropper canvas {
    display: block;
}

.logo-cropper__frame {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.logo-cropper__frame::after {
    content: '';
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: nwse-resize;
}

.logo-cropper__frame::before {
    content: '';
    position: absolute;
    right: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 24px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: ew-resize;
}

.logo-cropper__hint {
    text-align: center;
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: var(--space-sm);
}

/* --- Form Footer (Sticky on mobile) --- */

.form-footer {
    display: flex;
    flex-direction: row-reverse;
    gap: var(--space-sm);
    justify-content: flex-start;
    padding-top: var(--space-lg);
    border-top: none;
    margin-top: var(--space-md);
}

/* --- Payment Summary Card --- */

.payment-summary__title {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--color-dark);
    margin: 0 0 var(--space-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.payment-summary__rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.payment-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    font-size: var(--font-body);
}

.payment-summary__row--result {
    padding-top: var(--space-sm);
    font-size: 1.05em;
}

.payment-summary__row--success span:last-child {
    color: var(--color-success);
}

.payment-summary__row--warning span:last-child {
    color: var(--color-warning);
}

.payment-summary__row--danger span:last-child {
    color: var(--color-error);
}

.payment-summary__divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-xs) 0;
}

/* --- Mileage Calculator --- */

.mileage-calc {
    background: var(--color-bg-raised, var(--color-primary-light));
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-top: var(--space-sm);
}

.mileage-calc__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-sm);
}


/* ============================================
   7. ACTION COMPONENTS
   ============================================ */

/* --- Button --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 40px;
    padding: 0 var(--space-lg);
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled, .btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variants */
.btn--primary {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn--primary:hover {
    background: var(--color-primary-dark);
}

.btn--secondary {
    background: var(--color-white);
    color: var(--color-dark);
    border-color: var(--color-border);
}
.btn--secondary:hover {
    background: var(--color-light);
}

.btn--accent {
    background: var(--color-accent);
    color: var(--color-white);
}
.btn--accent:hover {
    background: hsl(38 92% 34%);
}

.btn--danger {
    background: var(--color-danger);
    color: var(--color-white);
}
.btn--danger:hover {
    background: hsl(0 84% 50%);
}

.btn--destructive {
    background: var(--color-danger);
    color: var(--color-white);
}
.btn--destructive:hover {
    background: hsl(0 84% 50%);
}

.btn--ghost {
    background: transparent;
    color: var(--color-primary);
}
.btn--ghost:hover {
    background: var(--color-primary-light);
}

.btn--outline {
    background: transparent;
    color: var(--color-dark);
    border-color: var(--color-border);
}
.btn--outline:hover {
    background: var(--color-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Sizes */
.btn--sm {
    height: 36px;
    padding: 0 var(--space-md);
    font-size: var(--font-body-sm);
}

.btn--lg {
    height: 44px;
    padding: 0 var(--space-xl);
    font-size: var(--font-h3);
}

.btn--full {
    width: 100%;
}

/* Icon only */
.btn--icon {
    width: 40px;
    padding: 0;
}

.btn--icon.btn--sm {
    width: 36px;
}

/* Loading state */
.btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn--loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Floating Action Button --- */

.fab {
    position: fixed;
    bottom: calc(var(--tab-bar-height) + var(--space-md) + env(safe-area-inset-bottom, 0px));
    right: var(--space-md);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 20px hsl(24 10% 10% / 0.15);
}

/* --- Dropdown Menu --- */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 180px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    z-index: 200;
    padding: var(--space-xs) 0;
}

.dropdown--open .dropdown__menu {
    display: block;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    height: 44px;
    font-size: var(--font-body);
    color: var(--color-mid);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.1s;
}

.dropdown__item:hover {
    background: var(--color-light);
    text-decoration: none;
}

.dropdown__item--danger {
    color: var(--color-danger);
}

.dropdown__divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-xs) 0;
}


/* ============================================
   8. OVERLAY COMPONENTS
   ============================================ */

/* --- Modal --- */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: hsl(24 10% 10% / 0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-backdrop--open {
    display: flex;
}

/* Bottom-sheet alignment variant */
.modal-backdrop--bottom {
    align-items: flex-end;
    padding: 0;
}

.modal {
    background: var(--color-white);
    width: calc(100% - var(--space-lg) * 2);
    max-width: 560px;
    max-height: 90vh;
    margin: auto;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    animation: modal-scale-in var(--motion-default, 180ms) var(--motion-ease, ease-out);
    box-shadow: var(--shadow-elevated);
}

.modal--sm {
    max-width: 400px;
}

/* Bottom-aligned variant (true bottom-sheet style) keeps the slide-up */
.modal-backdrop--bottom .modal {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slide-up 0.25s ease-out;
}

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

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

.modal__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
}

.modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
}

.modal__close:hover {
    background: var(--color-light);
    color: var(--color-dark);
}

.modal__body {
    padding: var(--space-md);
    overflow-y: auto;
    flex: 1;
}

.modal__footer {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    padding: var(--space-md);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* When a <form> wraps the body + footer (common pattern across edit modals),
   it must participate in the modal's flex column layout — otherwise the
   body's `flex: 1; overflow-y: auto` doesn't engage and a tall form spills
   the footer below the modal panel. */
.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* --- Modal as overlay (confirmation-dialog pattern) --- */
.modal--open {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    padding: var(--space-lg);
}

.modal__backdrop {
    position: fixed;
    inset: 0;
    background: hsl(24 10% 10% / 0.5);
}

.modal__dialog,
.modal__content {
    position: relative;
    z-index: 1;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    width: calc(100% - var(--space-lg) * 2);
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modal-scale-in var(--motion-default, 180ms) var(--motion-ease, ease-out);
    box-shadow: var(--shadow-elevated);
}

.modal__dialog--sm {
    max-width: 400px;
}

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

/* --- Quote Lead Selection --- */

.quote-lead-results {
    max-height: 300px;
    overflow-y: auto;
}

.quote-lead-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.15s ease;
}

.quote-lead-option:hover {
    background: var(--color-bg-secondary, #f5f5f4);
}

/* --- Bottom Sheet (Mobile only) --- */

.bottom-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
}

.bottom-sheet--open {
    display: block;
}

.bottom-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: hsl(24 10% 10% / 0.5);
}

.bottom-sheet__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: slide-up 0.25s ease-out;
}

.bottom-sheet__handle {
    display: flex;
    justify-content: center;
    padding: var(--space-sm);
}

.bottom-sheet__handle::after {
    content: '';
    width: 40px;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.bottom-sheet__body {
    padding: 0 var(--space-md) var(--space-md);
}

/* --- Toast Notification --- */

.flash-messages {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 600;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: calc(100% - var(--space-md) * 2);
    max-width: 480px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--color-primary);
    animation: slideIn 0.3s ease-out;
}

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

.toast--success { border-left-color: var(--color-success); }
.toast--error   { border-left-color: var(--color-danger); }
.toast--warning { border-left-color: var(--color-accent); }
.toast--info    { border-left-color: var(--color-primary); }

.toast__icon {
    flex-shrink: 0;
    display: flex;
    color: var(--color-muted);
}

.toast--success .toast__icon { color: var(--color-success); }
.toast--error .toast__icon   { color: var(--color-danger); }
.toast--warning .toast__icon { color: var(--color-accent); }
.toast--info .toast__icon    { color: var(--color-primary); }

.toast__message {
    flex: 1;
    font-size: var(--font-body);
    color: var(--color-dark);
}

.toast__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--color-muted);
    border-radius: var(--radius-sm);
}

.toast__close:hover {
    background: var(--color-light);
    color: var(--color-dark);
}

/* --- Confirmation Dialog --- */

.confirm {
    text-align: center;
    padding: var(--space-lg);
}

.confirm__icon {
    margin-bottom: var(--space-md);
}

.confirm__icon--warning { color: var(--color-accent); }
.confirm__icon--danger  { color: var(--color-danger); }

.confirm__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-sm);
}

.confirm__message {
    font-size: var(--font-body);
    color: var(--color-mid);
    margin-bottom: var(--space-lg);
}

.confirm__actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}


/* ============================================
   9. NAVIGATION COMPONENTS
   ============================================ */

/* --- Breadcrumbs --- */

.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-bottom: var(--space-sm);
}

.breadcrumbs__item {
    color: var(--color-primary);
}

.breadcrumbs__item:hover {
    color: var(--color-primary-dark, #0F766E);
}

.breadcrumbs__separator {
    margin: 0 var(--space-xs);
    color: var(--color-muted);
}

.breadcrumbs__current {
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
}

/* --- Tabs --- */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;

    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tabs__tab {
    padding: var(--space-sm) 12px;
    font-size: var(--font-body);
    color: var(--color-muted);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tabs__tab:hover {
    color: var(--color-dark);
    text-decoration: none;
}

.tabs__tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: var(--weight-medium);
}

/* --- Pagination --- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md) 0;
    font-size: var(--font-caption);
}

.pagination__info {
    color: var(--color-muted);
    margin-right: auto;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-caption);
    color: var(--color-mid);
    text-decoration: none;
    background: var(--color-white);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.pagination__btn:hover {
    background: var(--color-light);
    text-decoration: none;
}

.pagination__btn--active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Search Bar --- */

.search {
    position: relative;
}

.search__input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-body);
    color: var(--color-dark);
    background: var(--color-white);
}

.search__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.1);
}

.search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    pointer-events: none;
}

.search__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    border-radius: var(--radius-sm);
}

.search__clear:hover {
    background: var(--color-light);
    color: var(--color-dark);
}


/* ============================================
   10. FEEDBACK STATES
   ============================================ */

/* --- Empty State --- */

.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    background: var(--color-light);
    border-radius: var(--radius-md);
}

.empty-state__icon {
    color: var(--color-primary);
    opacity: 0.2;
    margin-bottom: var(--space-md);
}

.empty-state__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    margin-bottom: var(--space-sm);
}

.empty-state__description {
    font-size: var(--font-body);
    color: var(--color-muted);
    margin-bottom: var(--space-lg);
}

/* --- Loading Skeleton --- */

.skeleton {
    background: linear-gradient(90deg, var(--color-border) 25%, var(--color-light) 50%, var(--color-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton--text {
    height: 14px;
    margin-bottom: var(--space-sm);
}

.skeleton--text-sm {
    height: 12px;
    width: 60%;
}

.skeleton--heading {
    height: 24px;
    width: 40%;
    margin-bottom: var(--space-md);
}

.skeleton--card {
    height: 120px;
}

.skeleton--avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

/* Skeleton Layouts */

.skeleton-group {
    padding: var(--space-md) 0;
}

.skeleton-card {
    padding: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-md);
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.skeleton-list-item__text {
    flex: 1;
}

.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.skeleton-stat {
    padding: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.skeleton-table {
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: var(--space-lg);
}

.skeleton-table-row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.skeleton-table-row:last-child {
    border-bottom: none;
}

.skeleton-detail {
    padding: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* --- Error State --- */

.error-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.error-state__icon {
    color: var(--color-danger);
    margin-bottom: var(--space-md);
}

.error-state__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    margin-bottom: var(--space-sm);
}

.error-state__description {
    font-size: var(--font-body);
    color: var(--color-mid);
    margin-bottom: var(--space-lg);
}

/* --- Offline Banner --- */

.offline-banner {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    height: 44px;
    background: var(--color-accent);
    color: var(--color-dark);
    font-size: var(--font-body);
    font-weight: var(--weight-medium);
    animation: slideDown 0.3s ease-out;
}

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

.offline-banner--visible {
    display: flex;
}


/* ============================================
   11. UTILITY CLASSES
   ============================================ */

/* Margin top */
.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* Margin bottom */
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* Margin left */
.ml-xs  { margin-left: var(--space-xs); }
.ml-sm  { margin-left: var(--space-sm); }
.ml-md  { margin-left: var(--space-md); }

/* Margin right */
.mr-xs  { margin-right: var(--space-xs); }
.mr-sm  { margin-right: var(--space-sm); }
.mr-md  { margin-right: var(--space-md); }

/* Padding */
.p-xs  { padding: var(--space-xs); }
.p-sm  { padding: var(--space-sm); }
.p-md  { padding: var(--space-md); }
.p-lg  { padding: var(--space-lg); }
.p-xl  { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

/* Text colours */
.text-dark    { color: var(--color-dark); }
.text-mid     { color: var(--color-mid); }
.text-muted   { color: var(--color-muted); }
.text-primary { color: var(--color-primary); }
.text-success  { color: var(--color-success); }
.text-danger   { color: var(--color-danger); }
.text-warning  { color: var(--color-accent); }
.text-semibold { font-weight: var(--weight-semibold); }
.text-body     { color: var(--color-dark); margin: 0; }
.text-accent  { color: var(--color-accent); }

/* Text sizes */
.text-sm { font-size: var(--font-body-sm); }
.text-md { font-size: var(--font-body); }
.text-lg { font-size: var(--font-h3); }

/* Flex utilities */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }

/* Grid */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr 1fr; }

/* Text alignment */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

/* Display */
.hidden { display: none; }
.block  { display: block; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================
   PAGE: DASHBOARD
   ============================================ */

/* --- Greeting Card --- */
.dashboard-greeting {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0 var(--space-lg);
    margin-bottom: var(--space-md);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.dashboard-greeting__icon {
    color: var(--color-primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
}

.dashboard-greeting__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    color: var(--color-text);
    margin: 0;
    line-height: 1.2;
}

.dashboard-greeting__date {
    font-size: var(--font-body);
    color: var(--color-muted);
    margin: 2px 0 0;
}

.dashboard-greeting__business {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    margin: 2px 0 0;
}

/* --- Alert Cards Strip --- */
.dashboard-alerts {
    margin-bottom: var(--space-lg);
}

.dashboard-alerts__strip {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: var(--space-xs);
}

.dashboard-alerts__strip::-webkit-scrollbar {
    display: none;
}

.dashboard-alerts__strip .alert-card {
    min-width: 240px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* --- Dashboard Sections --- */
.dashboard-section {
    margin-bottom: var(--space-lg);
}

.dashboard-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.dashboard-section__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-bold);
    color: var(--color-dark);
    margin: 0;
}

.dashboard-section__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-xs);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
}

.dashboard-section__subtitle {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    margin-left: auto;
}

/* --- Dashboard Empty State --- */
.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.dashboard-empty__icon {
    color: var(--color-muted);
    margin-bottom: var(--space-sm);
    opacity: 0.5;
}

.dashboard-empty__text {
    font-size: var(--font-body);
    color: var(--color-muted);
    margin: 0;
}

/* --- Today's Events List --- */
.dashboard-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dashboard-event {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-white);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
}

.dashboard-event:hover {
    background: var(--color-bg);
    text-decoration: none;
}

.dashboard-event__time {
    font-size: var(--font-body);
    font-weight: var(--weight-bold);
    color: var(--color-dark);
    flex-shrink: 0;
    width: 48px;
}

.dashboard-event__info {
    flex: 1;
    min-width: 0;
}

.dashboard-event__title {
    display: block;
    font-size: var(--font-body);
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-event__venue {
    display: block;
    font-size: var(--font-caption);
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-event__type {
    flex-shrink: 0;
    font-size: var(--font-caption);
    padding: 2px var(--space-xs);
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.dashboard-event__payment {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.dashboard-event__payment--paid    { color: var(--color-success); }
.dashboard-event__payment--partial { color: var(--color-accent); }
.dashboard-event__payment--unpaid  { color: var(--color-danger); opacity: 0.4; }

.dashboard-event__chevron {
    flex-shrink: 0;
    color: var(--color-muted);
}

/* --- Quick Actions Grid --- */
.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.dashboard-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-dark);
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
    font-family: inherit;
}

.dashboard-action:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.dashboard-action__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    position: relative;
    transition: transform 0.2s;
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.dashboard-action:hover .dashboard-action__icon {
    transform: scale(1.08);
}

/* Colored icon variants */
.dashboard-action__icon--lead {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.dashboard-action__icon--quote {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.dashboard-action__icon--expense {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.dashboard-action__icon--clock {
    background: var(--color-info-light);
    color: var(--color-info);
}

.dashboard-action__label {
    text-align: center;
    color: var(--color-dark);
}

.dashboard-action__desc {
    font-size: var(--font-caption);
    color: var(--color-muted);
    font-weight: var(--weight-regular);
    text-align: center;
    margin-top: -4px;
}

/* Clock in active state */
.dashboard-action--active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.dashboard-action--active .dashboard-action__icon {
    background: hsla(0, 0%, 100%, 0.2);
    color: var(--color-white);
}

.dashboard-action--active .dashboard-action__label {
    color: var(--color-white);
}

.dashboard-action--active:hover {
    background: var(--color-primary-dark);
}

.dashboard-action__pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

/* --- Dashboard: Disabled Quick Actions (Offline) --- */
.dashboard-action--disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}
.dashboard-action--disabled .dashboard-action__icon {
    background: var(--color-bg);
    color: var(--color-muted);
}

/* --- Dashboard: Global Error State --- */
.dashboard-error {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    padding: var(--space-xl);
}
.dashboard-error__card {
    text-align: center;
    max-width: 360px;
}
.dashboard-error__icon {
    color: var(--color-muted);
    margin-bottom: var(--space-md);
    display: inline-block;
}
.dashboard-error__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    margin-bottom: var(--space-sm);
}
.dashboard-error__text {
    font-size: var(--font-body);
    color: var(--color-mid);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

/* --- Dashboard: Cache Banner (Offline) --- */
.dashboard-cache-banner {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-warning-light, #FEF3C7);
    color: var(--color-warning-dark, #92400E);
    font-size: var(--font-body-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

/* --- Weekly Snapshot Grid --- */
.dashboard-snapshot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.dashboard-snapshot .stat-card {
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

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

.dashboard-snapshot .stat-card__icon {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
}

.dashboard-snapshot .stat-card__value {
    color: var(--color-dark);
    font-size: var(--font-h2);
}

.dashboard-snapshot .stat-card__label {
    text-transform: none;
    font-size: var(--font-body-sm);
}

/* Snapshot icon colour variants */
.stat-card__icon--events {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.stat-card__icon--revenue {
    background: var(--color-success-light);
    color: var(--color-success);
}

.stat-card__icon--quotes {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.stat-card__icon--leads {
    background: var(--color-info-light);
    color: var(--color-info);
}

/* --- Dashboard responsive --- */
@media (min-width: 768px) {
    .dashboard-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-snapshot {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-alerts__strip {
        flex-wrap: wrap;
    }

    .dashboard-alerts__strip .alert-card {
        min-width: 220px;
        flex: 1 1 220px;
    }
}


/* ============================================
   PAGE: LEADS
   ============================================ */

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.page-header__left {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

.page-header__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    color: var(--color-dark);
    margin: 0;
}

.page-header__count {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
}

.page-header__actions,
.cal-day-header__actions,
.invoice-row__actions,
.payment-row__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.page-header__actions form,
.cal-day-header__actions form,
.invoice-row__actions form,
.payment-row__actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

/* --- Filter Tabs (horizontal scrolling status filters) --- */
.filter-tabs {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;

    scrollbar-width: none;
    padding-bottom: 2px;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
    flex-shrink: 0;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-body-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-muted);
    text-decoration: none;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-white);
    white-space: nowrap;
    transition: all 0.15s;
}

.filter-tab:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    text-decoration: none;
}

.filter-tab--active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.filter-tab--active:hover {
    color: var(--color-white);
}

/* --- Filter Chips --- */
.filter-chips {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}
.filter-chip {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-body-sm);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-mid);
    text-decoration: none;
    transition: all 0.15s ease;
}
.filter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.filter-chip--active { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }
.filter-chip--active:hover { color: var(--color-white); }
.filter-chip--success.filter-chip--active { background: var(--color-success); border-color: var(--color-success); }
.filter-chip--warning.filter-chip--active { background: var(--color-warning); border-color: var(--color-warning); }
.filter-chip--danger.filter-chip--active { background: var(--color-danger); border-color: var(--color-danger); }
.filter-chip--muted.filter-chip--active { background: var(--color-muted); border-color: var(--color-muted); }

/* --- Sort Bar --- */
.sort-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-body-sm);
}
.sort-bar__label {
    color: var(--color-muted);
    white-space: nowrap;
}
.sort-bar__option {
    color: var(--color-mid);
    text-decoration: none;
    padding: var(--space-xs) 0;
    border-bottom: 2px solid transparent;
}
.sort-bar__option:hover { color: var(--color-primary); text-decoration: none; }
.sort-bar__option--active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 500; }

/* --- Filter Bar (sort/source selectors) --- */
.filter-bar {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}
.filter-bar--secondary {
    padding-top: 0;
}

.filter-bar__form {
    display: flex;
    gap: var(--space-sm);
    flex: 1;
}

.form-control--sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-body-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    min-width: 0;
    flex: 1;
}

/* --- Search --- */
.leads-search {
    position: relative;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
}

.search__icon {
    position: absolute;
    left: var(--space-sm);
    color: var(--color-muted);
    pointer-events: none;
}

.search__input {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 36px;
    font-size: var(--font-body);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    outline: none;
    transition: border-color 0.15s;
}

.search__input:focus {
    border-color: var(--color-primary);
}

.search__clear {
    position: absolute;
    right: var(--space-sm);
    color: var(--color-muted);
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
}

/* --- Lead Card --- */
.lead-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--color-border), 0 1px 3px hsl(24 10% 10% / 0.06);
}

.lead-card {
    display: block;
    padding: var(--space-md);
    background: var(--color-white);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
    position: relative;
}

.lead-card:hover {
    background: var(--color-bg-secondary);
    text-decoration: none;
}

.lead-card__alert {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.lead-card__alert--danger {
    background: var(--color-danger);
}

.lead-card__alert--warning {
    background: var(--color-accent);
}

.lead-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.lead-card__name {
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-card__details {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-caption);
    color: var(--color-secondary);
    margin-bottom: 2px;
}

.lead-card__type {
    font-size: var(--font-caption);
    padding: 1px var(--space-xs);
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
}

.lead-card__date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lead-card__date--tbc {
    color: var(--color-muted);
    font-style: italic;
}

.lead-card__venue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-caption);
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.lead-card__activity {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--font-caption);
    color: var(--color-muted);
}

/* Urgent lead accent — amber stripe on left for items needing attention */
.lead-card--urgent {
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.lead-card--urgent-payment {
    box-shadow: inset 3px 0 0 var(--color-danger);
}

/* Hide tiny alert dots when we use the stripe instead */
.lead-card--urgent .lead-card__alert,
.lead-card--urgent-payment .lead-card__alert {
    display: none;
}

/* --- View Toggle --- */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-right: var(--space-sm);
}
.view-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0 var(--space-sm);
    height: 36px;
    background: var(--color-white);
    color: var(--color-mid);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.view-toggle__btn:hover {
    background: var(--color-bg);
    color: var(--color-dark);
}
.view-toggle__btn--active {
    background: var(--color-primary);
    color: var(--color-white);
}
.view-toggle__btn--active:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}
.view-toggle__btn + .view-toggle__btn {
    border-left: 1px solid var(--color-border);
}
.view-toggle__label {
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    line-height: 1;
}

/* --- Kanban / Pipeline Board --- */
.kanban {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;

    padding-bottom: var(--space-md);
    min-height: 400px;
}
.kanban__column {
    flex: 0 0 260px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 220px);
}
.kanban__column-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kanban__column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kanban__column-title {
    font-size: var(--font-body-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kanban__column-count {
    margin-left: auto;
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    background: var(--color-white);
    padding: 1px 7px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}
.kanban__column-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-xs) var(--space-xs);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-height: 60px;
}
.kanban__column-body.kanban__column-body--dragover {
    background: var(--color-primary-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.kanban__empty {
    padding: var(--space-lg) var(--space-sm);
    text-align: center;
    font-size: var(--font-body-sm);
    color: var(--color-muted);
}
/* Kanban cards: compact version of lead-card */
.kanban-card {
    display: block;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: grab;
    transition: box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.06);
    position: relative;
}
.kanban-card:hover {
    box-shadow: 0 2px 8px hsl(24 10% 10% / 0.1);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card.dragging {
    opacity: 0.5;
}
/* On mobile, stack kanban vertically */
@media (max-width: 767px) {
    .kanban {
        flex-direction: column;
        gap: var(--space-md);
    }
    .kanban__column {
        flex: none;
        min-width: 0;
        max-height: none;
    }
    .kanban__column-body {
        max-height: 300px;
    }
}
/* Desktop: wider columns */
@media (min-width: 1024px) {
    .kanban__column {
        flex: 0 0 280px;
        min-width: 280px;
    }
}

/* --- Star Rating Display --- */
.star-rating {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}
.star-rating__star {
    color: var(--color-border);
    display: inline-flex;
}
.star-rating__star--filled {
    color: #D97706;
}

/* --- Star Rating Input --- */
.star-input {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.star-input__label {
    cursor: pointer;
    display: inline-flex;
}
.star-input__radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.star-input__star {
    color: var(--color-border);
    transition: color 0.15s;
    display: inline-flex;
}
.star-input__radio:checked ~ .star-input__star,
.star-input__label:hover .star-input__star {
    color: #D97706;
}
/* Fill all stars up to hovered/checked one */
.star-input__label:hover ~ .star-input__label .star-input__star {
    color: var(--color-border);
}

/* --- Testimonial Quote --- */
.testimonial-quote {
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    border-left: 3px solid var(--color-primary);
    background: var(--color-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.testimonial-quote p {
    margin: 0 0 var(--space-sm);
    font-size: var(--font-body);
    font-style: italic;
    color: var(--color-dark);
    line-height: 1.6;
}
.testimonial-quote footer {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    font-style: normal;
}

/* --- Radio Group --- */
.radio-group {
    display: flex;
    gap: var(--space-md);
}
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    font-size: var(--font-body);
    color: var(--color-dark);
}

/* --- Card Variants --- */
.card--danger {
    border-left: 3px solid var(--color-danger, #DC2626);
}

/* --- Empty State Inline --- */
.empty-state--inline {
    text-align: center;
    padding: var(--space-lg);
    color: var(--color-muted);
}
.empty-state--inline p {
    margin: var(--space-sm) 0 0;
}

/* --- Infinite Scroll Loader --- */
.infinite-scroll-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    color: var(--color-muted);
    font-size: var(--font-body-sm);
}
.spinner--sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Active Filter Chips --- */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-radius: 999px;
    font-size: var(--font-body-sm);
    font-weight: var(--weight-medium);
    text-decoration: none;
    transition: background 0.15s;
}
.filter-chip:hover {
    background: var(--color-primary);
    color: var(--color-white);
}
.filter-chip__remove {
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
}
.filter-chip:hover .filter-chip__remove {
    opacity: 1;
}
.filter-chip--clear {
    background: transparent;
    color: var(--color-mid);
    border: 1px dashed var(--color-border);
}
.filter-chip--clear:hover {
    background: var(--color-bg);
    color: var(--color-dark);
}

/* --- Floating Action Button (Mobile) --- */
.fab {
    display: none;
    position: fixed;
    bottom: calc(var(--tab-bar-height, 64px) + var(--space-md));
    right: var(--space-md);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 4px 12px hsl(24 10% 10% / 0.2);
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 50;
    transition: transform 0.15s, box-shadow 0.15s;
}
.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px hsl(24 10% 10% / 0.25);
}
.fab:active {
    transform: scale(0.95);
}
@media (max-width: 767px) {
    .fab { display: flex; }
}

/* --- Tappable Status Pill Button --- */
.status-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 6px 2px 4px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color var(--motion-fast, 120ms) var(--motion-ease, ease-out),
                box-shadow var(--motion-fast, 120ms) var(--motion-ease, ease-out);
}
.status-pill-btn:hover,
.status-pill-btn:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
    outline: none;
}
.status-pill-btn__chevron {
    display: inline-flex;
    color: var(--color-muted);
    transition: transform var(--motion-fast, 120ms) var(--motion-ease, ease-out),
                color var(--motion-fast, 120ms) var(--motion-ease, ease-out);
}
.status-pill-btn:hover .status-pill-btn__chevron,
.status-pill-btn:focus-visible .status-pill-btn__chevron {
    color: var(--color-primary);
    transform: translateY(1px);
}

/* --- Change Status Bottom Sheet Options --- */
.status-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.status-option-form {
    margin: 0;
}
.status-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px var(--space-md);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.status-option:hover {
    background: var(--color-bg);
}
.status-option--current {
    background: var(--color-primary-light);
    cursor: default;
}
.status-option__check {
    color: var(--color-primary);
}

/* --- Lead Header (detail page) --- */
.lead-header {
    margin-bottom: var(--space-lg);
}

.lead-header__top {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}

.lead-header__name {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    color: var(--color-dark);
    margin: 0;
}

.lead-header__countdown {
    font-size: var(--font-body);
    color: var(--color-secondary);
    margin: 0 0 var(--space-sm);
}

.lead-header__actions {
    display: flex;
    gap: var(--space-sm);
}

.lead-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.15s;
}

.lead-header__action:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* --- Tab Nav (lead detail tabs) --- */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;

    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav__item {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-body-sm);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab-nav__item:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.tab-nav__item--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    margin-left: 4px;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    background: var(--color-bg);
    color: var(--color-muted);
    border-radius: var(--radius-full);
}

.tab-nav__item--active .tab-nav__badge {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.tab-content-header {
    display: flex;
    justify-content: flex-end;
}

/* --- Detail Grid --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.detail-row__icon {
    flex-shrink: 0;
    color: var(--color-muted);
    margin-top: 2px;
    display: inline-flex;
}

.detail-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label,
.detail-row__label {
    display: block;
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value,
.detail-row__value {
    display: block;
    font-size: var(--font-body);
    color: var(--color-dark);
    word-break: break-word;
}

.detail-value a,
.detail-row__value a {
    color: var(--color-primary);
    text-decoration: none;
}

.detail-value a:hover,
.detail-row__value a:hover {
    color: var(--color-primary-dark, #0F766E);
}

.detail-row--link {
    text-decoration: none;
    color: inherit;
    padding: var(--space-2);
    margin: calc(var(--space-2) * -1);
    border-radius: var(--radius-md);
    transition: background-color var(--motion-fast, 120ms) var(--motion-ease, ease-out);
}

.detail-row--link:hover {
    background-color: var(--color-light);
}

.detail-item__label {
    display: block;
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.detail-item__value {
    display: block;
    font-size: var(--font-body);
    color: var(--color-dark);
}

.detail-item__value--link {
    color: var(--color-primary);
    text-decoration: none;
}

.detail-item__value--link:hover {
    color: var(--color-primary-dark, #0F766E);
}

.detail-item__value--muted {
    color: var(--color-muted);
    font-style: italic;
}

/* --- Quote Card (in lead detail) --- */
.quote-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.quote-card {
    display: block;
    padding: var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}

.quote-card:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.quote-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.quote-card__number {
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
}

.quote-card__amount {
    font-size: var(--font-h3);
    font-weight: var(--weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.quote-card__meta {
    display: flex;
    gap: var(--space-md);
    font-size: var(--font-caption);
    color: var(--color-muted);
}

/* --- Checklist Items --- */
.checklist-item {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--color-border);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item__label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checklist-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* --- Assigned Staff --- */
.staff-assigned-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.staff-assigned-card:last-child { border-bottom: none; }

.staff-assigned-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.staff-assigned-card__name {
    font-weight: var(--weight-medium);
}

.staff-assigned-card__hours {
    font-size: var(--font-sm);
    color: var(--color-muted);
}

/* --- Payment Summary --- */
.payment-summary-strip {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-light);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    flex-wrap: wrap;
}

.payment-summary-strip__item {
    white-space: nowrap;
}

.payment-summary {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.payment-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.payment-summary__label {
    font-size: var(--font-body-sm);
    color: var(--color-secondary);
}

.payment-summary__value {
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
}

.payment-summary__bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    margin-top: var(--space-sm);
    overflow: hidden;
}

.payment-summary__progress {
    height: 100%;
    background: var(--color-success);
    border-radius: var(--radius-full);
    transition: width 0.3s;
}

.payment-summary__percent {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 4px;
    display: block;
}

/* --- Payment List --- */
.payment-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.payment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.payment-row__info {
    flex: 1;
    min-width: 0;
}

.payment-row__type {
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
}

.payment-row__method {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-left: var(--space-xs);
}

.payment-row__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.payment-row__amount {
    font-weight: var(--weight-semibold);
}

.payment-row__date {
    width: 100%;
    font-size: var(--font-caption);
    color: var(--color-muted);
}

/* --- Card variants --- */
.card--danger {
    border-left: 3px solid var(--color-danger);
}

.card--warning {
    border-left: 3px solid var(--color-accent);
}

/* --- Notes List --- */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.notes-list__item {
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-light);
}
.notes-list__item:last-child { border-bottom: none; padding-bottom: 0; }
.notes-list__meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.notes-list__author {
    font-weight: 600;
    font-size: var(--font-body-sm);
    color: var(--color-dark);
}
.notes-list__date {
    font-size: var(--font-xs, 11px);
    color: var(--color-muted);
}
.notes-list__body {
    font-size: var(--font-body-sm);
    color: var(--color-mid);
    line-height: 1.5;
}

/* --- Follow-up Actions --- */
.follow-up-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ============================================
   PAGE: QUOTES
   ============================================ */

/* --- Quote Header --- */
.quote-header {
    margin-bottom: var(--space-lg);
}

.quote-header__top {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}

.quote-header__number {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    color: var(--color-dark);
    margin: 0;
}

.quote-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    margin-bottom: var(--space-md);
}

.quote-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* --- Line Items (Quote Builder) --- */
.line-item {
    margin-bottom: var(--space-sm);
}

.line-item__fields {
    display: flex;
    gap: var(--space-xs);
    align-items: flex-start;
}

.line-item__desc {
    flex: 3;
    min-width: 0;
}

.line-item__qty {
    flex: 0 0 60px;
}

.line-item__price {
    flex: 0 0 100px;
    position: relative;
}

.line-item__currency {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: var(--font-body-sm);
    pointer-events: none;
}

.line-item__price .form-input {
    padding-left: 22px;
}

.line-item__total {
    flex: 0 0 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.line-item__total-value {
    font-weight: var(--weight-semibold);
    font-size: var(--font-body-sm);
    color: var(--color-dark);
    white-space: nowrap;
}

.line-item__remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1;
}

.line-item__remove:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background: var(--color-danger-light, #FEE2E2);
}

/* --- Line Items Subtotal --- */
.line-items-subtotal {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--color-border);
}

.line-items-subtotal__label {
    font-weight: var(--weight-semibold);
    color: var(--color-secondary);
}

.line-items-subtotal__value {
    font-size: var(--font-h3);
    font-weight: var(--weight-bold);
    color: var(--color-primary);
}

/* --- Quote Totals --- */
.quote-totals {
    padding: var(--space-sm) 0;
}

.quote-totals__row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    font-size: var(--font-body);
    color: var(--color-secondary);
}

.quote-totals__row--total {
    border-top: 2px solid var(--color-dark);
    margin-top: var(--space-xs);
    padding-top: var(--space-sm);
    font-size: var(--font-h3);
    font-weight: var(--weight-bold);
    color: var(--color-dark);
}

/* --- Quote Items Table (detail view) --- */
.quote-items-table {
    width: 100%;
    border-collapse: collapse;
}

.quote-items-table__th {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.quote-items-table__th--right {
    text-align: right;
}

.quote-items-table__td {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-body);
    color: var(--color-dark);
    border-bottom: 1px solid var(--color-bg);
}

.quote-items-table__td--right {
    text-align: right;
}

.card__body--no-pad {
    padding: 0;
}

.p-md {
    padding: var(--space-md);
}


/* --- Quote Totals: Discount & Deposit rows --- */
.quote-totals__row--discount {
    color: var(--color-danger);
}

.quote-totals__row--deposit {
    border-top: 1px dashed var(--color-primary-light);
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    color: var(--color-primary);
    font-weight: var(--weight-semibold);
}

/* --- Quote Header: Declined reason --- */
.quote-header__declined-reason {
    margin-bottom: var(--space-sm);
}

/* --- Line Item: Category column --- */
.line-item__cat {
    flex: 0 0 100px;
    min-width: 0;
}

/* ============================================
   QUOTE WIZARD
   ============================================ */

/* --- Progress Bar --- */
.wizard-progress {
    margin-bottom: var(--space-lg);
}

.wizard-progress__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--space-sm);
}

.wizard-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    min-width: 48px;
    font-family: inherit;
}

.wizard-progress__number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-body-sm);
    font-weight: var(--weight-semibold);
    background: var(--color-bg);
    color: var(--color-muted);
    border: 2px solid var(--color-border);
    transition: all 0.2s;
}

.wizard-progress__label {
    font-size: 11px;
    color: var(--color-muted);
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

.wizard-progress__line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    margin: 0 2px;
    margin-bottom: 20px;
}

.wizard-progress__step--active .wizard-progress__number {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.wizard-progress__step--active .wizard-progress__label {
    color: var(--color-primary);
    font-weight: var(--weight-semibold);
}

.wizard-progress__step--done .wizard-progress__number {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.wizard-progress__step--done .wizard-progress__label {
    color: var(--color-primary);
}

.wizard-progress__bar {
    height: 4px;
    background: var(--color-bg);
    border-radius: 2px;
    overflow: hidden;
}

.wizard-progress__fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* --- Wizard Steps --- */
.wizard-step {
    display: none;
}

.wizard-step--active {
    display: block;
    animation: wizard-fade-in 0.2s ease;
}

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

.wizard-step__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    margin: 0 0 var(--space-xs) 0;
}

/* --- Pricing Model Cards (Step 1) --- */
.pricing-model-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.pricing-model-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    background: var(--color-surface, #fff);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.pricing-model-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.1);
}

.pricing-model-card--selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.pricing-model-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 50%;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}

.pricing-model-card--selected .pricing-model-card__icon {
    background: var(--color-primary);
    color: #fff;
}

.pricing-model-card__title {
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    margin: 0 0 4px 0;
}

.pricing-model-card__desc {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    margin: 0;
    line-height: 1.4;
}

/* --- Saved Items Panel (Step 2) --- */
.saved-items-panel {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.saved-items-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.saved-items-panel__header .form-label {
    margin: 0;
    white-space: nowrap;
}

.saved-items-panel__header .form-input {
    max-width: 200px;
}

.saved-items-panel__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    max-height: 160px;
    overflow-y: auto;
}

.saved-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full, 999px);
    cursor: pointer;
    font-size: var(--font-body-sm);
    font-family: inherit;
    transition: all 0.15s;
}

.saved-item-chip:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.saved-item-chip__name {
    color: var(--color-dark);
}

.saved-item-chip__price {
    color: var(--color-muted);
    font-size: 12px;
}

.saved-item-chip svg {
    color: var(--color-primary);
}

/* --- Wizard Navigation --- */
.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    margin-top: var(--space-md);
    border-top: 1px solid var(--color-border);
    position: sticky;
    bottom: 0;
    background: var(--color-surface, #fff);
    z-index: 10;
}

.wizard-nav__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.wizard-nav__autosave {
    font-style: italic;
}

/* --- Discount type toggle --- */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* --- Deposit preview card --- */
.card--muted {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    box-shadow: none;
}

/* --- Card warning variant --- */
.card--warning {
    border: 1px solid var(--color-accent);
    background: var(--color-accent-light, #FFFBEB);
}

/* --- Success button variant --- */
.btn--success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

.btn--success:hover {
    filter: brightness(0.9);
}

@media (min-width: 768px) {
    .pricing-model-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .line-item__cat {
        flex: 0 0 120px;
    }
}

/* ============================================
   12. RESPONSIVE OVERRIDES
   ============================================ */

/* Tablet (768px+) */
@media (min-width: 768px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-collapsed);
    }

    .sidebar__label,
    .sidebar__heading {
        display: none;
    }

    .sidebar__item {
        justify-content: center;
        padding: 10px;
    }

    .sidebar__logo-link {
        font-size: 0;
    }

    .sidebar__logo-vendor,
    .sidebar__logo-pad {
        font-size: var(--font-h3);
    }

    .top-bar__menu-btn {
        display: none;
    }

    .top-bar__business {
        display: inline;
    }

    .tab-bar {
        display: none;
    }

    .app-content {
        padding: var(--space-lg);
        padding-bottom: var(--space-lg);
    }

    /* Grid responsive */
    .grid--2 { grid-template-columns: 1fr 1fr; }
    .grid--3 { grid-template-columns: 1fr 1fr 1fr; }

    /* Detail grid 2 columns on tablet+ */
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Filter bar inline */
    .filter-bar__form {
        flex-wrap: nowrap;
    }

    /* Bottom sheet hidden on tablet+ unless open */
    .bottom-sheet:not(.bottom-sheet--open) { display: none !important; }

    /* FAB hidden on tablet+ */
    .fab { display: none; }

    /* Base .modal already centres + scales — tablet+ override no longer needed. */

    /* Toast top-right on tablet+ */
    .flash-messages {
        left: auto;
        right: var(--space-md);
        transform: none;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .sidebar {
        width: var(--sidebar-width);
    }

    .sidebar__label,
    .sidebar__heading {
        display: block;
    }

    .sidebar__item {
        justify-content: flex-start;
        padding: 10px var(--space-md);
    }

    .sidebar__logo-link {
        font-size: var(--font-h2);
    }

    .app-content {
        padding: var(--space-xl);
        max-width: var(--content-max-width);
    }

    /* Grid responsive */
    .grid--3 { grid-template-columns: 1fr 1fr 1fr; }
    .grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

    /* Form section card padding on desktop */
    fieldset.form-section {
        padding: var(--space-lg);
    }

    /* Form rows allow two columns */
    .form-row {
        flex-direction: row;
    }

    /* Breadcrumbs visible on desktop */
    .breadcrumbs {
        display: flex;
        align-items: center;
    }
}

/* Mobile-only form row stacking */
@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-footer {
        position: sticky;
        bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px));
        background: var(--color-white);
        margin: var(--space-lg) calc(-1 * var(--space-md)) 0;
        padding: var(--space-md);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -2px 4px hsl(24 10% 10% / 0.05);
    }

    .form-footer .btn {
        flex: 1;
    }

    /* Pagination simplified on mobile */
    .pagination__btn--page {
        display: none;
    }
}


/* ============================================
   CALENDAR MODULE
   ============================================ */

/* Calendar Header */
.cal-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.cal-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.cal-header__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--color-mid);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.cal-header__nav-btn:hover {
    background: var(--color-light);
    color: var(--color-primary);
}

.cal-header__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-dark);
    min-width: 180px;
    text-align: center;
}

.cal-header__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cal-header__add-label {
    display: none;
}

/* View Mode Toggle */
.cal-view-toggle {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cal-view-toggle__btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-mid);
    text-decoration: none;
    border-right: 1px solid var(--color-border);
    transition: background-color 0.15s, color 0.15s;
}

.cal-view-toggle__btn:last-child {
    border-right: none;
}

.cal-view-toggle__btn:hover {
    background: var(--color-light);
}

.cal-view-toggle__btn--active {
    background: var(--color-primary);
    color: var(--color-white);
}

.cal-view-toggle__btn--active:hover {
    background: var(--color-primary-dark);
}

/* ── Month View ── */
.cal-month {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-white);
}

.cal-month__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--color-light);
    border-bottom: 1px solid var(--color-border);
}

.cal-month__dow {
    padding: var(--space-xs);
    text-align: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-month__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-month__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xs);
    min-height: 48px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-dark);
    transition: background-color 0.15s;
    cursor: pointer;
    position: relative;
}

.cal-month__cell:nth-child(7n) {
    border-right: none;
}

.cal-month__cell:hover {
    background: var(--color-primary-light);
}

.cal-month__cell--other {
    opacity: 0.4;
    background: var(--color-light);
}

.cal-month__cell--today .cal-month__date {
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-month__cell--selected {
    background: var(--color-primary-light);
}

.cal-month__date {
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
}

.cal-month__dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    align-items: center;
}

.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-dot--confirmed {
    background: #0F766E;
}

.cal-dot--provisional {
    background: #D97706;
}

.cal-dot--completed {
    background: var(--color-success);
}

.cal-dot--cancelled {
    background: var(--color-muted);
}

.cal-dot--google {
    background: #5EEAD4;
}

.cal-dot--holiday {
    background: var(--color-border);
}

.cal-month__more {
    font-size: 10px;
    color: var(--color-muted);
    white-space: nowrap;
}

/* ── Week View ── */
.cal-week {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-white);
}

.cal-week__header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-light);
}

.cal-week__day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xs);
    gap: 2px;
}

.cal-week__day-header--today {
    background: var(--color-primary-light);
}

.cal-week__day-name {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
}

.cal-week__day-num {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-dark);
    text-decoration: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cal-week__day-num:hover {
    background: var(--color-primary-light);
}

.cal-week__day-num--today {
    background: var(--color-primary);
    color: var(--color-white);
}

.cal-week__day-num--today:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.cal-week__allday {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-light);
    min-height: 32px;
}

.cal-week__allday-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px 4px;
    border-right: 1px solid var(--color-border);
    align-items: center;
}

.cal-week__allday-cell:last-child {
    border-right: none;
}

.cal-week__allday-event {
    display: block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: var(--color-white);
}

.cal-week__body {
    max-height: 600px;
    overflow-y: auto;
    position: relative;
}

.cal-week__now-line {
    position: absolute;
    left: 60px;
    right: 0;
    height: 2px;
    background: var(--color-danger);
    z-index: 10;
    pointer-events: none;
}

.cal-week__now-dot {
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-danger);
}

.cal-week__row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    min-height: 48px;
    border-bottom: 1px solid var(--color-border);
}

.cal-week__row:last-child {
    border-bottom: none;
}

.cal-week__time-gutter {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-xs);
    border-right: 1px solid var(--color-border);
    background: var(--color-light);
}

.cal-week__time-label {
    font-size: var(--text-xs);
    color: var(--color-muted);
    font-weight: 500;
}

.cal-week__cell {
    position: relative;
    border-right: 1px solid var(--color-border);
    min-height: 48px;
}

.cal-week__cell:last-child {
    border-right: none;
}

.cal-week__event {
    display: block;
    position: absolute;
    left: 2px;
    right: 2px;
    top: 2px;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    line-height: 1.3;
    text-decoration: none;
    color: var(--color-white);
    overflow: hidden;
    z-index: 1;
}

.cal-event--confirmed {
    background: #0F766E;
}

.cal-event--provisional {
    background: #D97706;
}

.cal-event--completed {
    background: var(--color-success);
}

.cal-event--cancelled {
    background: var(--color-muted);
    opacity: 0.6;
}

.cal-week__event-time {
    font-weight: 600;
    display: block;
}

.cal-week__event-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Day View (inline on calendar page) ── */
.cal-day-inline {
    margin-top: var(--space-sm);
}

/* ── Event Cards (used in day view and inline day) ── */
.cal-day-events {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.cal-event-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-muted);
    text-decoration: none;
    color: var(--color-dark);
    transition: box-shadow 0.15s, border-color 0.15s;
}

a.cal-event-card:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-primary);
}

.cal-event-card--confirmed {
    border-left-color: #0F766E;
}

.cal-event-card--provisional {
    border-left-color: #D97706;
}

.cal-event-card--completed {
    border-left-color: var(--color-success);
}

.cal-event-card--cancelled {
    border-left-color: var(--color-muted);
    opacity: 0.7;
}

.cal-event-card--past {
    opacity: 0.6;
}

.cal-event-card__time {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 80px;
    flex-shrink: 0;
}

.cal-event-card__time-range {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-dark);
    white-space: nowrap;
}

.cal-event-card__setup {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-bottom: 2px;
}

.cal-event-card__details {
    flex: 1;
    min-width: 0;
}

.cal-event-card__title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-dark);
    margin: 0 0 var(--space-xs) 0;
}

.cal-event-card__title-link {
    text-decoration: none;
    color: inherit;
}

.cal-event-card__title-link:hover .cal-event-card__title {
    color: var(--color-primary);
}

.cal-event-card__venue {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin: 0 0 var(--space-xs) 0;
}

.cal-event-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cal-event-card__guests {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.cal-event-card__payment {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
}

.cal-event-card__payment--paid {
    color: var(--color-success);
}

.cal-event-card__payment--partial {
    color: var(--color-accent);
}

.cal-event-card__payment--unpaid {
    color: var(--color-danger);
}

.cal-event-card__staff {
    display: flex;
    gap: 4px;
    margin-top: var(--space-xs);
}

.cal-event-card__staff-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    border: 2px solid var(--color-white);
}

.cal-event-card__status {
    flex-shrink: 0;
    align-self: flex-start;
}

/* ── Day Header ── */
.cal-day-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.cal-day-header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cal-day-header__info {
    flex: 1;
    text-align: center;
}

.cal-day-header__date {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-dark);
    margin: 0;
}

.cal-day-header__context {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.cal-day-header__context--today {
    color: var(--color-primary);
    font-weight: 600;
}

.cal-day-actions {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

/* ── Day Timeline ── */
.cal-timeline {
    position: relative;
    margin-left: 0;
    border-left: 1px solid var(--color-border);
    margin-top: var(--space-md);
    overflow-y: auto;

}
.cal-timeline__row {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    pointer-events: none;
}
.cal-timeline__label {
    width: 56px;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--color-muted);
    text-align: right;
    padding-right: var(--space-xs);
    transform: translateY(-7px);
    user-select: none;
}
.cal-timeline__label--half {
    visibility: hidden;
}
.cal-timeline__line {
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.cal-timeline__line--half {
    background: var(--color-border);
    opacity: 0.4;
}
.cal-timeline__row--last .cal-timeline__line {
    background: var(--color-border);
}
.cal-timeline__events {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}
.cal-timeline__block {
    position: absolute;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--color-white);
    text-decoration: none;
    overflow: hidden;
    pointer-events: auto;
    cursor: pointer;
    transition: box-shadow 0.15s, opacity 0.15s;
    min-height: 24px;
}
.cal-timeline__block:hover {
    box-shadow: 0 2px 8px hsl(24 10% 10% / 0.2);
    z-index: 2;
}
.cal-timeline__block--past {
    opacity: 0.55;
}
.cal-timeline__block-inner {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    height: 100%;
}
.cal-timeline__block-time {
    font-weight: var(--weight-semibold);
    font-size: 11px;
    opacity: 0.9;
}
.cal-timeline__block-title {
    font-weight: var(--weight-semibold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-timeline__block-venue {
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-timeline__block-meta {
    display: flex;
    gap: var(--space-xs);
    font-size: 11px;
    opacity: 0.85;
    margin-top: auto;
}
.cal-timeline__block-payment--paid { color: var(--color-success-light); }
.cal-timeline__block-payment--partial { color: var(--color-accent-light); }
.cal-timeline__block-payment--unpaid { color: var(--color-danger-light); }

/* Timeline event status colours */
.cal-event--confirmed { background: #0F766E; }
.cal-event--provisional { background: #D97706; }
.cal-event--booked { background: #0F766E; }
.cal-event--deposit_paid,
.cal-event--deposit-paid { background: var(--color-primary); }
.cal-event--balance_paid,
.cal-event--balance-paid { background: #059669; }
.cal-event--completed { background: var(--color-success); }
.cal-event--cancelled { background: var(--color-muted); opacity: 0.7; }
.cal-event--enquiry { background: #6366F1; }
.cal-event--quoted { background: #8B5CF6; }

/* Setup time (lighter block) */
.cal-timeline__setup {
    position: absolute;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    opacity: 0.35;
    pointer-events: none;
}
.cal-timeline__setup-label {
    font-size: 10px;
    color: var(--color-white);
    padding: 2px 6px;
}

/* Current time indicator */
.cal-timeline__now {
    position: absolute;
    left: 56px;
    right: 0;
    display: flex;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}
.cal-timeline__now-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #EF4444;
    flex-shrink: 0;
    margin-left: -5px;
}
.cal-timeline__now-line {
    flex: 1;
    height: 2px;
    background: #EF4444;
}
.cal-timeline__now-time {
    font-size: 10px;
    font-weight: var(--weight-semibold);
    color: #EF4444;
    padding-left: 4px;
    white-space: nowrap;
}

/* All-day events banner */
.cal-allday-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--color-border);
}
.cal-allday-banner__label {
    font-size: var(--font-body-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-mid);
    white-space: nowrap;
}
.cal-allday-banner__events {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.cal-allday-event {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-body-sm);
    color: var(--color-white);
    text-decoration: none;
}

/* ── Calendar Empty State ── */
.cal-empty {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--color-muted);
}

.cal-empty__text {
    margin-bottom: var(--space-md);
    font-size: var(--text-base);
}

/* ── Availability Module ── */
.cal-avail-legend {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
    font-size: var(--text-sm);
    color: var(--color-mid);
}

.cal-avail-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-avail-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-avail-legend__dot--available {
    background: var(--color-success);
}

.cal-avail-legend__dot--unavailable {
    background: var(--color-danger);
}

.cal-avail-legend__dot--event {
    background: var(--color-primary);
}
.cal-avail-legend__dot--holiday {
    background: var(--color-border);
}

.cal-avail__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-avail__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-xs);
    min-height: 52px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.15s;
    background: var(--color-white);
    color: var(--color-dark);
    text-decoration: none;
}

a.cal-avail__cell:hover,
a.cal-avail__cell:focus-visible {
    text-decoration: none;
}

.cal-avail__cell:nth-child(7n) {
    border-right: none;
}

.cal-avail__cell:hover {
    opacity: 0.8;
}

.cal-avail__cell--other {
    opacity: 0.3;
    cursor: default;
}

.cal-avail__cell--past {
    opacity: 0.4;
    cursor: default;
}

.cal-avail__cell--today .cal-avail__date {
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-avail__cell--available {
    background: var(--color-success-light);
}

.cal-avail__cell--unavailable {
    background: var(--color-danger-light);
}

.cal-avail__cell--event {
    background: var(--color-primary-light);
}

a.cal-avail__cell--event {
    cursor: pointer;
}

a.cal-avail__cell--event:hover {
    background: var(--color-primary-lighter, var(--color-primary-light));
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.cal-avail__date {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-dark);
    line-height: 1;
}

.cal-avail__reason {
    font-size: 10px;
    color: var(--color-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.cal-avail__event-count {
    font-size: 10px;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 2px;
}

/* Availability Modal */
.cal-avail-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-avail-modal__backdrop {
    position: absolute;
    inset: 0;
    background: hsl(24 10% 10% / 0.4);
}

.cal-avail-modal__content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.cal-avail-modal__title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 var(--space-md) 0;
}

.cal-avail-modal__date {
    font-size: var(--text-base);
    color: var(--color-mid);
    margin-bottom: var(--space-md);
}

.cal-avail-modal__options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.cal-avail-modal__option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--color-dark);
}

.cal-avail-modal__option input[type="radio"] {
    accent-color: var(--color-primary);
}

/* Availability Blocks List */
.cal-avail-blocks {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.cal-avail-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-danger-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-danger);
}

.cal-avail-block__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-avail-block__date {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-dark);
}

.cal-avail-block__reason {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

/* --- Google Calendar Banner --- */
.cal-google-banner {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-body-sm);
}
.cal-google-banner--connected {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}
.cal-google-banner--disconnected {
    background: #FEF3C7;
    color: var(--color-warning-dark);
}
.cal-google-banner__sync {
    color: var(--color-muted);
    margin-left: auto;
    font-size: var(--font-caption);
}
.cal-google-banner__action {
    margin-left: var(--space-sm);
}

/* --- Clash Detection Indicators --- */
.cal-clash-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 2;
}
.cal-clash-dot--danger {
    background: #DC2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}
.cal-clash-dot--warning {
    background: #D97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.3);
}
.cal-clash-dot--info {
    background: #2563EB;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

/* --- Clash Warning Banners --- */
.cal-clash-warnings {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.cal-clash-warning {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-body-sm);
    font-weight: var(--weight-medium);
}
.cal-clash-warning--danger {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 3px solid #DC2626;
}
.cal-clash-warning--warning {
    background: #FEF3C7;
    color: var(--color-warning-dark);
    border-left: 3px solid #D97706;
}
.cal-clash-warning--info {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    border-left: 3px solid var(--color-info);
}

/* Google Calendar event styling */
.cal-event--google {
    background: #CCFBF1 !important;
    color: var(--color-primary-dark) !important;
    border-left: 2px solid #5EEAD4 !important;
    opacity: 0.85;
}
.cal-week__event-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    opacity: 0.6;
}

/* --- Maybe State (amber) --- */
.cal-avail-legend__dot--maybe {
    background: #D97706;
}
.cal-avail__cell--maybe {
    background: #FEF3C7;
    border-color: #D97706;
}

/* --- Team Availability Grid --- */
.team-avail-grid {
    display: grid;
    gap: 1px;
    background: var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    overflow-x: auto;
}
.team-avail-grid__row {
    display: grid;
    grid-template-columns: 120px repeat(14, 1fr);
    min-width: 0;
}
.team-avail-grid__row--header {
    position: sticky;
    top: 0;
    z-index: 1;
}
.team-avail-grid__name {
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-white);
    font-size: var(--font-body-sm);
    font-weight: var(--weight-medium);
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    position: sticky;
    left: 0;
    z-index: 1;
}
.team-avail-grid__cell {
    padding: var(--space-xs);
    background: var(--color-white);
    min-width: 40px;
    text-align: center;
    font-size: var(--font-caption);
    display: flex;
    align-items: center;
    justify-content: center;
}
.team-avail-grid__cell--header {
    flex-direction: column;
    gap: 1px;
    background: var(--color-bg);
    font-weight: var(--weight-medium);
}
.team-avail-grid__cell--today {
    background: var(--color-primary-light) !important;
}
.team-avail-grid__dow {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--color-muted);
}
.team-avail-grid__date {
    font-size: var(--font-body-sm);
    color: var(--color-dark);
}
.team-avail-grid__cell--available {
    background: var(--color-success-light);
}
.team-avail-grid__cell--maybe {
    background: #FEF3C7;
}
.team-avail-grid__cell--unavailable {
    background: #FEE2E2;
}
.team-avail-grid__cell--event {
    background: var(--color-primary-light);
}
.team-avail-grid__cell--holiday {
    background: var(--color-border);
}
.team-avail-grid__count {
    font-size: 10px;
    font-weight: var(--weight-semibold);
    color: var(--color-primary-dark);
}
/* Clickable team grid cells */
a.team-avail-grid__cell {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.team-avail-grid__cell:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Staff Availability on Day View */
.cal-day-staff__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.cal-day-staff__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 160px;
    flex: 1 1 160px;
}
.cal-day-staff__info {
    display: flex;
    flex-direction: column;
}

/* Bulk Select Mode for Availability */
.cal-avail__grid--bulk .cal-avail__cell {
    cursor: pointer;
}
.cal-avail__cell--bulk-selected {
    background: var(--color-primary-light) !important;
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Calendar Responsive */
@media (min-width: 768px) {
    .cal-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cal-header__add-label {
        display: inline;
    }

    .cal-month__cell {
        min-height: 72px;
        padding: var(--space-sm);
        align-items: flex-start;
    }

    .cal-month__date {
        font-size: var(--text-base);
    }

    .cal-week__body {
        max-height: 700px;
    }

    .cal-event-card {
        padding: var(--space-lg);
    }

    .cal-day-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cal-day-header__nav {
        flex: none;
    }
}

@media (min-width: 1024px) {
    .cal-month__cell {
        min-height: 90px;
    }

    .cal-header__title {
        font-size: var(--text-xl);
    }

    .cal-week__body {
        max-height: 800px;
    }
}


/* ============================================
   MONEY MODULE
   ============================================ */

/* Money Header */
.money-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.money-header__title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-dark);
    margin: 0;
}

.money-header__filter {
    flex-shrink: 0;
}

/* Summary Cards */
.money-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.money-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
    text-decoration: none;
    color: var(--color-dark);
    transition: box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
}

.money-card:hover {
    box-shadow: var(--shadow-md);
}

.money-card--warning {
    box-shadow: inset 3px 0 0 var(--color-accent),
                0 1px 2px hsl(24 10% 10% / 0.04),
                0 1px 3px hsl(24 10% 10% / 0.06);
}

.money-card--warning:hover {
    box-shadow: inset 3px 0 0 var(--color-accent), var(--shadow-md);
}

.money-card--danger {
    box-shadow: inset 3px 0 0 var(--color-danger),
                0 1px 2px hsl(24 10% 10% / 0.04),
                0 1px 3px hsl(24 10% 10% / 0.06);
}

.money-card--danger:hover {
    box-shadow: inset 3px 0 0 var(--color-danger), var(--shadow-md);
}

.money-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.money-card__icon--revenue {
    background: var(--color-success-light);
    color: var(--color-success);
}

.money-card__icon--outstanding {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.money-card__icon--expenses {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.money-card__icon--profit {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.money-card__value {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.2;
}

.money-card__label {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: 2px;
}

.money-card__trend {
    display: block;
    font-size: var(--font-xs, 11px);
    margin-top: 4px;
}
.money-card__trend--up { color: var(--color-success); }
.money-card__trend--down { color: var(--color-danger); }
.money-card__trend--neutral { color: var(--color-muted); }

/* Overdue Section */
.money-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.money-overdue-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.money-overdue-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-danger);
    border-radius: var(--radius-md);
}

.money-overdue-row__info {
    flex: 1;
    min-width: 0;
}

.money-overdue-row__name {
    font-weight: 600;
    color: var(--color-dark);
    text-decoration: none;
    display: block;
}

a.money-overdue-row__name:hover {
    color: var(--color-primary);
}

.money-overdue-row__meta {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    margin-top: 2px;
}

.money-overdue-row__amount {
    text-align: right;
    flex-shrink: 0;
}

.money-overdue-row__value {
    font-weight: 700;
    font-size: var(--text-base);
    display: block;
}

.money-overdue-row__days {
    font-size: var(--text-xs);
    display: block;
}

/* All Clear Banner */
.money-all-clear {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-success-light);
    color: var(--color-success);
    border-radius: var(--radius-lg);
    font-weight: 600;
}

/* Quick Links */
.money-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.money-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-mid);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: border-color 0.15s, color 0.15s;
}

.money-link-card:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Payment List */
.payment-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-dark);
    transition: box-shadow 0.15s;
}

.payment-row:hover {
    box-shadow: var(--shadow-sm);
}

.payment-row__info {
    flex: 1;
    min-width: 0;
}

.payment-row__name {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.payment-row__meta {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-wrap: wrap;
}

.payment-row__right {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.payment-row__amount {
    font-weight: 700;
    font-size: var(--text-base);
}

.payment-row__days {
    font-size: var(--text-xs);
}

/* Expense List */
.expense-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.expense-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.expense-row__info {
    flex: 1;
    min-width: 0;
}

.expense-row__desc {
    font-weight: 600;
    color: var(--color-dark);
    display: block;
    margin-bottom: 2px;
}

.expense-row__meta {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.expense-row__right {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.expense-row__amount {
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--color-dark);
}

.expense-row--expandable {
    flex-wrap: wrap;
    cursor: pointer;
}

.expense-row__chevron {
    transition: transform 0.2s ease;
    color: var(--color-muted);
}

.expense-row--expanded .expense-row__chevron {
    transform: rotate(180deg);
}

.expense-row__detail {
    display: none;
    width: 100%;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-sm);
}

.expense-row--expanded .expense-row__detail {
    display: block;
}

.expense-row__actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

/* Report Styles */
.report-summary {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.report-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.report-summary__row:last-child {
    border-bottom: none;
}

.report-summary__row--total {
    background: var(--color-light);
}

.report-summary__label {
    font-weight: 500;
    color: var(--color-mid);
}

.report-summary__row--total .report-summary__label {
    font-weight: 700;
    color: var(--color-dark);
}

.report-summary__value {
    font-weight: 700;
    font-size: var(--text-lg);
}

.report-summary__row--total .report-summary__value {
    font-size: var(--text-xl);
}

/* Margin Bar */
.report-margin {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
}

.report-margin__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.report-margin__label {
    font-weight: 500;
    color: var(--color-mid);
}

.report-margin__value {
    font-weight: 700;
    font-size: var(--text-lg);
}

.report-margin__bar {
    height: 8px;
    background: var(--color-light);
    border-radius: 4px;
    overflow: hidden;
}

.report-margin__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.report-margin__fill--positive {
    background: var(--color-success);
}

.report-margin__fill--negative {
    background: var(--color-danger);
}

/* --- Profit Bar Chart --- */

.profit-chart {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.profit-chart__title {
    font-size: var(--font-sm);
    font-weight: 600;
    margin: 0 0 var(--space-sm) 0;
}

.profit-chart__legend {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: var(--font-sm);
    color: var(--color-muted);
}

.profit-chart__legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.profit-chart__legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.profit-chart__legend-dot--revenue {
    background: var(--color-success);
}

.profit-chart__legend-dot--expense {
    background: var(--color-error);
}

.profit-chart__legend-dot--profit {
    background: var(--color-primary);
}

.profit-chart__bars {
    display: flex;
    align-items: flex-end;
    gap: var(--space-xs);
    height: 180px;
    padding-bottom: var(--space-lg);
    overflow-x: auto;
}

.profit-chart__group {
    flex: 1;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.profit-chart__bar-pair {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
}

.profit-chart__bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.profit-chart__bar--revenue {
    background: var(--color-success);
    opacity: 0.8;
}

.profit-chart__bar--expense {
    background: var(--color-error);
    opacity: 0.7;
}

.profit-chart__profit-line {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 2px;
}

.profit-chart__label {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 2px;
}

/* --- Filter Button Active State --- */

.btn--ghost-active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Report Cards */
.report-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

/* Report Total */
.report-total {
    text-align: center;
    padding: var(--space-xl);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.report-total__label {
    font-size: var(--text-sm);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.report-total__value {
    font-size: var(--text-2xl, 1.875rem);
    font-weight: 700;
    color: var(--color-primary);
}

/* Revenue Chart (simple horizontal bars) */
.revenue-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.revenue-chart__row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.revenue-chart__label {
    width: 70px;
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-mid);
}

.revenue-chart__bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--color-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.revenue-chart__bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    min-width: 2px;
    transition: width 0.3s ease;
}

.revenue-chart__value {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-dark);
    text-align: right;
    min-width: 100px;
}

/* Text utilities */
.text-lg {
    font-size: var(--text-lg);
}

.text-primary {
    color: var(--color-primary);
}

.ml-sm {
    margin-left: var(--space-sm);
}

/* Money responsive */
@media (min-width: 768px) {
    .money-summary {
        grid-template-columns: repeat(4, 1fr);
    }

    .money-links {
        grid-template-columns: repeat(4, 1fr);
    }

    .revenue-chart__label {
        width: 90px;
    }

    .revenue-chart__value {
        min-width: 150px;
    }
}


/* ============================================
   SETTINGS MODULE
   ============================================ */

/* Settings Page Header */
.settings-page-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.settings-page-header__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary);
    flex-shrink: 0;
}

/* Settings Categories */
.settings-category {
    margin-bottom: var(--space-xl);
}

.settings-category__title {
    font-size: var(--font-body-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

/* Settings Card Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .settings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Settings Card */
.settings-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-dark);
    transition: box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
}

.settings-card:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.settings-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.settings-card:hover .settings-card__icon {
    transform: scale(1.08);
}

/* Icon colour variants */
.settings-card__icon--amber {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.settings-card__icon--green {
    background: var(--color-success-light);
    color: var(--color-success);
}

.settings-card__icon--blue {
    background: var(--color-info-light);
    color: var(--color-info);
}

.settings-card__icon--purple {
    background: #F3E8FF;
    color: #7C3AED;
}

.settings-card__icon--danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.settings-card__info {
    flex: 1;
    min-width: 0;
}

.settings-card__label {
    display: block;
    font-weight: var(--weight-semibold);
    font-size: var(--font-body);
    color: var(--color-dark);
}

.settings-card__desc {
    display: block;
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    margin-top: 2px;
}

/* Danger card variant */
.settings-card--danger {
    padding: 0;
    border: none;
    box-shadow: none;
    background: none;
}

.settings-card--danger:hover {
    box-shadow: none;
    border-color: transparent;
    transform: none;
}

.settings-card__btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.settings-card__btn:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    box-shadow: var(--shadow-md);
}

.settings-card__btn:hover .settings-card__label {
    color: var(--color-danger);
}

/* Legacy settings-menu (used in sub-pages sidebar fallback) */
.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-white);
    text-decoration: none;
    color: var(--color-dark);
    transition: background-color 0.15s;
}

.settings-menu__item:hover {
    background: var(--color-light);
}

.settings-menu__item--danger {
    color: var(--color-danger);
}

.settings-menu__item--danger:hover {
    background: var(--color-danger-light);
}

.settings-menu__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary);
    flex-shrink: 0;
}

.settings-menu__item--danger .settings-menu__icon {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.settings-menu__info {
    flex: 1;
    min-width: 0;
}

.settings-menu__label {
    display: block;
    font-weight: 600;
    font-size: var(--text-base);
}

.settings-menu__desc {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: 1px;
}

/* --- More Menu Badges --- */

.more-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    flex-shrink: 0;
    margin-right: var(--space-xs);
}

.more-badge--warning {
    background: var(--color-warning);
    color: var(--color-dark);
}

.more-badge--danger {
    background: var(--color-error);
}

/* Settings Layout — Sidebar on Desktop */
.settings-layout {
    display: block;
}

.settings-layout__content {
    display: none;
}

@media (min-width: 768px) {
    .settings-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: var(--space-xl);
        align-items: start;
    }

    .settings-layout__sidebar {
        position: sticky;
        top: var(--space-lg);
    }

    .settings-layout__content {
        display: block;
        padding-top: var(--space-xl);
    }
}

/* Notification Table */
.notif-table {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.notif-table__header {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-light);
    border-bottom: 1px solid var(--color-border);
}

.notif-table__label-header,
.notif-table__toggle-header {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notif-table__toggle-header {
    text-align: center;
}

.notif-table__row {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.notif-table__row:last-child {
    border-bottom: none;
}

.notif-table__label {
    font-size: var(--text-sm);
    color: var(--color-dark);
}

.notif-table__toggle {
    display: flex;
    justify-content: center;
    cursor: pointer;
}

/* Toggle Switch (used in notifications) */
.toggle-switch {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--color-border);
    border-radius: 10px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--color-white);
    border-radius: 50%;
    transition: transform 0.2s;
}

.notif-table__toggle input[type="checkbox"] {
    display: none;
}

.notif-table__toggle input[type="checkbox"]:checked + .toggle-switch {
    background: var(--color-primary);
}

.notif-table__toggle input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(16px);
}


/* ============================================
   13. PRINT STYLES
   ============================================ */

/* ── Error Pages ── */

.error-page {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    max-width: 480px;
    margin: 0 auto;
}

.error-page__icon {
    margin-bottom: var(--space-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.error-page__icon--muted {
    background: var(--color-light);
    color: var(--color-muted);
}

.error-page__icon--danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.error-page__code {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1;
}

.error-page__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0 0 var(--space-sm) 0;
}

.error-page__message {
    font-size: 0.9375rem;
    color: var(--color-muted);
    line-height: 1.5;
    margin: 0 0 var(--space-lg) 0;
}

.error-page__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

@media (min-width: 480px) {
    .error-page__actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* ── Billing & Plans ── */

.billing-plan {
    display: flex;
    flex-direction: column;
    position: relative;
    gap: var(--space-xs);
}

.billing-plan__info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.billing-plan__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0;
}

.billing-plan__detail {
    font-size: 0.875rem;
    margin: 0;
}

.billing-actions {
    display: flex;
    flex-direction: column;
}

.plan-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 480px) {
    .plan-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.plan-card {
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    position: relative;
}

.plan-card--highlight {
    border-color: var(--color-primary);
}

.plan-card--current {
    background: var(--color-primary-light);
}

.plan-card__badge {
    position: absolute;
    top: -12px;
    right: var(--space-md);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 99px;
}

.plan-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.plan-card__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0;
}

.plan-card__price {
    margin-bottom: var(--space-xs);
}

.plan-card__amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
}

.plan-card__period {
    font-size: 0.875rem;
    color: var(--color-muted);
}

.plan-card__saving {
    font-size: 0.8125rem;
    margin: 0 0 var(--space-sm) 0;
}

.plan-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md) 0;
    flex: 1;
}

.plan-card__features li {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--color-mid);
    padding: 4px 0;
}

.plan-card__features svg {
    color: var(--color-success);
    flex-shrink: 0;
}

/* Stripe Elements card input */
.stripe-card-element {
    padding: 12px var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    background: var(--color-white);
    height: 44px;
}

.stripe-card-element .StripeElement {
    width: 100%;
}

.stripe-card-element:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 117, 112, 0.15);
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.btn-spinner svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Invoice list */
.invoice-list {
    display: flex;
    flex-direction: column;
}

.invoice-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.invoice-row:last-child {
    border-bottom: none;
}

.invoice-row__info {
    flex: 1;
    min-width: 0;
}

.invoice-row__number {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-dark);
    display: block;
}

.invoice-row__date {
    font-size: 0.8125rem;
    color: var(--color-muted);
}

.invoice-row__amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-dark);
    white-space: nowrap;
}

/* ── Onboarding Checklist ── */

.onboarding {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0A5F5B 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    color: var(--color-white);
    animation: fadeIn 0.4s ease-out;
}

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

.onboarding__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.onboarding__welcome {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.onboarding__icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: var(--space-xs);
    flex-shrink: 0;
}

.onboarding__title {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    margin: 0 0 2px;
}

.onboarding__subtitle {
    font-size: var(--font-sm);
    opacity: 0.85;
    margin: 0;
}

.onboarding__dismiss {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-white);
    flex-shrink: 0;
    transition: background 0.15s;
}

.onboarding__dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

.onboarding__progress {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.onboarding__progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.onboarding__progress-fill {
    height: 100%;
    background: var(--color-white);
    border-radius: 3px;
    transition: width 0.4s ease-out;
}

.onboarding__progress-text {
    font-size: var(--font-xs);
    opacity: 0.8;
    white-space: nowrap;
}

.onboarding__steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.onboarding__step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.onboarding__step-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.onboarding__step-circle {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: block;
}

.onboarding__step--done .onboarding__step-check {
    color: var(--color-success-light);
}

.onboarding__step-label {
    font-size: var(--font-body);
    color: var(--color-white);
    text-decoration: none;
}

a.onboarding__step-label:hover {
    opacity: 0.85;
}

.onboarding__step--done .onboarding__step-label {
    opacity: 0.6;
    text-decoration: line-through;
}

/* ── Card Hover Lift ── */

.card,
.money-card,
.stat-card--interactive,
.dashboard-action,
.money-link-card,
.settings-menu__item {
    transition: box-shadow 0.2s ease;
}

.card:hover,
.money-card:hover,
.stat-card--interactive:hover,
.money-link-card:hover,
.dashboard-action:hover {
    box-shadow: var(--shadow-card);
}

.settings-menu__item:hover {
    background-color: var(--color-light);
}

/* ── Button Press Feedback ── */

.btn:active {
    transform: scale(0.97);
}

.btn {
    transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}

/* ── Form Submit Loading State ── */

.btn--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.btn--loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: var(--space-sm);
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

/* ── Stat Card Number Count-up Feel ── */

.stat-card__value {
    transition: color 0.3s ease;
}

/* ── Lead Card Hover ── */

.lead-card {
    transition: background-color 0.15s ease, box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
}

/* ── Dashboard Event Hover ── */

.dashboard-event {
    transition: background-color 0.15s ease;
}

.dashboard-event:hover {
    background-color: var(--color-light);
}

/* ── Offline Detection Banner ── */

.offline-banner__text {
    font-size: var(--font-sm);
}

/* ═══════════════════════════════════════════════════
   14. COMPLIANCE MODULE
   ═══════════════════════════════════════════════════ */

/* ── Summary Bar ── */

.compliance-summary {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-4);
}

.compliance-summary__counts {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.compliance-count {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-sm);
    font-weight: 600;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.compliance-count--valid { color: var(--color-success-deep); background: var(--color-success-light); }
.compliance-count--expiring { color: #b45309; background: #fffbeb; }
.compliance-count--expired { color: #dc2626; background: #fef2f2; }

.compliance-bar-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compliance-bar {
    height: 10px;
    background: var(--color-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
}

.compliance-bar__fill {
    height: 100%;
    transition: width 0.6s ease;
}
.compliance-bar__fill:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.compliance-bar__fill:last-child { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.compliance-bar__fill:only-child { border-radius: var(--radius-full); }

.compliance-bar-legend {
    display: flex;
    gap: var(--space-3);
}

.compliance-bar-legend__item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-xs);
    color: var(--color-muted);
}

.compliance-bar-legend__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ── All Valid Banner ── */

.compliance-all-valid {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-success-light);
    border: 1px solid var(--color-success-light);
    border-radius: var(--radius-lg);
    color: var(--color-success-deep);
    font-weight: 600;
    font-size: var(--font-sm);
    margin-bottom: var(--space-4);
}

/* ── Filters ── */

.compliance-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

/* ── Category Sections (Accordion) ── */

.compliance-section {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-3);
    overflow: hidden;
}

.compliance-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-sm);
    color: var(--color-text);
    text-align: left;
}

.compliance-section__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
}

.compliance-section__count {
    font-weight: 400;
    color: var(--color-muted);
}

.compliance-section__chevron {
    transition: transform 0.2s ease;
}

.compliance-section--collapsed .compliance-section__chevron {
    transform: rotate(-90deg);
}

.compliance-section--collapsed .compliance-section__body {
    display: none;
}

/* ── Staff Sub-groups ── */

.compliance-staff-group {
    margin-top: var(--space-xs);
}

.compliance-staff-group__header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-secondary, #f5f5f4);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--color-mid);
    border-top: 1px solid var(--color-border);
}

/* ── Item Row ── */

.compliance-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.15s ease;
}

.compliance-item:hover {
    background: var(--color-light);
}

.compliance-item__accent {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.compliance-item__info {
    flex: 1;
    min-width: 0;
}

.compliance-item__name {
    display: block;
    font-weight: 500;
    font-size: var(--font-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compliance-item__type {
    font-size: var(--font-xs);
    color: var(--color-muted);
}

.compliance-item__status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.compliance-item__date {
    font-size: var(--font-xs);
    color: var(--color-muted);
}

.compliance-item__days {
    font-size: var(--font-xs);
    color: var(--color-muted);
}

.compliance-item__days--overdue {
    color: #dc2626;
    font-weight: 600;
}

.compliance-item__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-muted);
    flex-shrink: 0;
}

.compliance-item__doc-icon {
    color: var(--color-primary);
}

.compliance-item__share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--color-muted);
    transition: color 0.15s, background-color 0.15s;
}

.compliance-item__share:hover {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
}

/* ── Traffic Light Badges ── */

.compliance-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    white-space: nowrap;
}

.compliance-badge--valid { background: var(--color-success-light); color: var(--color-success-deep); }
.compliance-badge--expiring { background: #fef3c7; color: #b45309; }
.compliance-badge--expired { background: #fee2e2; color: #dc2626; }
.compliance-badge--grey { background: var(--color-light); color: var(--color-muted); }
.compliance-badge--not-set { background: #fef3c7; color: var(--color-warning-dark); border: 1px dashed #d97706; }
.compliance-badge--lg { padding: 4px 12px; font-size: var(--font-sm); }

/* ── Detail Page ── */

.compliance-detail__header {
    margin-bottom: var(--space-4);
}

.compliance-detail__title-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.compliance-detail__name {
    font-size: var(--font-xl);
    font-weight: 700;
    margin: 0;
}

.compliance-detail__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.compliance-detail__type {
    font-size: var(--font-sm);
    color: var(--color-muted);
}

.compliance-detail__actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ── Document Section ── */

.compliance-doc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.compliance-doc__preview {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
}

.compliance-doc__name {
    font-size: var(--font-sm);
    word-break: break-all;
}

.compliance-doc--empty {
    flex-direction: column;
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--color-muted);
}

.compliance-doc--empty p {
    margin: var(--space-2) 0 0;
    font-size: var(--font-sm);
}

.compliance-doc--current {
    padding: var(--space-2) var(--space-3);
    background: var(--color-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    font-size: var(--font-sm);
}

/* ── Reminder Settings ── */

.compliance-reminders {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.compliance-reminder-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-sm);
    font-weight: 500;
}

.compliance-reminder-intervals {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.compliance-reminder-tag {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    background: var(--color-light);
    color: var(--color-muted);
}

.compliance-reminder-tag--active {
    background: var(--color-info-light);
    color: var(--color-info);
}

/* ── Share History ── */

.compliance-shares {
    display: flex;
    flex-direction: column;
}

.compliance-share-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-sm);
}

.compliance-share-row:last-child { border-bottom: none; }
.compliance-share-email { color: var(--color-text); }
.compliance-share-date { color: var(--color-muted); }

/* ── Audit Log ── */
.compliance-audit-log {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.compliance-audit-entry {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.compliance-audit-entry:last-child { border-bottom: none; }

.compliance-audit-entry__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-bg-subtle, var(--color-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.compliance-audit-entry__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.compliance-audit-entry__desc {
    font-size: var(--font-sm);
    color: var(--color-text);
}

.compliance-audit-entry__meta {
    font-size: var(--font-xs);
    color: var(--color-muted);
}

/* ── Reminder Form ── */

/* ── Reminder Form: vertical rhythm + indented checkbox group ── */

.compliance-reminder-form > .toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: var(--space-sm) 0;
}

.compliance-reminder-form > .toggle + .compliance-reminder-checkboxes {
    margin-top: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.compliance-reminder-checkboxes {
    padding-left: var(--space-md);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    font-size: var(--font-sm);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* ── File Input ── */

.form-file {
    display: block;
    width: 100%;
    padding: var(--space-2);
    font-size: var(--font-sm);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-light);
    cursor: pointer;
}

.form-file:hover {
    border-color: var(--color-primary);
}

/* ── Responsive ── */

@media (min-width: 768px) {
    .compliance-summary__counts {
        gap: var(--space-6);
    }

    .compliance-item {
        padding: var(--space-3) var(--space-5);
    }

    .compliance-detail__actions {
        margin-top: var(--space-2);
    }
}

/* ═══════════════════════════════════════════════════
   15. TEAM MODULE
   ═══════════════════════════════════════════════════ */

/* ── Team Stats ── */
.team-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.team-stat {
    background: var(--color-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
}

.team-stat:hover {
    box-shadow: var(--shadow-md);
}

.team-stat--warning {
    box-shadow: inset 3px 0 0 var(--color-accent),
                0 1px 2px hsl(24 10% 10% / 0.04),
                0 1px 3px hsl(24 10% 10% / 0.06);
}

.team-stat--warning:hover {
    box-shadow: inset 3px 0 0 var(--color-accent), var(--shadow-md);
}

.team-stat__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
}

.team-stat__icon--primary { background: var(--color-primary-light); color: var(--color-primary); }
.team-stat__icon--success { background: var(--color-success-light); color: var(--color-success); }
.team-stat__icon--warning { background: var(--color-accent-light); color: var(--color-accent); }
.team-stat__icon--muted { background: var(--color-light); color: var(--color-muted); }

.team-stat__value {
    display: block;
    font-size: var(--font-h2);
    font-weight: 700;
    color: var(--color-dark);
}

.team-stat__value--active { color: var(--color-success-deep); }
.team-stat__value--warning { color: var(--color-accent); }

.team-stat__label {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
}

@media (min-width: 768px) {
    .team-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Team Action Links ── */
.team-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.team-action-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
    position: relative;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.team-action-link:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.team-action-link__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary);
    flex-shrink: 0;
}

.team-action-link__icon--amber { background: var(--color-accent-light); color: var(--color-accent); }
.team-action-link__icon--blue { background: var(--color-info-light); color: var(--color-info); }
.team-action-link__icon--white { background: hsla(0,0%,100%,0.2); color: var(--color-white); }

.team-action-link__text { flex: 1; min-width: 0; }

.team-action-link__label {
    display: block;
    font-weight: var(--weight-semibold);
    font-size: var(--font-body);
    color: var(--color-dark);
}

.team-action-link__desc {
    display: block;
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 1px;
}

.team-action-link--primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.team-action-link--primary .team-action-link__label { color: var(--color-white); }
.team-action-link--primary .team-action-link__desc { color: hsla(0,0%,100%,0.75); }

.team-action-link--primary:hover {
    background: var(--color-primary-dark);
}

/* Alert variants — left accent stripe instead of coloured border.
   Replaces inline style="border-color:..." overrides that made tiles feel
   inconsistent page-to-page. */
.team-action-link--warning {
    box-shadow: inset 3px 0 0 var(--color-accent),
                0 1px 2px hsl(24 10% 10% / 0.04),
                0 1px 3px hsl(24 10% 10% / 0.06);
}

.team-action-link--danger {
    box-shadow: inset 3px 0 0 var(--color-danger),
                0 1px 2px hsl(24 10% 10% / 0.04),
                0 1px 3px hsl(24 10% 10% / 0.06);
}

.team-action-link--warning:hover,
.team-action-link--danger:hover {
    box-shadow: inset 3px 0 0 var(--color-accent), var(--shadow-md);
}

.team-action-link--danger:hover {
    box-shadow: inset 3px 0 0 var(--color-danger), var(--shadow-md);
}

.team-action-link--success {
    background: var(--color-success-light);
    box-shadow: inset 3px 0 0 var(--color-success-deep),
                0 1px 2px hsl(24 10% 10% / 0.04);
}

.team-action-link--warning .team-action-link__label { color: var(--color-accent); }
.team-action-link--danger  .team-action-link__label { color: var(--color-danger); }
.team-action-link--success .team-action-link__label { color: var(--color-success-deep); }

/* ── Team Cards Grid ── */
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.team-card {
    display: block;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

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

.team-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.team-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-body-sm);
    flex-shrink: 0;
}

.team-card__info {
    flex: 1;
    min-width: 0;
}

.team-card__name {
    display: block;
    font-weight: 600;
    font-size: var(--font-body);
}

.team-card__details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    margin-top: var(--space-xs);
}

.team-card__stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.team-card__status {
    font-size: var(--font-caption);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    margin-left: auto;
    flex-shrink: 0;
}

.team-card__status--active { background: var(--color-success-light); color: var(--color-success-deep); }
.team-card__status--holiday { background: #f5f5f4; color: #78716c; }
.team-card__status--inactive { background: #fee2e2; color: #dc2626; }

/* ── Staff Profile ── */
.staff-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.staff-header__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-xl);
    flex-shrink: 0;
}

.staff-header__name { font-size: var(--font-xl); font-weight: 700; margin: 0 0 var(--space-1); }
.staff-header__meta { display: flex; gap: var(--space-2); align-items: center; }

.staff-links {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.staff-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--color-primary);
    font-size: var(--font-sm);
    font-weight: 500;
}

.staff-link svg {
    flex-shrink: 0;
}

.staff-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }

/* ── Timesheets ── */
.ts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.ts-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ts-nav__range {
    font-weight: 600;
    font-size: var(--font-sm);
    white-space: nowrap;
}

.ts-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

form.inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.ts-filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.ts-table-wrap {
    overflow-x: auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.ts-table th {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    background: var(--color-light);
    font-weight: 600;
    font-size: var(--font-xs);
    text-transform: uppercase;
    color: var(--color-muted);
    white-space: nowrap;
}

.ts-table td {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--color-border);
    white-space: nowrap;
}

.ts-row--today { background: var(--color-primary-light); }
.ts-row--weekend td { color: var(--color-muted); }
.ts-hours { font-weight: 600; }
.ts-totals { background: var(--color-light); }
.ts-totals td { border-top: 2px solid var(--color-border); font-weight: 600; }

.ts-submit {
    margin-top: var(--space-4);
    text-align: center;
}

.btn--xs {
    padding: 2px 8px;
    font-size: var(--font-xs);
}

.btn--success {
    background: var(--color-success-deep);
    color: var(--color-white);
    border: none;
}

/* ── Clock In/Out ── */
.clock-display {
    text-align: center;
    margin-bottom: var(--space-6);
}

.clock-time {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -1px;
}

.clock-date {
    font-size: var(--font-sm);
    color: var(--color-muted);
}

.clock-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.clock-card--active { border: 2px solid var(--color-success-deep); }
.clock-card--break { border: 2px solid var(--color-amber); }

.clock-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.clock-status__dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

.clock-status__dot--active { background: var(--color-success-deep); }
.clock-status__dot--break { background: var(--color-amber); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.clock-elapsed {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.clock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    border: none;
    font-size: var(--font-lg);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.clock-btn:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
.clock-btn:active { transform: scale(0.98); }

.clock-btn--in { background: var(--color-primary); color: var(--color-white); }
.clock-btn--out { background: #dc2626; color: var(--color-white); }
.clock-btn--resume { background: var(--color-primary); color: var(--color-white); }

.clock-card__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.clock-break-total {
    margin-top: var(--space-3);
    font-size: var(--font-sm);
    color: var(--color-muted);
}

/* ── Holidays ── */
.holiday-balance {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.holiday-balance--compact {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-sm);
}

.holiday-balance__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.holiday-balance__stats {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.holiday-balance__stat { text-align: center; }
.holiday-balance__value { display: block; font-size: var(--font-xl); font-weight: 700; }
.holiday-balance__label { font-size: var(--font-xs); color: var(--color-muted); }
.holiday-balance__stat--remaining .holiday-balance__value { color: var(--color-primary); }

.holiday-balance__bar {
    height: 6px;
    background: var(--color-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.holiday-balance__bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.holiday-list { display: flex; flex-direction: column; gap: var(--space-3); }

.holiday-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
}

.holiday-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.holiday-card__name { display: block; font-weight: 600; font-size: var(--font-sm); }
.holiday-card__dates { display: block; font-size: var(--font-sm); color: var(--color-text); }
.holiday-card__days { font-size: var(--font-xs); color: var(--color-muted); }
.holiday-card__reason { font-size: var(--font-sm); color: var(--color-muted); margin: 0 0 var(--space-2); }
.holiday-card__note { font-size: var(--font-sm); color: var(--color-muted); margin: 0 0 var(--space-2); }

.holiday-card__actions {
    display: flex;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

.btn--danger { background: #dc2626; color: var(--color-white); border: none; }

/* ── Team Calendar ── */
.team-cal-wrap {
    overflow-x: auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.team-cal {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-xs);
}

.team-cal__staff-header {
    position: sticky;
    left: 0;
    background: var(--color-light);
    z-index: 1;
    padding: var(--space-1) var(--space-2);
    font-weight: 600;
    min-width: 100px;
}

.team-cal__day-header {
    padding: var(--space-1);
    text-align: center;
    background: var(--color-light);
    min-width: 28px;
}

.team-cal__day-header--weekend { color: var(--color-muted); }
.team-cal__day-header--today { background: var(--color-primary); color: var(--color-white); border-radius: var(--radius-sm); }
.team-cal__day-name { display: block; font-size: 10px; }
.team-cal__day-num { display: block; font-weight: 700; }

.team-cal__staff-name {
    position: sticky;
    left: 0;
    background: var(--color-white);
    padding: var(--space-1) var(--space-2);
    font-weight: 500;
    font-size: var(--font-xs);
    white-space: nowrap;
    border-top: 1px solid var(--color-border);
    z-index: 1;
}

.team-cal__cell {
    padding: 2px;
    border-top: 1px solid var(--color-border);
    min-width: 28px;
    height: 24px;
}

.team-cal__cell--weekend { background: #fafaf9; }
.team-cal__cell--event { background: var(--color-primary); opacity: 0.7; }
.team-cal__cell--holiday { background: var(--color-border); }
.team-cal__cell--available { background: var(--color-success-light); }
.team-cal__cell--maybe { background: #FEF3C7; }
.team-cal__cell--unavailable { background: #FEE2E2; }

.team-cal-legend__dot--available { background: #059669; }
.team-cal-legend__dot--maybe { background: #D97706; }
.team-cal-legend__dot--unavailable { background: #DC2626; }

.team-cal-legend {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-3);
    justify-content: center;
    font-size: var(--font-xs);
    color: var(--color-muted);
}

.team-cal-legend__item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.team-cal-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.team-cal-legend__dot--event { background: var(--color-primary); opacity: 0.7; }
.team-cal-legend__dot--holiday { background: var(--color-border); }
.team-cal-legend__dot--weekend { background: #fafaf9; border: 1px solid var(--color-border); }

/* ── Responsive ── */
@media (min-width: 768px) {
    .team-grid { grid-template-columns: 1fr 1fr; }
    .team-actions { grid-template-columns: repeat(4, 1fr); }
}

/* --- App Footer --- */

.app-footer {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-caption);
    text-align: center;
}

.app-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.app-footer__links {
    display: flex;
    gap: var(--space-md);
}

.app-footer__links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.15s;
}

.app-footer__links a:hover {
    color: var(--color-white);
    text-decoration: none;
}

@media (min-width: 768px) {
    .app-footer__inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* --- Prose Content Styling --- */

.prose {
    font-size: var(--font-body);
    line-height: 1.75;
    color: var(--color-dark);
}

.prose h2 {
    font-family: var(--font-display-family);
    font-size: 1.5rem;
    font-weight: var(--weight-semibold);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 2rem 0 1rem;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: var(--weight-semibold);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 1.5rem 0 0.75rem;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul, .prose ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    margin-bottom: 0.25rem;
    line-height: 1.75;
}

.prose blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--color-muted);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.prose th, .prose td {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.prose th {
    background: var(--color-bg-secondary);
    font-weight: var(--weight-semibold);
}

.prose-lg {
    font-size: 1.125rem;
    line-height: 1.8;
}

@media print {
    .sidebar,
    .top-bar,
    .tab-bar,
    .fab,
    .flash-messages,
    .bottom-sheet,
    .modal-backdrop,
    .btn,
    .search,
    .app-footer {
        display: none !important;
    }

    .app-layout {
        display: block;
    }

    .app-main {
        width: 100%;
    }

    .app-content {
        padding: 0;
        max-width: none;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .badge {
        border: 1px solid #ccc;
        background: transparent !important;
        color: black !important;
    }
}

/* ── Data Export ── */

.export-filters {
    margin-bottom: var(--space-lg);
}

.export-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.export-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.export-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-teal-50, #E6F5F4);
    border-radius: var(--radius-md);
    color: var(--color-primary);
}

.export-card__info {
    flex: 1;
    min-width: 0;
}

.export-card__title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 2px 0;
}

.export-card__desc {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin: 0;
}

@media (max-width: 480px) {
    .export-card {
        flex-wrap: wrap;
    }
    .export-card .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Stock & Suppliers ── */

.stock-filters {
    margin-bottom: var(--space-md);
}

.stock-filters__form {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.stock-category {
    margin-bottom: var(--space-lg);
}

.stock-category__title {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0 0 var(--space-sm) 0;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--color-border);
}

.stock-category__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    padding: var(--space-xs) 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    text-align: left;
}

.stock-category__chevron {
    transition: transform 0.2s ease;
}

.stock-category--collapsed .stock-category__chevron {
    transform: rotate(-90deg);
}

.stock-category--collapsed .stock-category__body {
    display: none;
}

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.stock-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-white);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.stock-item:hover {
    background: var(--color-bg);
}

.stock-item__info {
    flex: 0 0 140px;
    min-width: 0;
}

.stock-item__name {
    display: block;
    font-weight: 500;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-item__qty {
    font-size: var(--text-xs);
    color: var(--color-muted);
}

.stock-item__bar {
    flex: 1;
    min-width: 0;
}

.stock-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.stock-bar--lg {
    height: 10px;
    border-radius: 5px;
}

.stock-bar__fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s;
}

.stock-bar__fill.stock-status--success { background: var(--color-success, #16a34a); }
.stock-bar__fill.stock-status--warning { background: var(--color-warning, #d97706); }
.stock-bar__fill.stock-status--danger { background: var(--color-danger, #dc2626); }

.stock-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stock-dot.stock-status--success { background: var(--color-success, #16a34a); }
.stock-dot.stock-status--warning { background: var(--color-warning, #d97706); }
.stock-dot.stock-status--danger { background: var(--color-danger, #dc2626); }

.stock-level {
    text-align: center;
}

.stock-level__current {
    margin-bottom: var(--space-sm);
}

.stock-level__value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
}

.stock-level__unit {
    font-size: var(--text-base);
    color: var(--color-muted);
    margin-left: var(--space-xs);
}

.stock-level__labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: var(--space-xs);
}

.movement-form .form-grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Supplier Cards */

.supplier-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.supplier-card {
    display: block;
    padding: var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.supplier-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px hsl(24 10% 10% / 0.06);
}

.supplier-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.supplier-card__name {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}

.supplier-card__contact {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin: 0 0 var(--space-sm) 0;
}

.supplier-card__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--text-xs);
    color: var(--color-muted);
}

.supplier-card__meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.supplier-actions {
    display: flex;
    gap: var(--space-sm);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    cursor: pointer;
}

/* ── Equipment ── */
.equipment-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.equipment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.equipment-item:hover {
    background: var(--surface-hover, #f8f9fa);
}

.equipment-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.equipment-item__name {
    font-weight: 500;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipment-item__meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.equipment-item__details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.equipment-item__status {
    flex-shrink: 0;
    margin-left: var(--space-sm);
}

.condition-form .form-grid--3 {
    grid-template-columns: 1fr 2fr;
}

@media (min-width: 768px) {
    .condition-form .form-grid--3 {
        grid-template-columns: 200px 1fr;
    }
}

.form-group--span-2 {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .form-group--span-2 {
        grid-column: span 1;
    }
}

.badge--muted {
    background: var(--text-muted, #6c757d);
    color: #fff;
}

/* ── Marketing ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

@media (min-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-cards--sm {
    grid-template-columns: repeat(2, 1fr);
    max-width: 300px;
}

.stat-cards--fit {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

@media (min-width: 768px) {
    .stat-cards--fit {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

/* ── Dashboard Weather Widget ── */

.dashboard-weather {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid;
    text-decoration: none;
    color: inherit;
}

.dashboard-weather--green { background: #F0FDF4; border-color: #BBF7D0; }
.dashboard-weather--amber { background: #FFFBEB; border-color: #FDE68A; }
.dashboard-weather--red   { background: #FEF2F2; border-color: #FECACA; }

.dashboard-weather__icon {
    flex-shrink: 0;
    color: var(--color-text);
}

.dashboard-weather__body {
    flex: 1;
    min-width: 0;
}

.dashboard-weather__event {
    font-weight: var(--weight-semibold);
    font-size: var(--font-body-sm);
    color: var(--color-text);
    margin-bottom: 2px;
}

.dashboard-weather__venue {
    font-weight: var(--weight-regular);
    color: var(--color-mid);
}

.dashboard-weather__temp {
    font-weight: var(--weight-semibold);
    font-size: var(--font-body);
}

.dashboard-weather--green .dashboard-weather__temp { color: #166534; }
.dashboard-weather--amber .dashboard-weather__temp { color: #92400E; }
.dashboard-weather--red   .dashboard-weather__temp { color: #991B1B; }

.dashboard-weather__meta {
    font-size: var(--font-caption);
    color: var(--color-mid);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.dashboard-weather__forecast {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 2px;
}

.dashboard-weather__chevron {
    color: var(--color-muted);
    flex-shrink: 0;
}

/* ── Photo Grid (equipment, stock, etc.) ── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-xs);
}

.photo-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
}

.photo-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-card__action {
    position: absolute;
    top: 4px;
    right: 4px;
}

.photo-card__action-btn {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photo-card__action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.photo-empty {
    text-align: center;
    padding: var(--space-lg);
    color: var(--color-text-muted);
}

.photo-empty__label {
    margin: var(--space-xs) 0 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.stat-card--compact {
    padding: var(--space-sm);
}

.stat-card--danger {
    border-color: var(--color-danger, #dc3545);
}

.stat-card__label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card__value {
    display: block;
    font-size: var(--text-xl, 1.5rem);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card--compact .stat-card__value {
    font-size: var(--text-lg, 1.25rem);
}

.source-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.source-bar-row__label {
    flex: 0 0 120px;
    font-size: var(--text-sm);
    font-weight: 500;
}

.source-bar-row__bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.source-bar {
    height: 100%;
    background: var(--color-primary, #0E7570);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.3s;
}

.source-bar-row__count {
    flex: 0 0 auto;
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.badge--count {
    margin-left: 4px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
}

.follow-up-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.follow-up-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.follow-up-card--overdue {
    border-left: 3px solid var(--color-danger, #dc3545);
}

.follow-up-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.follow-up-card__lead {
    font-weight: 600;
    font-size: var(--text-sm);
}

.follow-up-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.follow-up-card__actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.snooze-select {
    width: auto;
    min-width: 100px;
}

.funnel {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.funnel__stage {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.funnel__bar {
    height: 32px;
    background: var(--color-primary, #0E7570);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 var(--space-sm);
    transition: width 0.3s;
}

.funnel__value {
    color: #fff;
    font-weight: 600;
    font-size: var(--text-sm);
}

.funnel__label {
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
}

.funnel__dropoff {
    font-size: var(--text-xs);
    color: var(--color-danger, #dc3545);
}

.referrer-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
}

@media (min-width: 768px) {
    .referrer-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.referrer-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.referrer-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.referrer-card__name {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}

.referrer-card__contact {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-xs);
}

.referrer-card__stats {
    display: flex;
    gap: var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.referrer-card__actions {
    display: flex;
    gap: var(--space-xs);
}

.automation-rule__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
}

.automation-rule__name {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}

.automation-rule__desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: var(--space-xs) 0 0;
}

.input-group {
    display: flex;
    gap: var(--space-xs);
}

.input-group .form-input,
.input-group .form-select {
    flex: 1;
}

/* Bare label-less switch — used by automation rule rows in marketing/settings.
   Was previously called `.toggle` here, which collided with the shared form-toggle
   component (label + input + track) and broke its layout (the wrapper got pinned
   to 44×24, squashing the label text into multi-line). Renamed to `.switch` to
   keep the shared `.toggle` selector free for the form-toggle component. */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border);
    border-radius: 12px;
    transition: background 0.2s;
}

.switch__slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.switch input:checked + .switch__slider {
    background: var(--color-primary, #0E7570);
}

.switch input:checked + .switch__slider::before {
    transform: translateX(20px);
}

.form-group--end {
    display: flex;
    align-items: flex-end;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    font-size: var(--text-sm);
}

.activity-item__text {
    flex: 1;
    color: var(--text-muted);
}

.activity-item__date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.badge--info {
    background: var(--color-info);
    color: #fff;
}

.badge--primary {
    background: var(--color-primary, #0E7570);
    color: #fff;
}

.date-range-form .form-grid--3 {
    grid-template-columns: 1fr 1fr auto;
}

/* ── Stat Card ── */

.stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card__label {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    font-weight: var(--weight-medium);
}

.stat-card__icon {
    color: var(--color-muted);
}

.stat-card__value {
    font-size: var(--font-h1);
    font-weight: var(--weight-semibold);
    color: var(--color-dark);
    line-height: 1.2;
}

.stat-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
}

.stat-card__trend--up { color: var(--color-success); }
.stat-card__trend--down { color: var(--color-danger); }
.stat-card__trend--flat { color: var(--color-muted); }

.stat-card--primary { border-left: 3px solid var(--color-primary); }
.stat-card--success { border-left: 3px solid var(--color-success); }
.stat-card--warning { border-left: 3px solid var(--color-accent); }
.stat-card--danger { border-left: 3px solid var(--color-danger); }

/* ── Alert Card ── */

.alert-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-body-sm);
}

.alert-card--warning { background: var(--color-accent-light); color: var(--color-warning-dark); }
.alert-card--danger { background: var(--color-danger-light); color: hsl(0 84% 35%); }
.alert-card--success { background: var(--color-success-light); color: var(--color-success-dark); }
.alert-card--info { background: var(--color-info-light); color: var(--color-info-dark); }

.alert-card__icon { flex-shrink: 0; }

.alert-card__content { flex: 1; min-width: 0; }

.alert-card__title {
    font-weight: var(--weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.alert-card__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: currentColor;
    color: var(--color-white);
    font-size: 11px;
    font-weight: var(--weight-semibold);
}

.alert-card__message {
    font-size: var(--font-caption);
    opacity: 0.85;
    margin-top: 2px;
}

.alert-card__action {
    flex-shrink: 0;
    font-weight: var(--weight-semibold);
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

/* ── Timeline ── */

.timeline {
    position: relative;
    padding-left: var(--space-lg);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--color-border);
}

.timeline__item {
    position: relative;
    padding-bottom: var(--space-md);
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
    position: absolute;
    left: calc(-1 * var(--space-lg) + 1px);
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline__marker--primary { border-color: var(--color-primary); background: var(--color-primary-light); }
.timeline__marker--success { border-color: var(--color-success); background: var(--color-success-light); }
.timeline__marker--warning { border-color: var(--color-accent); background: var(--color-accent-light); }
.timeline__marker--danger { border-color: var(--color-danger); background: var(--color-danger-light); }

.timeline__title {
    font-size: var(--font-body-sm);
    font-weight: var(--weight-medium);
    color: var(--color-dark);
}

.timeline__detail {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 2px;
}

.timeline__date {
    font-size: var(--font-caption);
    color: var(--color-muted);
    margin-top: 2px;
}

/* ── Tabs ── */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;

    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs__item {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-body-sm);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.tabs__item:hover { color: var(--color-dark); }

.tabs__item--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: var(--radius-full);
    background: var(--color-light);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    color: var(--color-mid);
}

.tabs__item--active .tabs__count {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── Bottom Sheet ── */

.bottom-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.bottom-sheet--open { display: flex; align-items: flex-end; }

.bottom-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: hsl(24 10% 10% / 0.4);
}

.bottom-sheet__panel {
    position: relative;
    width: 100%;
    max-height: 85vh;
    background: var(--color-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.bottom-sheet__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
    margin: var(--space-sm) auto;
}

.bottom-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md) var(--space-sm);
}

.bottom-sheet__title {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
}

.bottom-sheet__body {
    padding: 0 var(--space-md) var(--space-lg);
}

@media (min-width: 768px) {
    .bottom-sheet { align-items: center; justify-content: center; }
    .bottom-sheet__panel {
        max-width: 480px;
        max-height: 70vh;
        border-radius: var(--radius-lg);
        margin: auto;
    }
    .bottom-sheet__handle { display: none; }
}

/* ── Search ── */

.search__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search__icon {
    position: absolute;
    left: 12px;
    color: var(--color-muted);
    pointer-events: none;
}

.search__input {
    padding-left: 40px !important;
    padding-right: 36px !important;
}

.search__clear {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.search__clear:hover {
    background: var(--color-light);
    color: var(--color-dark);
}

/* ── Dropdown Menu ── */

.dropdown { position: relative; display: inline-block; }

/* Specificity-0 reset (via :where) so additional trigger classes — e.g.
   `.lead-header__action` passed in via the dropdown component's triggerClass
   prop — can supply their own background, border, padding, sizing without
   being clobbered by these defaults. */
:where(.dropdown__trigger) {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.dropdown__menu {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: var(--space-xs);
    min-width: 180px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs) 0;
    z-index: 1000;
}

.dropdown__menu--left { left: 0; }
.dropdown__menu--right { right: 0; }
.dropdown--open .dropdown__menu { display: block; }

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-body-sm);
    color: var(--color-dark);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.dropdown__item:hover { background: var(--color-light); }
.dropdown__item--danger { color: var(--color-danger); }
.dropdown__item--danger:hover { background: var(--color-danger-light); }

.dropdown__divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-xs) 0;
}

/* ── Form Checkbox ── */

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-body-sm);
}

.form-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-checkbox__box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 1px;
}

.form-checkbox__input:checked + .form-checkbox__box {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.form-checkbox__input:checked + .form-checkbox__box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid var(--color-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

.form-checkbox__input:focus-visible + .form-checkbox__box {
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-checkbox__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-checkbox__help {
    font-size: var(--font-caption);
    color: var(--color-muted);
}

/* ── Form Radio ── */

.form-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-radio-group--inline {
    flex-direction: row;
    flex-wrap: wrap;
}

.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-body-sm);
}

.form-radio__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-radio__dot {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
}

.form-radio__input:checked + .form-radio__dot {
    border-color: var(--color-primary);
}

.form-radio__input:checked + .form-radio__dot::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
}

.form-radio__input:focus-visible + .form-radio__dot {
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ── Form File Upload ── */

.form-file__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--color-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}

.form-file__dropzone:hover,
.form-file__dropzone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.form-file__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.form-file__text { font-size: var(--font-body-sm); }
.form-file__browse { color: var(--color-primary); font-weight: var(--weight-medium); }
.form-file__hint { font-size: var(--font-caption); }

.form-file__preview {
    margin-top: var(--space-sm);
}

.form-file__thumb {
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.form-file--error .form-file__dropzone { border-color: var(--color-danger); }

/* ============================================
   14. ACCESSIBILITY
   ============================================ */

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

/* Card padding on desktop */
@media (min-width: 768px) {
    .card {
        padding: var(--space-lg);
    }
}

/* ============================================
   DARK MODE — for dim venue interiors
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #22B2A0;
        --color-primary-dark: #0E7570;
        --color-primary-light: #065E57;

        --color-accent: #E8B86D;
        --color-accent-light: #78350F;

        --color-success: #4ADE80;
        --color-success-light: #064E3B;

        --color-danger: #F87171;
        --color-danger-light: #7F1D1D;

        --color-dark: #F5F5F5;
        --color-mid: #D6D3D1;
        --color-muted: #A8A29E;
        --color-light: #292524;
        --color-border: #44403C;
        --color-white: #1A1410;
        --color-bg: #0C0A09;
        --color-secondary: #A8A29E;
        --color-cream: #1A1410;
        --color-bg-secondary: #292524;

        --color-text: #F5F5F5;

        --shadow-sm: 0 1px 2px hsl(24 10% 10% / 0.3);
        --shadow-md: 0 4px 6px hsl(24 10% 10% / 0.4);
        --shadow-lg: 0 10px 15px hsl(24 10% 10% / 0.5);
    }

    body {
        background: var(--color-bg);
        color: var(--color-text);
    }

    .top-bar {
        background: #1C1917;
        border-color: var(--color-border);
    }

    .tab-bar {
        background: #1C1917;
        border-color: var(--color-border);
    }

    .card {
        background: #1C1917;
        border-color: var(--color-border);
    }

    .form-input,
    .form-select,
    .form-textarea,
    .form-control {
        background: #292524;
        border-color: var(--color-border);
        color: var(--color-text);
    }

    .btn--secondary {
        background: #292524;
        border-color: var(--color-border);
        color: var(--color-text);
    }

    .data-table th {
        background: #292524;
    }

    .data-table td {
        border-color: var(--color-border);
    }

    .modal {
        background: #1C1917;
    }

    .modal-backdrop {
        background: rgba(0, 0, 0, 0.7);
    }

    .bottom-sheet__panel {
        background: #1C1917;
    }

    .alert-card {
        background: #292524;
    }

    .badge--outline {
        border-color: var(--color-border);
        color: var(--color-muted);
    }

    a {
        color: var(--color-primary);
    }

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

    img {
        opacity: 0.9;
    }

    .context-menu {
        background: #1C1917;
        border-color: var(--color-border);
    }

    .date-picker__dropdown {
        background: #1C1917;
        border-color: var(--color-border);
    }

    .date-picker__day:hover {
        background: #292524;
    }

    .swipe-card__action {
        opacity: 0.9;
    }
}


/* ============================================
   SECTION 3 ENHANCEMENTS
   FAB Menu, Swipe Cards, Context Menu,
   Pull-to-Refresh, Custom Date Picker
   ============================================ */

/* --- FAB Expand Menu --- */

.fab-menu {
    position: fixed;
    bottom: calc(var(--tab-bar-height) + var(--space-md) + env(safe-area-inset-bottom, 0px));
    right: var(--space-md);
    z-index: 100;
}

.fab-menu__trigger {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    position: relative;
    z-index: 2;
}

.fab-menu__trigger:hover {
    box-shadow: 0 12px 20px hsl(24 10% 10% / 0.15);
}

.fab-menu--open .fab-menu__trigger {
    transform: rotate(45deg);
    background: var(--color-dark);
}

.fab-menu__actions {
    position: absolute;
    bottom: 68px;
    right: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px) scale(0.95);
}

.fab-menu--open .fab-menu__actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fab-menu__action {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
    text-decoration: none;
    color: var(--color-text);
}

.fab-menu__action-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
}

.fab-menu__action-label {
    background: var(--color-white);
    color: var(--color-dark);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-body-sm);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.fab-menu__overlay {
    position: fixed;
    inset: 0;
    background: hsl(24 10% 10% / 0.3);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.fab-menu--open ~ .fab-menu__overlay,
.fab-menu__overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .fab-menu {
        display: none;
    }
}


/* --- Swipe Card --- */

.swipe-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
}

.swipe-card__content {
    position: relative;
    z-index: 1;
    background: var(--color-white);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.swipe-card__content--swiping {
    transition: none;
}

.swipe-card__content > a,
.swipe-card__content > div {
    display: block;
}

.swipe-card__actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
    z-index: 0;
}

.swipe-card__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    gap: 4px;
    color: var(--color-white);
    font-size: var(--font-caption);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    padding: 0;
}

.swipe-card__action--call {
    background: #059669;
}

.swipe-card__action--email {
    background: var(--color-primary);
}

.swipe-card__action--status {
    background: var(--color-accent);
}

.swipe-card__action--delete {
    background: var(--color-danger);
}

.swipe-card__action--default {
    background: var(--color-muted);
}

@media (min-width: 768px) {
    .swipe-card {
        overflow: visible;
    }
    .swipe-card__actions {
        display: none;
    }
}


/* --- Context Menu --- */

.context-menu {
    position: fixed;
    z-index: 500;
    min-width: 200px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px hsl(24 10% 10% / 0.18);
    border: 1px solid var(--color-border);
    padding: var(--space-xs) 0;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}

.context-menu--visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.context-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    min-height: 44px;
    font-size: var(--font-body);
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.1s;
}

.context-menu__item:hover,
.context-menu__item:active {
    background: var(--color-light);
    text-decoration: none;
}

.context-menu__item--danger {
    color: var(--color-danger);
}

.context-menu__divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-xs) 0;
}

.context-menu__overlay {
    position: fixed;
    inset: 0;
    z-index: 499;
}


/* --- Pull to Refresh --- */

.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pull-refresh-indicator--pulling {
    transition: none;
}

.pull-refresh-indicator--visible {
    transform: translateX(-50%) translateY(calc(var(--top-bar-height) + var(--space-sm)));
}

.pull-refresh-indicator__arrow {
    transition: transform 0.2s;
}

.pull-refresh-indicator--ready .pull-refresh-indicator__arrow {
    transform: rotate(180deg);
}

.pull-refresh-indicator--loading .pull-refresh-indicator__arrow {
    display: none;
}

.pull-refresh-indicator__spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.pull-refresh-indicator--loading .pull-refresh-indicator__spinner {
    display: block;
}


/* --- Custom Date Picker --- */

.date-picker {
    position: relative;
}

.date-picker__input-wrap {
    position: relative;
    cursor: pointer;
}

.date-picker__input-wrap .form-input {
    cursor: pointer;
    padding-right: 40px;
}

.date-picker__input-wrap .form-input:read-only {
    background: var(--color-white);
}

.date-picker__icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    pointer-events: none;
}

.date-picker__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 400;
    width: 300px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px hsl(24 10% 10% / 0.15);
    padding: var(--space-md);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}

.date-picker__dropdown--open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.date-picker__dropdown--above {
    top: auto;
    bottom: calc(100% + 4px);
    transform: translateY(4px);
}

.date-picker__dropdown--above.date-picker__dropdown--open {
    transform: translateY(0);
}

.date-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.date-picker__month-label {
    font-size: var(--font-body);
    font-weight: 600;
    color: var(--color-text);
}

.date-picker__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.1s, color 0.1s;
}

.date-picker__nav:hover {
    background: var(--color-light);
    color: var(--color-text);
}

.date-picker__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: var(--space-xs);
}

.date-picker__weekday {
    font-size: var(--font-caption);
    font-weight: 600;
    color: var(--color-muted);
    padding: 4px 0;
}

.date-picker__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.date-picker__day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border: none;
    background: none;
    color: var(--color-text);
    font-size: var(--font-body-sm);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: background 0.1s, color 0.1s;
}

.date-picker__day:hover {
    background: var(--color-light);
}

.date-picker__day--outside {
    color: var(--color-muted);
    opacity: 0.4;
}

.date-picker__day--today {
    font-weight: 700;
    color: var(--color-primary);
}

.date-picker__day--selected {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.date-picker__day--selected:hover {
    background: var(--color-primary-dark);
}

.date-picker__day--disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.date-picker__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

.date-picker__today-btn {
    font-size: var(--font-body-sm);
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.date-picker__today-btn:hover {
    background: var(--color-primary-light);
}

.date-picker__clear-btn {
    font-size: var(--font-body-sm);
    color: var(--color-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.date-picker__clear-btn:hover {
    background: var(--color-light);
    color: var(--color-text);
}


/* ============================================
   DESKTOP UPGRADES — Responsive Grid & Polish
   ============================================
   Upgrades mobile-first single-column layouts
   to multi-column grids on tablet/desktop.
*/

/* --- Utility: Card Row (replaces inline flex styles in settings sub-pages) --- */
.card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.card__row:last-child {
    border-bottom: none;
}

.card__row:hover {
    background: var(--color-light);
}

/* --- Utility: Flex icon + text --- */
.flex-icon-text {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* --- Utility: Card with accent top border --- */
.card--featured {
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* --- Lead List: Desktop Grid --- */
@media (min-width: 768px) {
    .lead-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
        background: none;
        border-radius: 0;
        overflow: visible;
        box-shadow: none;
    }

    .lead-card {
        border-radius: var(--radius-lg);
        box-shadow: 0 1px 2px hsl(24 10% 10% / 0.04), 0 1px 3px hsl(24 10% 10% / 0.06);
        transition: box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
    }

    .lead-card:hover {
        box-shadow: var(--shadow-md);
    }
}

/* Keep leads at 2-col on wide desktop — 3-col makes rows too dense to scan */

/* --- Detail Grid: 3 columns on large desktop --- */
@media (min-width: 1024px) {
    .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Team Grid: 3 columns on large desktop --- */
@media (min-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Holiday List: Desktop Grid --- */
@media (min-width: 768px) {
    .holiday-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .holiday-card {
        transition: all 0.2s ease;
    }

    .holiday-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }
}

/* --- Stock List: Desktop Grid --- */
@media (min-width: 768px) {
    .stock-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
        background: none;
    }

    .stock-list > * {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        transition: all 0.2s ease;
    }

    .stock-list > *:hover {
        box-shadow: var(--shadow-md);
        border-color: var(--color-primary);
        transform: translateY(-2px);
    }
}

@media (min-width: 1024px) {
    .stock-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Equipment: Auto-expand categories on desktop --- */
@media (min-width: 768px) {
    .stock-category--collapsed .stock-category__body {
        display: block !important;
    }

    .stock-category__chevron {
        display: none;
    }
}

/* --- Compliance Items: Better desktop card styling --- */
.compliance-item {
    border-radius: var(--radius-md);
}

@media (min-width: 768px) {
    .compliance-item {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        margin-bottom: var(--space-sm);
        padding: var(--space-md);
    }

    .compliance-item:hover {
        box-shadow: var(--shadow-md);
        border-color: var(--color-primary);
        background: var(--color-white);
    }
}

/* --- Data Table: Desktop hover states --- */
@media (min-width: 768px) {
    .data-table tbody tr {
        transition: background-color 0.15s;
    }

    .data-table tbody tr:hover {
        background: var(--color-light);
    }
}

/* --- Payment/Expense Rows: Better desktop card styling --- */
@media (min-width: 768px) {
    .payment-row,
    .expense-row {
        border-radius: var(--radius-md);
        transition: all 0.15s ease;
    }

    .payment-row:hover,
    .expense-row:hover {
        background: var(--color-light);
    }
}

/* --- Follow-up Cards: Hover state --- */
.follow-up-card {
    transition: border-color var(--motion-default, 180ms) var(--motion-ease, ease-out),
                box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
}

.follow-up-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

/* --- Referrer Cards: Hover state --- */
.referrer-card {
    transition: border-color var(--motion-default, 180ms) var(--motion-ease, ease-out),
                box-shadow var(--motion-default, 180ms) var(--motion-ease, ease-out);
}

.referrer-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════
   App Feedback System
   ═══════════════════════════════════════════════ */

/* Floating Action Button */
.feedback-fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1rem;
    z-index: 900;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: background 0.2s ease, transform 0.15s ease;
}

.feedback-fab:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

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

@media (min-width: 1024px) {
    .feedback-fab {
        bottom: 2rem;
        right: 2rem;
    }
}

@media print {
    .feedback-fab { display: none; }
}

/* Overlay */
.feedback-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    .feedback-overlay {
        align-items: center;
    }
}

/* Backdrop */
.feedback-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

/* Panel (bottom sheet on mobile, centred modal on desktop) */
.feedback-panel {
    position: relative;
    z-index: 1;
    background: white;
    width: 100%;
    max-height: 90vh;
    border-radius: 1rem 1rem 0 0;
    display: flex;
    flex-direction: column;
    animation: feedbackSlideUp 0.25s ease;
}

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

@media (min-width: 768px) {
    .feedback-panel {
        max-width: 540px;
        border-radius: 0.75rem;
        animation: feedbackScaleIn 0.2s ease;
    }

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

.feedback-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.feedback-panel__title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.feedback-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-secondary);
    border-radius: 0.375rem;
}

.feedback-panel__close:hover {
    background: var(--color-surface);
}

.feedback-panel__body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.feedback-panel__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

/* Feedback type pills */
.feedback-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.375rem;
}

.feedback-pill {
    cursor: pointer;
}

.feedback-pill__label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    transition: all 0.15s ease;
}

.feedback-pill:hover .feedback-pill__label {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.feedback-pill--active .feedback-pill__label {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Screenshot area */
.feedback-screenshot {
    border: 1px dashed var(--color-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.375rem;
    min-height: 3.5rem;
}

.feedback-screenshot__loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
}

.feedback-screenshot__preview img {
    max-width: 100%;
    max-height: 10rem;
    border-radius: 0.375rem;
    border: 1px solid var(--color-border);
}

.feedback-screenshot__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Error display */
.feedback-error {
    background: var(--color-danger-light, #fef2f2);
    color: var(--color-danger);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

/* Ensure form groups have spacing */
.feedback-panel__body .form-group {
    margin-bottom: 1rem;
}

.feedback-panel__body .form-group:last-of-type {
    margin-bottom: 0;
}

.feedback-type-group {
    margin-bottom: 1rem;
}

/* Read-only input style */
.form-input--readonly {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: default;
    font-size: 0.8125rem;
}

.form-hint-inline {
    font-weight: 400;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.form-required {
    color: var(--color-danger);
}

/* ============================================================
   Integrations module
   ============================================================ */

.token-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}
.token-value {
    background: var(--color-surface, #f5f5f5);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    flex: 1;
}
.code-block {
    background: var(--color-surface, #f5f5f5);
    padding: 0.875rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0.5rem 0;
}

/* Form builder shell */
.form-builder-shell {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
    .form-builder-shell {
        grid-template-columns: 280px 1fr 400px;
    }
}
.form-builder-fields,
.form-builder-config,
.form-builder-preview {
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: var(--radius-lg, 12px);
    padding: 1rem 1.125rem 1.25rem;
    box-shadow: 0 1px 3px hsl(24 10% 10% / 0.06);
}
.form-builder-config .form-builder__heading:not(:first-child) {
    margin-top: 1.5rem !important;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, #e5e5e5);
}
.form-builder-preview iframe {
    background: var(--color-surface, #f5f5f5);
}
/* Vertical-stack inside config/styling/submit sections */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.form-stack > label {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    margin: 0;
    cursor: default;
}
.form-stack > label:has(input[type="radio"]) {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.form-stack > label:has(input[type="radio"]) input {
    margin: 0;
    accent-color: var(--color-primary, #0E7570);
}
.form-stack input[type="text"],
.form-stack input[type="url"],
.form-stack textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 6px;
    font: inherit;
    font-size: 0.875rem;
    background: var(--color-white, #fff);
}
.form-stack input[type="text"]:focus,
.form-stack input[type="url"]:focus,
.form-stack textarea:focus {
    outline: 2px solid var(--color-primary, #0E7570);
    outline-offset: 1px;
    border-color: var(--color-primary, #0E7570);
}
.form-stack textarea {
    min-height: 72px;
    resize: vertical;
}
.form-stack input[type="color"] {
    width: 48px;
    height: 36px;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    background: var(--color-white, #fff);
}
.form-stack input[type="range"] {
    flex: 1;
    accent-color: var(--color-primary, #0E7570);
}
/* Standalone text/textarea inside a form-stack (no wrapping label) */
.form-stack > input[type="text"],
.form-stack > input[type="url"],
.form-stack > textarea {
    grid-template-columns: none;
}
.form-builder__heading {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}
.form-builder__list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}
.form-builder__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 6px;
    margin-bottom: 0.375rem;
    cursor: pointer;
    background: var(--color-background, #fff);
}
.form-builder__item.is-active {
    border-color: var(--color-primary, #0E7570);
    box-shadow: 0 0 0 1px var(--color-primary, #0E7570);
}
.form-builder__grip {
    color: var(--color-text-secondary);
    cursor: grab;
}
.form-builder__label { flex: 1; }
.form-builder__type {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    background: var(--color-surface, #f5f5f5);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}
.form-builder__del {
    background: none;
    border: 0;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0 0.25rem;
}
.form-builder__config label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
.form-builder__config input[type="text"],
.form-builder__config textarea,
.form-builder__config select {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 6px;
    font: inherit;
}
.form-builder__picker {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.form-builder__picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.form-builder__picker-panel {
    position: relative;
    background: var(--color-white, #fff);
    width: min(440px, 100%);
    max-height: min(80vh, 600px);
    padding: 1.25rem 1.25rem 1rem;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 20px 50px hsl(24 10% 10% / 0.25), 0 0 0 1px hsl(24 10% 10% / 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: vp-picker-in var(--motion-default) var(--motion-ease);
}
@keyframes vp-picker-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Bottom-sheet behaviour on mobile (narrower screens) */
@media (max-width: 640px) {
    .form-builder__picker {
        align-items: flex-end;
        padding: 0;
    }
    .form-builder__picker-panel {
        width: 100%;
        max-height: 80vh;
        border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
        animation: vp-picker-sheet-in var(--motion-slow) var(--motion-ease);
    }
    @keyframes vp-picker-sheet-in {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}
.form-builder__picker-panel h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary, #1A1A2E);
}
.form-builder__picker-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}
.form-builder__picker-panel li {
    margin: 0 0 0.375rem;
}
.form-builder__picker-panel li:last-child {
    margin-bottom: 0;
}
.form-builder__picker-panel button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 8px;
    background: var(--color-white, #fff);
    cursor: pointer;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--color-text-primary, #1A1A2E);
    transition: border-color 0.15s, background 0.15s;
}
.form-builder__picker-panel button:hover,
.form-builder__picker-panel button:focus-visible {
    border-color: var(--color-primary, #0E7570);
    background: rgba(14, 117, 112, 0.04);
    outline: none;
}

/* Settings card selectable (for type picker) */
.settings-card--selectable {
    cursor: pointer;
    position: relative;
}
.settings-card--selectable input[type="radio"] {
    position: absolute;
    opacity: 0;
}
.settings-card--selectable:has(input:checked) {
    border-color: var(--color-primary, #0E7570);
    box-shadow: 0 0 0 1px var(--color-primary, #0E7570);
}

/* Spec list (key/value) */
.spec-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}
.spec-list dt {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}
.spec-list dd { margin: 0; }

/* VP Chart placeholder */
.vp-chart { min-height: 120px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.data-table--compact th, .data-table--compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Vertical stack spacing for integration detail + analytics pages */
.integration-stack > * + * {
    margin-top: var(--space-lg);
}

/* Event picker (webhooks modal) */
.event-picker {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-background, #fff);
}
.event-picker__row {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--color-border, #e5e5e5);
    cursor: pointer;
    transition: background 0.15s;
    margin: 0;
}
.event-picker__row:last-child {
    border-bottom: 0;
}
.event-picker__row:hover {
    background: var(--color-surface, #f9f9f9);
}
.event-picker__row:has(input:checked) {
    background: rgba(14, 117, 112, 0.05);
}
.event-picker__row input[type="checkbox"] {
    margin: 0.1875rem 0 0 0;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary, #0E7570);
    cursor: pointer;
}
.event-picker__body {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}
.event-picker__name {
    font-size: 0.75rem;
    color: var(--color-text-secondary, #444);
    letter-spacing: 0.01em;
}
.event-picker__name code {
    background: transparent;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
}
.event-picker__label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-primary, #1A1A2E);
    line-height: 1.3;
}
.event-picker__desc {
    font-size: 0.8125rem;
    color: var(--color-text-secondary, #444);
    line-height: 1.4;
}
