/*
 * Cartuul admin design layer — applied after Filament's own stylesheet via a
 * HEAD_END render hook (see App\Filament\Support\Brand). Content-first, quiet,
 * Apple-influenced: neutral canvas, hairline borders, soft radii, no ornament.
 */

:root {
    /* Surfaces & canvas */
    --ct-canvas: #f5f5f7;            /* Apple page gray */
    --ct-surface: #ffffff;
    --ct-surface-raised: #ffffff;    /* tiles/cards that sit on a surface */
    --ct-surface-sunken: #f0f0f2;    /* wells, inset areas */

    /* Hairlines & hover */
    --ct-hairline: rgba(0, 0, 0, 0.08);
    --ct-hairline-soft: rgba(0, 0, 0, 0.05);
    --ct-hover: rgba(0, 0, 0, 0.03);

    /* Text */
    --ct-text-strong: #1d1d1f;
    --ct-text-muted: #6e6e73;
    --ct-text-faint: #86868b;        /* meta labels, captions */

    /* Brand + semantic accents (text colour / soft background pairs) */
    --ct-accent: #486db4;
    --ct-accent-strong: #3a5a99;
    --ct-accent-soft: rgba(72, 109, 180, 0.10);
    --ct-success: #1f7a4d;
    --ct-success-soft: rgba(47, 169, 140, 0.16);
    --ct-warning: #9a6a14;
    --ct-warning-soft: rgba(214, 158, 46, 0.18);
    --ct-danger: #9f3a38;
    --ct-danger-soft: rgba(159, 58, 56, 0.14);
    --ct-info: #1f6f97;
    --ct-info-soft: rgba(34, 167, 224, 0.16);
    --ct-neutral-soft: rgba(0, 0, 0, 0.06);

    /* Focus ring (keyboard a11y) */
    --ct-focus-ring: rgba(72, 109, 180, 0.45);

    /* Radii */
    --ct-r-sm: 0.5rem;
    --ct-r-md: 0.75rem;
    --ct-r-lg: 1rem;
    --ct-r-pill: 999px;

    /* Shadows */
    --ct-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --ct-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --ct-shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.12);

    /* Spacing rhythm for custom components */
    --ct-gap: 0.75rem;
    --ct-pad: 1.25rem;

    /* Mono-logo silhouette tuning (see .ct-logo-mono) */
    --ct-logo-filter: brightness(0);
    --ct-logo-opacity: 0.62;
}

.dark {
    --ct-canvas: #161618;
    --ct-surface: #1f1f22;
    --ct-surface-raised: rgba(255, 255, 255, 0.04);
    --ct-surface-sunken: #141416;

    --ct-hairline: rgba(255, 255, 255, 0.09);
    --ct-hairline-soft: rgba(255, 255, 255, 0.06);
    --ct-hover: rgba(255, 255, 255, 0.04);

    --ct-text-strong: #f5f5f7;
    --ct-text-muted: #a1a1a6;
    --ct-text-faint: #86868b;

    --ct-accent: #a9c4ee;
    --ct-accent-strong: #c3d6f4;
    --ct-accent-soft: rgba(72, 109, 180, 0.22);
    --ct-success: #66d19e;
    --ct-success-soft: rgba(47, 169, 140, 0.22);
    --ct-warning: #e3b659;
    --ct-warning-soft: rgba(214, 158, 46, 0.22);
    --ct-danger: #e88f8d;
    --ct-danger-soft: rgba(159, 58, 56, 0.26);
    --ct-info: #7fd0f2;
    --ct-info-soft: rgba(34, 167, 224, 0.22);
    --ct-neutral-soft: rgba(255, 255, 255, 0.08);

    --ct-focus-ring: rgba(125, 162, 232, 0.55);

    --ct-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --ct-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --ct-shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55);

    --ct-logo-filter: brightness(0) invert(1);
    --ct-logo-opacity: 0.7;
}

/* ---------- Canvas & typography ---------- */

