:root {
    --sidebar-width: 15.5rem;
    --sidebar-collapsed: 4.25rem;
    --app-bg:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 26rem),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.10), transparent 22rem),
        linear-gradient(180deg, #f3f6fb 0%, #eef2f7 46%, #f8fafc 100%);
    --app-surface: rgba(255, 255, 255, 0.94);
    --app-surface-strong: #ffffff;
    --app-surface-muted: #f8fafc;
    --app-border: rgba(15, 23, 42, 0.08);
    --app-border-strong: rgba(15, 23, 42, 0.14);
    --app-text: #152235;
    --app-text-muted: #5b6b82;
    --app-accent: #2563eb;
    --app-accent-soft: rgba(37, 99, 235, 0.10);
    --app-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
    --app-shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.05);
    --app-radius-lg: 0.75rem;
    --app-radius-md: 0.6rem;
    --app-radius-sm: 0.45rem;
    --app-space-1: 0.25rem;
    --app-space-2: 0.5rem;
    --app-space-3: 0.75rem;
    --app-space-4: 1rem;
    --app-space-5: 1.25rem;
    --app-control-height: 2.4rem;
    --app-control-height-sm: 2rem;
    --app-font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --app-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --app-font-xs: 0.75rem;
    --app-font-sm: 0.875rem;
    --app-font-md: 1rem;
    --app-font-lg: 1.125rem;
    --app-font-xl: 1.5rem;
    --app-font-2xl: 1.875rem;
    --app-leading-tight: 1.2;
    --app-leading-normal: 1.5;
    --app-leading-data: 1.4;
    --app-icon-size: 1rem;
}

