/* ============================================================================
   MyFleet — Design system
   ============================================================================
   Single source of truth for tokens, primitives, and components.
   Pages should reference this file via:
     <link rel="stylesheet" href="/assets/css/app.css">
   and only carry page-specific overrides.
   ============================================================================ */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --c-primary:        #1c1917;
    --c-primary-soft:   #292524;
    --c-primary-pressed:#0c0a09;

    /* Greys (stone palette) */
    --c-bg:             #f5f5f4;
    --c-bg-elevated:    #ffffff;
    --c-surface-glass:  rgba(255, 255, 255, 0.78);
    --c-line:           #e7e5e4;
    --c-line-strong:    #d6d3d1;

    /* Text */
    --c-text:           #1c1917;
    --c-text-muted:     #57534e;
    --c-text-soft:      #78716c;
    --c-text-faint:     #a8a29e;
    --c-text-on-dark:   #fafaf9;

    /* Semantic */
    --c-ok:             #16a34a;
    --c-ok-bg:          #f0fdf4;
    --c-ok-border:      #bbf7d0;
    --c-warn:           #d97706;
    --c-warn-bg:        #fffbeb;
    --c-warn-border:    #fde68a;
    --c-danger:         #dc2626;
    --c-danger-bg:      #fef2f2;
    --c-danger-border:  #fecaca;
    --c-info:           #2563eb;
    --c-info-bg:        #eff6ff;
    --c-info-border:    #bfdbfe;
    --c-accent:         #7e22ce;
    --c-accent-bg:      #f3e8ff;
    --c-accent-border:  #e9d5ff;
    --c-bodywork:       #ea580c;
    --c-bodywork-bg:    #fff7ed;
    --c-bodywork-border:#fed7aa;

    /* Radius */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-pill: 999px;

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
    --shadow-lg: 0 1px 3px rgba(0, 0, 0, .04), 0 16px 40px rgba(0, 0, 0, .06);
    --shadow-focus: 0 0 0 3px rgba(28, 25, 23, .08);

    /* Glass */
    --blur-glass: 12px;

    /* Transitions */
    --t-fast: .12s ease;
    --t-normal: .18s ease;
    --t-slow: .28s ease;

    /* Z-index */
    --z-sticky: 30;
    --z-overlay: 100;
    --z-modal: 110;
    --z-toast: 120;

    /* Layout */
    --container-narrow: 560px;
    --container-form:   720px;
    --container-base:   960px;
    --container-wide:   1200px;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --t-fast: 0s;
        --t-normal: 0s;
        --t-slow: 0s;
    }
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

button { background: none; border: none; cursor: pointer; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}
.container-narrow { max-width: var(--container-narrow); }
.container-form   { max-width: var(--container-form); }
.container-base   { max-width: var(--container-base); }
.container-wide   { max-width: var(--container-wide); }