.fi-body {
    background-color: var(--ct-canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.fi-header-heading {
    letter-spacing: -0.02em;
    font-weight: 650;
    color: var(--ct-text-strong);
}

/* ---------- Topbar: translucent, blurred, hairline (macOS menu bar feel) ---------- */

.fi-topbar nav {
    border-bottom: 1px solid var(--ct-hairline-soft);
    box-shadow: none;
}

.fi-topbar {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ---------- Sidebar: quiet list, soft active state ---------- */

.fi-sidebar {
    border-inline-end: 1px solid var(--ct-hairline-soft);
}

.fi-sidebar-header {
    box-shadow: none;
    border-bottom: 1px solid transparent;
}

.fi-sidebar-item-btn {
    border-radius: 0.625rem;
    transition: background-color 0.15s ease;
}

/* ---------- Surfaces: cards, tables, dropdowns, modals ---------- */

.fi-section,
.fi-ta-ctn {
    background-color: var(--ct-surface);
    border-radius: var(--ct-r-lg);
    border: 1px solid var(--ct-hairline-soft);
    box-shadow: var(--ct-shadow-sm);
}

.fi-dropdown-panel,
.fi-modal-box {
    border-radius: 0.875rem;
    border: 1px solid var(--ct-hairline-soft);
    box-shadow: var(--ct-shadow-pop);
}

/* ---------- Tables: information first ---------- */

.fi-ta-header-cell {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ct-text-muted);
}

.fi-ta-row {
    transition: background-color 0.1s ease;
}

.fi-ta-row:hover {
    background-color: var(--ct-hover);
}

.fi-ta-cell {
    font-size: 0.875rem;
}

/* Stacked (layout-column) records — the user lists: comfortable rows with
   hairline separation, like a contact list. */
.fi-ta-record-content {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.fi-ta-record:not(:last-child) {
    border-bottom: 1px solid var(--ct-hairline-soft);
}

/* ---------- Controls: calm radii, hairline inputs ---------- */

.fi-btn {
    border-radius: var(--ct-r-sm);
}

.fi-input-wrp {
    border-radius: var(--ct-r-sm);
}

.fi-badge {
    border-radius: var(--ct-r-pill);
    font-weight: 600;
    letter-spacing: 0.005em;
}

/* Consistent, brand-tinted keyboard focus ring across interactive chrome
   (Filament's default is fine but varies; this unifies it). */
.fi-btn:focus-visible,
.fi-input:focus-visible,
.fi-sidebar-item-btn:focus-visible,
.fi-link:focus-visible,
.ct-pill:focus-visible,
.ct-btn:focus-visible {
    outline: 2px solid var(--ct-focus-ring);
    outline-offset: 2px;
}

/* =====================================================================
   Reusable element library (.ct-*)
   ---------------------------------------------------------------------
   The shared vocabulary for Cartuul's custom (non-Filament) surfaces:
   dealer inventory cards, integration tiles, feed-presence/key chips,
   status pills, empty states. Built on the tokens above so they read as
   one family with Filament's own components. Prefer these over inline
   per-blade <style> blocks.
   ===================================================================== */

/* ---- Pills: the one canonical status chip ----
   Usage: <span class="ct-pill ct-pill--success"><i class="ct-pill-dot"></i> Label</span>
   Modifiers tint text + background together; the dot inherits currentColor. */
.ct-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--ct-r-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    color: var(--ct-text-muted);
    background: var(--ct-neutral-soft);
}

.ct-pill-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.ct-pill--accent  { color: var(--ct-accent);  background: var(--ct-accent-soft); }
.ct-pill--success { color: var(--ct-success); background: var(--ct-success-soft); }
.ct-pill--warning { color: var(--ct-warning); background: var(--ct-warning-soft); }
.ct-pill--danger  { color: var(--ct-danger);  background: var(--ct-danger-soft); }
.ct-pill--info    { color: var(--ct-info);    background: var(--ct-info-soft); }
.ct-pill--neutral { color: var(--ct-text-muted); background: var(--ct-neutral-soft); }

/* Standalone status dot (e.g. before a label in a list) */
.ct-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
}

/* ---- Column-help "?" badge: click to reveal a feed column's reference ---- */
.ct-col-help-anchor {
    display: inline-flex;
    vertical-align: middle;
}
.ct-col-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.95rem;
    height: 0.95rem;
    margin-left: 0.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ct-info-soft, rgba(34, 167, 224, 0.15));
    color: var(--ct-info, #1a86c7);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    user-select: none;
    appearance: none;
    transition: background 0.12s, color 0.12s;
}
.ct-col-help:hover,
.ct-col-help[aria-expanded='true'] {
    background: var(--ct-info, #22a7e0);
    color: #fff;
}
.ct-col-pop {
    position: fixed;
    z-index: 9999;
    padding: 0.5rem 0.625rem;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #fff;
    background: #1f2733;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    box-shadow: var(--ct-shadow-pop, 0 10px 30px rgba(0, 0, 0, 0.3));
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ---- Cards: a reusable surface matching .fi-section ---- */
.ct-card {
    display: flex;
    flex-direction: column;
    background: var(--ct-surface-raised);
    border: 1px solid var(--ct-hairline-soft);
    border-radius: var(--ct-r-lg);
    padding: var(--ct-pad);
    box-shadow: var(--ct-shadow-sm);
}

.ct-card-head {
    display: flex;
    align-items: flex-start;
    gap: var(--ct-gap);
}

.ct-card-title {
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.2;
    color: var(--ct-text-strong);
}

/* dt/dl meta row — quiet label over a strong value, wrapping in columns. */
.ct-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0;
}

.ct-card-meta div { font-size: 0.75rem; }
.ct-card-meta dt { color: var(--ct-text-faint); margin: 0; }
.ct-card-meta dd { margin: 0; font-weight: 650; color: var(--ct-text-strong); }

/* ---- Quiet uppercase section/meta label ---- */
.ct-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ct-text-faint);
    margin: 0.5rem 0 0.75rem;
}