/* APAD application shell */
.apad-body { overflow-x: hidden; }
.app-frame { display: flex; min-height: 100vh; }
.app-sidebar {
    background: #101827; border-right: 1px solid rgba(255,255,255,.07); color: #d7dfec;
    display: flex; flex-direction: column; height: 100vh; left: 0; position: fixed; top: 0;
    transition: width .2s ease, transform .2s ease; width: var(--sidebar-width); z-index: 1040;
}
.sidebar-brand { align-items: center; display: flex; flex: 0 0 4rem; gap: .7rem; padding: .7rem .8rem; }
.brand-mark { align-items:center; background:#3974f6; border-radius:.65rem; color:#fff; display:flex; flex:0 0 2.35rem; font-size:1.1rem; font-weight:800; height:2.35rem; justify-content:center; text-decoration:none; }
.brand-copy { color:#fff; display:grid; line-height:1.05; min-width:0; text-decoration:none; }
.brand-copy strong { font-size:.95rem; letter-spacing:.08em; }
.brand-copy small { color:#8491a5; font-size:.62rem; margin-top:.25rem; white-space:nowrap; }
.sidebar-toggle { background:transparent; border:0; color:#91a0b5; font-size:1.5rem; margin-left:auto; padding:.2rem; }
.sidebar-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:.35rem .55rem; scrollbar-color:#43516a #141e2f; scrollbar-gutter:stable; scrollbar-width:thin; }
.sidebar-scroll::-webkit-scrollbar { width:8px; }
.sidebar-scroll::-webkit-scrollbar-track { background:#141e2f; border-radius:999px; margin:.35rem 0; }
.sidebar-scroll::-webkit-scrollbar-thumb { background:linear-gradient(180deg,#52627e,#37455d); border:2px solid #141e2f; border-radius:999px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background:linear-gradient(180deg,#6682b3,#45628d); }
.side-link { align-items:center; border-radius:.55rem; color:#aeb9ca; display:flex; gap:.72rem; margin:.15rem 0; min-height:2.55rem; padding:.48rem .65rem; position:relative; text-decoration:none; }
.side-link:hover { background:rgba(255,255,255,.06); color:#fff; text-decoration:none; }
.side-link.is-active { background:#2864e8; box-shadow:0 5px 16px rgba(20,82,220,.25); color:#fff; }
.side-group { margin:.15rem 0; }
.side-row { align-items:center; display:flex; position:relative; }
.side-row .side-link { flex:1 1 auto; margin:0; min-width:0; padding-right:2.15rem; }
.side-expand { align-items:center; background:transparent; border:0; color:#8190a6; display:flex; height:2rem; justify-content:center; padding:0; position:absolute; right:.2rem; width:1.8rem; z-index:2; }
.side-expand:hover { color:#fff; }
.side-expand svg { height:.9rem; transition:transform .18s ease; width:.9rem; }
.side-group.is-open .side-expand svg { transform:rotate(180deg); }
.side-submenu { display:none; margin:.15rem 0 .35rem 1.75rem; padding-left:.55rem; border-left:1px solid rgba(255,255,255,.12); }
.side-group.is-open .side-submenu { display:grid; }
.side-sublink { align-items:center; border-radius:.4rem; color:#8f9db1; display:flex; font-size:var(--app-font-xs); gap:.45rem; line-height:1.3; padding:.42rem .45rem; text-decoration:none; }
.side-sublink > span { background:#4a5870; border-radius:50%; flex:0 0 .28rem; height:.28rem; width:.28rem; }
.side-sublink:hover { background:rgba(255,255,255,.05); color:#e8eef7; text-decoration:none; }
.side-sublink.is-active { color:#8eb4ff; font-weight:700; }
.side-sublink.is-active > span { background:#5f91ff; box-shadow:0 0 0 3px rgba(95,145,255,.13); }
.side-icon { flex:0 0 1.15rem; height:1.15rem; width:1.15rem; }
.side-label { font-size:var(--app-font-sm); font-weight:600; line-height:1.25; }
.sidebar-account { align-items:center; border-top:1px solid rgba(255,255,255,.07); display:flex; flex:0 0 3.55rem; gap:.6rem; padding:.55rem .75rem; }
.account-avatar { align-items:center; background:#25334a; border-radius:50%; display:flex; flex:0 0 2rem; font-size:.75rem; font-weight:800; height:2rem; justify-content:center; }
.account-copy { display:grid; line-height:1.15; min-width:0; }
.account-copy strong { color:#e7edf6; font-size:var(--app-font-xs); }
.account-copy small { color:#8794a8; font-size:.7rem; }
.account-logout { margin:0 0 0 auto; }
.account-notes { align-items:center; color:#8491a5; display:flex; height:2rem; justify-content:center; margin-left:auto; width:2rem; }
.account-notes:hover,.account-notes.is-active { color:#fff; text-decoration:none; }
.account-notes.is-active { background:rgba(57,116,246,.18); border-radius:.45rem; }
.account-notes svg { height:1rem; width:1rem; }
.account-notes + .account-logout { margin-left:0; }
.account-logout button { align-items:center; background:transparent; border:0; color:#8491a5; display:flex; height:2rem; justify-content:center; padding:0; width:2rem; }
.account-logout button:hover { color:#fff; }
.account-logout svg { height:1rem; width:1rem; }
.account-exit { color:#8d9bad; font-size:1.05rem; margin-left:auto; padding:.3rem; text-decoration:none; }
.app-workspace { margin-left:var(--sidebar-width); min-width:0; transition:margin-left .2s ease; width:calc(100% - var(--sidebar-width)); }
.app-topbar { align-items:center; background:rgba(255,255,255,.9); border-bottom:1px solid var(--app-border); display:flex; height:3.5rem; padding:0 1.25rem; position:sticky; top:0; z-index:1020; backdrop-filter:blur(12px); }
.topbar-context { align-items:center; display:flex; flex:1 1 auto; font-size:var(--app-font-sm); gap:.5rem; line-height:1.25; min-width:0; }
.topbar-product,.topbar-separator { color:var(--app-text-muted); }
.topbar-context > strong { flex:0 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar-search { align-items:center; background:#f5f7fb; border:1px solid var(--app-border-strong); border-radius:.5rem; display:flex; flex:0 1 27rem; height:2.15rem; min-width:10rem; position:relative; transition:border-color .15s ease, box-shadow .15s ease; }
.topbar-search:focus-within { background:#fff; border-color:rgba(37,99,235,.5); box-shadow:0 0 0 .18rem rgba(37,99,235,.1); }
.topbar-search input[type="search"] { background:transparent; border:0; color:var(--app-text); flex:1; font-size:var(--app-font-sm); height:100%; min-width:0; outline:0; padding:.35rem 1.9rem .35rem 2rem; }
.topbar-search input[type="search"]::-webkit-search-cancel-button { display:none; }
.topbar-search-icon { color:#718096; height:1rem; left:.65rem; pointer-events:none; position:absolute; width:1rem; }
.topbar-search-clear { align-items:center; color:var(--app-text-muted); display:flex; font-size:1.15rem; height:100%; justify-content:center; position:absolute; right:.3rem; text-decoration:none; width:1.5rem; }
.topbar-search-clear:hover { color:var(--app-text); }
.topbar-search-clear svg { height:.95rem; width:.95rem; }
.sidebar-toggle svg,.mobile-menu svg { height:1.15rem; width:1.15rem; }
.sidebar-toggle svg { transition:transform .18s ease; }
.sidebar-collapsed .sidebar-toggle svg { transform:rotate(180deg); }
.system-indicator { align-items:center; color:#5b6b82; display:flex; font-size:var(--app-font-xs); font-weight:600; gap:.4rem; margin-left:auto; }
.system-indicator i { background:#22a06b; border-radius:50%; height:.45rem; width:.45rem; }
.completeness { align-items:center; display:flex; gap:.5rem; min-width:8rem; }
.completeness .progress { flex:1; height:.42rem; }
.completeness strong { font-size:var(--app-font-xs); width:2.4rem; }
.mobile-menu,.sidebar-overlay { display:none; }
.sidebar-collapsed .app-sidebar { width:var(--sidebar-collapsed); }
.sidebar-collapsed .app-workspace { margin-left:var(--sidebar-collapsed); width:calc(100% - var(--sidebar-collapsed)); }
.sidebar-collapsed .brand-copy,.sidebar-collapsed .side-label,.sidebar-collapsed .account-copy { display:none; }
.sidebar-collapsed .sidebar-toggle { margin-left:0; transform:rotate(180deg); }
.sidebar-collapsed .sidebar-brand { gap:.15rem; padding-inline:.55rem; }
.sidebar-collapsed .side-link { justify-content:center; padding-inline:.55rem; }
.sidebar-collapsed .side-expand,.sidebar-collapsed .side-submenu { display:none; }
.sidebar-collapsed .sidebar-account { justify-content:center; padding-inline:.4rem; }
.sidebar-collapsed .account-exit { display:none; }
.sidebar-collapsed .account-logout { display:none; }
.sidebar-collapsed .account-notes { margin-left:0; }
.sidebar-collapsed .side-link:hover::after { background:#0f172a; border-radius:.35rem; color:#fff; content:attr(data-title); font-size:.72rem; left:3.75rem; padding:.4rem .55rem; pointer-events:none; position:fixed; top:var(--tip-y); white-space:nowrap; z-index:1100; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font-family);
    font-size: var(--app-font-md);
    font-synthesis: none;
    line-height: var(--app-leading-normal);
    min-height: 100vh;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--app-text);
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -0.012em;
    line-height: var(--app-leading-tight);
}

.h3 { font-size: var(--app-font-xl); }
.h4 { font-size: 1.25rem; }
.h5 { font-size: var(--app-font-lg); }
.h6 { font-size: var(--app-font-md); }

p, dl, ol, ul { margin-top: 0; }

body::before {
    content: "";
    inset: 0 0 auto 0;
    height: 17rem;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.72);
    outline-offset: 2px;
}

.app-main {
    padding: var(--app-space-5) var(--app-space-4) 2rem !important;
}

.page-shell {
    margin: 0 auto;
    max-width: 1760px;
}

.navbar {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.navbar-brand {
    color: var(--app-text);
    font-size: var(--app-font-lg);
    font-weight: 700;
    letter-spacing: 0;
}

.navbar .nav-link {
    border-radius: var(--app-radius-md);
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 600;
    line-height: 1.2;
    margin-right: var(--app-space-1);
    min-height: var(--app-control-height-sm);
    padding: 0.42rem 0.66rem;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.is-active {
    background: var(--app-accent-soft);
    color: var(--app-accent);
    text-decoration: none;
}

.page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-4);
    justify-content: space-between;
    margin-bottom: var(--app-space-5);
}

.page-title {
    font-size: clamp(var(--app-font-xl), 1.15rem + 0.75vw, var(--app-font-2xl));
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0;
}

.page-subtitle {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    margin: var(--app-space-2) 0 0;
    line-height: 1.55;
    max-width: 76ch;
}

.page-meta {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-3);
}

.summary-panel {
    overflow: hidden;
    position: relative;
}

.summary-panel::after {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.04));
    content: "";
    inset: 0;
    position: absolute;
    z-index: 0;
}

.summary-panel .card-body,
.summary-panel > * {
    position: relative;
    z-index: 1;
}

.summary-kicker {
    color: var(--app-accent);
    font-size: var(--app-font-xs);
    font-weight: 700;
    letter-spacing: 0.045em;
    margin-bottom: var(--app-space-2);
    text-transform: uppercase;
}

.dashboard-hero .card-body {
    padding: var(--app-space-5);
}

.dashboard-hero .page-meta {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--app-radius-md);
    min-width: min(100%, 20rem);
    padding: var(--app-space-3) var(--app-space-4);
}

.warehouse-update-grid {
    display: grid;
    gap: var(--app-space-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.warehouse-update-tile {
    align-items: center;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    color: inherit;
    display: grid;
    gap: var(--app-space-3);
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    min-height: 4.5rem;
    padding: var(--app-space-3);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.warehouse-update-tile:hover {
    border-color: var(--warehouse-state-color);
    box-shadow: var(--app-shadow-soft);
    color: inherit;
    transform: translateY(-1px);
}

.warehouse-update-tile.is-fresh { --warehouse-state-color: #16a36a; --warehouse-state-bg: #e7f8f0; }
.warehouse-update-tile.is-delayed { --warehouse-state-color: #d58a00; --warehouse-state-bg: #fff4d6; }
.warehouse-update-tile.is-stale { --warehouse-state-color: #dc3545; --warehouse-state-bg: #fdebec; }
.warehouse-update-tile.is-paused,
.warehouse-update-tile.is-unknown { --warehouse-state-color: #64748b; --warehouse-state-bg: #edf1f5; }

.warehouse-update-icon {
    align-items: center;
    background: var(--warehouse-state-bg);
    border-radius: 50%;
    color: var(--warehouse-state-color);
    display: flex;
    font-size: 1.4rem;
    font-weight: 800;
    height: 2.75rem;
    justify-content: center;
    line-height: 1;
    width: 2.75rem;
}

.warehouse-update-icon svg { height:1.35rem; width:1.35rem; }

.warehouse-update-copy { display: grid; min-width: 0; }
.warehouse-update-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-update-copy small,
.warehouse-update-meta small { color: var(--app-text-muted); font-size: var(--app-font-xs); }
.warehouse-update-meta { display: grid; text-align: right; }

.warehouse-update-legend {
    color: var(--app-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--app-font-xs);
    gap: var(--app-space-3);
}

.warehouse-update-legend span { align-items: center; display: flex; gap: .35rem; }
.warehouse-update-legend i { background: currentColor; border-radius: 50%; height: .55rem; width: .55rem; }
.warehouse-update-legend .is-fresh { color: #16a36a; }
.warehouse-update-legend .is-delayed { color: #d58a00; }
.warehouse-update-legend .is-stale { color: #dc3545; }
.warehouse-update-legend .is-paused { color: #64748b; }

.finance-period-groups { display: grid; gap: var(--app-space-3); }
.finance-period-group { border: 1px solid var(--app-border); border-radius: var(--app-radius-md); overflow: hidden; }
.finance-period-group > summary { align-items: center; cursor: pointer; display: flex; gap: var(--app-space-3); justify-content: space-between; list-style: none; padding: var(--app-space-3) var(--app-space-4); }
.finance-period-group > summary::-webkit-details-marker { display: none; }
.finance-period-group > summary span { display: grid; margin-right: auto; min-width: 0; }
.finance-period-group > summary small { color: var(--app-text-muted); font-size: var(--app-font-xs); }
.finance-period-group[open] > summary { background: var(--app-surface-muted); border-bottom: 1px solid var(--app-border); }
.finance-period-group table { min-width: 880px; }

.entity-completeness { align-items:center; display:inline-flex; gap:.4rem; white-space:nowrap; }
.entity-completeness i { background:conic-gradient(var(--completeness-color) calc(var(--score) * 1%), #e2e8f0 0); border-radius:50%; display:block; height:1.9rem; position:relative; width:1.9rem; }
.entity-completeness i > svg { background:#fff; border-radius:50%; color:var(--completeness-color); height:1.28rem; inset:.31rem; padding:.2rem; position:absolute; width:1.28rem; }
.entity-completeness b { font-size:var(--app-font-xs); }
.entity-completeness.is-high { --completeness-color:#16a36a; }
.entity-completeness.is-medium { --completeness-color:#d58a00; }
.entity-completeness.is-low { --completeness-color:#dc3545; }
.entity-db-fields > summary { align-items:center; cursor:pointer; display:flex; justify-content:space-between; list-style:none; }
.entity-db-fields > summary::-webkit-details-marker { display:none; }
.details-lucide-icon { color:var(--app-accent); display:inline-flex !important; flex:0 0 auto; margin-right:.55rem !important; }
.details-lucide-icon svg { height:1.1rem; width:1.1rem; }
.details-icon-open { display:none; }
details[open] .details-icon-closed { display:none; }
details[open] .details-icon-open { display:block; }
.entity-db-fields table { min-width:720px; }

.entity-stat-grid { display:grid; gap:var(--app-space-3); grid-template-columns:repeat(4, minmax(0, 1fr)); }
.entity-stat-card .card-body { align-items:center; display:flex; gap:var(--app-space-3); min-height:5.5rem; padding:var(--app-space-4); }
.entity-stat-icon { align-items:center; background:var(--entity-stat-bg); border-radius:var(--app-radius-md); color:var(--entity-stat-color); display:flex; flex:0 0 2.75rem; font-size:1.15rem; font-weight:800; height:2.75rem; justify-content:center; }
.entity-stat-icon svg { height:1.3rem; width:1.3rem; }
.entity-stat-icon.is-phones { --entity-stat-bg:#e8f1ff; --entity-stat-color:#2563eb; }
.entity-stat-icon.is-vins { --entity-stat-bg:#fff4d6; --entity-stat-color:#b66f00; font-size:.72rem; letter-spacing:.03em; }
.entity-stat-icon.is-names { --entity-stat-bg:#e7f8f0; --entity-stat-color:#168257; }
.entity-stat-icon.is-emails { --entity-stat-bg:#f2eafe; --entity-stat-color:#7c3aed; }
.entity-stat-copy { display:grid; min-width:0; }
.entity-stat-copy strong { display:block; font-size:clamp(1.15rem,1rem + .75vw,var(--app-font-xl)); line-height:1.1; max-width:100%; overflow-wrap:anywhere; }
.entity-stat-copy small { color:var(--app-text-muted); font-size:var(--app-font-xs); margin-top:.35rem; }
.brand-score { background:var(--score-bg); border:1px solid var(--score-color); border-radius:999px; color:var(--score-color); display:inline-flex; font-size:var(--app-font-xs); font-weight:800; justify-content:center; min-width:3.5rem; padding:.3rem .55rem; white-space:nowrap; }
.brand-score.is-high { --score-bg:#e7f8f0; --score-color:#168257; }
.brand-score.is-medium { --score-bg:#fff4d6; --score-color:#a86400; }
.brand-score.is-low { --score-bg:#edf1f5; --score-color:#64748b; }
.brand-score-large { font-size:var(--app-font-md); padding:.55rem .8rem; }

@media (max-width: 900px) { .entity-stat-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .entity-stat-card .card-body { min-height:4.75rem; padding:var(--app-space-3); } .entity-stat-icon { flex-basis:2.35rem; height:2.35rem; width:2.35rem; } }

.dashboard-metric-grid,
.dashboard-status-grid,
.dashboard-table-grid {
    align-items: stretch;
}

.summary-grid {
    display: grid;
    gap: var(--app-space-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.summary-grid .card-body {
    min-height: 6.5rem;
    padding: var(--app-space-4);
}

.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-2);
}

.hierarchy-browser {
    display: grid;
    align-items: start;
    gap: var(--app-space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.hierarchy-level {
    min-width: 0;
}

.hierarchy-level .card-body {
    padding: var(--app-space-4);
}

.hierarchy-level-wide {
    grid-column: span 2;
    min-width: min(100%, 24rem);
}

.hierarchy-level-links {
    min-width: 0;
}

.hierarchy-level-head {
    align-items: center;
    display: flex;
    gap: var(--app-space-3);
    justify-content: space-between;
    margin-bottom: var(--app-space-3);
}

.hierarchy-level-head h2 {
    font-size: var(--app-font-lg);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.hierarchy-level-head h2 small {
    color: var(--app-text-muted);
    display: block;
    font-size: var(--app-font-xs);
    font-weight: 500;
    margin: .28rem 0 0 2.3rem;
}

.tree-step {
    align-items: center;
    background: var(--app-accent);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: var(--app-font-xs);
    height: 1.65rem;
    justify-content: center;
    margin-right: .45rem;
    width: 1.65rem;
}

.vehicle-tree-path { margin-bottom: var(--app-space-4); }
.vehicle-tree-path .card-body { padding: var(--app-space-3) var(--app-space-4); }
.vehicle-tree-path-label { color:var(--app-text-muted); font-size:var(--app-font-xs); font-weight:700; margin-bottom:.4rem; text-transform:uppercase; }
.vehicle-tree-path-items { align-items:center; display:flex; flex-wrap:wrap; gap:.45rem; }
.vehicle-tree-path-items a,.vehicle-tree-path-items strong { border-radius:.4rem; font-weight:700; padding:.35rem .55rem; text-decoration:none; }
.vehicle-tree-path-items a { background:var(--app-surface-muted); border:1px solid var(--app-border); color:var(--app-text); }
.vehicle-tree-path-items a:hover { background:var(--app-accent-soft); border-color:rgba(37,99,235,.34); }
.vehicle-tree-path-items strong { background:var(--app-accent); color:#fff; }
.vehicle-tree-path-items > span { color:var(--app-text-muted); font-size:1.25rem; }
.vehicle-tree-path-hint { color:var(--app-text-muted); font-size:var(--app-font-xs); margin-top:.55rem; }

.hierarchy-browser-vehicles { display:block; padding-left:0; }
.hierarchy-browser-vehicles .hierarchy-level {
    margin-bottom:var(--app-space-4);
    margin-left:calc((var(--tree-depth, 1) - 1) * 2.25rem);
    position:relative;
    width:calc(100% - ((var(--tree-depth, 1) - 1) * 2.25rem));
}
.hierarchy-browser-vehicles .hierarchy-level[data-tree-depth="1"] { --tree-depth:1; }
.hierarchy-browser-vehicles .hierarchy-level[data-tree-depth="2"] { --tree-depth:2; }
.hierarchy-browser-vehicles .hierarchy-level[data-tree-depth="3"] { --tree-depth:3; }
.hierarchy-browser-vehicles .hierarchy-level[data-tree-depth="4"] { --tree-depth:4; }
.hierarchy-browser-vehicles .hierarchy-level[data-tree-depth="5"] { --tree-depth:5; }
.hierarchy-browser-vehicles .hierarchy-level[data-tree-depth="6"] { --tree-depth:6; }
.hierarchy-browser-vehicles .hierarchy-level:not([data-tree-depth="1"])::before {
    border-bottom:2px solid #cbd5e1;
    border-left:2px solid #cbd5e1;
    border-bottom-left-radius:.65rem;
    content:"";
    height:calc(100% + var(--app-space-4));
    left:-1.35rem;
    position:absolute;
    top:calc(-1 * var(--app-space-4));
    width:1.35rem;
    z-index:0;
}
.hierarchy-browser-vehicles .hierarchy-node-list {
    grid-template-columns:repeat(auto-fill,minmax(min(100%,17rem),1fr));
    max-height:32rem;
}
.hierarchy-browser-vehicles .hierarchy-variant-list { max-height:44rem; }
.hierarchy-browser-vehicles .hierarchy-level > .card-body { position:relative; z-index:1; }

.hierarchy-level-head span {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 700;
}

.hierarchy-node-list,
.hierarchy-variant-list {
    display: grid;
    gap: var(--app-space-3);
    max-height: 48rem;
    overflow: auto;
    padding-right: 0.15rem;
}

.hierarchy-node {
    align-items: flex-start;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    color: inherit;
    display: flex;
    gap: var(--app-space-3);
    min-height: 4.5rem;
    min-width: 0;
    padding: var(--app-space-3);
    text-decoration: none;
}

.hierarchy-node:hover,
.hierarchy-node.is-active,
.hierarchy-variant.is-active > .hierarchy-node {
    background: var(--app-accent-soft);
    border-color: rgba(37, 99, 235, 0.32);
    color: inherit;
    text-decoration: none;
}

.hierarchy-thumb {
    align-items: center;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text-muted);
    display: flex;
    flex: 0 0 3.4rem;
    font-size: var(--app-font-xs);
    font-weight: 800;
    height: 3.4rem;
    justify-content: center;
    overflow: hidden;
    text-transform: uppercase;
}

.hierarchy-thumb-wide {
    flex-basis: 4.8rem;
    height: 3.6rem;
    width: 4.8rem;
}

.hierarchy-thumb img {
    height: 100%;
    object-fit: contain;
    padding: 0.15rem;
    width: 100%;
}

.hierarchy-node-main {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.hierarchy-node-main strong,
.hierarchy-node-main small {
    overflow-wrap: anywhere;
    white-space: normal;
}

.hierarchy-node-main small,
.hierarchy-inline-note {
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
}

.hierarchy-variant {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    display: grid;
    gap: var(--app-space-3);
    padding: var(--app-space-3);
}

.hierarchy-variant > .hierarchy-node {
    border: 0;
    padding: 0;
}

.hierarchy-engine-grid,
.hierarchy-year-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-2);
}

.hierarchy-chip {
    align-items: center;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    display: inline-flex;
    font-size: var(--app-font-xs);
    gap: 0.35rem;
    line-height: 1.2;
    min-height: 1.8rem;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 0.32rem 0.5rem;
    text-decoration: none;
}

.hierarchy-chip.is-active,
.hierarchy-chip:hover {
    background: var(--app-accent-soft);
    border-color: rgba(37, 99, 235, 0.34);
    text-decoration: none;
}

.hierarchy-chip b {
    color: var(--app-accent);
    font-weight: 800;
}

@media (min-width: 1200px) {
    .hierarchy-browser-vehicles .hierarchy-level-makes .hierarchy-node-list { grid-template-columns:repeat(auto-fill,minmax(18rem,1fr)); }
}

.metric-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    height: 100%;
    overflow: hidden;
}

.metric-card .card-body,
.entity-stat-copy,
.warehouse-analytics-metrics > div {
    min-width: 0;
}

.dashboard-metric-link {
    color: inherit;
    display: block;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dashboard-metric-link:hover {
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}

.dashboard-metric-link:hover *,
.dashboard-metric-link:focus *,
.dashboard-metric-link:focus-visible * {
    text-decoration: none;
}

.dashboard-metric-link:focus-visible {
    box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.18), var(--app-shadow-soft);
    outline: 0;
}

.dashboard-metric-link .card-body {
    display: flex;
    flex-direction: column;
    min-height: 8rem;
    padding: var(--app-space-4);
}

.dashboard-status-card .card-body {
    min-height: 15rem;
    padding: var(--app-space-4);
}

.metric-label {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--app-space-2);
}

.metric-value {
    color: var(--app-text);
    font-size: var(--app-font-xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums lining-nums;
    letter-spacing: -0.025em;
    line-height: 1.08;
    overflow-wrap: anywhere;
    max-width: 100%;
    white-space: normal;
}

.metric-value-sm {
    font-size: 1.2rem;
    line-height: 1.2;
}

.analytics-conversion {
    align-items: flex-end;
    display: grid;
    gap: 0.15rem;
    min-width: 10rem;
    text-align: right;
}

.analytics-conversion span {
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
}

.analytics-conversion strong {
    color: var(--app-accent);
    font-size: var(--app-font-lg);
    line-height: 1.1;
}

.analytics-command-header { align-items: flex-end; }
.analytics-freshness { display: flex; flex-wrap: wrap; gap: .55rem 1.1rem; justify-content: flex-end; }
.analytics-freshness span { display: inline-flex; align-items: center; gap: .4rem; }
.analytics-freshness svg, .analytics-kpi .metric-label svg { width: 16px; height: 16px; }
.analytics-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(11rem, 1fr)); gap: .75rem; }
.analytics-kpi { border-top: 3px solid var(--bs-border-color); }
.analytics-kpi.is-primary { border-top-color: var(--bs-primary); background: linear-gradient(145deg, rgba(var(--bs-primary-rgb), .08), #fff 55%); }
.analytics-kpi .metric-label { display: flex; align-items: center; gap: .4rem; }
.analytics-kpi .metric-value { font-size: clamp(1.25rem, 1rem + 1.05vw, 2.05rem); overflow-wrap:anywhere; white-space:normal; }
.analytics-kpi .metric-note { margin-top: .45rem; font-size: .78rem; }
.analytics-month-chart { display: grid; gap: .78rem; }
.analytics-month-row { display: grid; grid-template-columns: 5.5rem minmax(100px, 1fr) 8.5rem 4.5rem; gap: .75rem; align-items: center; }
.analytics-month-row strong, .analytics-month-row small { text-align: right; white-space: nowrap; }
.analytics-bar-track { height: .72rem; border-radius: 999px; background: var(--bs-tertiary-bg); overflow: hidden; }
.analytics-bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--bs-primary), #22c55e); }
.analytics-status-list { display: grid; gap: .55rem; }
.analytics-status-list > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--bs-border-color); }
.analytics-status-list > div:last-child { border-bottom: 0; }
.analytics-period-filter { display: grid; grid-template-columns: minmax(150px, .6fr) minmax(180px, .8fr) auto 1fr; gap: 1rem; align-items: end; }
.analytics-delta { display: inline-flex; align-items: center; gap: .25rem; margin-top: .45rem; font-size: .8rem; font-weight: 700; }
.analytics-delta svg { width: 15px; height: 15px; }
.analytics-delta.is-positive { color: var(--bs-success); }
.analytics-delta.is-negative { color: var(--bs-danger); }
.strategy-header { align-items: flex-end; }
.strategy-header .badge { display: inline-flex; align-items: center; gap: .4rem; padding: .65rem .8rem; }
.strategy-header .badge svg, .strategy-brand-notes h3 svg { width: 17px; height: 17px; }
.strategy-decision { border-left: 5px solid var(--bs-primary); background: linear-gradient(110deg, rgba(var(--bs-primary-rgb), .08), #fff 60%); }
.strategy-list, .strategy-criteria { margin: 0; padding-left: 1.2rem; display: grid; gap: .55rem; }
.strategy-brand-notes h3 { display: flex; align-items: center; gap: .45rem; }
.strategy-timeline { display: grid; gap: 0; }
.strategy-timeline article { display: grid; grid-template-columns: 6rem 1fr; gap: 1.25rem; position: relative; padding: 0 0 1.75rem; }
.strategy-timeline article:not(:last-child)::before { content: ""; position: absolute; left: 2.65rem; top: 2rem; bottom: 0; border-left: 2px solid var(--bs-border-color); }
.strategy-timeline article > span { align-self: start; position: relative; z-index: 1; padding: .45rem .6rem; border-radius: 999px; background: var(--bs-primary); color: #fff; text-align: center; font-weight: 700; }
.strategy-timeline article ol { margin-bottom: 0; padding-left: 1.2rem; }
.runtime-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.runtime-actions form { margin: 0; }
.runtime-actions .btn { display: inline-flex; align-items: center; gap: .3rem; }
.runtime-actions svg { width: 14px; height: 14px; }
.runtime-log-view { min-height: 55vh; max-height: 72vh; overflow: auto; margin: 0; padding: 1rem; border-radius: .6rem; background: #10151d; color: #dbe7f3; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.dashboard-command-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.75rem; }
.dashboard-command-card { color:inherit; text-decoration:none; transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease; }
.dashboard-command-card:hover { border-color:rgba(var(--bs-primary-rgb),.3); box-shadow:var(--app-shadow); color:inherit; text-decoration:none; transform:translateY(-2px); }
.dashboard-command-card .card-body { align-items:flex-start; display:flex; gap:.7rem; padding:.9rem; }
.dashboard-command-card svg { color:var(--bs-primary); flex:0 0 1.25rem; height:1.25rem; margin-top:.1rem; width:1.25rem; }
.dashboard-command-card strong,.dashboard-command-card small { display:block; }
.dashboard-command-card strong { font-size:.84rem; line-height:1.25; }
.dashboard-command-card small { color:var(--app-text-muted); font-size:.7rem; margin-top:.25rem; }
.dashboard-service-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; }
.dashboard-service-item { align-items:center; background:var(--app-surface-muted); border:1px solid var(--app-border); border-radius:.55rem; color:inherit; display:grid; gap:.6rem; grid-template-columns:auto 1fr auto; padding:.7rem; text-decoration:none; }
.dashboard-service-item:hover { border-color:rgba(var(--bs-primary-rgb),.3); text-decoration:none; }
.dashboard-service-item strong,.dashboard-service-item small { display:block; }
.dashboard-service-item small { color:var(--app-text-muted); font-size:.7rem; }
.service-state-dot { border-radius:50%; height:.55rem; width:.55rem; }
.service-state-dot.is-ok { background:#22a06b; box-shadow:0 0 0 4px rgba(34,160,107,.1); }
.service-state-dot.is-error { background:#dc3545; box-shadow:0 0 0 4px rgba(220,53,69,.1); }

@media (max-width:1399.98px) { .dashboard-command-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:991.98px) { .dashboard-service-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:575.98px) { .dashboard-command-grid,.dashboard-service-grid { grid-template-columns:1fr; } }

/* Authentication */
.auth-page { background:#0b1220; min-height:100vh; overflow-x:hidden; }
.auth-page::before { background:radial-gradient(circle at 15% 20%,rgba(37,99,235,.3),transparent 28rem),radial-gradient(circle at 80% 80%,rgba(14,165,233,.17),transparent 26rem); height:100%; }
.auth-shell { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(25rem,.9fr); min-height:100vh; position:relative; }
.auth-intro { color:#fff; display:flex; flex-direction:column; justify-content:space-between; min-height:100vh; padding:clamp(2rem,6vw,6rem); position:relative; }
.auth-intro::after { border:1px solid rgba(255,255,255,.08); border-radius:50%; content:""; height:28rem; position:absolute; right:-10rem; top:15%; width:28rem; }
.auth-brand { align-items:center; color:#fff; display:flex; gap:.75rem; letter-spacing:.12em; text-decoration:none; width:max-content; }
.auth-brand:hover { color:#fff; text-decoration:none; }
.auth-brand span { align-items:center; background:#3974f6; border-radius:.75rem; display:flex; font-size:1.2rem; font-weight:800; height:2.8rem; justify-content:center; width:2.8rem; }
.auth-brand small { border-left:1px solid rgba(255,255,255,.2); color:#8fa1b9; font-size:.68rem; letter-spacing:.08em; margin-left:.15rem; padding-left:.85rem; }
.auth-intro h1 { font-size:clamp(2.5rem,5vw,5.25rem); font-weight:780; letter-spacing:-.05em; line-height:.95; margin:1rem 0 1.5rem; max-width:48rem; }
.auth-intro p { color:#aab7ca; font-size:1.05rem; max-width:38rem; }
.auth-features { display:flex; flex-wrap:wrap; gap:.75rem 1.5rem; }
.auth-features span { align-items:center; color:#bdc9da; display:flex; font-size:.8rem; gap:.45rem; }
.auth-features svg { color:#75a3ff; height:1rem; width:1rem; }
.auth-card-wrap { align-items:center; background:rgba(248,250,252,.98); display:flex; justify-content:center; padding:2rem; }
.auth-card { background:#fff; border:1px solid var(--app-border); border-radius:1rem; box-shadow:0 28px 65px rgba(3,10,24,.22); display:grid; gap:1.2rem; max-width:29rem; padding:clamp(1.5rem,4vw,2.7rem); width:100%; }
.auth-card-icon { align-items:center; background:var(--app-accent-soft); border-radius:.75rem; color:var(--app-accent); display:flex; height:3rem; justify-content:center; width:3rem; }
.auth-card-icon svg { height:1.35rem; width:1.35rem; }
.auth-card h2 { font-size:1.65rem; font-weight:750; margin:.25rem 0; }
.auth-card p { color:var(--app-text-muted); font-size:.85rem; margin:0; }
.auth-input { position:relative; }
.auth-input > svg { color:#718096; height:1rem; left:.8rem; pointer-events:none; position:absolute; top:50%; transform:translateY(-50%); width:1rem; z-index:2; }
.auth-input .form-control { height:2.8rem; padding-left:2.4rem; padding-right:2.5rem; }
.auth-input button { align-items:center; background:transparent; border:0; color:#718096; display:flex; height:100%; justify-content:center; position:absolute; right:.3rem; top:0; width:2rem; }
.auth-input button svg { height:1rem; width:1rem; }
.auth-submit { align-items:center; display:flex; height:2.85rem; justify-content:space-between; padding-inline:1rem; }
.auth-submit svg { height:1rem; width:1rem; }
.auth-security { align-items:flex-start; color:var(--app-text-muted); display:flex; font-size:.72rem; gap:.45rem; }
.auth-security svg { color:#22a06b; flex:0 0 1rem; height:1rem; width:1rem; }
.auth-card .alert { align-items:center; display:flex; font-size:.8rem; gap:.45rem; margin:0; }
.auth-card .alert svg { flex:0 0 1rem; height:1rem; width:1rem; }
@media (max-width:991.98px) { .auth-shell { grid-template-columns:1fr; } .auth-intro { display:none; } .auth-card-wrap { min-height:100vh; } }

/* Personal notes */
.notes-layout { align-items:start; display:grid; gap:1rem; grid-template-columns:minmax(20rem,.75fr) minmax(0,1.25fr); }
.notes-editor { position:sticky; top:4.75rem; }
.notes-form { display:grid; gap:1rem; }
.notes-form .btn { align-items:center; display:inline-flex; gap:.4rem; }
.notes-form .btn svg { height:1rem; width:1rem; }
.notes-list { display:grid; gap:.75rem; }
.notes-list-head { align-items:center; display:flex; justify-content:space-between; padding:.35rem .15rem; }
.note-card { border-left:3px solid transparent; }
.note-card.is-pinned { border-left-color:var(--bs-primary); background:linear-gradient(120deg,rgba(var(--bs-primary-rgb),.045),#fff 45%); }
.note-card-head { align-items:center; display:flex; flex-wrap:wrap; gap:.5rem; justify-content:space-between; }
.note-card-head > div { display:flex; flex-wrap:wrap; gap:.35rem; }
.note-card-head .badge { align-items:center; display:inline-flex; gap:.25rem; }
.note-card-head svg { height:.75rem; width:.75rem; }
.note-card h3 { font-size:1.02rem; margin:.75rem 0 .45rem; }
.note-body { color:var(--app-text-muted); line-height:1.55; max-height:18rem; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.note-actions { display:flex; gap:.45rem; margin-top:1rem; }
.note-actions form { margin:0; }
.note-actions .btn { align-items:center; display:inline-flex; gap:.3rem; }
.note-actions svg { height:.85rem; width:.85rem; }
.notes-empty-icon { color:#8da0ba; height:2.5rem; width:2.5rem; }
@media (max-width:991.98px) { .notes-layout { grid-template-columns:1fr; } .notes-editor { position:static; } }

@media (max-width: 1399.98px) { .analytics-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .analytics-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-month-row { grid-template-columns: 4.5rem 1fr 6.8rem; }
  .analytics-month-row small { display: none; }
  .analytics-period-filter { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 479.98px) { .analytics-kpi-grid { grid-template-columns: 1fr; } }

.warehouse-analytics-metrics strong {
    display:block;
    font-size:clamp(1rem,.92rem + .5vw,var(--app-font-lg));
    max-width:100%;
    overflow-wrap:anywhere;
}

.warehouse-analytics-row {
    align-items: baseline;
    border-top: 1px solid var(--app-border);
    display: flex;
    font-size: var(--app-font-xs);
    gap: var(--app-space-2);
    justify-content: space-between;
    padding: .35rem 0;
}

.warehouse-analytics-row span:first-child {
    min-width: 0;
}

.filter-card .card-body {
    padding: var(--app-space-4);
}

.view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-2);
}

.entity-card-grid {
    display: grid;
    gap: var(--app-space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

.entity-card-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 32rem), 1fr));
}

.entity-card {
    min-width: 0;
}

.entity-card .card-body {
    display: flex;
    flex-direction: column;
    gap: var(--app-space-4);
    height: 100%;
    padding: var(--app-space-4);
}

.entity-card-head {
    align-items: flex-start;
    display: flex;
    gap: var(--app-space-4);
    justify-content: space-between;
}

.entity-card-identity {
    min-width: 0;
}

.entity-card-identity .text-mono,
.entity-card-title,
.entity-card-head h2 {
    overflow-wrap: anywhere;
}

.entity-card-counters {
    flex: 0 0 auto;
}

.entity-card-title {
    font-size: var(--app-font-lg);
    line-height: 1.25;
    margin: 0 0 var(--app-space-1);
}

.entity-kv {
    grid-template-columns: minmax(6.25rem, 8.5rem) minmax(0, 1fr);
}

.entity-card-section {
    border-top: 1px solid var(--app-border);
    padding-top: var(--app-space-3);
}

.entity-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-2);
    margin-top: auto;
}

.min-w-0 {
    min-width: 0;
}

.table-card .card-body {
    padding: var(--app-space-4);
}

.dashboard-table-grid .table-card {
    box-shadow: var(--app-shadow-soft);
}

.dashboard-table-grid .card-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.72) !important;
    border-bottom: 1px solid var(--app-border) !important;
    min-height: 3.5rem;
    padding: var(--app-space-3) var(--app-space-4);
}

.dashboard-table-grid .card-header a {
    color: var(--app-accent);
    font-size: var(--app-font-sm);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-table-grid .card-header a:hover {
    color: #1e40af;
    text-decoration: none;
}

.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--app-border);
    padding: var(--app-space-4);
}

.card-header :is(h2, h3, h4, h5, h6, .h2, .h3, .h4, .h5, .h6) {
    margin-bottom: 0;
}

.card-header .summary-kicker + :is(h2, h3, h4, h5, h6) {
    margin-top: 0.2rem;
}

.card-body {
    padding: var(--app-space-4);
}

.btn {
    align-items: center;
    border-radius: var(--app-radius-md);
    display: inline-flex;
    gap: var(--app-space-2);
    justify-content: center;
    font-size: var(--app-font-sm);
    font-weight: 600;
    line-height: 1.2;
    min-height: var(--app-control-height);
    padding: 0.55rem 0.86rem;
    white-space: nowrap;
}

.btn-sm {
    font-size: var(--app-font-xs);
    min-height: var(--app-control-height-sm);
    padding: 0.42rem 0.68rem;
}

.btn svg,
.nav-link svg,
.navbar-brand svg {
    flex: 0 0 auto;
    height: var(--app-icon-size);
    width: var(--app-icon-size);
}

.form-control,
.form-select {
    border-color: var(--app-border-strong);
    border-radius: var(--app-radius-md);
    box-shadow: none;
    font-size: var(--app-font-sm);
    min-height: var(--app-control-height);
    padding: 0.52rem 0.75rem;
}

.form-label,
fieldset > legend {
    color: var(--app-text);
    font-size: var(--app-font-sm);
    font-weight: 650;
    line-height: 1.3;
}

.form-text {
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
    line-height: 1.45;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.12);
}

textarea.form-control {
    min-height: 6rem;
}

.table-wrap {
    margin: 0;
    overflow: auto;
    padding: 0;
    scrollbar-gutter: stable both-edges;
}

.table-scroll-top {
    margin: 0 0 var(--app-space-2);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scrollbar-gutter: stable both-edges;
}

.table-scroll-top-inner {
    height: 1px;
}

.table-wrap > table {
    min-width: 820px;
}

#dashboard-orders-table,
#dashboard-runs-table {
    min-width: 100%;
}

.table {
    color: var(--app-text);
    font-size: var(--app-font-sm);
    font-variant-numeric: tabular-nums lining-nums;
    line-height: var(--app-leading-data);
    margin-bottom: 0;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    padding: 0.625rem 0.75rem;
}

.table thead th {
    background: var(--app-surface-muted);
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
    font-weight: 700;
    letter-spacing: 0.005em;
    line-height: 1.25;
    text-transform: none;
    white-space: nowrap;
}

.resizable-table thead tr:first-child > th { position:relative; }
.column-resize-handle { bottom:0; cursor:col-resize; position:absolute; right:-.3rem; top:0; touch-action:none; width:.65rem; z-index:4; }
.column-resize-handle::after { background:transparent; border-radius:1px; content:""; inset:.35rem auto .35rem 50%; position:absolute; transition:background .12s ease, width .12s ease; width:1px; }
.column-resize-handle:hover::after,
.column-resize-handle:focus-visible::after { background:var(--app-accent); width:3px; }
.column-resize-handle:focus-visible { outline:2px solid rgba(37,99,235,.3); outline-offset:-2px; }
.resizable-table.has-resized-columns { table-layout:fixed; }
.resizable-table.has-resized-columns > :not(caption) > * > * { overflow-wrap:anywhere; }
.is-resizing-column { cursor:col-resize !important; user-select:none !important; }
.is-resizing-column * { cursor:col-resize !important; }

.table-hover > tbody > tr:hover > * {
    background: rgba(37, 99, 235, 0.035);
}

.table tbody th {
    color: var(--app-text);
    font-weight: 650;
}

.table td > :last-child,
.table td > p:last-child {
    margin-bottom: 0;
}

.text-mono {
    font-family: var(--app-font-mono);
    font-size: 0.92em;
    font-variant-numeric: tabular-nums lining-nums;
    letter-spacing: -0.01em;
}

.small-muted {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    line-height: 1.45;
}

.badge {
    font-size: var(--app-font-xs);
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    padding: 0.35em 0.58em;
}

.alert {
    font-size: var(--app-font-sm);
    line-height: 1.5;
}

.table :is(td, th).text-end,
.metric-value,
.analytics-conversion strong,
.brand-score {
    font-variant-numeric: tabular-nums lining-nums;
}

.cell-pre {
    max-width: 44rem;
    white-space: pre-wrap;
}

.paid-dot {
    background: #16a34a;
    border-radius: 50%;
    display: inline-block;
    height: 0.72rem;
    vertical-align: middle;
    width: 0.72rem;
}

.free-dot {
    color: #adb5bd;
}

.order-completeness {
    align-items: center;
    display: grid;
    gap: var(--app-space-2);
    grid-template-columns: 5.5rem 2.4rem;
    min-width: 8.3rem;
}

.order-completeness-track {
    background: #e5e7eb;
    border-radius: 999px;
    height: 0.45rem;
    overflow: hidden;
}

.order-completeness-fill {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 48%, #16a34a 100%);
    border-radius: inherit;
    height: 100%;
    min-width: 0.45rem;
}

.kv {
    column-gap: var(--app-space-4);
    display: grid;
    grid-template-columns: minmax(8rem, 10.5rem) minmax(0, 1fr);
    margin: 0;
    row-gap: var(--app-space-2);
}

.kv dt {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 600;
    margin: 0;
}

.kv dd {
    margin: 0;
    min-width: 0;
}

.table-sort-link {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: var(--app-space-1);
    text-decoration: none;
}

.table-sort-link:hover {
    color: inherit;
    text-decoration: none;
}

.table-sort-indicator {
    color: #7b8799;
    font-size: var(--app-font-xs);
}
.table-sort-indicator svg { height:.8rem; width:.8rem; }

.table-sort-link.is-active .table-sort-indicator {
    color: var(--app-accent);
}

th.table-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.table-sortable::after { content:none; }

.table-pagination-block {
    align-items: center;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--app-radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-3);
    justify-content: space-between;
    margin: 0 0 var(--app-space-4);
    padding: var(--app-space-3) var(--app-space-4);
}

.table-pagination-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-3);
    justify-content: flex-end;
}

.table-pagination-meta {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
}

.table-pagination-size {
    align-items: center;
    display: flex;
    gap: var(--app-space-2);
    margin: 0;
}

.table-pagination-size select {
    min-width: 88px;
}

.pagination {
    gap: var(--app-space-1);
}

.page-link {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    color: var(--app-text);
    font-size: var(--app-font-sm);
    min-height: var(--app-control-height-sm);
    padding: 0.38rem 0.62rem;
}

.page-item.active .page-link {
    background: var(--app-accent);
    border-color: var(--app-accent);
}

.page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.75);
}

.client-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-3);
    justify-content: space-between;
    margin-top: var(--app-space-4);
    padding-top: var(--app-space-1);
}

.dashboard-state-list {
    display: grid;
    border-top: 1px solid var(--app-border);
    gap: 0;
    margin-top: auto !important;
    padding-top: var(--app-space-2);
}

.dashboard-state-list > div {
    align-items: baseline;
    border-bottom: 1px solid rgba(15, 23, 42, 0.055);
    display: grid;
    gap: var(--app-space-2);
    grid-template-columns: minmax(7.8rem, 45%) minmax(0, 1fr);
    min-width: 0;
    padding: var(--app-space-2) 0;
}

.dashboard-state-list > div:last-child {
    border-bottom: 0;
}

.dashboard-state-list strong {
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
    font-weight: 700;
    text-transform: none;
}

.dashboard-state-list .text-mono,
.dashboard-state-list > div {
    overflow-wrap: anywhere;
}

.reference-card {
    overflow: hidden;
}

.reference-panel {
    overflow: hidden;
    position: relative;
}

.reference-jumpbar .card-body,
.reference-panel .card-body {
    position: relative;
    z-index: 1;
}

.reference-jumpbar::after,
.reference-panel::after {
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 13rem),
        linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(15, 23, 42, 0.02));
    content: "";
    inset: 0;
    position: absolute;
    z-index: 0;
}

.reference-section-title {
    font-size: var(--app-font-xl);
    line-height: 1.2;
}

.reference-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-2);
}

.reference-chip {
    align-items: center;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: var(--app-radius-md);
    color: var(--app-accent);
    display: inline-flex;
    font-size: var(--app-font-sm);
    font-weight: 600;
    gap: var(--app-space-1);
    line-height: 1.15;
    max-width: 100%;
    min-height: var(--app-control-height-sm);
    overflow-wrap: anywhere;
    padding: 0.42rem 0.62rem;
    text-decoration: none;
    white-space: normal;
}

.reference-chip:hover {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    text-decoration: none;
}

.reference-chip-muted {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.08);
    color: var(--app-text-muted);
}

.reference-filter-hint {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
}

.reference-fact {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--app-radius-md);
    height: 100%;
    padding: var(--app-space-4);
}

.reference-fact-title {
    font-size: var(--app-font-md);
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: var(--app-space-2);
}

.reference-domain-head {
    align-items: flex-start;
    display: flex;
    gap: var(--app-space-3);
    justify-content: space-between;
}

.reference-group {
    margin-bottom: var(--app-space-5);
}

.reference-group-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-space-3) var(--app-space-4);
    justify-content: space-between;
}

.reference-card summary {
    list-style: none;
}

.reference-card summary::-webkit-details-marker {
    display: none;
}

.reference-card-summary {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    padding: var(--app-space-4);
}

.reference-card-title {
    font-size: var(--app-font-lg);
    font-weight: 700;
    letter-spacing: 0;
}

.reference-block {
    background: rgba(248, 250, 252, 0.82);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    height: 100%;
    padding: var(--app-space-4);
}

.reference-flat-list {
    margin: 0;
    padding-left: 1.1rem;
}

.reference-flat-list li + li {
    margin-top: 0.38rem;
}

.reference-code-block {
    background: rgba(15, 23, 42, 0.045);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--app-radius-md);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: var(--app-font-sm);
    line-height: 1.45;
    margin: 0;
    min-height: 9rem;
    padding: var(--app-space-3) var(--app-space-4);
    white-space: pre-wrap;
    word-break: break-word;
}

.shop-card .card-body {
    padding: var(--app-space-4);
}

.shop-card .kv {
    grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr);
}

.alert {
    border: 1px solid transparent;
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-soft);
    padding: var(--app-space-3) var(--app-space-4);
}

details {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: var(--app-space-3);
}

details[open] {
    background: #ffffff;
}

details summary {
    color: var(--app-text);
    cursor: pointer;
    font-weight: 600;
}

pre {
    margin-bottom: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.catalog-thumb {
    aspect-ratio: 1;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    height: 3rem;
    object-fit: contain;
    width: 3rem;
}

.catalog-detail-image {
    aspect-ratio: 1;
    display: block;
    max-height: 18rem;
    object-fit: contain;
    width: 100%;
}

.catalog-compatibility {
    max-height: 38rem;
    overflow: auto;
}

.product-page-header {
    margin-bottom: var(--app-space-4);
}

.product-layout {
    align-items: start;
    display: grid;
    gap: var(--app-space-4);
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
}

.product-aside {
    display: grid;
    gap: var(--app-space-4);
    position: sticky;
    top: 5.25rem;
}

.product-media-card .card-body {
    padding: var(--app-space-4);
}

.product-summary-card .card-body {
    padding: var(--app-space-4);
}

.product-meta {
    display: grid;
    gap: var(--app-space-2) var(--app-space-3);
    grid-template-columns: minmax(6.5rem, 0.8fr) minmax(0, 1fr);
    margin: 0;
}

.product-meta dt {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 700;
}

.product-meta dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-main {
    display: grid;
    gap: var(--app-space-4);
    min-width: 0;
}

.product-stats {
    display: grid;
    gap: var(--app-space-3);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-stat {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-soft);
    min-width: 0;
    padding: var(--app-space-3) var(--app-space-4);
}

.product-stat span {
    color: var(--app-text-muted);
    display: block;
    font-size: var(--app-font-xs);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.product-stat strong {
    display: block;
    font-size: 1.2rem;
    letter-spacing: 0;
    line-height: 1;
}

.product-section .card-body {
    padding: var(--app-space-4);
}

.product-section-head {
    align-items: baseline;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    gap: var(--app-space-3);
    justify-content: space-between;
    margin: 0 0 var(--app-space-4);
    padding-bottom: var(--app-space-3);
}

.product-section-head h2 {
    font-size: var(--app-font-lg);
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.product-section-head span {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 600;
    text-align: right;
}

.product-params {
    display: grid;
    gap: var(--app-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.product-params > div {
    background: rgba(248, 250, 252, 0.74);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--app-radius-md);
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    padding: var(--app-space-3);
}

.product-params dt {
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
    font-weight: 700;
    line-height: 1.25;
}

.product-params dd {
    font-weight: 600;
    line-height: 1.32;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-description {
    color: #243247;
    line-height: 1.65;
    white-space: pre-wrap;
}

.product-related-grid {
    display: grid;
    gap: var(--app-space-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-code-list {
    display: grid;
    gap: var(--app-space-2);
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.product-code-item {
    align-items: center;
    background: rgba(248, 250, 252, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--app-radius-md);
    display: flex;
    gap: var(--app-space-3);
    justify-content: space-between;
    min-width: 0;
    padding: var(--app-space-2) var(--app-space-3);
}

.product-code-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-code-item span:last-child {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    font-weight: 700;
    text-align: right;
}

.compatibility-tree {
    display: grid;
    gap: var(--app-space-3);
}

.compatibility-tree details {
    background: rgba(248, 250, 252, 0.78);
    border-radius: var(--app-radius-md);
    padding: 0;
}

.compatibility-tree summary {
    align-items: center;
    display: flex;
    gap: var(--app-space-3);
    justify-content: space-between;
    list-style: none;
    padding: var(--app-space-3) var(--app-space-4);
}

.compatibility-tree summary::-webkit-details-marker {
    display: none;
}

.compatibility-tree summary > span {
    align-items: center;
    display: inline-flex;
    gap: var(--app-space-2);
    min-width: 0;
}

.compatibility-tree summary img {
    aspect-ratio: 1;
    height: 1.45rem;
    object-fit: contain;
    width: 1.45rem;
}

.compatibility-tree summary small {
    color: var(--app-text-muted);
    font-size: var(--app-font-xs);
    font-weight: 650;
    text-align: right;
}

.compat-brand[open] {
    background: #ffffff;
}

.compat-brand-body {
    border-top: 1px solid var(--app-border);
    display: grid;
    gap: var(--app-space-2);
    padding: var(--app-space-3);
}

.compat-group {
    box-shadow: none;
}

.compat-group summary {
    padding: var(--app-space-2) var(--app-space-3);
}

.compat-model-list {
    display: grid;
    gap: var(--app-space-2);
    padding: 0 var(--app-space-2) var(--app-space-2);
}

.compat-model {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--app-radius-md);
    padding: var(--app-space-3);
}

.compat-model-head {
    align-items: flex-start;
    display: flex;
    gap: var(--app-space-3);
    justify-content: space-between;
}

.compat-model-head h3 {
    font-size: var(--app-font-md);
    font-weight: 750;
    line-height: 1.25;
    margin: 0;
}

.compat-model-head p {
    color: var(--app-text-muted);
    font-size: var(--app-font-sm);
    margin: var(--app-space-1) 0 0;
}

.compat-model-head > span {
    background: rgba(37, 99, 235, 0.08);
    border-radius: var(--app-radius-md);
    color: var(--app-accent);
    flex: 0 0 auto;
    font-size: var(--app-font-xs);
    font-weight: 700;
    padding: 0.28rem var(--app-space-2);
}

.compat-engine-list {
    display: grid;
    gap: var(--app-space-2);
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    margin-top: var(--app-space-3);
}

.compat-engine {
    background: rgba(248, 250, 252, 0.78);
    border-radius: var(--app-radius-sm);
    display: grid;
    gap: var(--app-space-1);
    padding: var(--app-space-2) var(--app-space-3);
}

.compat-engine span {
    font-weight: 650;
    line-height: 1.3;
}

.compat-engine small {
    color: var(--app-text-muted);
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .app-sidebar { box-shadow:0 0 32px rgba(0,0,0,.28); transform:translateX(-102%); width:min(17rem,86vw); }
    .app-workspace,.sidebar-collapsed .app-workspace { margin-left:0; width:100%; }
    .sidebar-collapsed .app-sidebar { width:min(17rem,86vw); }
    .sidebar-collapsed .brand-copy,.sidebar-collapsed .side-label,.sidebar-collapsed .account-copy { display:grid; }
    .sidebar-collapsed .side-link { justify-content:flex-start; }
    .sidebar-collapsed .side-expand { display:flex; }
    .sidebar-collapsed .side-group.is-open .side-submenu { display:grid; }
    .sidebar-collapsed .account-exit { display:block; }
    .sidebar-open .app-sidebar { transform:translateX(0); }
    .sidebar-overlay { background:rgba(15,23,42,.48); border:0; inset:0; opacity:0; pointer-events:none; position:fixed; transition:opacity .2s; z-index:1035; }
    .sidebar-open .sidebar-overlay { display:block; opacity:1; pointer-events:auto; }
    .mobile-menu { background:transparent; border:0; color:#334155; display:block; font-size:1.15rem; margin-right:.7rem; padding:.35rem; }
    .system-indicator { font-size:0; }
    .topbar-search { flex:1 1 auto; max-width:none; }
    .reference-card-summary {
        padding: var(--app-space-4);
    }

    .reference-code-block {
        min-height: 0;
    }
}

@media (max-width: 520px) {
    .app-topbar { padding-inline:.65rem; }
    .topbar-context > strong { display:none; }
    .topbar-product,.topbar-separator { display:none; }
    .topbar-context { gap:0; }
    .topbar-search { min-width:0; width:100%; }
}

.list-group-item {
    border-color: rgba(15, 23, 42, 0.08);
}

.xml-processing-head {
    align-items: flex-start;
}

.xml-live-dot {
    animation: xml-pulse 1.4s ease-out infinite;
    background: #2563eb;
    border-radius: 50%;
    height: 0.65rem;
    width: 0.65rem;
}

.xml-state-grid {
    display: grid;
    gap: var(--app-space-3);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: var(--app-space-4) 0;
}

.xml-state-grid > div {
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    border-radius: var(--app-radius-sm);
    display: flex;
    flex-direction: column;
    padding: var(--app-space-3);
}

.xml-state-grid span { color: var(--app-text-muted); font-size: var(--app-font-sm); }
.xml-state-grid strong { font-size: 1.45rem; }
.xml-state-grid .is-new { border-color: #f59e0b; }
.xml-state-grid .is-active { border-color: #2563eb; }
.xml-state-grid .is-ready { border-color: #16a34a; }

.xml-file-list { display: grid; gap: var(--app-space-2); }

.xml-file-row {
    align-items: center;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--app-radius-md);
    display: grid;
    gap: var(--app-space-4);
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.65fr);
    padding: var(--app-space-3) var(--app-space-4);
}

.xml-file-row.is-processing { background: rgba(37, 99, 235, 0.04); border-color: rgba(37, 99, 235, 0.28); }
.xml-file-row.is-queued { background: rgba(245, 158, 11, 0.04); border-color: rgba(245, 158, 11, 0.28); }
.xml-file-title { align-items: center; display: flex; flex-wrap: wrap; gap: var(--app-space-2); }
.xml-file-title a { font-weight: 700; overflow-wrap: anywhere; }

.xml-file-icon {
    background: #e2e8f0;
    border-radius: 0.3rem;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.24rem 0.35rem;
}

.xml-file-progress .progress { height: 0.55rem; }

@keyframes xml-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
    70% { box-shadow: 0 0 0 0.45rem rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@media (max-width: 1199.98px) {
    .page-header {
        margin-bottom: var(--app-space-4);
    }

    .card-body {
        padding: var(--app-space-4);
    }
}

@media (max-width: 991.98px) {
    .app-main {
        padding: var(--app-space-4) var(--app-space-3) 2rem !important;
    }

    .page-shell {
        max-width: 100%;
    }

    .navbar .nav-link {
        margin-right: 0;
        margin-top: 0.15rem;
    }

    .product-layout {
        grid-template-columns: 1fr;
    }

    .product-aside {
        grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
        position: static;
    }

    .product-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-related-grid,
    .product-params {
        grid-template-columns: 1fr;
    }

    .hierarchy-browser {
        grid-template-columns: 1fr;
    }

    .hierarchy-level-wide {
        grid-column: auto;
    }

    .hierarchy-node-list,
    .hierarchy-variant-list {
        max-height: none;
    }
}

.warehouse-products-table { min-width: 1380px; }
.warehouse-product-details > td { background: #f8fafc; padding: .75rem 1rem !important; }
.warehouse-product-details summary { color: #2563eb; cursor: pointer; font-weight: 600; }
.warehouse-product-details pre.cell-pre { background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; max-height: 24rem; max-width: 100%; overflow: auto; padding: .75rem; white-space: pre-wrap; word-break: break-word; }
.current-task-panel { border-left: 4px solid #2563eb; }
.current-task-title { font-size: 1.05rem; font-weight: 700; }
.current-task-subject { font-size: 1.35rem; font-weight: 700; margin-top: .35rem; }
.current-task-details { display: grid; gap: .65rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.current-task-details > div { background: #f8fafc; border-radius: .5rem; display: grid; gap: .15rem; padding: .65rem .75rem; }
.current-task-details span { color: #64748b; font-size: .75rem; text-transform: uppercase; }
.dashboard-task-queues table { min-width: 1100px; }

@media (max-width: 767.98px) {
    .hierarchy-browser-vehicles .hierarchy-level {
        margin-left:0;
        width:100%;
    }
    .hierarchy-browser-vehicles .hierarchy-level:not([data-tree-depth="1"])::before {
        border-bottom:0;
        border-left:2px solid #cbd5e1;
        border-radius:0;
        height:var(--app-space-4);
        left:1.2rem;
        top:calc(-1 * var(--app-space-4));
        width:0;
    }
    .hierarchy-browser-vehicles .hierarchy-node-list { grid-template-columns:1fr; }
    .vehicle-tree-path-items { align-items:flex-start; flex-direction:column; }
    .vehicle-tree-path-items > span { display:none; }
    .vehicle-tree-path-items a,.vehicle-tree-path-items strong { width:100%; }
    .page-header,
    .table-pagination-block,
    .table-pagination-actions,
    .client-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions,
    .table-pagination-size {
        justify-content: space-between;
        width: 100%;
    }

    .entity-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .entity-card-counters {
        display: flex;
        flex-wrap: wrap;
        gap: var(--app-space-2);
        text-align: left !important;
    }

    .entity-card-counters .mt-1 {
        margin-top: 0 !important;
    }

    .filter-card .row > [class*="col-"] {
        min-width: 0;
    }

    .table-wrap > table {
        min-width: 680px;
    }

    .kv {
        grid-template-columns: 1fr;
        row-gap: 0.32rem;
    }

    .kv dt {
        margin-top: 0.45rem;
    }

    .page-title {
        font-size: 1.55rem;
    }

    .product-aside,
    .product-stats {
        grid-template-columns: 1fr;
    }

    .compatibility-tree summary,
    .compat-model-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .compatibility-tree summary small {
        text-align: left;
    }

    .compat-engine-list {
        grid-template-columns: 1fr;
    }

    .xml-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xml-file-row { align-items: stretch; grid-template-columns: 1fr; }
    .current-task-details { grid-template-columns: 1fr; }
}
