:root {
    --bg-dark: #070c12;
    --bg-panel: rgba(14, 20, 28, 0.88);
    --bg-card: #151c26;
    --bg-card-hover: #1a2330;
    --bg-topbar: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(14, 20, 28, 0.85));
    --bg-modal: #0f151c;
    --bg-field: rgba(255, 255, 255, 0.04);
    --bg-field-soft: rgba(255, 255, 255, 0.03);
    --bg-panel-solid: #0a1018;
    --bg-hero: linear-gradient(135deg, #0a0e14, #141b24);
    --bg-empty-media: linear-gradient(135deg, rgba(30, 37, 48, 0.6), rgba(12, 18, 24, 0.9));
    --bg-overlay: radial-gradient(ellipse at top, rgba(7, 12, 18, 0.4), rgba(7, 12, 18, 0.92));
    --line: rgba(255, 255, 255, 0.06);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-label: #64748b;
    --accent: #f5a623;
    --accent-soft: rgba(245, 166, 35, 0.15);
    --accent-dark: #d4891b;
    --green: #10b981;
    --green-soft: rgba(16, 185, 129, 0.15);
    --teal: #06b6d4;
    --blue: #3b82f6;
    --blue-soft: rgba(59, 130, 246, 0.15);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.15);
    --yellow: #eab308;
    --yellow-soft: rgba(234, 179, 8, 0.15);
    --purple: #a855f7;
    --purple-soft: rgba(168, 85, 247, 0.15);
    --gray: #64748b;

    --type-auto: #3b82f6;
    --type-pickup: #f5a623;
    --type-camioneta: #f97316;
    --type-camion: #ef4444;
    --type-moto: #10b981;
    --type-maquinaria: #a855f7;
    --type-default: #64748b;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="light"] {
    --bg-dark: #f4f0e8;
    --bg-panel: rgba(255, 251, 245, 0.92);
    --bg-card: #fffdf8;
    --bg-card-hover: #f8f2e7;
    --bg-topbar: linear-gradient(to right, rgba(255, 250, 243, 0.98), rgba(249, 242, 230, 0.96));
    --bg-modal: #fffdf8;
    --bg-field: rgba(82, 60, 35, 0.06);
    --bg-field-soft: rgba(82, 60, 35, 0.04);
    --bg-panel-solid: #f8f1e5;
    --bg-hero: linear-gradient(135deg, #fffdf8, #f5ecdd);
    --bg-empty-media: linear-gradient(135deg, rgba(226, 214, 196, 0.9), rgba(244, 237, 225, 0.95));
    --bg-overlay: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.55), rgba(239, 229, 214, 0.95));
    --line: rgba(76, 53, 28, 0.10);
    --line-strong: rgba(76, 53, 28, 0.20);
    --text: #1d2733;
    --text-muted: #5c6b7c;
    --text-label: #766b5d;
    --shadow-sm: 0 10px 26px rgba(102, 72, 34, 0.10);
    --shadow-md: 0 18px 40px rgba(102, 72, 34, 0.14);
    --shadow-lg: 0 24px 60px rgba(102, 72, 34, 0.18);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

html, body { min-height: 100%; }

body {
    font-family: 'Montserrat', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg-dark);
    overflow-x: hidden;
    font-size: 13px;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

body.modal-open { overflow: hidden; }

/* ---------- BG VIDEO ---------- */
#bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.25);
    will-change: transform;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-overlay);
}

/* ---------- DEMO BANNER ---------- */
.demo-banner {
    margin-bottom: 10px;
    animation: slideDown 0.3s var(--ease);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.demo-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--red-soft);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-md);
}