.stack { display: flex; flex-direction: column; }
.row   { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* --------------------------------------------------------------------------
   4. Typography helpers
   -------------------------------------------------------------------------- */
.t-11 { font-size: 11px; }
.t-12 { font-size: 12px; }
.t-13 { font-size: 13px; }
.t-14 { font-size: 14px; }
.t-15 { font-size: 15px; }
.t-18 { font-size: 18px; }
.t-22 { font-size: 22px; line-height: 1.25; letter-spacing: -.4px; }
.t-26 { font-size: 26px; line-height: 1.2;  letter-spacing: -.5px; }
.t-32 { font-size: 32px; line-height: 1.15; letter-spacing: -.7px; font-weight: 700; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-strong { color: var(--c-text); }
.text-muted  { color: var(--c-text-muted); }
.text-soft   { color: var(--c-text-soft); }
.text-faint  { color: var(--c-text-faint); }
.text-danger { color: var(--c-danger); }
.text-ok     { color: var(--c-ok); }
.text-warn   { color: var(--c-warn); }

.uppercase { text-transform: uppercase; letter-spacing: .5px; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabular   { font-variant-numeric: tabular-nums; }
.center-text { text-align: center; }

.page-title    { font-size: 24px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.page-subtitle { font-size: 13px; color: var(--c-text-soft); margin-top: 4px; }
.section-title { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.field-section-title {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
    color: var(--c-text-faint);
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--c-bg);
}

/* --------------------------------------------------------------------------
   5. Navbar
   -------------------------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--c-primary);
    color: var(--c-text-on-dark);
}
.navbar-left, .navbar-right { display: flex; align-items: center; gap: 16px; }
.navbar-logo {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.navbar-logo span {
    color: var(--c-text-faint);
    font-weight: 400;
}
.navbar-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.navbar-sep {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, .14);
}
.navbar-link, .back-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-faint);
    text-decoration: none;
    transition: color var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.navbar-link:hover, .back-link:hover { color: var(--c-text-on-dark); }
.back-link svg { width: 16px; height: 16px; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--c-text-faint);
    margin-bottom: 12px;
}
.breadcrumb a {
    color: var(--c-text-faint);
    transition: color var(--t-fast);
}
.breadcrumb a:hover { color: var(--c-text); }
.breadcrumb-current {
    color: var(--c-text-muted);
    font-weight: 600;
}
.breadcrumb-sep {
    color: var(--c-line-strong);
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--c-bg-elevated);
    border-radius: var(--r-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
}
.glass-card {
    background: var(--c-surface-glass);
    backdrop-filter: blur(var(--blur-glass));
    -webkit-backdrop-filter: blur(var(--blur-glass));
    border-radius: var(--r-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(229, 229, 229, .6);
}
.card-tight { padding: 18px 20px; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--c-bg);
    flex-wrap: wrap;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    min-height: 44px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: var(--c-text-on-dark);
    background: var(--c-primary);
    border: 1px solid var(--c-primary);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t-fast), transform .08s ease, opacity var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.btn:hover  { background: var(--c-primary-soft); border-color: var(--c-primary-soft); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 14px; height: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 7px 12px; min-height: 32px; font-size: 12px; }

.btn-secondary, .btn-outline {
    color: var(--c-text);
    background: var(--c-bg-elevated);
    border-color: var(--c-line-strong);
}
.btn-secondary:hover, .btn-outline:hover {
    background: var(--c-bg);
    border-color: var(--c-text-faint);
}

.btn-ghost {
    color: var(--c-text-muted);
    background: transparent;
    border-color: transparent;
}
.btn-ghost:hover { color: var(--c-text); background: var(--c-bg); }

.btn-danger {
    color: var(--c-danger);
    background: var(--c-danger-bg);
    border-color: var(--c-danger-border);
}
.btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: var(--c-danger);
}

.btn-danger-solid {
    color: var(--c-text-on-dark);
    background: var(--c-danger);
    border-color: var(--c-danger);
}
.btn-danger-solid:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--c-text-soft);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 12px;
    font-weight: 500;
    padding: 0;
    min-height: auto;
    text-align: inherit;
}
.btn-link:hover { color: var(--c-text); }

.btn-icon-only {
    width: 36px;
    min-height: 36px;
    padding: 0;
}
.btn-icon-only svg { width: 16px; height: 16px; }

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin .7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: 6px;
}
.field-label-uppercase {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-faint);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
    display: block;
}
.field-input,
input.field-input,
select.field-input,
textarea.field-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    outline: none;
    background: rgba(250, 250, 249, .85);
    color: var(--c-text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field-input:focus { border-color: var(--c-primary); box-shadow: var(--shadow-focus); background: var(--c-bg-elevated); }
.field-input::placeholder { color: var(--c-text-faint); }
.field-input.has-error { border-color: var(--c-danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }

.field-hint  { font-size: 11px; color: var(--c-text-faint); margin-top: 5px; line-height: 1.5; }
.field-error { font-size: 12px; color: var(--c-danger); margin-top: 5px; font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   9. Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--r-sm);
    white-space: nowrap;
    line-height: 1.4;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-ok       { background: var(--c-ok-bg);       color: var(--c-ok); }
.badge-ok .dot  { background: var(--c-ok); }
.badge-warn     { background: var(--c-warn-bg);     color: var(--c-warn); }
.badge-warn .dot{ background: var(--c-warn); }
.badge-danger,
.badge-over     { background: var(--c-danger-bg);   color: var(--c-danger); }
.badge-danger .dot,
.badge-over .dot{ background: var(--c-danger); }
.badge-info     { background: var(--c-info-bg);     color: var(--c-info); }
.badge-info .dot{ background: var(--c-info); }
.badge-accent,
.badge-purple   { background: var(--c-accent-bg);   color: var(--c-accent); }
.badge-accent .dot,
.badge-purple .dot { background: var(--c-accent); }
.badge-bodywork {
    background: var(--c-bodywork-bg);
    color: var(--c-bodywork);
    border: 1px solid var(--c-bodywork-border);
}
.badge-bodywork .dot { background: var(--c-bodywork); }
.badge-neutral  { background: var(--c-bg);          color: var(--c-text-muted); }
.badge-neutral .dot { background: var(--c-text-soft); }

.badge-pill { border-radius: var(--r-pill); padding: 3px 10px; font-size: 11px; }

/* --------------------------------------------------------------------------
   10. Alerts (page-level flash messages)
   -------------------------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
}
.alert-success { background: var(--c-ok-bg);     color: var(--c-ok);     border-color: var(--c-ok-border); }
.alert-error,
.alert-danger  { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger-border); }
.alert-warning { background: var(--c-warn-bg);   color: var(--c-warn);   border-color: var(--c-warn-border); }
.alert-info    { background: var(--c-info-bg);   color: var(--c-info);   border-color: var(--c-info-border); }

/* --------------------------------------------------------------------------
   11. Tables
   -------------------------------------------------------------------------- */
.table-wrap {
    background: var(--c-bg-elevated);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--c-line);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
    text-align: left;
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-faint);
    text-transform: uppercase;
    letter-spacing: .5px;
    background: rgba(250, 250, 249, .9);
    border-bottom: 1px solid var(--c-line);
    position: sticky;
    top: 0;
    z-index: 2;
    user-select: none;
}
.table thead th.sortable {
    cursor: pointer;
    transition: color var(--t-fast);
}
.table thead th.sortable:hover { color: var(--c-text); }
.table thead th.sortable .sort-arrow {
    margin-left: 4px;
    opacity: .35;
    font-size: 10px;
}
.table thead th.sort-asc  .sort-arrow,
.table thead th.sort-desc .sort-arrow { opacity: 1; color: var(--c-text); }
.table thead th.right { text-align: right; }
.table tbody tr  { border-bottom: 1px solid var(--c-bg); transition: background var(--t-fast); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr.row-clickable { cursor: pointer; }
.table tbody tr.row-clickable:hover { background: rgba(250, 250, 249, .8); }
.table tbody td  { padding: 16px 20px; vertical-align: middle; }
.table tbody td.right { text-align: right; }

/* --------------------------------------------------------------------------
   12. Empty state
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--c-text-soft);
}
.empty-state .empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--c-text-faint);
}
.empty-state .empty-icon svg { width: 100%; height: 100%; }
.empty-state h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 6px;
}
.empty-state p {
    font-size: 13px;
    color: var(--c-text-soft);
    margin-bottom: 20px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   13. Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, .42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
    width: 100%;
    max-width: 460px;
    background: var(--c-bg-elevated);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    animation: modalIn .22s cubic-bezier(.16,1,.3,1);
}
@keyframes modalIn {
    from { transform: scale(.96) translateY(8px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 12px;
    gap: 12px;
}
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.modal-head p  { font-size: 13px; color: var(--c-text-soft); margin-top: 4px; line-height: 1.5; }
.modal-body {
    padding: 12px 24px 16px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--c-bg);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    color: var(--c-text-faint);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--c-bg); color: var(--c-text); }
.modal-close svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   14. Toast (global)
   -------------------------------------------------------------------------- */
#toastContainer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: var(--z-toast);
    pointer-events: none;
    width: 100%;
    max-width: 360px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--c-primary);
    color: var(--c-text-on-dark);
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--t-slow), transform var(--t-slow);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { background: var(--c-ok); }
.toast-error,
.toast-danger  { background: var(--c-danger); }
.toast-warning { background: var(--c-warn); }
.toast-info    { background: var(--c-info); }

/* --------------------------------------------------------------------------
   15. Stats grid (admin dashboards)
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
    background: var(--c-bg-elevated);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-line);
}
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-soft);
    margin-bottom: 8px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.7px;
    color: var(--c-text);
    line-height: 1.05;
}
.stat-value.ok     { color: var(--c-ok); }
.stat-value.warn   { color: var(--c-warn); }
.stat-value.danger { color: var(--c-danger); }

/* --------------------------------------------------------------------------
   16. Search input
   -------------------------------------------------------------------------- */
.search-wrap {
    position: relative;
    max-width: 320px;
    width: 100%;
}
.search-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--c-text-faint);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    font-size: 13px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    background: var(--c-bg-elevated);
    color: var(--c-text);
    outline: none;
    transition: border-color var(--t-fast);
}
.search-input:focus { border-color: var(--c-primary); }

