/* =====================================================================
   Asset Intelligence Management — UI
   Brand colours derived from the Unified Software Hub mark.
   All spacing uses logical properties so Arabic (RTL) mirrors cleanly.
   ===================================================================== */

:root {
    --brand-navy: #0b1b3f;
    --brand-blue: #1677e6;
    --brand-cyan: #0ea5e9;
    --brand-teal: #22c3a6;
    --grad: linear-gradient(135deg, #1677e6 0%, #0ea5e9 55%, #22c3a6 100%);

    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafd;
    --surface-3: #eef3f9;
    --border: #e3e9f2;
    --border-strong: #cfd9e6;
    --text: #0f1b33;
    --text-2: #4a5a75;
    --muted: #7a8aa3;
    --primary: #1677e6;
    --primary-ink: #ffffff;
    --primary-soft: #e6f0fd;
    --success: #12a37c;
    --success-soft: #e3f7f0;
    --warning: #d48806;
    --warning-soft: #fdf3dc;
    --danger: #e0394a;
    --danger-soft: #fde8ea;
    --info: #0c8bd6;
    --info-soft: #e2f3fc;
    --teal: #16a991;
    --teal-soft: #ddf6f1;
    --neutral-soft: #edf1f6;

    --sidebar-bg: #0b1b3f;
    --sidebar-text: #b8c5dd;
    --sidebar-active: rgba(255, 255, 255, .09);
    --sidebar-fg: #ffffff;
    --sidebar-muted: #5f7193;
    --sidebar-line: rgba(255, 255, 255, .06);
    --sidebar-thumb: rgba(255, 255, 255, .18);
    --sidebar-thumb-hover: rgba(255, 255, 255, .32);

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(15, 27, 51, .05), 0 4px 16px rgba(15, 27, 51, .05);
    --shadow-lg: 0 20px 60px rgba(9, 20, 45, .25);
    --font: "Alexandria", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-ar: "Alexandria", "Segoe UI", Tahoma, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
    --sidebar-w: 256px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a1224;
        --surface: #111b31;
        --surface-2: #14203a;
        --surface-3: #1a2745;
        --border: #22304f;
        --border-strong: #2e3e62;
        --text: #e6ecf7;
        --text-2: #aab7cf;
        --muted: #7d8cab;
        --primary: #3b8ef0;
        --primary-soft: rgba(59, 142, 240, .16);
        --success-soft: rgba(18, 163, 124, .16);
        --warning-soft: rgba(212, 136, 6, .18);
        --danger-soft: rgba(224, 57, 74, .18);
        --info-soft: rgba(12, 139, 214, .18);
        --teal-soft: rgba(22, 169, 145, .18);
        --neutral-soft: rgba(255, 255, 255, .06);
        --sidebar-bg: #070e1d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .2);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0a1224;
    --surface: #111b31;
    --surface-2: #14203a;
    --surface-3: #1a2745;
    --border: #22304f;
    --border-strong: #2e3e62;
    --text: #e6ecf7;
    --text-2: #aab7cf;
    --muted: #7d8cab;
    --primary: #3b8ef0;
    --primary-soft: rgba(59, 142, 240, .16);
    --success-soft: rgba(18, 163, 124, .16);
    --warning-soft: rgba(212, 136, 6, .18);
    --danger-soft: rgba(224, 57, 74, .18);
    --info-soft: rgba(12, 139, 214, .18);
    --teal-soft: rgba(22, 169, 145, .18);
    --neutral-soft: rgba(255, 255, 255, .06);
    --sidebar-bg: #070e1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .2);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body, :lang(ar) body { font-family: var(--font-ar); }
/* Browsers keep the viewport scrollbar on the right; scrolling the body instead puts it on the left in RTL. */
@media screen {
    html[dir="rtl"] { height: 100%; overflow: hidden; }
    html[dir="rtl"] body { height: 100%; overflow-y: auto; }
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 600; }
h4 { font-size: 11px; font-weight: 600; margin-block: 14px 8px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
small { font-size: 10px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.icon-xs { width: 14px; height: 14px; vertical-align: -2px; }
.icon-lg { width: 36px; height: 36px; }
.icon-title { width: 24px; height: 24px; color: var(--primary); vertical-align: -4px; }
[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

.muted { color: var(--muted); }
.small { font-size: 10px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; }
.mt { margin-top: 18px; }
.pad { padding: 12px 16px; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar-collapsed .shell { grid-template-columns: 72px 1fr; }
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    border-inline-end: 1px solid rgba(255, 255, 255, .04);
    z-index: 30;
}
/* Keep wheel/touch scrolling inside the menu (no hand-off to the page at the top or bottom),
   and give it a slim scrollbar that blends with the dark sidebar. */
.sidebar {
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-thumb) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-thumb); border-radius: 8px; border: 2px solid var(--sidebar-bg); }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--sidebar-thumb-hover); }
.sidebar:hover { scrollbar-color: var(--sidebar-thumb-hover) transparent; }
.sidebar::before {
    content: ""; position: absolute; inset-inline: 0; top: 0; height: 220px; pointer-events: none;
    background: radial-gradient(ellipse at 20% 0%, rgba(22, 119, 230, .35), transparent 70%);
}
/* Sidebar brand: logo on top, platform name below it in the interface language, both centred. */
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px 18px; color: var(--sidebar-fg); position: relative; text-align: center; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(14, 165, 233, .35)); }
.brand-text { display: flex; flex-direction: column; align-items: center; line-height: 1.3; min-width: 0; max-width: 100%; }
.brand-text strong { font-size: 14px; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.brand-text small { color: #7fd8ff; font-size: 9.5px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
[dir="rtl"] .brand-text small { letter-spacing: 0; text-transform: none; font-family: var(--font); }
.nav { padding: 6px 12px 16px; flex: 1; position: relative; }
.nav-group { margin-bottom: 14px; }
.nav-label { font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--sidebar-muted); padding: 8px 12px 6px; white-space: nowrap; }
[dir="rtl"] .nav-label { letter-spacing: 0; font-size: 9.5px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
    color: var(--sidebar-text); font-size: 12px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sidebar-active); color: var(--sidebar-fg); text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(22, 119, 230, .35), rgba(34, 195, 166, .12)); color: var(--sidebar-fg); box-shadow: inset 3px 0 0 var(--brand-teal); }
[dir="rtl"] .nav-item.active { box-shadow: inset -3px 0 0 var(--brand-teal); background: linear-gradient(270deg, rgba(22, 119, 230, .35), rgba(34, 195, 166, .12)); }
.nav-item .icon { width: 19px; height: 19px; }
.sidebar-foot { padding: 14px 20px; border-top: 1px solid var(--sidebar-line); white-space: nowrap; color: var(--sidebar-muted); }
.sidebar-foot .muted { color: inherit; }
.sidebar-collapsed .brand-text, .sidebar-collapsed .nav-item span, .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar-foot { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar-collapsed .brand { padding-inline: 10px; }
.sidebar-collapsed .brand-mark { width: 40px; height: 40px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    padding: 12px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.smart-search {
    flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 9px 14px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted);
    font: inherit; cursor: text; text-align: start; box-shadow: var(--shadow);
}
.smart-search .icon { color: var(--brand-cyan); }
.smart-search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; margin-inline: auto; }

.icon-btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center; min-width: 38px; height: 38px; padding: 0 9px;
    border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-weight: 600; font-size: 10px; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn.sm { min-width: 30px; height: 30px; padding: 0 6px; }
.bell .dot { position: absolute; top: 3px; inset-inline-end: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 9px; display: grid; place-items: center; border: 2px solid var(--bg); }
.theme-dark { display: none; }
:root[data-theme="dark"] .theme-dark { display: inline; }
:root[data-theme="dark"] .theme-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-dark { display: inline; }
    :root:not([data-theme="light"]) .theme-light { display: none; }
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); text-align: start; }
[dir="rtl"] .user-chip { padding: 4px 4px 4px 10px; }
.user-chip span:last-child { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 11px; }
.user-chip small { color: var(--muted); font-weight: 500; font-size: 9px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 180px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50;
}
.dropdown-menu.end { inset-inline-start: auto; inset-inline-end: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: start;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); text-decoration: none; }
.dropdown-menu a.active { color: var(--primary); font-weight: 600; }
.dropdown-menu form { margin: 0; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.page-actions select { max-width: 100%; }
.back-link { display: inline-block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.asset-title { display: flex; align-items: center; gap: 14px; }
.asset-title small { font-size: 12px; font-weight: 500; margin-inline-start: 6px; }
.title-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; }
.title-icon .icon { width: 24px; height: 24px; }
.title-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px;
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 11.5px; cursor: pointer; white-space: nowrap; transition: transform .05s, box-shadow .15s, background .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(22, 119, 230, .25); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(22, 119, 230, .35); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 10.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-size: 11px; cursor: pointer; font-weight: 500; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3, .card-title { display: flex; align-items: center; gap: 8px; }
.card-title { margin-bottom: 14px; }
.card-head .icon, .card-title .icon { color: var(--primary); }
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 16px 18px 0; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.narrow { max-width: 720px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 4px; color: var(--text); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 27, 51, .08); }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; flex: none; }
.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-neutral { background: var(--neutral-soft); color: var(--text-2); }
.kpi-label { font-size: 10.5px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.kpi-value small { font-size: 11px; color: var(--muted); font-weight: 500; }
.kpi-sub { font-size: 10px; color: var(--muted); }
.meter { display: block; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; border-radius: 6px; }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }
.bg-teal { background: var(--grad); }
.bg-neutral { background: var(--muted); }