.demo-banner-inner > i { font-size: 18px; color: var(--red); margin-top: 2px; }
.demo-banner-text { flex: 1; }
.demo-banner-text strong { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #fca5a5; }
.demo-banner-text p { margin: 4px 0 0; font-size: 11px; color: #cbd5e1; line-height: 1.4; }
.demo-banner-text code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 3px; font-size: 10px; }
.demo-banner-detail { color: #94a3b8 !important; font-style: italic; }

.demo-banner-close {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: #94a3b8;
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.demo-banner-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---------- SHELL ---------- */
.app-shell {
    width: calc(100% - 24px);
    max-width: none;
    margin: 10px auto 24px;
}

/* ---------- PANELS ---------- */
.topbar,
.hero-panel,
.toolbar-panel,
.fleet-section,
.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.topbar {
    border-radius: var(--radius-lg);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--bg-topbar);
}

.topbar-actions {
    justify-content: flex-end;
}

.brand-lockup { display: flex; align-items: center; gap: 12px; }

.brand-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent-soft), rgba(245, 166, 35, 0.05));
    border: 1px solid rgba(245, 166, 35, 0.25);
    flex-shrink: 0;
}

.brand-mark img { width: 26px; height: 26px; object-fit: contain; }

.brand-copy h1,
.hero-copy h2,
.section-heading h3,
.modal-header h3,
.detail-plate-block h2,
.damage-header h4,
.report-sheet h2,
.report-sheet h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

.brand-copy h1 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.subcopy {
    margin: 2px 0 0;
    color: var(--accent);
    font-size: 9px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 9px;
    font-weight: 800;
    color: var(--accent);
}

/* ---------- BUTTONS ---------- */
.topbar-actions,
.hero-actions,
.filter-row,
.form-actions,
.report-actions,
.sidebar-actions,
.feature-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.top-pill,
.action-btn,
.side-action,
.feature-chip {
    border: 1px solid var(--line-strong);
    border-radius: 30px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle {
    min-width: 132px;
    justify-content: center;
}

.top-pill:hover,
.action-btn:hover,
.side-action:hover,
.feature-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.top-pill.accent,
.action-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: transparent;
    color: #1a0f00;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.top-pill.accent:hover,
.action-btn.primary:hover {
    box-shadow: 0 6px 18px rgba(245, 166, 35, 0.45);
    color: #000;
}

.action-btn.ghost,
.action-btn.subtle {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.action-btn.ghost:hover,
.action-btn.subtle:hover {
    color: var(--text);
}

.action-btn.full { width: 100%; justify-content: center; }

/* ---------- WORKSPACE ---------- */
.workspace { margin-top: 10px; display: grid; gap: 10px; }

.workspace > section {
    animation: sectionRise 0.55s var(--ease) both;
}

.workspace > section:nth-child(2) { animation-delay: 0.06s; }
.workspace > section:nth-child(3) { animation-delay: 0.12s; }

@keyframes sectionRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- HERO ---------- */
.hero-panel {
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 18px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.hero-panel::before {
    content: "";
    position: absolute;
    right: -80px; top: -80px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.1), transparent 70%);
    pointer-events: none;
    animation: heroGlow 9s ease-in-out infinite;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% 34%;
    height: 220px;
    background: linear-gradient(90deg, transparent 0%, rgba(245, 166, 35, 0.10) 48%, transparent 100%);
    transform: rotate(-8deg);
    opacity: 0.9;
    pointer-events: none;
}

@keyframes heroGlow {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.8; }
    50% { transform: scale(1.08) translateY(8px); opacity: 1; }
}

.hero-copy { position: relative; z-index: 1; }

.hero-copy h2 {
    font-size: clamp(1.1rem, 1.8vw, 1.6rem);
    line-height: 1.15;
    max-width: 16ch;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: heroTitleIn 0.7s var(--ease) both;
}

@keyframes heroTitleIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-text {
    margin: 6px 0 12px;
    max-width: 52ch;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.55;
    animation: heroTextIn 0.8s var(--ease) both;
    animation-delay: 0.08s;
}

@keyframes heroTextIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-strip {
    margin-top: 12px;
}

.hero-strip .feature-chip {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    animation: chipPulse 6s ease-in-out infinite;
}

.hero-strip .feature-chip:nth-child(2) { animation-delay: 0.8s; }
.hero-strip .feature-chip:nth-child(3) { animation-delay: 1.6s; }

@keyframes chipPulse {
    0%, 100% { transform: translateY(0); border-color: var(--line-strong); }
    50% { transform: translateY(-2px); border-color: rgba(245, 166, 35, 0.36); }
}