/* ---- Empty state: centred icon + message ---- */
.ct-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--ct-text-muted);
}

.ct-empty svg,
.ct-empty .ct-empty-icon {
    width: 2.25rem;
    height: 2.25rem;
    opacity: 0.5;
}

/* ---- Monochrome logo silhouette ----
   Flattens any logo (colour SVG/PNG or self-uploaded) to a single
   theme-appropriate mark: black in light, white in dark, at reduced
   opacity that lifts on hover. Used for integration-module logos AND
   dealer logos (tenant switcher). Tune per-context with --ct-logo-opacity. */
.ct-logo-mono {
    filter: var(--ct-logo-filter);
    opacity: var(--ct-logo-opacity);
    transition: opacity 0.2s ease;
    object-fit: contain;
}

.ct-logo-mono:hover,
*:hover > .ct-logo-mono {
    opacity: 0.95;
}

/* ---------- Tenant (account) switcher: prominent, card-like ---------- */

.fi-tenant-menu-trigger {
    border: 1px solid var(--ct-hairline-soft);
    border-radius: 0.75rem;
    background-color: var(--ct-surface);
    padding: 0.5rem 0.625rem;
    transition: background-color 0.15s ease;
}

.fi-tenant-menu-trigger:hover {
    background-color: var(--ct-hover);
}

/* Expanded: stacked card — full-size logo with the account name centred
   beneath it; the switcher chevron tucks into the top-right corner. */
.fi-sidebar.fi-sidebar-open .fi-tenant-menu-trigger {
    position: relative;
    flex-direction: column;
    align-items: center;
    row-gap: 0.5rem;
    padding: 0.875rem 0.625rem 0.625rem;
}

.fi-sidebar.fi-sidebar-open .fi-tenant-menu-trigger > svg:last-of-type {
    position: absolute;
    top: 0.625rem;
    inset-inline-end: 0.625rem;
}

/* Logos keep their real shape: natural aspect ratio, capped, not rounded off. */
.fi-tenant-avatar {
    width: auto;
    height: auto;
    max-height: 4rem;
    max-width: 100%;
    border-radius: 0.25rem;
    object-fit: contain;
}

/* Uploaded dealer logos get the same theme-adaptive monochrome silhouette as
   integration-module logos, so a colour logo reads cleanly on the dark sidebar
   and the light one alike. Scoped to /storage/ URLs (real uploads) so Filament's
   generated initials-avatar fallback is left in full colour. */