.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.mini-kpis .card { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.mini-kpis .card span { font-size: 10px; color: var(--muted); }
.mini-kpis .card strong { font-size: 20px; font-weight: 700; }
.mini-kpis a.card:hover { text-decoration: none; border-color: var(--border-strong); }

/* ---------- Insights ---------- */
.insight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insight { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 4px solid var(--muted); }
.insight p { color: var(--text-2); font-size: 11px; margin-top: 2px; }
.insight-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--text-2); flex: none; }
.sev-critical { border-inline-start-color: var(--danger); }
.sev-critical .insight-icon { background: var(--danger-soft); color: var(--danger); }
.sev-high { border-inline-start-color: #f06f2b; }
.sev-high .insight-icon { background: #fdebe1; color: #e2622a; }
:root[data-theme="dark"] .sev-high .insight-icon { background: rgba(240, 111, 43, .18); }
.sev-medium { border-inline-start-color: var(--warning); }
.sev-medium .insight-icon { background: var(--warning-soft); color: var(--warning); }
.sev-low { border-inline-start-color: var(--info); }
.sev-low .insight-icon { background: var(--info-soft); color: var(--info); }
.sev-info { border-inline-start-color: var(--success); }
.sev-info .insight-icon { background: var(--success-soft); color: var(--success); }
.insight-list.large .insight { padding: 16px 18px; }
.sev-tag { display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-inline-end: 8px; }
.sev-card { border-top: 3px solid var(--muted); }
.sev-card.sev-critical { border-top-color: var(--danger); }
.sev-card.sev-high { border-top-color: #f06f2b; }
.sev-card.sev-medium { border-top-color: var(--warning); }
.sev-card.sev-low { border-top-color: var(--info); }
.sev-card.sev-info { border-top-color: var(--success); }

/* ---------- Lists & feed ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.list li:last-child { border-bottom: 0; }
.list.compact li { padding: 7px 0; }
.list-main { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.list-main:hover { text-decoration: none; }
.list-main > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.list-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-icon, .cell-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 7px 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-top: 7px; flex: none; }
.feed div { display: flex; flex-direction: column; min-width: 0; }
.feed small { color: var(--muted); }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 9.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--neutral-soft); color: var(--text-2); }
a.badge:hover { text-decoration: none; filter: brightness(.95); }
.risk-pill { display: inline-block; min-width: 46px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 10px; }
.risk-low { background: var(--success-soft); color: var(--success); }
.risk-mid { background: var(--warning-soft); color: var(--warning); }
.risk-high { background: var(--danger-soft); color: var(--danger); }
.risk-low-text { color: var(--success); }
.risk-mid-text { color: var(--warning); }
.risk-high-text { color: var(--danger); }
.health { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; }
.health-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; min-width: 54px; }
.health-bar > span { display: block; height: 100%; border-radius: 6px; }
.health b { font-size: 10.5px; min-width: 22px; text-align: end; }
.health-success .health-bar > span { background: var(--success); }
.health-warning .health-bar > span { background: var(--warning); }
.health-danger .health-bar > span { background: var(--danger); }
.health-neutral .health-bar > span { background: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 10.5px; border: 1px solid var(--border); white-space: nowrap; }
.chip .icon { width: 13px; height: 13px; }
.chip:hover { text-decoration: none; border-color: var(--border-strong); }
.chip.found { background: var(--success-soft); color: var(--success); text-decoration: line-through; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 9px; font-weight: 700; text-align: center; }

/* ---------- Forms ---------- */
input, select, textarea {
    font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 8px 11px; height: 38px; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; resize: vertical; }
input[type="checkbox"], input[type="radio"] { height: auto; width: 16px; height: 16px; accent-color: var(--primary); padding: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 10.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; }
.field-help { color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.inline-form input { flex: 1; min-width: 180px; }
.tiny-input { width: 64px; height: 30px; padding: 4px 8px; font-size: 10px; }
.tiny-input.wide { width: 140px; }
.inline-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.actions { text-align: end; white-space: nowrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type="search"] { flex: 1; min-width: 220px; }
.filters select { max-width: 200px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.table-filter { width: 220px; }

.smartbar {
    display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; margin-bottom: 14px; border-radius: 14px;
    background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: var(--shadow); flex-wrap: wrap;
}
[dir="rtl"] .smartbar { padding: 8px 14px 8px 8px; }
.smartbar > .icon { color: var(--brand-cyan); }
.smartbar input { flex: 1; border: 0; box-shadow: none !important; padding-inline: 0; background: transparent; min-width: 200px; }
.smartbar-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.smartbar-chips .chip { background: var(--primary-soft); color: var(--primary); border-color: transparent; font-weight: 600; }

.bulkbar { position: sticky; top: 70px; z-index: 10; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--brand-navy); color: #fff; box-shadow: var(--shadow-lg); }
.bulkbar select { height: 30px; padding: 2px 8px; font-size: 10.5px; }

.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg a { padding: 6px 14px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* Settings */
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit input { flex: 1; min-width: 0; }
.input-unit em { font-style: normal; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.color-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-pick input[type="color"] { width: 46px; height: 34px; padding: 3px; cursor: pointer; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.brand-preview { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 12px; color: var(--sidebar-fg);
    background: radial-gradient(ellipse at 15% 0%, color-mix(in srgb, var(--primary) 45%, transparent), transparent 70%), var(--sidebar-bg); }
.brand-preview { flex-direction: column; text-align: center; }
.brand-preview .brand-mark { width: 60px; height: 60px; object-fit: contain; }
.brand-preview .brand-text small { text-transform: none; letter-spacing: 0; }
.preview-actions { display: flex; align-items: center; gap: 10px; }
.preview-actions .badge { background: var(--primary-soft); color: var(--primary); }
.logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.logo-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 12px; min-width: 0; }
.logo-box { width: 100%; height: 96px; display: grid; place-items: center; border-radius: 10px; margin-bottom: 4px;
    background: repeating-conic-gradient(var(--surface-3) 0% 25%, var(--surface) 0% 50%) 0 0 / 16px 16px; }
.logo-box img { max-width: 80%; max-height: 76px; object-fit: contain; }
.logo-favicon img { width: 32px; height: 32px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.login-message { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); color: var(--text-2); font-size: 11px; white-space: pre-line; }
.login-message .icon { color: var(--info); flex: none; }
@media (max-width: 760px) { .logo-grid { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: 9.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
[dir="rtl"] .table th { letter-spacing: 0; font-size: 10px; }
.table th a { color: inherit; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table td.mono, .table strong.mono { white-space: nowrap; }
.w-check { width: 36px; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.cell-main:hover { text-decoration: none; }
.cell-main > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cell-main small { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }

/* ---------- Asset detail ---------- */
.asset-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 18px; margin-bottom: 18px; }
.hero-health { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.factor-list { list-style: none; margin: 0; padding: 0; }
.factor-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 11px; }
.factor-list b { color: var(--danger); }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.stat-label { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-label .icon { width: 15px; height: 15px; }
.stat strong { font-size: 17px; font-weight: 700; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.spec { padding: 9px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.spec dt { font-size: 9.5px; color: var(--muted); }
.spec dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border: 1px dashed var(--danger); border-radius: var(--radius); background: var(--danger-soft); }

.tabs { margin-bottom: 18px; }
.tab-list { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab-list button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab-list button:hover { color: var(--text); }
.tab-list button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li > div { display: flex; flex-direction: column; padding-top: 5px; min-width: 0; }
.timeline small { color: var(--muted); }
.tl-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); position: relative; z-index: 1; }
.tl-icon .icon { width: 15px; height: 15px; }
.tl-success .tl-icon { background: var(--success-soft); color: var(--success); }
.tl-warning .tl-icon { background: var(--warning-soft); color: var(--warning); }
.tl-danger .tl-icon { background: var(--danger-soft); color: var(--danger); }
.tl-neutral .tl-icon { background: var(--neutral-soft); color: var(--text-2); }
.timeline.compact li { padding-bottom: 12px; }

/* ---------- Charts & graph ---------- */
.chart { width: 100%; min-height: 180px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-2); font-family: inherit; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 10px; color: var(--text-2); }
.chart .legend a { color: inherit; display: inline-flex; align-items: center; gap: 6px; }
.chart .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart .bar { transition: opacity .15s; }
.chart .bar:hover { opacity: .8; }
.chart-tip { position: absolute; pointer-events: none; background: var(--brand-navy); color: #fff; padding: 5px 9px; border-radius: 7px; font-size: 10px; white-space: nowrap; transform: translate(-50%, -120%); z-index: 5; }
.gauge { min-height: 150px; }
.graph { width: 100%; border-radius: 12px; background: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 22px 22px, var(--surface-2); position: relative; overflow: hidden; touch-action: none; }
.graph svg { width: 100%; height: 100%; display: block; cursor: grab; }
.graph svg:active { cursor: grabbing; }
.graph .node circle { stroke: var(--surface); stroke-width: 3; cursor: pointer; }
.graph .node text { font-size: 9px; fill: var(--text); font-family: var(--mono); pointer-events: none; paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
.graph .node.dim { opacity: .25; }
.graph .edge { stroke-width: 1.6; fill: none; }
.graph .edge.dim { opacity: .12; }
.graph .edge.depends_on, .lg-depends { stroke: #1677e6; background: #1677e6; }
.graph .edge.connected_to, .lg-connected { stroke: #7a8aa3; background: #7a8aa3; }
.graph .edge.hosts, .lg-hosts { stroke: #22c3a6; background: #22c3a6; }
.graph .edge.part_of { stroke: #9b6bf2; }
.graph .edge.backup_of, .lg-backup { stroke: #d48806; background: #d48806; stroke-dasharray: 5 4; }
.graph .edge.impact { stroke: var(--danger) !important; stroke-width: 2.6; opacity: 1; }
.graph .node.impact circle { stroke: var(--danger); stroke-width: 4; }
.graph-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 10px; margin-bottom: 12px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.graph-card { padding-bottom: 12px; }
.graph-tip { position: absolute; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 8px 12px; font-size: 10px; pointer-events: none; z-index: 5; max-width: 260px; }
.graph-tip strong { display: block; font-family: var(--mono); }

/* ---------- Licenses ---------- */
.license-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.license-card { display: flex; flex-direction: column; gap: 12px; color: var(--text); transition: transform .15s; }
.license-card:hover { text-decoration: none; transform: translateY(-2px); }
.license-head { display: flex; gap: 12px; align-items: center; }
.license-head > div { display: flex; flex-direction: column; min-width: 0; }
.license-head .kpi-icon { margin: 0; }
.license-usage { display: flex; justify-content: space-between; font-size: 11px; }
.license-usage b { font-size: 16px; }
.license-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Callouts, flash, empty ---------- */
.callout { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.callout > div { flex: 1; }
.callout .icon { width: 22px; height: 22px; }
.callout-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.callout-warning > .icon { color: var(--warning); }
.callout-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.callout-success > .icon { color: var(--success); }
.callout-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.callout-danger > .icon { color: var(--danger); }
.callout-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); align-items: flex-start; }
.callout-info > .icon { color: var(--info); }
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; border: 1px solid; animation: fade .25s ease; }
.flash span { flex: 1; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.flash-close { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; color: var(--muted); text-align: center; }
.empty-state .icon { width: 32px; height: 32px; color: var(--success); }
.empty-state.small { padding: 22px 10px; }
.error-page { min-height: 60vh; }
.error-code { font-size: 70px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.code-block { display: block; padding: 12px 14px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); font-family: var(--mono); font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0; direction: ltr; text-align: left; }
.copyable { cursor: copy; }
.steps { padding-inline-start: 20px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Modal & palette ---------- */
.modal { border: 0; border-radius: 18px; padding: 24px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(7, 14, 29, .55); backdrop-filter: blur(3px); }
.modal h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.modal h3 .icon { color: var(--primary); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 6px; }

.palette { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(7, 14, 29, .55); backdrop-filter: blur(4px); }
.palette-panel { position: relative; width: min(680px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(-6px); } to { opacity: 1; transform: none; } }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette-input .icon { color: var(--brand-cyan); width: 22px; height: 22px; }
.palette-input input { flex: 1; border: 0; box-shadow: none !important; font-size: 14px; padding: 0; background: transparent; height: 32px; }
.palette-body { max-height: 56vh; overflow-y: auto; padding: 8px; }
.palette-foot { padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.pal-section { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; font-weight: 600; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); cursor: pointer; }
.pal-item:hover, .pal-item.active { background: var(--primary-soft); text-decoration: none; }
.pal-item > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pal-item small { color: var(--muted); }
.pal-item .list-icon { width: 30px; height: 30px; }
.pal-nlq { padding: 12px; margin: 4px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-soft), var(--teal-soft)); }
.pal-nlq .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pal-nlq .chip { background: var(--surface); }
.pal-empty { padding: 18px; color: var(--muted); text-align: center; }

/* ---------- Audits / scanner ---------- */
.scanner-view { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #0b1426; display: grid; place-items: center; margin-bottom: 12px; }
.scanner-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 18%; border: 2px solid rgba(34, 195, 166, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; display: none; }
.scanner.live .scanner-frame { display: block; }
.scanner.live [data-start-camera] { display: none; }
.scan-manual { display: flex; gap: 8px; margin-bottom: 8px; }
.scan-manual input { flex: 1; font-family: var(--mono); }
.scan-toast { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 11px; margin-top: 8px; }
.scan-toast.found { background: var(--success-soft); color: var(--success); }
.scan-toast.misplaced, .scan-toast.unexpected, .scan-toast.duplicate { background: var(--warning-soft); color: var(--warning); }
.scan-toast.error { background: var(--danger-soft); color: var(--danger); }
.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; }
tr.flash-row td { animation: flashrow 1.2s ease; }
@keyframes flashrow { from { background: var(--success-soft); } to { background: transparent; } }

/* ---------- Misc components ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon { color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.import-result { margin-top: 18px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.mini-stats div { padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; }
.mini-stats strong { font-size: 22px; }
.mini-stats span { font-size: 10px; color: var(--muted); }
.icon-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-picker label { cursor: pointer; }
.icon-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.icon-picker span { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-2); }
.icon-picker input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.roles-help { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.roles-help .card { padding: 14px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--border); }
.notif-list li > div { flex: 1; min-width: 0; }
.notif-list li.unread { background: var(--primary-soft); border-radius: 10px; padding-inline: 12px; }
.payload summary { cursor: pointer; color: var(--primary); font-size: 10px; margin-top: 4px; }
.payload pre { font-size: 9px; background: var(--surface-3); padding: 8px; border-radius: 8px; max-width: 520px; overflow: auto; direction: ltr; text-align: left; }
.report-desc { margin: -4px 0 16px; max-width: 900px; }

/* ---------- Login ---------- */
body.guest { background: var(--bg); }
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-hero { position: relative; overflow: hidden; background: radial-gradient(circle at 15% 10%, rgba(14, 165, 233, .45), transparent 45%), radial-gradient(circle at 90% 90%, rgba(34, 195, 166, .4), transparent 45%), var(--brand-navy); color: #dbe6fb; display: flex; align-items: center; padding: 60px; }
.login-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .08) 1px, transparent 0) 0 0 / 26px 26px; pointer-events: none; }
.login-hero-inner { position: relative; z-index: 1; max-width: 520px; }
.login-mark { width: 120px; filter: drop-shadow(0 18px 40px rgba(14, 165, 233, .45)); margin-bottom: 24px; }
.login-hero h1 { color: #fff; font-size: 32px; letter-spacing: -.02em; }
.ar-name { display: inline-block; font-family: var(--font-ar); font-size: 20px; color: #7fd8ff; margin-top: 6px; font-weight: 600; }
.login-points { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 14px; }
.login-points li { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.login-points .icon { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #7fd8ff; }
.login-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.login-langs { position: absolute; top: 20px; inset-inline-end: 24px; display: flex; gap: 4px; }
.login-langs a { padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: 11px; font-weight: 600; }
.login-langs a.active { background: var(--primary-soft); color: var(--primary); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-logo { width: 190px; margin-bottom: 8px; }
:root[data-theme="dark"] .login-logo { filter: brightness(1.6) saturate(1.1); }
.login-card h2 { font-size: 22px; }
.hint { font-size: 10.5px; color: var(--text-2); background: var(--info-soft); padding: 10px 12px; border-radius: 10px; }
.hint code { background: var(--surface); padding: 1px 5px; border-radius: 5px; }
.login-foot { position: absolute; bottom: 18px; }

/* ---------- Labels (print) ---------- */
.print-body { background: #fff; color: #0f1b33; }
.print-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #e3e9f2; position: sticky; top: 0; background: #fff; }
.print-toolbar .btn { margin-inline-start: auto; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, 66mm); gap: 4mm; padding: 8mm; justify-content: center; }
.label { width: 66mm; height: 32mm; border: 1px solid #cfd9e6; border-radius: 3mm; padding: 2.5mm; display: flex; gap: 2.5mm; align-items: center; break-inside: avoid; background: #fff; overflow: hidden; }
.label-qr { width: 26mm; height: 26mm; flex: none; }
.label-qr svg, .label-qr img { width: 100%; height: 100%; display: block; }
.label-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; position: relative; flex: 1; padding-inline-end: 7mm; }
.label-text strong { font-size: 11pt; color: #0b1b3f; }
.label-text span { font-size: 7.5pt; color: #27364f; }
.label-text small { font-size: 6.5pt; color: #5d6b82; font-family: var(--mono); }
.label-text .label-org { font-family: var(--font); color: #1677e6; margin-top: 1mm; font-weight: 600; }
.label-logo { width: 6mm; position: absolute; inset-inline-end: 0; top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 .span-2 { grid-column: 1 / -1; }
    .asset-hero { grid-template-columns: 1fr; }
    .roles-help { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hide-md { display: none; }
}
@media (max-width: 860px) {
    .shell, .sidebar-collapsed .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar-open .sidebar { transform: none !important; }
    .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-item span, .sidebar-collapsed .nav-label { display: revert; }
    .topbar { padding: 10px 16px; }
    .content { padding: 18px 16px 50px; }
    .grid-2, .grid-3, .form-grid, .fields { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-health { grid-template-columns: 1fr; }
    .login { grid-template-columns: 1fr; }
    .login-hero { padding: 36px 24px; }
    .login-points { display: none; }
    .smart-search kbd { display: none; }
}
@media (max-width: 560px) {
    .hide-sm { display: none !important; }
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .specs { grid-template-columns: 1fr; }
    h1 { font-size: 18px; }
    .roles-help { grid-template-columns: 1fr; }
}

/* Toolbars & small helpers */
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar .seg { margin-bottom: 12px; }
.search-form { margin-top: 0; margin-bottom: 12px; }
.search-form input { min-width: 0; width: min(280px, 100%); }
.specs.single { grid-template-columns: 1fr; }
.stock-cell { min-width: 150px; }
.stock-cell .meter { max-width: 160px; }

/* Radio cards (disposal sanitisation, stock modes) */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.radio-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 12px 12px 36px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; background: var(--surface); }
[dir="rtl"] .radio-card { padding: 12px 36px 12px 12px; }
.radio-card input, .field .radio-card input { position: absolute; inset-inline-start: 12px; top: 14px; width: 16px; height: 16px; margin: 0; }
.radio-card strong { font-size: 11.5px; }
.radio-card small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* Disposal pre-flight checklist */
.checks-title { margin: 18px 0 8px; font-size: 11.5px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: 9px; font-size: 11px; background: var(--surface-2); }
.checklist li .icon { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.checklist li.ok .icon { color: var(--success); }
.checklist li.warn { background: var(--warning-soft); }
.checklist li.warn .icon { color: var(--warning); }
.checklist li.danger { background: var(--danger-soft); }
.checklist li.danger .icon { color: var(--danger); }

/* Attachments */
.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px dashed var(--border); }
.photo-strip a { flex: none; }
.photo-strip img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }

/* Disposal certificate (printable, always light) */
.certificate { max-width: 210mm; margin: 24px auto; padding: 14mm 14mm 10mm; background: #fff; color: #0f1b33; border: 1px solid #e3e9f2; border-radius: 6px; box-shadow: 0 10px 40px rgba(15, 27, 51, .08); }
.cert-head { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 3px solid var(--brand-blue); }
.cert-logo { height: 54px; width: auto; }
.cert-head h1 { margin: 0; font-size: 18px; }
.cert-head p { margin: 2px 0 0; color: #5d6b82; font-size: 11px; }
.cert-no { margin-inline-start: auto; text-align: end; display: flex; flex-direction: column; }
.cert-no small { color: #5d6b82; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.cert-no strong { font-size: 15px; color: var(--brand-blue); }
.cert-statement { margin: 18px 0; font-size: 12px; line-height: 1.7; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.cert-grid h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #4a5a75; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid #e3e9f2; }
[dir="rtl"] .cert-grid h2, [dir="rtl"] .cert-no small { letter-spacing: 0; }
.cert-grid dl { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 0; font-size: 11px; }
.cert-grid dt { color: #5d6b82; }
.cert-grid dd { margin: 0; font-weight: 500; }
.cert-wide { grid-column: 1 / -1; }
[dir="rtl"] .cert-grid dd { text-align: right; }
.print-flash { margin: 12px 20px 0; }
.cert-notes { font-size: 10.5px; color: #4a5a75; white-space: pre-line; margin: 8px 0 0; }
.cert-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 34px 0 22px; }
.cert-signs div { display: flex; flex-direction: column; gap: 4px; padding-top: 30px; border-bottom: 1px solid #0f1b33; font-size: 11px; }
.cert-signs span { color: #5d6b82; font-size: 9.5px; order: 2; padding: 4px 0; }
.cert-signs strong { order: 1; }
.cert-foot { display: flex; align-items: center; gap: 16px; padding-top: 14px; border-top: 1px solid #e3e9f2; }
.cert-qr { width: 26mm; height: 26mm; flex: none; }
.cert-qr svg, .cert-qr img { width: 100%; height: 100%; display: block; }
.cert-foot p { margin: 0 0 4px; }
.cert-integrity { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 11px; }
.cert-integrity.ok { color: #12a37c; }
.cert-integrity.bad { color: #e0394a; }
.cert-hash { font-size: 9px; overflow-wrap: anywhere; color: #4a5a75; direction: ltr; display: block; text-align: start; }
@media (max-width: 640px) {
    .certificate { margin: 0; padding: 18px 16px; border: 0; box-shadow: none; }
    .cert-head { flex-wrap: wrap; }
    .cert-grid, .cert-signs { grid-template-columns: 1fr; }
}

/* Work orders: badges and SLA */
.row-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-inline-start: 6px; vertical-align: middle; }
.row-badges a.badge:hover { text-decoration: none; filter: brightness(.95); }
.sla { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.sla-ok { background: var(--success-soft); color: var(--success); }
.sla-warning { background: var(--warning-soft); color: var(--warning); }
.sla-breached, .sla-missed { background: var(--danger-soft); color: var(--danger); }
.sla-met { background: var(--neutral-soft); color: var(--text-2); }
.span-all { grid-column: 1 / -1; }
.modal-wide { width: min(760px, calc(100vw - 32px)); }

/* Public pages (fault report, second factor) */
.public-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; background: radial-gradient(circle at 10% 0%, var(--primary-soft), transparent 50%), var(--bg); }
.public-page .login-langs { position: static; }
.public-card { width: min(460px, 100%); }
.public-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.public-brand img { width: 30px; height: 30px; object-fit: contain; }
.report-asset { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin: 8px 0 14px; }
.report-asset strong { display: block; }
.report-asset small { color: var(--muted); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.thanks-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 8px auto; background: var(--success-soft); color: var(--success); }
.thanks-icon .icon { width: 28px; height: 28px; }
.text-center { text-align: center; }
.report-ref { font-size: 13px; margin: 14px 0; }
.otp-input { font-family: var(--mono); font-size: 18px; letter-spacing: .25em; text-align: center; }

/* Onboarding kits */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.kit-qty { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; font-size: 11px; }
.kit-qty span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.kit-qty input { width: 64px; height: 30px; }
.kit-items { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.kit-items li { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.kit-items li small { margin-inline-start: auto; }
.kit-card .license-foot { justify-content: space-between; }
.kit-picker { margin: 0 0 16px; }
.kit-picker select { width: auto; min-width: 200px; }
.cert-banner { display: flex; align-items: center; gap: 8px; margin: 16px 0; padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 12px; }
.cert-banner.ok { background: #e3f7f0; color: #0e7f60; }
.cert-banner.bad { background: #fdf3dc; color: #a46a04; }
.cert-list { margin: 0; padding-inline-start: 18px; font-size: 11px; line-height: 1.8; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.cert-table th, .cert-table td { text-align: start; padding: 5px 6px; border-bottom: 1px solid #e3e9f2; }
.cert-table th { color: #5d6b82; font-weight: 600; }

/* End-of-support radar */
.eos-timeline { display: flex; flex-direction: column; gap: 12px; }
.eos-rule { padding: 14px 16px; border-inline-start: 4px solid var(--border-strong); }
.eos-rule.eos-expired { border-inline-start-color: var(--danger); }
.eos-rule.eos-soon { border-inline-start-color: var(--warning); }
.eos-rule.eos-year { border-inline-start-color: var(--info); }
.eos-rule.eos-ok { border-inline-start-color: var(--success); }
.eos-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eos-head .kpi-icon { margin: 0; }
.eos-head > div:nth-child(2) { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.eos-date { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.eos-count { font-size: 20px; min-width: 36px; text-align: center; }
.eos-assets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* Compliance */
.compliance-score { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.compliance-score .gauge { max-width: 220px; margin: 0 auto; }

/* Two-factor enrolment */
.twofa { margin-top: 18px; }
.twofa .card-title { display: flex; align-items: center; gap: 8px; }
.twofa-setup { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.twofa-qr { width: 150px; height: 150px; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.recovery-codes { columns: 2; white-space: pre; direction: ltr; text-align: left; }

/* Rack elevation */
.rack-wrap { display: flex; justify-content: center; }
.rack { position: relative; display: grid; grid-template-rows: repeat(var(--rack-u), 20px); width: min(320px, 100%); padding: 10px 10px 10px 34px; background: #1b2638; border-radius: 10px; border: 3px solid #2e3e5c; }
[dir="rtl"] .rack { padding: 10px 34px 10px 10px; }
.rack-slot { grid-column: 1; border-bottom: 1px dashed rgba(255, 255, 255, .07); position: relative; }
.rack-slot.free { background: repeating-linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, .025) 8px 16px); }
.rack-u { position: absolute; inset-inline-start: -28px; top: 3px; font: 9px var(--mono); color: #7d8cab; width: 22px; text-align: end; }
.rack-device { grid-column: 1; z-index: 1; margin: 1px 0; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 4px; overflow: hidden; font-size: 10px; color: #fff; background: linear-gradient(180deg, #33476b, #26375a); border: 1px solid #4a6290; white-space: nowrap; }
.rack-device:hover { text-decoration: none; border-color: #8fb3ff; }
.rack-device small { color: #b8c5dd; overflow: hidden; text-overflow: ellipsis; }
.rack-device.dev-net { background: linear-gradient(180deg, #1d5f63, #15494c); border-color: #2c8a8f; }
.rack-device.dev-sto { background: linear-gradient(180deg, #4b3a75, #3a2c5c); border-color: #6c55a8; }
.rack-device.dev-ups { background: linear-gradient(180deg, #6a5317, #523f10); border-color: #a07c21; }
.rack-device.health-danger { box-shadow: inset 4px 0 0 var(--danger); }
.rack-device.health-warning { box-shadow: inset 4px 0 0 var(--warning); }

/* Floor plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; color: var(--text); }
.plan-card:hover { text-decoration: none; border-color: var(--border-strong); }
.plan-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.plan-card div { display: flex; flex-direction: column; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.plan-layout[data-editable="0"] { grid-template-columns: 1fr; }
.plan-canvas { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--border); touch-action: none; }
.plan-canvas.drop { outline: 3px dashed var(--primary); outline-offset: -3px; }
.plan-canvas img { width: 100%; height: 100%; display: block; user-select: none; }
.plan-pin { position: absolute; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 4px; padding: 3px 7px 3px 5px; border-radius: 999px; background: var(--surface); color: var(--text); border: 2px solid var(--primary); box-shadow: 0 4px 12px rgba(15, 27, 51, .25); font-size: 10px; cursor: grab; white-space: nowrap; z-index: 2; }
.plan-pin::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 8px; height: 8px; background: inherit; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: translateX(-50%) rotate(45deg); }
.plan-pin:hover { text-decoration: none; z-index: 3; }
.plan-pin.health-danger { border-color: var(--danger); }
.plan-pin.health-danger::after { border-color: var(--danger); }
.plan-pin.health-warning { border-color: var(--warning); }
.plan-pin.health-warning::after { border-color: var(--warning); }
.plan-pin .pin-label small { display: none; color: var(--muted); margin-inline-start: 4px; }
.plan-pin:hover .pin-label small { display: inline; }
.plan-pin.hit { background: var(--primary); color: #fff; z-index: 4; transform: translate(-50%, -100%) scale(1.15); }
.plan-pin.dim { opacity: .25; }
.plan-pin.removing { opacity: .4; border-style: dashed; }
.plan-side { max-height: 70vh; overflow-y: auto; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-list li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); font-size: 10.5px; cursor: grab; background: var(--surface-2); }
.plan-list li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-search { width: 220px; }

/* Knowledge base */
.kb-list { display: flex; flex-direction: column; gap: 10px; }
.kb-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); }
.kb-card:hover { text-decoration: none; border-color: var(--border-strong); }
.kb-card .kpi-icon { margin: 0; }
.kb-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kb-card p { margin: 4px 0 0; color: var(--text-2); }
.kb-solution { font-size: 12.5px; line-height: 1.75; }

@media (max-width: 900px) {
    .plan-layout { grid-template-columns: 1fr; }
    .plan-side { max-height: none; }
}

/* Offline audits */
.offline-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; margin-bottom: 12px; font-size: 11px; font-weight: 600; }
.offline-status.warning { background: var(--warning-soft); color: var(--warning); }
.offline-status.info { background: var(--info-soft); color: var(--info); }
.offline-status.error { background: var(--danger-soft); color: var(--danger); }
.offline-status .btn { margin-inline-start: auto; }
.offline-hint { margin: 8px 0 0; }
.scan-toast.queued { background: var(--info-soft); color: var(--info); }
.chip.queued { background: var(--info-soft); color: var(--info); text-decoration: none; border-style: dashed; }

/* Sign-in: single sign-on */
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10.5px; margin: 6px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sso-btn { gap: 10px; }
.sso-btn .icon { width: 18px; height: 18px; }

/* Custody receipts & signature pad */
.custody-sign { max-width: 900px; }
.custody-sign.public-card.wide { width: min(900px, 100%); }
.custody-title { margin: 0 0 14px; font-size: 16px; }
.custody-terms { font-size: 11px; line-height: 1.8; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.certificate .custody-terms { background: #f8fafd; border-color: #e3e9f2; color: #27364f; }
.sign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 18px 0 12px; }
.sign-box { position: relative; display: flex; flex-direction: column; gap: 8px; }
.sign-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sign-canvas { width: 100%; height: 170px; border: 2px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sign-box.signed .sign-canvas { border-style: solid; border-color: var(--primary); }
.sign-hint { position: absolute; top: 50%; left: 0; right: 0; text-align: center; color: #9aa7bd; font-size: 11px; pointer-events: none; transform: translateY(-50%); }
.sign-box.signed .sign-hint { display: none; }
.remote-sign { display: flex; gap: 16px; align-items: center; max-width: 900px; margin-top: 16px; flex-wrap: wrap; }
.remote-sign > div:last-child { flex: 1; min-width: 220px; }
.remote-sign h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.sig-img { height: 70px; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.custody-signs div { padding-top: 6px; }
.custody-signs span, .custody-signs strong, .custody-signs small { order: 0; }
.custody-signs span { padding: 0 0 4px; }
.thanks-icon.warn { background: var(--warning-soft); color: var(--warning); }

/* Device telemetry */
.spark { display: block; overflow: visible; }
.tele-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tele-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.tele-item > span:first-child { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-2); font-weight: 600; }
.tele-item strong { font-size: 20px; }

/* Smart redistribution */
.swap-list { display: flex; flex-direction: column; gap: 12px; }
.swap-card { display: flex; flex-direction: column; gap: 12px; }
.swap-person { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swap-person > div { display: flex; flex-direction: column; }
.swap-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.swap-device { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); color: var(--text); min-width: 0; }
.swap-device:hover { text-decoration: none; border-color: var(--border-strong); }
.swap-device > small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
[dir="rtl"] .swap-device > small { text-transform: none; letter-spacing: 0; }
.swap-device.out { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.swap-device.in { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.swap-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.swap-arrow .icon { width: 22px; height: 22px; }
[dir="rtl"] .swap-arrow .icon { transform: scaleX(-1); }
.swap-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Employee portal */
.portal { min-height: 100vh; background: radial-gradient(circle at 10% 0%, var(--primary-soft), transparent 45%), var(--bg); }
.portal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.portal-user { display: flex; align-items: center; gap: 10px; }
.portal-user > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
.portal-main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.portal-main h1 { margin: 0; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin-top: 16px; }
.portal-attn { margin-top: 16px; border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-soft); }
/* The tag is what an employee reads out to support: wrap it rather than cut it. */
.portal-devices li { flex-wrap: wrap; }
.portal-devices .list-main { min-width: min(100%, 220px); }
.portal-devices .mono { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; text-align: start; }
@media (max-width: 640px) {
    .swap-pair { grid-template-columns: 1fr; }
    .swap-arrow { flex-direction: row; justify-content: center; }
    .swap-arrow .icon { transform: rotate(90deg); }
}
@media print {
    .no-print, .sidebar, .topbar, .page-actions, .seg, .print-toolbar { display: none !important; }
    .shell { display: block; }
    .content { padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
    body { background: #fff; }
    .labels { padding: 0; }
    .certificate { margin: 0; border: 0; box-shadow: none; max-width: none; padding: 0; }
    .cert-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 8mm; }
}

/* ---------- Maintenance windows ---------- */
.flip-rtl { display: inline-block; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 9.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 92px; padding: 6px; border-radius: 10px; background: var(--surface-2, var(--surface-3)); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: transparent; border-style: dashed; opacity: .4; }
.cal-day.past { opacity: .72; }
.cal-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-num { font-size: 10px; font-weight: 700; color: var(--text-2); }
.cal-day.today .cal-num { color: var(--primary); }
.cal-ev { display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; font-size: 9.5px; line-height: 1.5; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-ev span { overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover { text-decoration: none; filter: brightness(.96); }
.cal-ev.ev-info { background: var(--info-soft); color: var(--info); }
.cal-ev.ev-warning { background: var(--warning-soft); color: var(--warning); }
.cal-ev.ev-success { background: var(--success-soft); color: var(--success); }
.cal-ev.ev-neutral { background: var(--neutral-soft); color: var(--text-2); }
.cal-ev.ev-danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.cal-ev.ev-work { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-2); }
.cal-legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; }
.cal-legend .cal-ev { display: inline-flex; }
.conflict-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.conflict { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.conflict > .icon { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.conflict > div { flex: 1; min-width: 0; }
.conflict p { margin: 2px 0 4px; color: var(--text-2); }
.conflict-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.conflict-danger > .icon { color: var(--danger); }
.conflict-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-soft); }
.conflict-warning > .icon { color: var(--warning); }
.impact-details { margin-top: 6px; }
.impact-details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.pick-box { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; }
.check-cell { width: 34px; }
.accept-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--text); }
.window-desc { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); white-space: normal; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: 11px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Anomalies ---------- */
.mini-kpis a.card.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.anomaly-list { display: flex; flex-direction: column; gap: 10px; }
.anomaly { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; border-inline-start: 4px solid var(--info); }
.anomaly-danger { border-inline-start-color: var(--danger); }
.anomaly-warning { border-inline-start-color: var(--warning); }
.anomaly-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.anomaly-danger .anomaly-icon { background: var(--danger-soft); color: var(--danger); }
.anomaly-warning .anomaly-icon { background: var(--warning-soft); color: var(--warning); }
.anomaly-main { flex: 1; min-width: min(100%, 260px); }
.anomaly-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.anomaly-main p { margin: 4px 0; color: var(--text-2); }
.anomaly-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 760px) {
    .cal { gap: 2px; }
    .cal-day { min-height: 58px; padding: 3px; }
    .cal-ev { padding: 1px 3px; font-size: 8.5px; }
    .anomaly-actions { width: 100%; }
}
@media (max-width: 1280px) {
    .cal-day .cal-ev .icon, .cal-day .cal-ev b { display: none; }
    .cal-ev { padding: 2px 4px; }
}

/* ---------- Asset list ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.count-primary { background: var(--primary); color: #fff; }
.grid-shell { position: relative; }
.grid-shell.is-loading [data-part="results"] { opacity: .55; transition: opacity .15s; pointer-events: none; }
.grid-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.grid-toolbar select { max-width: 180px; }
.grid-search { flex: 1 1 260px; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.grid-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.grid-search .icon { color: var(--muted); flex: none; }
.grid-search input { flex: 1; border: 0; background: transparent; box-shadow: none !important; padding: 0; height: 100%; min-width: 0; }
.grid-display { display: flex; gap: 6px; align-items: center; margin-inline-start: auto; flex-wrap: wrap; }
.seg.seg-icons { margin: 0; padding: 3px; }
.seg.seg-icons a { padding: 5px 9px; }
.btn-icon { padding: 0 9px; min-width: 38px; justify-content: center; }
.btn-icon.active { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.col-menu { min-width: 210px; padding: 10px 12px; display: none; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; inset-inline-start: auto; inset-inline-end: 0; }
.dropdown.open .col-menu { display: flex; }
.col-menu .check { padding: 3px 0; }

.preset-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: thin; }
.preset { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 10.5px; font-weight: 600; white-space: nowrap; cursor: pointer; font-family: inherit; }
.preset:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.preset.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.preset.active .count { background: rgba(255, 255, 255, .22); color: #fff; }
.preset.add { border-style: dashed; color: var(--primary); }
.preset.saved { padding-inline-end: 4px; }
.preset.saved a { color: inherit; display: inline-flex; align-items: center; gap: 6px; }
.preset.saved a:hover { text-decoration: none; }
.preset.saved form { margin: 0; display: inline-flex; }
.preset-x { border: 0; background: transparent; color: inherit; opacity: .55; padding: 2px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; }
.preset-x:hover { opacity: 1; background: rgba(0, 0, 0, .08); }
.preset-x .icon { width: 12px; height: 12px; }

.grid-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); min-width: 0; }
.kpi-tile span { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-tile strong { font-size: 18px; font-weight: 700; line-height: 1.3; }
a.kpi-tile:hover { text-decoration: none; border-color: var(--primary); }

.bulkbar .bulk-count { display: inline-flex; gap: 5px; align-items: baseline; }
.bulkbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }
.bulkbar .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.bulk-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .25); }
.bulk-fields { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bulk-fields input { height: 30px; font-size: 10.5px; min-width: 180px; }
.bulk-clear { margin-inline-start: auto; }

/* The list scrolls with the page; on wide screens the header stays pinned under the top bar (and the bulk bar). */
.grid-scroll { overflow-x: auto; }
@media (min-width: 1100px) {
    .grid-scroll, .grid-card, details.grid-group { overflow: visible; }
    .grid-table thead th { position: sticky; top: var(--grid-sticky, 64px); z-index: 3; }
    .grid-card .grid-table thead th:first-child { border-start-start-radius: var(--radius); }
    .grid-card .grid-table thead th:last-child { border-start-end-radius: var(--radius); }
}
.grid-table th a { display: inline-flex; gap: 4px; align-items: center; }
.sort-mark { font-size: 8px; color: var(--primary); }
.grid-table tbody tr[data-row] { cursor: pointer; }
.grid-table tr.is-selected td { background: var(--primary-soft); }
.grid-table tr.kb-active td { box-shadow: inset 0 1px 0 var(--primary), inset 0 -1px 0 var(--primary); }
.grid-table tr.is-previewed td { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.density-compact .grid-table td { padding: 6px 12px; }
.density-compact .grid-table .cell-icon { width: 26px; height: 26px; }
.density-compact .grid-table .cell-main small { display: none; }
.w-actions { width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
tr:hover .row-actions, tr.kb-active .row-actions, tr.is-previewed .row-actions, .row-actions:focus-within, .asset-card .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }

.asset-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.asset-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; min-width: 0; transition: border-color .12s, transform .12s; }
.asset-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.asset-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.asset-card.kb-active, .asset-card.is-previewed { border-color: var(--primary); }
.asset-card header { display: flex; align-items: center; gap: 8px; }
.asset-card header .badge { margin-inline-start: auto; }
.asset-card header .cell-icon { width: 28px; height: 28px; }
.asset-card-body { display: flex; gap: 12px; align-items: center; min-width: 0; }
.asset-card-body > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.asset-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.asset-card-meta { margin: 0; display: grid; gap: 4px; font-size: 10.5px; }
.asset-card-meta > div { display: flex; gap: 8px; align-items: center; min-width: 0; }
.asset-card-meta dt { color: var(--muted); display: flex; }
.asset-card-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card footer { border-top: 1px dashed var(--border); padding-top: 8px; display: flex; justify-content: flex-end; }

.ring { position: relative; width: var(--ring, 52px); height: var(--ring, 52px); flex: none; display: inline-grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
[dir="rtl"] .ring svg { transform: rotate(-90deg) scaleY(-1); }
.ring circle { fill: none; stroke-width: 3.2; }
.ring .ring-bg { stroke: var(--surface-3); }
.ring .ring-fg { stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring-success .ring-fg { stroke: var(--success); }
.ring-warning .ring-fg { stroke: var(--warning); }
.ring-danger .ring-fg { stroke: var(--danger); }
.ring-neutral .ring-fg { stroke: var(--muted); }
.ring b { font-size: calc(var(--ring, 52px) * .3); font-weight: 700; }

.grid-group { padding: 0; margin-bottom: 12px; overflow: hidden; }
.grid-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; cursor: pointer; list-style: none; }
.grid-group > summary::-webkit-details-marker { display: none; }
.grid-group-title { display: inline-flex; align-items: center; gap: 8px; }
.grid-group .chev { transition: transform .15s; }
.grid-group:not([open]) .chev { transform: rotate(-90deg); }
[dir="rtl"] .grid-group:not([open]) .chev { transform: rotate(90deg); }
.grid-group-stats { display: inline-flex; gap: 10px; align-items: center; }
.grid-group .grid-scroll { border-top: 1px solid var(--border); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(7, 14, 29, .35); }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 61; width: min(400px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease; }
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open, [dir="rtl"] .drawer.open { transform: none; }
.drawer-preview { width: min(460px, 100vw); }
.drawer > div, .drawer-form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.drawer-loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.facet-group > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.facets { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.facet { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; font-size: 11px; }
.facet:hover { background: var(--surface-2); }
.facet.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.facet span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.range-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px; }
.range-row > span:first-child { flex: 0 0 96px; color: var(--text-2); }
.range-row input { min-width: 0; flex: 1; }
.range-row.tight { margin: 0; }
.facet-group .field { margin-top: 8px; }

.pv-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-title > div { display: flex; flex-direction: column; min-width: 0; }
.pv-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-hero { display: flex; gap: 16px; align-items: center; }
.pv-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-specs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.pv-specs > div { min-width: 0; }
.pv-specs dt { font-size: 9.5px; color: var(--muted); }
.pv-specs dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.pv-section h4 { margin: 0 0 6px; display: flex; gap: 6px; align-items: center; }
.pv-tele { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv-tele > div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); }
.pv-tele span { font-size: 9.5px; color: var(--muted); }
.pv-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-timeline li { display: flex; gap: 8px; align-items: flex-start; font-size: 10.5px; }
.pv-timeline li > .icon { margin-top: 2px; color: var(--muted); flex: none; }
.pv-timeline li.tone-warning > .icon { color: var(--warning); }
.pv-timeline li.tone-danger > .icon { color: var(--danger); }
.pv-timeline li.tone-success > .icon { color: var(--success); }
.pv-timeline li > div { display: flex; flex-direction: column; min-width: 0; }

@media (max-width: 760px) {
    .grid-toolbar select { flex: 1 1 30%; max-width: none; }
    .grid-display { margin-inline-start: 0; width: 100%; justify-content: space-between; }
    .drawer, .drawer-preview { width: 100vw; }
    .pv-specs { grid-template-columns: 1fr; }
    .asset-cards { grid-template-columns: 1fr; }
    .bulk-clear { margin-inline-start: 0; }
    /* Headline figures become a swipeable strip instead of a tall block. */
    .grid-kpis { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .grid-kpis .kpi-tile { flex: 0 0 132px; }
}

[data-grid-bulk] .bulkbar { top: var(--grid-topbar, 64px); }

/* ---------- Monitoring ---------- */
.count-danger { background: var(--danger); color: #fff; }
.state-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.state-up { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.state-down { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); animation: pulse-down 1.6s ease-in-out infinite; }
@keyframes pulse-down { 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .state-down { animation: none; } }
tr.row-down td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.strip-cell { min-width: 150px; }
.uptime-strip { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.uptime-strip span { height: 100%; }
.uptime-strip .seg-up { background: var(--success); }
.uptime-strip .seg-down { background: var(--danger); }
.uptime-strip .seg-unknown { background: var(--surface-3); }

.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.printer-card { display: flex; flex-direction: column; gap: 10px; }
.printer-card header { display: flex; gap: 10px; align-items: center; }
.printer-card header > div { display: flex; flex-direction: column; min-width: 0; }
.printer-card footer { border-top: 1px dashed var(--border); padding-top: 8px; }
.supply-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.supply-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font-size: 10.5px; }
.supply-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supply-bar { grid-column: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.supply-bar > span { display: block; height: 100%; border-radius: 4px; background: #475569; }
.supply-bar > span.unknown { background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 4px, var(--border) 4px, var(--border) 8px); }
.supply-cyan > span { background: #06b6d4; } .supply-magenta > span { background: #d946ef; } .supply-yellow > span { background: #eab308; } .supply-black > span { background: #1f2937; }
[data-theme="dark"] .supply-black > span { background: #94a3b8; }
.supply-list b { grid-row: 1 / span 2; grid-column: 2; font-size: 12px; }
.supply-list a { grid-column: 1 / -1; }

/* ---------- Field mode & work orders ---------- */
.field-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.field-head h1 { margin: 0; }
.field-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.field-stats > div { display: flex; flex-direction: column; align-items: center; padding: 12px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.field-stats strong { font-size: 24px; line-height: 1.1; }
.field-stats span { font-size: 10px; color: var(--muted); }
.field-stats .late strong { color: var(--danger); }
.field-scan { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.btn-lg { height: 52px; font-size: 14px; border-radius: 14px; justify-content: center; }
.field-lookup { display: flex; gap: 6px; }
.field-lookup input { flex: 1; min-width: 0; }
.field-camera { position: relative; border-radius: 14px; overflow: hidden; background: #000; }
.field-camera video { width: 100%; max-height: 52vh; object-fit: cover; display: block; }
.field-camera .btn { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(255, 255, 255, .9); }
.field-h { font-size: 13px; display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
.field-list { display: flex; flex-direction: column; gap: 8px; }
.field-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); }
.field-card:hover { text-decoration: none; border-color: var(--border-strong); }
.field-card.late { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.field-prio { width: 4px; align-self: stretch; border-radius: 4px; background: var(--muted); flex: none; }
.prio-critical { background: var(--danger); } .prio-high { background: var(--warning); } .prio-medium { background: var(--info); }
.field-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.field-card-body strong { font-size: 12px; }
.field-card-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chev-end { transform: rotate(-90deg); color: var(--muted); flex: none; }
[dir="rtl"] .chev-end { transform: rotate(90deg); }
.wo-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 0; }
.wo-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wo-asset { display: flex; align-items: center; gap: 12px; color: var(--text); }
.wo-asset:hover { text-decoration: none; border-color: var(--border-strong); }
.wo-asset > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wo-actions { display: flex; flex-direction: column; gap: 8px; }
.wo-actions form { margin: 0; }
.wo-complete > summary { list-style: none; cursor: pointer; }
.wo-complete > summary::-webkit-details-marker { display: none; }
.wo-complete[open] > summary { margin-bottom: 10px; }
.wo-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.photo-row img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.photo-add label { width: 74px; height: 74px; border-radius: 10px; border: 2px dashed var(--border-strong); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.photo-add label:hover { color: var(--primary); border-color: var(--primary); }
.wo-parts select { flex: 1; min-width: 0; }
.wo-signature { max-width: 100%; height: 110px; display: block; background: #fff; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 6px; }
form.queued { opacity: .75; }
.queued-note { color: var(--info); margin: 6px 0 0; }

/* ---------- Comments & mentions ---------- */
.comment-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comment-list > li { display: flex; gap: 10px; align-items: flex-start; }
.comment-list p { margin: 3px 0 0; overflow-wrap: anywhere; }
.comment-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.mention { color: var(--primary); font-weight: 600; background: var(--primary-soft); border-radius: 5px; padding: 0 3px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.mention-wrap { position: relative; width: 100%; }
.mention-wrap textarea { width: 100%; }
.mention-menu { position: absolute; z-index: 20; inset-inline-start: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.mention-menu li { padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 11px; }
.mention-menu li.active, .mention-menu li:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------- Branch scope (users) ---------- */
.scope-pick > summary { cursor: pointer; color: var(--text-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-menu { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.scope-menu.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
.scope-field { border: 0; padding: 0; margin: 0; }
.scope-field legend { font-size: 10.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }

/* ---------- Warranty claims ---------- */
.rma-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; counter-reset: s; }
.rma-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10.5px; font-weight: 600; }
.rma-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 9.5px; }
.rma-steps li.done { background: var(--primary-soft); color: var(--primary); }
.rma-steps li.done span { background: var(--primary); color: #fff; }
.rma-steps li.current { box-shadow: inset 0 0 0 2px var(--primary); }
.rma-pack h2 { font-size: 12px; margin: 18px 0 6px; color: #4a5a75; text-transform: uppercase; letter-spacing: .05em; }
[dir="rtl"] .rma-pack h2 { letter-spacing: 0; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.doc-table th, .doc-table td { border: 1px solid #e3e9f2; padding: 6px 8px; text-align: start; vertical-align: top; }
.doc-table th { background: #f4f7fb; color: #4a5a75; font-weight: 600; width: 18%; }
.pack-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.pack-photos img { width: 150px; height: 112px; object-fit: cover; border: 1px solid #e3e9f2; border-radius: 6px; }
.doc-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid #e3e9f2; }

/* ---------- Report builder ---------- */
.rb-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.rb-form select, .rb-form input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.rb-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rb-group legend { font-size: 10.5px; font-weight: 700; color: var(--text-2); padding: 0 4px; display: flex; gap: 6px; align-items: center; }
.rb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.rb-result { min-width: 0; }

@media (max-width: 900px) {
    .wo-layout, .rb-layout { grid-template-columns: 1fr; }
    .wo-photos { grid-template-columns: 1fr; }
}

/* Two-line cell (e.g. model with the manufacturer below). */
.cell-stack { display: flex; flex-direction: column; line-height: 1.35; }
.cell-stack small { font-size: 9.5px; }
.grid-table .col-serial { white-space: nowrap; }
.grid-table .cell-main { min-width: 170px; }
.grid-table .col-model { min-width: 110px; }
.grid-scroll.is-wide { overflow-x: auto !important; }
.grid-scroll.is-wide .grid-table thead th { position: relative; top: 0; }

/* Asset table: one line per cell; a table wider than its card scrolls sideways inside it. */
.grid-table th, .grid-table td, .grid-table .cell-main strong, .grid-table .cell-main small, .grid-table .cell-stack > * { white-space: nowrap; }

/* Export menu */
.export-menu .dropdown-menu { min-width: 250px; }
.export-menu .dropdown-menu a { display: flex; gap: 10px; align-items: center; }
.export-menu .dropdown-menu a > span { display: flex; flex-direction: column; }
.export-menu .dropdown-menu small { font-size: 9.5px; }
.bulk-export { display: inline-flex; gap: 4px; align-items: center; }

/* ---------- Footer ---------- */
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-2); }
.footer-app { max-width: 1480px; width: 100%; margin: auto auto 0; padding: 16px 28px 22px; border-top: 1px solid var(--border); }
.footer-guest { max-width: 1040px; margin: 0 auto; padding: 18px 16px 26px; border-top: 1px solid var(--border); }
.footer-login { position: absolute; bottom: 16px; inset-inline: 24px; justify-content: center; flex-direction: column; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.footer-brand img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.footer-brand > span { display: flex; flex-direction: column; line-height: 1.45; }
.footer-brand small { font-size: 9.5px; }
.footer-login .footer-brand img { display: none; }
.footer-social { display: flex; gap: 6px; flex-wrap: wrap; }
.footer-social a { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); transition: color .15s, background .15s, border-color .15s, transform .15s; }
.footer-social a:hover { text-decoration: none; transform: translateY(-2px); color: #fff; border-color: transparent; }
.footer-social .social-icon { width: 15px; height: 15px; }
.footer-social .social-website:hover { background: var(--primary); }
.footer-social .social-email:hover { background: #475569; }
.footer-social .social-whatsapp:hover { background: #25d366; }
.footer-social .social-x:hover { background: #000; }
.footer-social .social-linkedin:hover { background: #0a66c2; }
.footer-social .social-instagram:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.footer-social .social-youtube:hover { background: #ff0000; }
.footer-social .social-tiktok:hover { background: #010101; }
.footer-social .social-facebook:hover { background: #1877f2; }
@media (prefers-reduced-motion: reduce) { .footer-social a:hover { transform: none; } }
@media print { .site-footer { display: none; } }
@media (max-width: 640px) {
    .footer-app, .footer-guest { justify-content: center; text-align: center; padding-inline: 16px; }
    .footer-brand { justify-content: center; }
    .footer-login { position: static; margin-top: 24px; }
}

/* ---------- Dashboard ---------- */
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.bg-primary { background: var(--primary); }
.text-body { color: var(--text) !important; }
.seg.seg-sm { margin: 0; padding: 3px; }
.seg.seg-sm button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; color: var(--text-2); font: inherit; font-weight: 600; font-size: 10.5px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.seg.seg-sm button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.dash-hero-main { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0; }
.dash-hero-main h1 { margin: 2px 0 6px; }
.dash-hero-main p { margin: 0; }
.dash-summary .badge { font-size: 11px; padding: 4px 12px; }
.dash-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dash-filter { display: inline-flex; align-items: center; gap: 6px; padding-inline-start: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); }
.dash-filter select { border: 0; background: transparent; box-shadow: none !important; min-width: 150px; }
.dash-score { display: flex; gap: 16px; align-items: center; padding: 18px 22px; border-radius: var(--radius); color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 320px; }
.dash-score:hover { text-decoration: none; border-color: var(--border-strong); }
.dash-score > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-score strong { font-size: 13px; }
.score-band { font-weight: 700; font-size: 11px; }
.score-excellent .score-band { color: var(--success); } .score-good .score-band { color: var(--info); }
.score-fair .score-band { color: var(--warning); } .score-poor .score-band { color: var(--danger); }
.score-parts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 10px; }
.score-parts li { display: flex; justify-content: space-between; gap: 14px; color: var(--text-2); }

.dash-editbar { position: sticky; top: var(--grid-topbar, 64px); z-index: 12; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--brand-navy); color: #fff; box-shadow: var(--shadow-lg); }
.dash-editbar > span { flex: 1; display: flex; gap: 8px; align-items: center; font-size: 11px; }
.dash-editbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }

.dash-widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; grid-auto-flow: row dense; }
.dash-widget { grid-column: span 12; min-width: 0; }
.dw-attention { grid-column: span 7; }
.dw-live { grid-column: span 5; }
.dw-watchlist, .dw-activity { grid-column: span 6; }
.dash-card { margin: 0; height: 100%; }
.dash-widget-edit { display: none; }
.dash-editing .dash-widget { outline: 2px dashed var(--border-strong); outline-offset: 4px; border-radius: var(--radius); cursor: grab; }
.dash-editing .dash-widget[data-hidden] { opacity: .45; }
.dash-editing .dash-widget.dragging { opacity: .35; }
.dash-editing .dash-widget-edit { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 10px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.dash-widget-edit strong { flex: 1; }
.dash-widget-edit .btn { padding-block: 2px; }
.drag-handle { display: inline-flex; cursor: grab; }

.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attention-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; }
.attention-list .att-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.attention-list .att-danger .att-icon { background: var(--danger-soft); color: var(--danger); }
.attention-list .att-warning .att-icon { background: var(--warning-soft); color: var(--warning); }
.attention-list li.att-danger { border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.att-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-text strong { font-size: 11.5px; font-weight: 600; }
.att-text small { color: var(--muted); font-size: 9.5px; }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.dash-kpi { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); min-width: 0; }
.dash-kpi:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.dash-kpi-top { display: flex; align-items: center; gap: 10px; }
.dash-kpi .kpi-icon { width: 32px; height: 32px; }
.dash-kpi .kpi-value { font-size: 24px; line-height: 1.1; }
.dash-kpi-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; min-height: 22px; }
.delta { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.delta-up-good { background: var(--success-soft); color: var(--success); }
.delta-up-bad { background: var(--danger-soft); color: var(--danger); }
.delta-flat { color: var(--muted); }
.spark svg { display: block; }

.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); min-width: 0; }
a.live-tile:hover { text-decoration: none; background: var(--surface-3); }
.live-label { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.live-tile > strong { font-size: 20px; }
.live-tile > strong small { font-size: 11px; color: var(--muted); font-weight: 500; }
.sla-stack { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.sla-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--text-2); }
.sla-legend span { display: inline-flex; align-items: center; gap: 4px; }
.sla-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tech-load { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; }
.tech-load li { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr auto; gap: 8px; align-items: center; }
.tech-load a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tech-load .meter { margin: 0; height: 6px; }
.live-window { font-size: 10.5px; display: flex; gap: 6px; min-width: 0; }
.live-window span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash-tabs-head { flex-wrap: wrap; }
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.chart-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-grid h4, [data-panel] > h4 { margin: 0 0 8px; font-size: 11px; color: var(--text-2); }
.eos-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; color: var(--text); }
.eos-tiles:hover { text-decoration: none; }
.eos-tile { display: flex; flex-direction: column; padding: 16px; border-radius: 12px; font-size: 10.5px; }
.eos-tile strong { font-size: 26px; }
.eos-tile.danger { background: var(--danger-soft); color: var(--danger); }
.eos-tile.warning { background: var(--warning-soft); color: var(--warning); }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.site-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.site-card:hover { text-decoration: none; border-color: var(--primary); }
.site-card.site-down { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.site-head > span { display: flex; flex-direction: column; min-width: 0; }
.site-stats { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.site-stats dt { font-size: 9px; color: var(--muted); }
.site-stats dd { margin: 0; font-weight: 700; font-size: 13px; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { display: flex; flex-direction: column; gap: 4px; min-height: 110px; padding: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.week-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.week-day.empty { opacity: .7; }
.week-date { font-weight: 700; font-size: 10.5px; color: var(--text-2); }
.week-day.today .week-date { color: var(--primary); }
.week-ev { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; font-size: 9.5px; color: var(--text); background: var(--surface); min-width: 0; }
.week-ev:hover { text-decoration: none; }
.week-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-ev.ev-window { background: var(--info-soft); color: var(--info); }
.week-ev.ev-work { background: var(--surface); border: 1px dashed var(--border-strong); }
.week-ev.ev-warranty { background: var(--warning-soft); color: var(--warning); }
.week-ev.ev-license { background: var(--danger-soft); color: var(--danger); }

.activity-list li { align-items: flex-start; }
.activity-list li > span { min-width: 0; }

@media (max-width: 1200px) {
    .dw-attention, .dw-live { grid-column: span 12; }
    .chart-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .dash-hero { grid-template-columns: 1fr; }
    .dash-score { min-width: 0; }
    .dw-watchlist, .dw-activity { grid-column: span 12; }
    .chart-grid, .chart-grid.two { grid-template-columns: 1fr; }
    .week-strip { grid-template-columns: 1fr; }
    .week-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .week-date { min-width: 70px; }
}
@media (max-width: 640px) {
    .live-grid { grid-template-columns: 1fr; }
    .dash-kpis { grid-template-columns: 1fr 1fr; }
    .dash-kpi .kpi-value { font-size: 20px; }
    .dash-filter { flex: 1; }
    .dash-filter select { min-width: 0; width: 100%; }
}

/* ---------- Operations wall screen ---------- */
body.noc { background: #070d1c; color: #e6edf8; min-height: 100vh; padding: 22px 28px; font-size: 15px; }
.noc-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.noc-brand { display: flex; align-items: center; gap: 12px; flex: 1; }
.noc-brand div { display: flex; flex-direction: column; }
.noc-brand strong { font-size: 20px; }
.noc-brand span { color: #8ea2c4; font-size: 13px; }
.noc-clock { font-size: 40px; font-weight: 800; letter-spacing: .02em; }
.noc-full { background: transparent; border: 1px solid #23324f; color: #c9d6ec; border-radius: 10px; padding: 8px 14px; display: inline-flex; gap: 8px; align-items: center; font: inherit; font-size: 12px; cursor: pointer; }
.noc-grid { display: grid; grid-template-columns: 280px 1fr 1fr; grid-auto-rows: minmax(150px, auto); gap: 18px; }
.noc-panel { background: #0d1630; border: 1px solid #1c2a48; border-radius: 18px; padding: 20px 22px; }
.noc-panel h2 { margin: 0 0 14px; font-size: 16px; display: flex; gap: 10px; align-items: center; color: #c9d6ec; }
.noc-panel h2 small { color: #8ea2c4; font-weight: 500; }
.noc-score { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.noc-score strong { font-size: 18px; }
.noc-score span { font-size: 16px; font-weight: 700; }
.noc-score .ring b { color: #fff; }
.noc-score .ring-bg { stroke: #1c2a48; }
.noc-kpis { grid-column: span 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.noc-kpis div { display: flex; flex-direction: column; gap: 6px; }
.noc-kpis span { color: #8ea2c4; font-size: 13px; }
.noc-kpis strong { font-size: 40px; font-weight: 800; }
.noc-attention ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.noc-attention li { display: flex; gap: 12px; align-items: center; font-size: 15px; padding: 10px 12px; border-radius: 12px; background: #111d3b; }
.noc-attention li.att-danger { border-inline-start: 5px solid #ef4444; }
.noc-attention li.att-warning { border-inline-start: 5px solid #f59e0b; }
.noc-attention li.att-info { border-inline-start: 5px solid #3b82f6; }
.noc-attention .icon { width: 22px; height: 22px; flex: none; }
.noc-ok { color: #34d399; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.noc-muted { color: #8ea2c4; }
.noc-down { display: flex; flex-wrap: wrap; gap: 10px; }
.noc-down > span { background: #3b0f17; color: #fecaca; border-radius: 10px; padding: 8px 12px; font-size: 16px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
.noc-sla-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.noc-sla-row div { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 14px; background: #111d3b; }
.noc-sla-row strong { font-size: 40px; font-weight: 800; }
.noc-sla-row .tone-danger { color: #f87171; } .noc-sla-row .tone-warning { color: #fbbf24; } .noc-sla-row .tone-success { color: #34d399; }
.noc-windows p { margin: 0 0 8px; font-size: 15px; }
.noc-conflict { color: #fca5a5; }
.noc-foot { margin-top: 18px; color: #5f739a; font-size: 12px; text-align: center; }
@media (max-width: 1100px) { .noc-grid { grid-template-columns: 1fr 1fr; } .noc-kpis { grid-column: span 2; } .noc-score { grid-row: auto; } }
@media (max-width: 700px) { body.noc { padding: 14px; } .noc-grid { grid-template-columns: 1fr; } .noc-kpis { grid-column: auto; grid-template-columns: 1fr 1fr; } .noc-clock { font-size: 26px; } }

/* ---- Security posture, software, webhooks, loans, consumables, assistant ---- */
.btn-xs { height: 24px; padding: 0 8px; font-size: 10px; border-radius: 7px; gap: 4px; }
.card-pad { padding: 12px 18px 16px; margin: 0; }
.stack-sm > * + * { margin-top: 6px; }
.sw-match { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; width: 100%; }
.sw-match > span { grid-column: 1 / -1; }
.sw-match input { min-width: 0; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 24px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: 11px; }
.sec-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 0; }
.sec-controls div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-3); font-size: 10.5px; }
.sec-controls .icon { width: 15px; height: 15px; flex: none; }
.sec-controls .ok { color: var(--success); } .sec-controls .bad { color: var(--danger); } .sec-controls .na { color: var(--muted); }
.kb-suggest { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.kb-suggest[hidden] { display: none; }
.kb-suggest h4 { margin: 0 0 6px; font-size: 11px; display: flex; gap: 6px; align-items: center; color: var(--primary); }
.kb-suggest details { border-top: 1px solid var(--border); padding: 6px 0; }
.kb-suggest details:first-of-type { border-top: 0; }
.kb-suggest summary { cursor: pointer; font-weight: 600; font-size: 11px; }
.kb-suggest .solution { white-space: pre-line; font-size: 11px; margin: 6px 0; }
.stars { display: inline-flex; gap: 4px; direction: ltr; }
.stars label { cursor: pointer; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars span { font-size: 26px; line-height: 1; color: var(--border-strong); transition: color .15s; }
.stars:has(input:checked) span { color: #f5b301; }
.stars label:has(input:checked) ~ label span { color: var(--border-strong); }
.stars:hover span { color: #f5b301; }
.stars label:hover ~ label span { color: var(--border-strong); }
.stars-static { color: #f5b301; letter-spacing: 1px; white-space: nowrap; }
.loan-cal { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 10px; }
.loan-cal .lc-head, .loan-cal .lc-row { display: contents; }
.loan-cal .lc-name { padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface); position: sticky; inset-inline-start: 0; }
.loan-cal .lc-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(22px, 1fr); border-top: 1px solid var(--border); position: relative; }
.loan-cal .lc-days span { border-inline-start: 1px solid var(--border); text-align: center; padding: 6px 0; color: var(--muted); }
.loan-cal .lc-days span.we { background: var(--surface-3); }
.loan-cal .lc-days span.today { color: var(--primary); font-weight: 700; }
.loan-cal .lc-bar { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-decoration: none; }
.loan-cal .lc-bar.st-checked_out { background: var(--success-soft); color: var(--success); }
.loan-cal .lc-bar.st-requested { background: var(--warning-soft); color: var(--warning); }
.loan-cal .lc-bar.late { background: var(--danger-soft); color: var(--danger); }
.loan-cal-wrap { overflow-x: auto; }
.loan-cal-wrap .loan-cal { min-width: 760px; }
.qty-pill { font-weight: 700; }
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 340px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: min(760px, 92%); padding: 10px 14px; border-radius: 14px; line-height: 1.7; font-size: 11.5px; white-space: pre-line; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-end-end-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--surface-3); border-end-start-radius: 4px; }
.chat-msg.error { align-self: center; background: var(--danger-soft); color: var(--danger); }
.chat-msg a { color: inherit; text-decoration: underline; }
.chat-action { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface); white-space: normal; }
.chat-action .inline-actions { margin-top: 8px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding-top: 8px; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.chat-hints { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-hints button { cursor: pointer; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: aim-blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes aim-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.label-scan { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; margin-bottom: 16px; }
.label-scan input[type=file] { display: none; }
.label-scan .muted { flex: 1; min-width: 180px; }
.field.ai-filled input, .field.ai-filled select { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.rr-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 90px; }
.rr-bar i { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.rr-bar i.warn { background: var(--warning); } .rr-bar i.bad { background: var(--danger); }
.secret-once { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret-once code { font-size: 11px; word-break: break-all; }
@media (max-width: 640px) {
    .chat-msg { max-width: 100%; }
    .loan-cal { grid-template-columns: 110px 1fr; }
}
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; }
.check-grid .check { align-items: flex-start; }
.public-card .stars { align-self: center; justify-content: center; }
.public-card .stars span { font-size: 34px; }
.loan-cal .lc-bar { display: block; line-height: 22px; text-overflow: ellipsis; top: 4px; bottom: auto; }

/* ---- License bar, license page, installation wizard ---- */
.license-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 11.5px; font-weight: 600; }
.license-bar .icon { width: 18px; height: 18px; flex: none; }
.license-bar a { margin-inline-start: auto; font-weight: 700; white-space: nowrap; }
.license-trial { background: var(--primary-soft); color: var(--primary); }
.license-soon { background: var(--warning-soft); color: var(--warning); }
.license-locked { background: var(--danger-soft); color: var(--danger); }
.install-page { padding: 24px 16px; }
.install-card { width: min(720px, 100%); padding: 24px; margin: 0 auto; }
.install-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.install-langs { display: flex; gap: 10px; }
.install-steps { margin-bottom: 18px; }
.install-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.install-card h2 { margin: 0; }
.install-card [hidden] { display: none; }
@media (max-width: 640px) { .install-card { padding: 16px; } .install-steps li { font-size: 0; } .install-steps li span { font-size: 11px; } }
/* A help note right after a card or a grid of cards needs breathing room. */
.card + p.small.muted, .grid + p.small.muted, .card + p.muted.small { margin-top: 14px; }

/* ---- Help center ---- */
.help-q { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.8px solid currentColor; font-weight: 800; font-size: 12px; line-height: 1; }
.help-search { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 18px; }
.help-search .icon { width: 20px; height: 20px; color: var(--muted); flex: none; }
.help-search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 13px; padding: 6px 0; outline: none; color: var(--text); }
.help-group h2 { font-size: 14px; margin: 22px 0 10px; color: var(--text-2); }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; color: var(--text); }
.help-card:hover { text-decoration: none; border-color: var(--border-strong); }
.help-card strong { display: block; margin-bottom: 2px; }
.help-card small { display: block; line-height: 1.6; }
.help-results { display: flex; flex-direction: column; gap: 10px; }
.help-hit { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; color: var(--text); }
.help-hit:hover { text-decoration: none; border-color: var(--primary); }
.help-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 1px; font-size: 11px; }
.help-nav a { padding: 5px 10px; border-radius: 8px; color: var(--text-2); }
.help-nav a:hover { text-decoration: none; background: var(--surface-3); color: var(--text); }
.help-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.help-nav .help-home { font-weight: 700; color: var(--text); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.help-nav-group { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px 4px; font-weight: 700; }
.help-article { padding: 26px 30px 22px; min-width: 0; }
.help-head h1 { margin: 6px 0; }
.help-summary { font-size: 13px; color: var(--text-2); margin: 0 0 12px; line-height: 1.8; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin: 16px 0 6px; font-size: 11px; }
.help-toc strong { width: 100%; font-size: 10px; color: var(--muted); }
.help-body { font-size: 12.5px; line-height: 1.95; max-width: 860px; }
.help-body h2 { font-size: 15.5px; margin: 28px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.help-body h2:first-child { border-top: 0; padding-top: 0; }
.help-body p { margin: 8px 0; }
.help-body code { background: var(--surface-3); border-radius: 5px; padding: 1px 6px; font-size: .92em; }
.help-steps, .help-list { margin: 8px 0; padding-inline-start: 22px; }
.help-steps li, .help-list li { margin: 5px 0; }
.help-steps li::marker { font-weight: 700; color: var(--primary); }
.help-fields { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 0; margin: 10px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.help-fields dt, .help-fields dd { margin: 0; padding: 8px 12px; border-top: 1px solid var(--border); }
.help-fields dt { font-weight: 700; background: var(--surface-2); }
.help-fields dt:first-of-type, .help-fields dt:first-of-type + dd { border-top: 0; }
.help-note { margin: 12px 0; }
.help-faq details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; margin: 8px 0; }
.help-faq summary { cursor: pointer; font-weight: 700; }
.help-faq p { margin: 8px 0 2px; }
.help-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11.5px; font-weight: 600; }
.help-print { max-width: 820px; margin: 0 auto; padding: 20px; font-size: 12px; line-height: 1.8; }
.help-print-cover { text-align: center; padding: 30px 0; }
.help-print-toc { text-align: start; columns: 2; font-size: 11px; }
.help-print-section { break-before: page; }
.help-print-section > h1 { border-bottom: 2px solid var(--primary); padding-bottom: 6px; }
@media (max-width: 960px) { .help-layout { grid-template-columns: 1fr; } .help-nav { position: static; max-height: 260px; } .help-article { padding: 18px 16px; } }
@media (max-width: 560px) { .help-fields { grid-template-columns: 1fr; } .help-fields dd { border-top: 0; padding-top: 0; } }
@media print { .help-nav, .help-pager, .help-head .inline-actions, .help-toc { display: none !important; } .help-layout { display: block; } .help-article { box-shadow: none; border: 0; } }