/* ---------- SUMMARY ---------- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-self: center;
}

.summary-card {
    border-radius: var(--radius-md);
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--bg-card);
    min-height: 72px;
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
    overflow: hidden;
    animation: cardFloatIn 0.55s var(--ease) both;
}

.summary-card:nth-child(2) { animation-delay: 0.08s; }
.summary-card:nth-child(3) { animation-delay: 0.16s; }
.summary-card:nth-child(4) { animation-delay: 0.24s; }

@keyframes cardFloatIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.summary-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}

.summary-card:nth-child(2)::before { background: var(--green); }
.summary-card:nth-child(3)::before { background: var(--blue); }
.summary-card:nth-child(4)::before { background: var(--red); }

.summary-card:hover { border-color: var(--line-strong); }

.summary-card p {
    margin: 0;
    color: var(--text-label);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1.3;
}

.summary-card strong {
    display: block;
    margin-top: 2px;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}

.summary-card p:last-child {
    margin-top: 4px;
    font-size: 9px;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0.3px;
    font-weight: 500;
}

/* ---------- TOOLBAR ---------- */
.toolbar-panel,
.fleet-section {
    border-radius: var(--radius-lg);
    padding: 12px;
}

.toolbar-panel {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 10px;
}

.search-field,
.select-wrap {
    min-height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-field-soft);
    transition: border-color 0.15s;
}

.search-field:focus-within,
.select-wrap:focus-within { border-color: var(--accent); }

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.search-field i,
.select-wrap i { color: var(--accent); font-size: 12px; }

.search-field input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    outline: none;
    font: inherit;
    font-size: 12px;
    padding: 8px 0;
}

.select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    flex: 1 1 160px;
}

select, input, textarea {
    width: 100%;
    min-height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-field);
    color: var(--text);
    padding: 8px 10px;
    outline: none;
    font: inherit;
    font-size: 12px;
    transition: border-color 0.15s;
}

select:focus, input:focus, textarea:focus { border-color: var(--accent); }

select {
    appearance: none;
    border: none;
    background: transparent;
    padding-left: 0;
    cursor: pointer;
}

select option { background: #1a2028; color: var(--text); }
body[data-theme="light"] select option { background: #fffaf2; color: #1d2733; }

textarea { min-height: 80px; resize: vertical; }

/* ---------- SECTION HEADING ---------- */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
    margin-bottom: 10px;
}

.section-heading h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-pill {
    border-radius: 20px;
    padding: 4px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ---------- FLEET GRID ---------- */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 10px;
}

.fleet-card {
    position: relative;
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-card);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    contain: layout style;
    min-height: 108px;
}

.fleet-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--type-color, var(--type-default));
    z-index: 3;
}

.fleet-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-strong);
}

.fleet-card-media {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-panel-solid);
    min-height: 108px;
}

.fleet-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 60%, rgba(21, 28, 38, 0.6));
}

.fleet-card-media.empty {
    display: grid;
    place-items: center;
    background: var(--bg-empty-media);
}

.fleet-card-media.empty i {
    font-size: 1.8rem;
    color: var(--type-color, rgba(255, 255, 255, 0.15));
    opacity: 0.5;
    z-index: 1;
}

.fleet-card-body {
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fleet-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.fleet-card h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-line {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.fleet-card-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 2px;
}

.fleet-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 10px;
    color: var(--text-muted);
}

.fleet-card-foot span { display: inline-flex; align-items: center; gap: 4px; }
.fleet-card-foot i { color: var(--accent); font-size: 9px; }
.fleet-card-foot strong { color: var(--text); font-weight: 600; font-size: 10px; }

/* ---------- TYPE COLOR VARIANTS ---------- */
.fleet-card.t-auto        { --type-color: var(--type-auto); }
.fleet-card.t-pickup      { --type-color: var(--type-pickup); }
.fleet-card.t-camioneta   { --type-color: var(--type-camioneta); }
.fleet-card.t-camion      { --type-color: var(--type-camion); }
.fleet-card.t-moto        { --type-color: var(--type-moto); }
.fleet-card.t-maquinaria  { --type-color: var(--type-maquinaria); }
.fleet-card.t-default     { --type-color: var(--type-default); }