/* --------------------------------------------------------------------------
   17. Page header / actions
   -------------------------------------------------------------------------- */
.page-wrap {
    max-width: var(--container-base);
    margin: 0 auto;
    padding: 32px 24px 80px;
}
.page-wrap-narrow { max-width: var(--container-narrow); }
.page-wrap-form   { max-width: var(--container-form); }
.page-wrap-wide   { max-width: var(--container-wide); }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   18. Section header (above tables / lists)
   -------------------------------------------------------------------------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    background: var(--c-bg-elevated);
    padding: 12px 16px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--c-line);
    gap: 16px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   19. Confirmation modal (custom replace for window.confirm)
   -------------------------------------------------------------------------- */
.confirm-modal { max-width: 420px; }
.confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-icon.danger  { background: var(--c-danger-bg); color: var(--c-danger); }
.confirm-icon.warning { background: var(--c-warn-bg);   color: var(--c-warn); }
.confirm-icon.info    { background: var(--c-info-bg);   color: var(--c-info); }

.confirm-type-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    letter-spacing: 1px;
}
.confirm-type-input:focus {
    border-color: var(--c-danger);
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

/* --------------------------------------------------------------------------
   20. Combobox (searchable dropdown)
   -------------------------------------------------------------------------- */
.combobox { position: relative; width: 100%; }

.combobox-trigger {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    background: var(--c-bg-elevated);
    color: var(--c-text);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.combobox-trigger:hover  { border-color: var(--c-text-faint); }
.combobox-trigger:focus,
.combobox.open .combobox-trigger {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: var(--shadow-focus);
}
.combobox-trigger.placeholder { color: var(--c-text-faint); }
.combobox-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.combobox-trigger .chevron {
    width: 14px;
    height: 14px;
    color: var(--c-text-faint);
    transition: transform var(--t-fast);
    flex-shrink: 0;
}
.combobox.open .combobox-trigger .chevron { transform: rotate(180deg); }

.combobox-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--c-bg-elevated);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    display: none;
    max-height: 320px;
    flex-direction: column;
    overflow: hidden;
    animation: comboIn .14s ease-out;
}
.combobox.open .combobox-panel { display: flex; }
@keyframes comboIn {
    from { transform: translateY(-4px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.combobox-search-wrap {
    padding: 8px;
    border-bottom: 1px solid var(--c-bg);
    position: relative;
    flex-shrink: 0;
}
.combobox-search-wrap .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--c-text-faint);
    pointer-events: none;
}
.combobox-search {
    width: 100%;
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    background: var(--c-bg);
    color: var(--c-text);
    outline: none;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.combobox-search:focus {
    border-color: var(--c-primary);
    background: var(--c-bg-elevated);
}
.combobox-search::placeholder { color: var(--c-text-faint); }

.combobox-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.combobox-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--c-text);
    cursor: pointer;
    transition: background var(--t-fast);
    user-select: none;
}
.combobox-option:hover,
.combobox-option.active { background: var(--c-bg); }
.combobox-option.selected {
    color: var(--c-primary);
    font-weight: 600;
    background: rgba(28, 25, 23, .04);
}
.combobox-option.selected::after {
    content: '';
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1917' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='4.5,12.75 10.5,18.75 19.5,5.25'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}
.combobox-opt-main {
    flex: 1;
    min-width: 0;
}
.combobox-opt-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.combobox-opt-sub {
    font-size: 11px;
    color: var(--c-text-soft);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}
.combobox-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--c-text-faint);
}

/* --------------------------------------------------------------------------
   21. Visually hidden (a11y)
   -------------------------------------------------------------------------- */
.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;
}