.fi-tenant-avatar[src*="/storage/"] {
    filter: var(--ct-logo-filter);
    opacity: var(--ct-logo-opacity);
    transition: opacity 0.2s ease;
}

.fi-tenant-menu-trigger:hover .fi-tenant-avatar[src*="/storage/"] {
    opacity: 0.95;
}

/* Collapsed rail: swap the logo for a compact initials badge ("MMF") sized
   like the nav icons; name/chevron are already hidden by the sidebar store. */
.ct-tenant-initials {
    display: none;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.5rem;
    color: var(--ct-text-strong);
}

.fi-sidebar:not(.fi-sidebar-open) .fi-tenant-menu-trigger {
    padding-inline: 0.25rem;
}

.fi-sidebar:not(.fi-sidebar-open) .fi-tenant-avatar {
    display: none;
}

.fi-sidebar:not(.fi-sidebar-open) .ct-tenant-initials {
    display: block;
}

/* Account images in the switcher dropdown (rendered as background tiles). */
.fi-dropdown-list-item-image {
    width: 3rem;
    height: 1.75rem;
    border-radius: 0.25rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Same silhouette treatment for uploaded logos in the dropdown thumbnails;
   generated avatars (no /storage/ in the inline background-image) stay colour. */
.fi-dropdown-list-item-image[style*="/storage/"] {
    filter: var(--ct-logo-filter);
    opacity: var(--ct-logo-opacity);
}

.fi-tenant-menu-trigger-tenant-name {
    font-weight: 600;
    color: var(--ct-text-strong);
}

/* ---------- Guest (auth) pages: split-screen with brand panel ---------- */

.fi-body:has(> .ct-auth-brand) {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.fi-body:has(> .ct-auth-brand) .fi-simple-layout {
    grid-column: 2;
    min-height: 100vh;
}

.ct-auth-brand {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    /* Flex centring is immune to extra decorative children; the footer is
       absolutely pinned so it never pushes the greeting off-centre. */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 60px;
    color: #fff;
    background: linear-gradient(155deg, #1b2333 0%, #14161c 55%, #0a0b0e 100%);
}

/* Faint blueprint grid, fading out to the lower right. */
.ct-auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(120% 120% at 30% 20%, #000 0%, transparent 75%);
    pointer-events: none;
}

/* Ambient glows in the corp palette, breathing very slowly. */
.ct-auth-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ct-auth-glow-a {
    background: radial-gradient(120% 90% at 12% 8%, rgba(72, 109, 180, 0.45) 0%, rgba(72, 109, 180, 0) 55%);
    animation: ct-breathe 9s ease-in-out infinite alternate;
}

.ct-auth-glow-b {
    background: radial-gradient(110% 80% at 92% 96%, rgba(34, 167, 224, 0.28) 0%, rgba(34, 167, 224, 0) 50%);
    /* Negative delay: starts mid-cycle, desynced from glow-a — a positive
       delay made it sit at full opacity then visibly snap when it kicked in. */
    animation: ct-breathe 11s ease-in-out -3s infinite alternate;
}

@keyframes ct-breathe {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ct-auth-glow { animation: none; }
}

/* Particle constellation (drawn by public/js/auth-particles.js). */
.ct-auth-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.ct-auth-center,
.ct-auth-foot {
    position: relative;
    z-index: 1;
}

.ct-auth-foot {
    position: absolute;
    left: 60px;
    bottom: 28px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.42);
}

.ct-auth-greet {
    font-weight: 600;
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: -0.025em;
    /* Moving gradient in pale tints of the badge palette (blue, mint, cyan,
       lavender) — mostly white so it reads as light, with a slow ping-pong
       sweep matching the constellation's pulse rhythm, and a soft glow.
       (drop-shadow, not text-shadow: the fill is transparent.) */
    background: linear-gradient(100deg,
        #f3f6fd 0%, #aac8f2 22%, #9fe6d2 42%, #a8ddf4 60%, #c4b4ec 80%, #f3f6fd 100%);
    background-size: 320% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: ct-greet-sheen 16s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 22px rgba(120, 160, 230, 0.3));
}

@keyframes ct-greet-sheen {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .ct-auth-greet { animation: none; }
}

.ct-auth-sub {
    margin-top: 16px;
    font-size: 16.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    max-width: 30ch;
}

/* Lift the brand logo out of the form card: it floats centred above the box
   instead of sitting inside it. The card anchors the absolute position. */
.fi-body:has(> .ct-auth-brand) .fi-simple-main {
    position: relative;
}

.fi-body:has(> .ct-auth-brand) .fi-simple-header .fi-logo {
    position: absolute;
    bottom: calc(100% + 2.25rem);
    left: 50%;
    transform: translateX(-50%);
}

/* Larger wordmark on the auth pages than in the panel chrome (the blade and
   Brand::panel() set 1.75rem inline, hence the !important). */
.fi-body:has(> .ct-auth-brand) .fi-simple-header .fi-logo,
.fi-body:has(> .ct-auth-brand) .fi-simple-header .fi-logo img {
    height: 2.75rem !important;
}

/* …and the v2 mark scales with it. */
.fi-body:has(> .ct-auth-brand) .fi-simple-header .fi-logo .cartuul-v2 {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
}

/* Reserve headroom so the floated logo never clips at the viewport top. */
.fi-body:has(> .ct-auth-brand) .fi-simple-main-ctn {
    padding-top: 6rem;
}

@media (max-width: 900px) {
    .fi-body:has(> .ct-auth-brand) {
        grid-template-columns: 1fr;
    }

    .fi-body:has(> .ct-auth-brand) .fi-simple-layout {
        grid-column: 1;
        min-height: auto;
    }

    /* On the slim mobile layout there is no room above the card — keep the
       logo in flow inside the header. */
    .fi-body:has(> .ct-auth-brand) .fi-simple-header .fi-logo {
        position: static;
        transform: none;
        margin-inline: auto;
    }

    /* Slim header: greeting only, centred — no sub-texts, no particles.
       Kept compact so the form fields stay above the fold. */
    .ct-auth-brand {
        position: static;
        height: auto;
        justify-content: center;
        align-items: center;
        padding: 0.875rem 1.25rem;
    }

    .ct-auth-canvas,
    .ct-auth-sub,
    .ct-auth-foot {
        display: none;
    }

    .ct-auth-greet {
        font-size: 1.125rem;
        line-height: 1.2;
    }

    /* Tighten the form side's vertical padding so inputs are visible
       without scrolling on a phone. */
    .fi-body:has(> .ct-auth-brand) .fi-simple-main-ctn {
        padding-top: 0.5rem;
    }

    .fi-body:has(> .ct-auth-brand) .fi-simple-main {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .fi-body:has(> .ct-auth-brand) .fi-simple-header {
        margin-bottom: 0.5rem;
    }
}

/* ---------- Inventory labels ---------- */

/*
 * Coloured label pills applied to vehicles. Background and text colour are set
 * inline from the dealer's label definition (Label::color / ::textColor()).
 * Blinking labels use ct-lbl--blink to draw attention.
 */

@keyframes ct-label-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.ct-lbl {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: var(--ct-r-pill);
    font-size: 0.71875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ct-lbl--blink {
    animation: ct-label-blink 1.4s ease-in-out infinite;
}

/* ---------- Scrollbars: thin and unobtrusive ---------- */

.fi-body ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fi-body ::-webkit-scrollbar-thumb {
    background-color: var(--ct-hairline);
    border-radius: 999px;
}

.fi-body ::-webkit-scrollbar-track {
    background: transparent;
}

/* ──────────────────────────────────────────────────────────────────────────
   Compact form — dense, multi-column modal layout (v1 "Add task" style).
   Reusable: wrap any Filament schema in a group with class `ct-compact-form`.
   ────────────────────────────────────────────────────────────────────────── */
.ct-compact-form .fi-sc-has-gap { gap: 0.5rem !important; }
.ct-compact-form .fi-fo-field-label { margin-bottom: 0.05rem; }
.ct-compact-form .fi-fo-field-label-label,
.ct-compact-form .fi-fo-field-label { font-size: 0.7rem; font-weight: 600; color: #6b7280; }
.dark .ct-compact-form .fi-fo-field-label-label,
.dark .ct-compact-form .fi-fo-field-label { color: #9aa3b2; }
/* Tighter, smaller inputs / selects */
.ct-compact-form .fi-input,
.ct-compact-form .fi-input-wrp .fi-select-input,
.ct-compact-form .fi-input-wrp input { padding-top: 0.3rem; padding-bottom: 0.3rem; font-size: 0.82rem; min-height: 0; }
.ct-compact-form .fi-input-wrp { border-radius: 0.45rem; }
.ct-compact-form textarea.fi-input { padding-top: 0.4rem; }
/* Sections become thin, chrome-light blocks — no big card borders/descriptions */
.ct-compact-form .fi-section { border-radius: 0.5rem; box-shadow: none; }
.ct-compact-form .fi-section-header { padding: 0.45rem 0.7rem; }
.ct-compact-form .fi-section-header-heading { font-size: 0.78rem; }
.ct-compact-form .fi-section-header-description { display: none; }
.ct-compact-form .fi-section-content { padding: 0.55rem 0.7rem; }
/* Repeater rows tight */
.ct-compact-form .fi-fo-repeater-item { border-radius: 0.45rem; }
.ct-compact-form .fi-fo-repeater-item-header { padding: 0.3rem 0.6rem; }
.ct-compact-form .fi-fo-repeater-item-content { padding: 0.5rem 0.6rem; }
/* Tabs as a tight pill row (Employees / Approval / Departments / Vendors) */
.ct-compact-form .fi-tabs { gap: 0.25rem; padding: 0.2rem; }
.ct-compact-form .fi-tabs-item { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
/* Toggles / checkboxes inline-tight */
.ct-compact-form .fi-fo-toggle { transform: scale(0.9); }

/* ── Task modal: attendants picker (Employees / Approval / Departments / Vendors) ── */
.ct-task-attend { display: grid; gap: 0.5rem; }
.ct-task-attend-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
@media (max-width: 640px) { .ct-task-attend-bar { grid-template-columns: repeat(2, 1fr); } }
.ct-task-attend-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    padding: 0.5rem 0.6rem; font-size: 0.78rem; font-weight: 600; cursor: pointer;
    color: var(--ct-accent); background: var(--ct-accent-soft);
    border: 1px solid var(--ct-hairline); border-radius: var(--ct-r-md);
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.ct-task-attend-btn:hover { background: var(--ct-accent); color: #fff; border-color: var(--ct-accent); }
.ct-task-attend-btn--active { background: var(--ct-accent); color: #fff; border-color: var(--ct-accent); }
.ct-task-attend-ico { width: 1rem; height: 1rem; }
.ct-task-attend-panel {
    background: var(--ct-surface-sunken); border: 1px solid var(--ct-hairline);
    border-radius: var(--ct-r-md); padding: 0.6rem; display: grid; gap: 0.5rem;
}
.ct-task-attend-search { width: 100%; }
.ct-task-attend-list {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem 0.5rem;
    max-height: 280px; overflow-y: auto;
}
@media (max-width: 640px) { .ct-task-attend-list { grid-template-columns: 1fr; } }
.ct-task-attend-item {
    text-align: left; padding: 0.3rem 0.5rem; font-size: 0.78rem; cursor: pointer;
    background: transparent; border: 0; border-bottom: 1px dotted var(--ct-hairline);
    color: inherit; border-radius: 0.3rem;
}
.ct-task-attend-item:hover { background: var(--ct-accent); color: #fff; }
.ct-task-attend-item--inactive { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.ct-task-attend-item--inactive:hover { background: transparent; color: inherit; }
.ct-task-attend-empty { grid-column: 1 / -1; text-align: center; font-size: 0.75rem; color: var(--ct-text-muted); padding: 0.5rem; }
.ct-task-attend-pool { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.ct-task-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.5rem;
    font-size: 0.75rem; border-radius: var(--ct-r-pill); border: 1px solid transparent;
}
.ct-task-chip-x { cursor: pointer; background: transparent; border: 0; font-size: 1rem; line-height: 1; color: inherit; opacity: 0.7; }
.ct-task-chip-x:hover { opacity: 1; }
.ct-task-chip--user { background: var(--ct-info-soft); color: var(--ct-info); border-color: var(--ct-info); }
.ct-task-chip--aprooval { background: var(--ct-success-soft); color: var(--ct-success); border-color: var(--ct-success); }
.ct-task-chip--department { background: var(--ct-accent-soft); color: var(--ct-accent); border-color: var(--ct-accent); }
.ct-task-chip--vendor { background: var(--ct-warning-soft); color: var(--ct-warning); border-color: var(--ct-warning); }
/* Approval sub-toggle (members | departments) */
.ct-task-attend-sub { display: inline-flex; gap: 0.25rem; padding: 0.15rem; background: var(--ct-surface); border: 1px solid var(--ct-hairline); border-radius: var(--ct-r-pill); width: fit-content; }
.ct-task-attend-sub-btn { padding: 0.2rem 0.7rem; font-size: 0.72rem; font-weight: 600; cursor: pointer; background: transparent; border: 0; border-radius: var(--ct-r-pill); color: var(--ct-text-muted); }
.ct-task-attend-sub-btn--active { background: var(--ct-accent); color: #fff; }
/* Department-approver chip: same green as member-approver, dashed to distinguish */
.ct-task-chip--aprooval_dept { background: var(--ct-success-soft); color: var(--ct-success); border-color: var(--ct-success); border-style: dashed; }

/* ── Recon pipeline diagram (Vehicle category editor) ───────────────────── */
.ct-recon-diagram { margin-bottom: 0.5rem; }
.ct-recon-diagram-empty { font-size: 0.8rem; color: var(--ct-text-muted); font-style: italic; }
.ct-recon-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.25rem; padding: 0.85rem; background: var(--ct-neutral-soft); border: 1px solid var(--ct-hairline); border-radius: var(--ct-r-md); overflow-x: auto; }
.ct-recon-stepwrap { display: flex; align-items: center; gap: 0.25rem; }
.ct-recon-step { min-width: 9rem; max-width: 14rem; display: flex; flex-direction: column; gap: 0.45rem; padding: 0.6rem 0.65rem; background: var(--ct-surface); border: 1px solid var(--ct-hairline); border-top: 3px solid var(--ct-neutral-soft); border-radius: var(--ct-r-md); box-shadow: var(--ct-shadow-sm); }
.ct-recon-step[data-marker="in_transit"] { border-top-color: var(--ct-info); }
.ct-recon-step[data-marker="recon"] { border-top-color: var(--ct-warning); }
.ct-recon-step[data-marker="frontline_ready"] { border-top-color: var(--ct-success); }
.ct-recon-step-head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.ct-recon-stepno { font-size: 0.66rem; font-weight: 600; color: var(--ct-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ct-recon-marker { font-size: 0.66rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: var(--ct-r-pill); background: var(--ct-neutral-soft); color: var(--ct-text-muted); }
.ct-recon-marker--info { background: var(--ct-info-soft); color: var(--ct-info); }
.ct-recon-marker--warning { background: var(--ct-warning-soft); color: var(--ct-warning); }
.ct-recon-marker--success { background: var(--ct-success-soft); color: var(--ct-success); }
.ct-recon-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ct-recon-chip { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; font-weight: 500; padding: 0.15rem 0.5rem; border-radius: var(--ct-r-pill); background: var(--ct-accent-soft); color: var(--ct-accent); border: 1px solid transparent; }
.ct-recon-chip.is-mandatory { background: transparent; border-color: var(--ct-accent); font-weight: 600; }
.ct-recon-chip--empty { background: transparent; color: var(--ct-text-muted); font-style: italic; border: 1px dashed var(--ct-hairline); }
.ct-recon-req { color: var(--ct-warning); font-size: 0.7rem; line-height: 1; }
.ct-recon-arrow { color: var(--ct-text-muted); font-size: 1.1rem; padding: 0 0.1rem; }