/* ---------- TYPE BADGES ---------- */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid;
    white-space: nowrap;
    line-height: 1.4;
}

.type-badge i { font-size: 9px; }

.type-badge.type-auto      { background: rgba(59, 130, 246, 0.14); color: #60a5fa; border-color: rgba(59, 130, 246, 0.4); }
.type-badge.type-pickup    { background: rgba(245, 166, 35, 0.14); color: #fbbf24; border-color: rgba(245, 166, 35, 0.4); }
.type-badge.type-camioneta { background: rgba(249, 115, 22, 0.14); color: #fb923c; border-color: rgba(249, 115, 22, 0.4); }
.type-badge.type-camion    { background: rgba(239, 68, 68, 0.14); color: #f87171; border-color: rgba(239, 68, 68, 0.4); }
.type-badge.type-moto      { background: rgba(16, 185, 129, 0.14); color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
.type-badge.type-maquinaria{ background: rgba(168, 85, 247, 0.14); color: #c084fc; border-color: rgba(168, 85, 247, 0.4); }
.type-badge.type-default   { background: rgba(100, 116, 139, 0.14); color: #94a3b8; border-color: rgba(100, 116, 139, 0.35); }

/* ---------- STATUS ---------- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 9px;
    font-weight: 800;
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.4);
    line-height: 1.4;
    white-space: nowrap;
}

.status-chip::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.status-chip[data-status="TALLER"]   { background: var(--red-soft); color: #f87171; border-color: rgba(239, 68, 68, 0.4); }
.status-chip[data-status="SERVICIO"] { background: var(--yellow-soft); color: #fde047; border-color: rgba(234, 179, 8, 0.4); }
.status-chip[data-status="BAJA"],
.status-chip[data-status="RADIADO"]  { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border-color: rgba(100, 116, 139, 0.35); }

/* ---------- EMPTY STATE ---------- */
.empty-state {
    grid-column: 1 / -1;
    padding: 30px 18px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.empty-state strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }

/* ---------- PAGINATION ---------- */
.pagination-bar {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-info { color: var(--text-muted); font-size: 11px; }

.pagination-controls { display: flex; gap: 4px; flex-wrap: wrap; }

.page-btn {
    min-width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.15s, border-color 0.15s;
}

.page-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: var(--accent); }

.page-btn.active {
    background: var(--accent);
    color: #1a0f00;
    border-color: transparent;
    font-weight: 900;
}

.page-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- MODAL SHELL ---------- */
.modal-shell {
    position: fixed;
    inset: 0;
    padding: 10px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.82);
    z-index: 9999;
    animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-shell.hidden { display: none; }
.hidden { display: none !important; }

.modal-card {
    width: min(100%, 1200px);
    max-height: calc(100vh - 20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: var(--radius-lg);
    background: var(--bg-modal);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-modal { width: min(100%, 1100px); }

.modal-close {
    position: absolute;
    top: 10px; right: 10px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(0, 0, 0, 0.6);
    color: var(--text);
    cursor: pointer;
    z-index: 10;
    font-size: 14px;
    display: grid; place-items: center;
    transition: background 0.15s, border-color 0.15s;
}

.modal-close:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.modal-close.small { position: static; width: 30px; height: 30px; font-size: 12px; }

.modal-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
}

.modal-header h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- VEHICLE DETAIL MODAL ---------- */
.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 160px;
    background: var(--bg-hero);
    flex-shrink: 0;
}

.detail-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    display: none;
}

.detail-image-empty {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    gap: 6px;
    align-content: center;
    justify-items: center;
    color: rgba(255, 255, 255, 0.2);
    background: var(--bg-hero);
    font-size: 11px;
}

.detail-image-empty i { font-size: 2rem; }

.detail-image.is-visible,
.detail-image-empty.is-visible { display: grid; }

.detail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(15, 21, 28, 0.95) 100%);
}

.detail-plate-block {
    position: relative;
    z-index: 1;
    padding: 70px 20px 16px;
}

.detail-plate-block h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 1.5px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.detail-subline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.detail-subline > span:first-child {
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* ---------- DETAIL BODY (SINGLE COLUMN, SCROLL) ---------- */
.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
    align-items: start;
}

.detail-main { min-width: 0; display: grid; gap: 10px; }

.detail-sidebar {
    display: grid;
    gap: 10px;
    align-content: start;
    position: sticky;
    top: 0;
}

.sidebar-card {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.sidebar-card .eyebrow { margin-bottom: 8px; }

/* ---------- DETAIL GRID (data fields) ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px;
}

.detail-item {
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.detail-item span {
    display: block;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.detail-item strong {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}

/* ---------- ACCORDION SECTIONS ---------- */
.section-stack { display: grid; gap: 8px; }

.accordion {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s;
}

.accordion.open { border-color: rgba(245, 166, 35, 0.3); }

.accordion-head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    transition: background 0.15s;
}

.accordion-head:hover { background: rgba(255, 255, 255, 0.03); }

.accordion-head .acc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.accordion-head .acc-title i:first-child {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
}

.accordion-head .acc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent);
    color: #1a0f00;
    font-size: 10px;
    font-weight: 900;
    border-radius: 10px;
}

.accordion-head .acc-caret {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.25s var(--ease);
}

.accordion.open .accordion-head .acc-caret { transform: rotate(180deg); }

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
}

.accordion.open .accordion-body { max-height: 2000px; }

.accordion-body-inner {
    padding: 4px 14px 14px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
}

/* ---------- TIMELINE/DOC/CLAIM CARDS ---------- */
.timeline-card,
.doc-card,
.claim-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.timeline-card header,
.doc-card header,
.claim-card header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.timeline-card header strong,
.doc-card header strong,
.claim-card header strong {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
}

.timeline-card header span,
.doc-card header span,
.claim-card header span {
    font-size: 10px;
    color: var(--text-muted);
}

.timeline-card p,
.doc-card p,
.claim-card p {
    margin: 3px 0;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.inspection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 6px 0;
    font-size: 11px;
    color: var(--text-muted);
}

.inspection-meta span {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-field-soft);
    border: 1px solid var(--line);
}

.inspection-meta strong {
    color: var(--text);
    font-weight: 700;
    margin-right: 3px;
}

.timeline-card p strong,
.doc-card p strong,
.claim-card p strong { color: var(--text); font-weight: 600; }

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 11px;
    margin-top: 4px;
}

.doc-link:hover { color: #fbbf24; }

.photo-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.photo-thumb {
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: #000;
    aspect-ratio: 1 / 1;
    display: block;
}

.photo-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-thumb:hover img { transform: scale(1.05); }

/* ---------- OVERVIEW CARDS ---------- */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.metric-card,
.highlight-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.metric-card span,
.highlight-card span {
    display: block;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.metric-card strong,
.highlight-card strong {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    color: var(--text);
    font-weight: 800;
}

/* ---------- SIDEBAR ACTIONS ---------- */
.sidebar-actions { display: grid; gap: 6px; }

.side-action {
    width: 100%;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 11px;
    border-color: var(--line);
}

.side-action.blue   { border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.side-action.blue:hover { background: var(--blue-soft); border-color: var(--blue); }
.side-action.green  { border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.side-action.green:hover { background: var(--green-soft); border-color: var(--green); }
.side-action.amber  { border-color: rgba(245, 166, 35, 0.32); color: #fcd34d; }
.side-action.amber:hover { background: var(--accent-soft); border-color: var(--accent); }
.side-action.red    { border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.side-action.red:hover { background: var(--red-soft); border-color: var(--red); }
.side-action.violet { border-color: rgba(167, 139, 250, 0.35); color: #c4b5fd; }
.side-action.violet:hover { background: rgba(167, 139, 250, 0.12); border-color: #a78bfa; }

.mini-summary {
    display: grid;
    gap: 4px;
    margin-top: 6px;
}

.mini-summary p {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.mini-summary p strong { color: var(--text); font-weight: 700; }

.doc-preview-item {
    padding: 8px 10px;
    background: var(--bg-field-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.doc-preview-item strong {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
}

.doc-preview-item span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 2px;
}

/* ---------- DOMAIN PICKER ---------- */
.domain-picker {
    margin-top: 2px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 166, 35, 0.28);
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(59, 130, 246, 0.06));
    padding: 8px 10px 7px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.domain-picker:focus-within {
    border-color: rgba(245, 166, 35, 0.7);
    box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.18);
}

.domain-picker-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-picker-head i {
    color: var(--accent);
    font-size: 12px;
}

.domain-picker-head input {
    width: 100%;
    min-height: 30px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 0;
}

.domain-picker-head input::placeholder {
    color: var(--text-muted);
}

.domain-picker-clear {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.domain-picker-clear:hover {
    border-color: rgba(245, 166, 35, 0.45);
    color: var(--accent);
}

.domain-picker-hint {
    margin: 4px 0 0;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.35;
}

.domain-select {
    appearance: auto;
    min-height: 44px;
    border: 1px solid rgba(245, 166, 35, 0.36);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.domain-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.2);
}

/* ---------- FORMS ---------- */
.form-modal { width: min(900px, 100%); background: #0f151c; }
.form-modal { background: var(--bg-modal); }
.form-modal.large { width: min(1150px, 100%); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

.form-grid label { display: grid; gap: 4px; }

.form-grid label span {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.full { grid-column: 1 / -1; }

.form-actions { padding-top: 4px; }

/* ---------- SINIESTRO LAYOUT ---------- */
.siniestro-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: minmax(0, 1fr) auto;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.siniestro-layout > .form-grid {
    grid-row: 1;
    grid-column: 1;
    overflow-y: auto;
    min-height: 0;
}

.damage-panel {
    grid-row: 1;
    grid-column: 2;
    border-left: 1px solid var(--line);
    background: var(--bg-panel-solid);
    padding: 16px;
    overflow-y: auto;
    min-height: 0;
}

.siniestro-layout > .form-actions {
    grid-row: 2;
    grid-column: 1 / -1;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--bg-panel-solid);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.damage-header h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.8px; }

.damage-toolbar {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.damage-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.type-switch,
.scope-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-switch-btn,
.scope-switch-btn,
.mechanic-chip {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text-muted);
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.type-switch-btn:hover,
.scope-switch-btn:hover,
.mechanic-chip:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--text);
}

.type-switch-btn.active,
.scope-switch-btn.active,
.mechanic-chip.active {
    background: var(--accent-soft);
    border-color: rgba(245, 166, 35, 0.36);
    color: var(--accent);
}

.mechanic-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.vehicle-map {
    position: relative;
    width: 100%;
    max-width: 270px;
    aspect-ratio: 3 / 5;
    max-height: 430px;
    margin: 12px auto 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(245, 166, 35, 0.08) 0%, transparent 70%), var(--bg-hero);
    border: 1px solid var(--line-strong);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
}

.vehicle-map::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCI+PGNpcmNsZSBjeD0iMSIgY3k9IjEiIHI9IjEiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4wNSkiLz48L3N2Zz4=');
    opacity: 0.5;
    pointer-events: none;
}

.vehicle-map::after {
    display: none;
}

.vehicle-map.dynamic-map::before,
.vehicle-map.dynamic-map::after {
    display: none;
}

.vehicle-map-graphic {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.vehicle-map-graphic svg,
.vehicle-map-svg {
    width: 100%;
    height: 100%;
    opacity: 0.92;
    filter: drop-shadow(0 0 15px rgba(245, 166, 35, 0.15));
    transition: all 0.3s ease;
}

.vehicle-map-graphic .map-stroke,
.vehicle-map-svg .map-stroke {
    fill: none;
    stroke: rgba(226, 232, 240, 0.85);
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.vehicle-map-graphic .map-fill,
.vehicle-map-svg .map-fill {
    fill: rgba(245, 166, 35, 0.03);
    stroke: rgba(245, 166, 35, 0.08);
    stroke-width: 0.8;
    transition: fill 0.3s ease;
}

.damage-spot {
    position: absolute;
    z-index: 5;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    color: var(--text);
    font: inherit;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.damage-spot:hover {
    background: var(--accent);
    color: #1a0f00;
    border-color: transparent;
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
}

.damage-spot.active {
    background: var(--red-soft);
    border-color: var(--red);
    color: #fca5a5;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.selected-damage {
    min-height: 20px;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 11px;
}

.damage-detail-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.damage-entry-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-field-soft);
    border: 1px solid var(--line);
}

.damage-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.damage-entry-head strong {
    font-size: 12px;
}

.damage-remove {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    cursor: pointer;
}

.damage-entry-card textarea,
.damage-entry-card input[type="text"],
.damage-entry-card input[type="file"],
.damage-entry-card select {
    width: 100%;
}

.damage-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.damage-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--line-strong);
    color: var(--text-muted);
    font-size: 11px;
}

.damage-preview img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.repair-layout .damage-panel {
    background: linear-gradient(180deg, rgba(245, 166, 35, 0.04), rgba(9, 12, 16, 0.02));
}

.repair-layout .scope-switch-btn.active,
.repair-layout .mechanic-chip.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.36);
    color: #93c5fd;
}

/* ---------- REPORTE ---------- */
.report-modal {
    width: min(980px, 100%);
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 12px;
}

.report-sheet {
    min-height: 70vh;
    padding: 28px;
    border-radius: var(--radius-md);
    background: #fff;
    color: #333;
    overflow-y: auto;
}

.report-sheet h2 { color: #1e272e; }
.report-sheet h3 { color: #2c3e50; font-size: 14px; margin-bottom: 6px; }

.report-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.report-box {
    padding: 14px;
    border-radius: var(--radius-md);
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.report-box p { margin: 4px 0; font-size: 12px; color: #555; }

.stats-modal {
    padding-top: 52px;
    min-height: 0;
}

.stats-sheet {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: grid;
    gap: 14px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.stats-header h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-intro {
    margin-top: 6px;
    max-width: 56ch;
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 12px;
}

.stats-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(245, 166, 35, 0.22);
}

.stats-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-switch {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.stats-switch:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 166, 35, 0.3);
    color: var(--text);
}

.stats-switch.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(245, 166, 35, 0.34);
    box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.1);
}

.stats-context {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.stats-context-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-context-text {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stats-grid-main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-card,
.stats-panel {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.stats-card {
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent);
}

.stats-card.green::before { background: var(--green); }
.stats-card.blue::before { background: var(--blue); }
.stats-card.red::before { background: var(--red); }

.stats-card span {
    display: block;
    color: var(--text-label);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stats-card strong {
    display: block;
    margin-top: 6px;
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 900;
}

.stats-card p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.stats-panel {
    padding: 14px;
}

.stats-panel h3 {
    margin: 0 0 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stats-bars,
.stats-list {
    display: grid;
    gap: 10px;
}

.stats-bar-row {
    display: grid;
    gap: 6px;
}

.stats-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 11px;
}

.stats-bar-label span {
    color: var(--text);
    font-weight: 600;
}

.stats-bar-label strong {
    color: var(--text-muted);
    font-size: 10px;
}

.stats-bar-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), #60a5fa);
}

.stats-bar-fill.accent-fill {
    background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.stats-bar-fill.teal-fill {
    background: linear-gradient(90deg, var(--teal), #67e8f9);
}

.stats-list-item {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-field-soft);
    border: 1px solid var(--line);
}

.stats-list-item strong {
    font-size: 12px;
}

.stats-list-item span,
.stats-list-item em {
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
}

.stats-empty {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1400px) {
    .hero-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar-actions {
        width: 100%;
    }

    .toolbar-panel,
    .hero-panel,
    .detail-body,
    .siniestro-layout {
        grid-template-columns: 1fr;
    }

    .siniestro-layout {
        grid-template-rows: auto auto auto;
        overflow-y: auto;
    }

    .siniestro-layout > .form-grid,
    .damage-panel {
        overflow: visible;
        min-height: 0;
    }

    .siniestro-layout > .form-grid { grid-row: auto; grid-column: 1; }
    .damage-panel { grid-row: auto; grid-column: 1; }
    .siniestro-layout > .form-actions { grid-row: auto; position: sticky; bottom: 0; }

    .filter-row {
        width: 100%;
    }

    .filter-row > * {
        flex: 1 1 220px;
    }

    .detail-sidebar { position: static; }
    .damage-panel { border-left: none; border-top: 1px solid var(--line); }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .overview-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mechanic-chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .app-shell { width: calc(100% - 14px); margin: 8px auto 16px; }
    .topbar, .section-heading { flex-direction: column; align-items: flex-start; }
    .topbar { padding: 12px; }
    .brand-lockup { width: 100%; align-items: flex-start; }
    .brand-copy { min-width: 0; }
    .brand-copy h1 { font-size: 12px; line-height: 1.2; }
    .subcopy { font-size: 8px; line-height: 1.35; }
    .topbar-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .topbar-actions > * { width: 100%; justify-content: center; }
    .toolbar-panel { padding: 10px; }
    .filter-row { display: grid; grid-template-columns: 1fr; width: 100%; }
    .fleet-grid { grid-template-columns: 1fr; }
    .fleet-card { grid-template-columns: 80px 1fr; min-height: 92px; }
    .fleet-card-media { min-height: 92px; }
    .form-grid { grid-template-columns: 1fr; }
    .summary-grid,
    .overview-grid,
    .report-grid,
    .detail-grid,
    .stats-grid,
    .stats-grid-main,
    .damage-entry-grid,
    .mechanic-chip-grid { grid-template-columns: 1fr; }
    .detail-body { padding: 12px; }
    .accordion-head { padding: 10px 12px; }
    .modal-shell { padding: 6px; }
    .modal-card { max-height: calc(100vh - 12px); }
    .hero-copy h2 { font-size: 1.2rem; }
    .detail-plate-block h2 { font-size: 1.5rem; }
    .detail-plate-block { padding: 50px 14px 14px; }
    .stats-sheet { padding: 14px; }
    .stats-header { align-items: stretch; }
    .stats-switches { display: grid; grid-template-columns: 1fr; }
    .stats-context { align-items: flex-start; }
    .type-switch,
    .scope-switch { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .app-shell { width: calc(100% - 10px); }
    .hero-panel,
    .fleet-section,
    .toolbar-panel { padding: 10px; }
    .search-field { padding: 0 10px; }
    .fleet-card-body { padding: 8px 10px; }
    .fleet-card-top {
        align-items: flex-start;
        flex-direction: column;
    }
    .fleet-card h4,
    .model-line { white-space: normal; }
    .fleet-card-foot {
        align-items: flex-start;
        flex-direction: column;
    }
}

body[data-theme="light"] #bg-video {
    filter: saturate(0.65) brightness(0.9);
    opacity: 0.14;
}

body[data-theme="light"] .timeline-card,
body[data-theme="light"] .doc-card,
body[data-theme="light"] .claim-card,
body[data-theme="light"] .metric-card,
body[data-theme="light"] .highlight-card,
body[data-theme="light"] .doc-preview-item {
    background: rgba(120, 91, 48, 0.04);
}

body[data-theme="light"] .accordion-head:hover,
body[data-theme="light"] .page-btn:hover:not(:disabled),
body[data-theme="light"] .top-pill:hover,
body[data-theme="light"] .action-btn:hover,
body[data-theme="light"] .side-action:hover,
body[data-theme="light"] .feature-chip:hover {
    background: rgba(120, 91, 48, 0.08);
}

body[data-theme="light"] .modal-close {
    background: rgba(255, 255, 255, 0.86);
}

body[data-theme="light"] .hero-strip .feature-chip {
    background: rgba(120, 91, 48, 0.06);
}

body[data-theme="light"] .stats-bar-track {
    background: rgba(120, 91, 48, 0.08);
}
