/* NexoraOne — IT Asset Management Software
   Design system: navy sidebar in both themes + indigo accent; dark theme in shades of black; auto follows the OS.
   Tenant colours are injected as --brand / --accent on <html>. */

:root {
  --brand: #5b5bf6;
  --accent: #7c7cff;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #f0f2f7;
  --border: #e5e7ef;
  --border-strong: #d3d7e3;
  --text: #0f1330;
  --text-2: #3b4263;
  --muted: #6b7291;
  --ok: #138a4b; --ok-bg: #e3f6ec;
  --warn: #a35b06; --warn-bg: #fdf1dc;
  --danger: #c22b2b; --danger-bg: #fde8e8;
  --info: #3c48c9; --info-bg: #e8eafe;
  --muted-bg: #eef0f5;
  --shadow-xs: 0 1px 2px rgba(16, 20, 48, .05);
  --shadow: 0 1px 2px rgba(16, 20, 48, .04), 0 2px 8px rgba(16, 20, 48, .04);
  --shadow-lg: 0 18px 40px rgba(16, 20, 48, .16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 256px;
  --sidebar-mini: 72px;
  --side-bg: #11142a;
  --side-bg-2: #171b36;
  --side-border: rgba(255, 255, 255, .07);
  --side-text: #a9afcb;
  --side-text-strong: #ffffff;
  --side-muted: #6c7398;
  --auth-hero-bg: #161a2e;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #09090b;
  --surface: #121214;
  --surface-2: #161618;
  --surface-3: #1e1e21;
  --border: #26262a;
  --border-strong: #36363c;
  --text: #ededef;
  --text-2: #c6c6cc;
  --muted: #8e8e96;
  --ok: #4ade80; --ok-bg: rgba(34, 197, 94, .14);
  --warn: #fbbf24; --warn-bg: rgba(245, 158, 11, .14);
  --danger: #f87171; --danger-bg: rgba(239, 68, 68, .14);
  --info: #9ec5ff; --info-bg: rgba(8, 125, 245, .16);
  --muted-bg: #1e1e21;
  --shadow-xs: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .65);
  --auth-hero-bg: #0b0b0d;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #09090b;
    --surface: #121214;
    --surface-2: #161618;
    --surface-3: #1e1e21;
    --border: #26262a;
    --border-strong: #36363c;
    --text: #ededef;
    --text-2: #c6c6cc;
    --muted: #8e8e96;
    --ok: #4ade80; --ok-bg: rgba(34, 197, 94, .14);
    --warn: #fbbf24; --warn-bg: rgba(245, 158, 11, .14);
    --danger: #f87171; --danger-bg: rgba(239, 68, 68, .14);
    --info: #9ec5ff; --info-bg: rgba(8, 125, 245, .16);
    --muted-bg: #1e1e21;
    --shadow-xs: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .65);
    --auth-hero-bg: #0b0b0d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--text); }
h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -.025em; margin: 0 0 .15rem; line-height: 1.2; }
h2 { font-size: .98rem; font-weight: 650; letter-spacing: -.01em; margin: 0 0 .9rem; }
h3 { font-size: .9rem; font-weight: 650; margin: 1.2rem 0 .5rem; }
h1 small, h2 small { font-weight: 400; color: var(--muted); }
p { margin: .4rem 0 .8rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-3); padding: .08em .4em; border-radius: 5px; }
pre { background: var(--surface-3); padding: .85rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; font: 12.5px/1.55 var(--mono); border: 1px solid var(--border); }
pre.json { max-width: 520px; max-height: 300px; margin: .4rem 0 0; }
hr { border: 0; border-top: 1px solid var(--border); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .83rem; margin: .25rem 0 .7rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.prewrap { white-space: pre-wrap; }
.upper { text-transform: uppercase; }
.grow { flex: 1; }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.dim { opacity: .55; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--surface); padding: .5rem 1rem; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- shell & sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.sidebar { background: var(--side-bg); background-image: linear-gradient(180deg, var(--side-bg-2), var(--side-bg) 320px); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; z-index: 40; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
.brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .35rem; padding: 19px 18px 16px; min-height: 70px; }
/* Logo exactly as wide as the payoff below it: the grid takes the text width, the logo stretches to it.
   All-white, tightly cropped vector; whole-pixel paddings keep its edges sharp. */
.brand-lockup { display: inline-grid; row-gap: 7px; }
.brand-lockup .brand-full { width: 0; min-width: 100%; height: auto; }
.brand img { display: block; flex: none; height: auto; }
.brand .brand-mark { display: none; width: 34px; height: 34px; }
.brand small { display: block; color: var(--side-muted); font-size: .66rem; line-height: 1.25; white-space: nowrap; }
.tenant-switch { margin: 0 .8rem .6rem; padding: .55rem .65rem .6rem; border: 1px solid var(--side-border); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.tenant-switch label { font-size: .64rem; color: var(--side-muted); text-transform: uppercase; letter-spacing: .12em; margin: 0; }
.tenant-switch select { width: 100%; margin-top: .25rem; padding: .35rem .5rem; background: rgba(255, 255, 255, .06); color: var(--side-text-strong); border: 1px solid var(--side-border); border-radius: 7px; font-size: .86rem; font-weight: 600; }
.tenant-switch select option { color: #0f1330; }
.tenant-switch select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 124, 255, .25); }
.nav { padding: .3rem .7rem 1rem; flex: 1; }
.nav-section { font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--side-muted); padding: 1.05rem .65rem .4rem; white-space: nowrap; }
.nav a { position: relative; display: flex; align-items: center; gap: .75rem; padding: .48rem .65rem; margin: 1px 0; color: var(--side-text); border-radius: 8px; font-weight: 500; font-size: .875rem; white-space: nowrap; transition: background .12s, color .12s; }
.nav a .ic { opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--side-text-strong); text-decoration: none; }
.nav a.active { background: rgba(124, 124, 255, .16); color: var(--side-text-strong); }
.nav a.active .ic { opacity: 1; color: #a9a9ff; }
.nav a.active::before { content: ""; position: absolute; left: -.7rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .8rem .7rem 1.1rem; color: var(--side-muted); font-size: .72rem; border-top: 1px solid var(--side-border); }
.collapse-btn { display: inline-flex; align-items: center; gap: .4rem; background: transparent; border: 1px solid var(--side-border); color: var(--side-text); border-radius: 8px; padding: .32rem .5rem; cursor: pointer; font: inherit; font-size: .75rem; }
.collapse-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.collapse-btn .ic { width: 16px; height: 16px; transition: transform .2s; }

/* Collapsed (icons only) */
html.sidebar-collapsed .shell { grid-template-columns: var(--sidebar-mini) minmax(0, 1fr); }
html.sidebar-collapsed .brand { align-items: center; padding: 1.15rem 0 1rem; }
html.sidebar-collapsed .brand .brand-mark { display: block; }
html.sidebar-collapsed .brand .brand-lockup,
html.sidebar-collapsed .brand .brand-full,
html.sidebar-collapsed .brand .brand-payoff,
html.sidebar-collapsed .tenant-switch,
html.sidebar-collapsed .nav a span,
html.sidebar-collapsed .sidebar-version,
html.sidebar-collapsed .collapse-btn span { display: none; }
html.sidebar-collapsed .nav { padding: .3rem .6rem 1rem; }
html.sidebar-collapsed .nav-section { font-size: 0; padding: .6rem 0 .3rem; margin: .4rem .5rem 0; border-top: 1px solid var(--side-border); }
html.sidebar-collapsed .nav-section:first-child { border-top: 0; }
html.sidebar-collapsed .nav a { justify-content: center; padding: .6rem 0; }
html.sidebar-collapsed .nav a.active::before { left: -.6rem; }
html.sidebar-collapsed .sidebar-foot { justify-content: center; padding: .7rem 0; }
html.sidebar-collapsed .collapse-btn .ic { transform: rotate(180deg); }

/* ---------- top bar ---------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .9rem; height: 62px; padding: 0 1.6rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.global-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 .55rem 0 .8rem; color: var(--muted); transition: border-color .15s, box-shadow .15s, background .15s; }
.global-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); background: var(--surface); }
.global-search input { border: 0; background: transparent; padding: .55rem 0; flex: 1; min-width: 0; box-shadow: none; margin: 0; }
.global-search input:focus { outline: none; box-shadow: none; }
.kbd { font: 600 .68rem/1 var(--font); color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: .2rem .38rem; background: var(--surface); }
.top-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; gap: .4rem; background: transparent; border: 1px solid transparent; color: var(--text-2); padding: .45rem .55rem; border-radius: 9px; cursor: pointer; font: inherit; }
.icon-btn:hover { background: var(--surface-3); }
.theme-label { font-size: .78rem; color: var(--muted); }
/* Theme switcher: one icon per state (auto = half circle, light = sun, dark = moon) */
.theme-ico { display: none; line-height: 0; }
:root[data-theme="auto"] .theme-ico-auto, :root:not([data-theme]) .theme-ico-auto, :root[data-theme="light"] .theme-ico-light, :root[data-theme="dark"] .theme-ico-dark { display: inline-flex; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .3rem .55rem .3rem .3rem; border-radius: 999px; border: 1px solid transparent; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--surface-3); border-color: var(--border); }
.user-name { font-weight: 600; font-size: .86rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 264px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; }
.menu-head { padding: .6rem .65rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem; }
.menu-head strong, .menu-head small { display: block; }
.menu-head small { color: var(--muted); margin-bottom: .4rem; }
.menu a, .menu button { display: flex; width: 100%; gap: .6rem; align-items: center; padding: .52rem .65rem; color: var(--text-2); background: none; border: 0; font: inherit; text-align: left; border-radius: 8px; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.content { padding: 1.7rem 1.8rem 2rem; flex: 1; max-width: 1560px; width: 100%; }
.foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.8rem; color: var(--muted); font-size: .75rem; border-top: 1px solid var(--border); }
.backdrop { display: none; }
.only-mobile { display: none; }

/* ---------- page structure ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.page-head h1 .badge { vertical-align: 4px; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; min-width: 0; }
.card.narrow { max-width: 660px; }
.card.highlight { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); box-shadow: 0 0 0 3px var(--warn-bg); }
.card-warn { border-left: 3px solid var(--warn); }
.card > h2:first-child { margin-top: 0; }
.card > h2:first-child { display: flex; align-items: center; gap: .45rem; }
.card > h2 .ic { color: var(--muted); width: 17px; height: 17px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.grid-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr); gap: 1.2rem; align-items: start; }
.grid-2.tight, .grid-3.tight { gap: .75rem; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-3 + .card, .grid-2 + .grid-2, .grid-3 + .grid-2 { margin-top: 1.2rem; }

/* ---------- KPI tiles & charts ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stats.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.stat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.05rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .15rem; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.stat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-1px); box-shadow: var(--shadow), 0 6px 18px rgba(16, 20, 48, .06); }
.stat-icon { position: absolute; right: .95rem; top: .95rem; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--brand); }
.stat-icon .ic { width: 18px; height: 18px; vertical-align: 0; }
.stat-label { color: var(--muted); font-size: .78rem; font-weight: 500; padding-right: 40px; }
.stat-value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: .25rem; }
.stats.small .stat-value { font-size: 1.3rem; }
.stats.small .stat-label { padding-right: 0; }
.stat small { color: var(--muted); }
.stat-ok .stat-icon { background: var(--ok-bg); color: var(--ok); }
.stat-info .stat-icon { background: var(--info-bg); color: var(--info); }
.stat-warn .stat-icon { background: var(--warn-bg); color: var(--warn); }
.stat-muted .stat-icon { background: var(--muted-bg); color: var(--muted); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.bars li { display: grid; grid-template-columns: minmax(80px, 36%) 1fr 2.4rem; align-items: center; gap: .7rem; font-size: .84rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.anomalies { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .5rem 1.4rem; }
.anomalies li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.more { display: inline-flex; margin-top: .8rem; font-size: .84rem; font-weight: 500; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.3rem; padding: 0 1.3rem; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: .6rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table thead th:first-child { border-top-left-radius: 8px; }
.table thead th:last-child { border-top-right-radius: 8px; }
.table th a { color: inherit; }
.table th a:hover { color: var(--text); text-decoration: none; }
.table td { padding: .62rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table td strong { font-weight: 600; }
.table.compact td, .table.compact th { padding: .45rem .55rem; }
.table-hover tbody tr { transition: background .1s; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.w-check { width: 2rem; }
.actions-col { width: 1%; position: sticky; right: 0; z-index: 1; }
.row-actions { white-space: nowrap; text-align: right; position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 12px -10px rgba(16, 20, 48, .25); }
.table-hover tbody tr:hover .row-actions { background: var(--surface-2); }
.cell-sub { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; }
.act { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: 2px; border-radius: 8px; color: var(--muted); border: 1px solid transparent; transition: background .12s, color .12s, border-color .12s; }
.act .ic { width: 16px; height: 16px; vertical-align: 0; }
.act:hover { background: var(--surface-3); color: var(--text); border-color: var(--border); text-decoration: none; }
.act-primary { color: var(--brand); }
.act-primary:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.act-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.actions-cell { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.actions-cell form { margin: 0; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.per-page { font-size: .8rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; }
.per-page a { padding: .15rem .45rem; border-radius: 6px; color: var(--text-2); }
.per-page a:hover { background: var(--surface-3); text-decoration: none; }
.per-page a.active { background: var(--text); color: var(--surface); }
.pagination { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination a, .pagination span { min-width: 2rem; text-align: center; padding: .32rem .6rem; border: 1px solid var(--border); border-radius: 8px; font-size: .83rem; color: var(--text-2); background: var(--surface); }
.pagination a:hover { border-color: var(--border-strong); text-decoration: none; }
.pagination .current { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 600; }
.pagination .disabled { color: var(--muted); opacity: .5; }
.bulk-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; margin-bottom: .8rem; background: var(--text); color: var(--surface); border-radius: 10px; flex-wrap: wrap; font-size: .85rem; }
.bulk-bar select { width: auto; margin: 0; padding: .3rem .5rem; font-size: .82rem; }
.bulk-bar .btn { background: transparent; color: var(--surface); border-color: color-mix(in srgb, var(--surface) 30%, transparent); }
.bulk-bar .btn:hover { background: color-mix(in srgb, var(--surface) 12%, transparent); }
.bulk-bar[hidden] { display: none; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .55rem .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--muted); }
.chip { display: inline-block; padding: .08rem .55rem; margin: 0 .25rem .2rem 0; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: .76rem; border: 1px solid var(--border); }
a.chip:hover { text-decoration: none; border-color: var(--border-strong); }

/* ---------- forms ---------- */
.form label, label { display: block; font-weight: 500; font-size: .83rem; color: var(--text-2); margin-bottom: .85rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; font-size: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); box-shadow: none; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 16px; height: 16px; margin: 0 .5rem 0 0; vertical-align: -3px; accent-color: var(--brand); box-shadow: none; }
input[type="color"] { height: 42px; padding: .25rem; }
input[type="file"] { padding: .45rem; font-size: .84rem; }
label.check { font-weight: 400; display: flex; align-items: flex-start; gap: .1rem; color: var(--text); }
label.check input { margin-top: .22rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
label.inline input { margin: 0; width: auto; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: .7rem 1rem .4rem; margin: 0 0 1rem; }
legend { font-weight: 600; font-size: .83rem; padding: 0 .35rem; color: var(--text); }
.field-error { color: var(--danger); font-size: .8rem; margin: -.55rem 0 .8rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: .8rem 0; border-top: 1px solid var(--border); z-index: 5; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin-bottom: 0; }
.inline-form input, .inline-form select { width: auto; min-width: 140px; }
.upload-form { margin-top: .9rem; }
.label-icon { display: inline-flex; align-items: center; gap: .35rem; }
.label-icon .ic { width: 15px; height: 15px; color: var(--muted); }

/* ---------- phone with country code ---------- */
.field > label { margin-bottom: 0; }
.phone-field { display: flex; gap: .4rem; margin: .3rem 0 .85rem; position: relative; }
.phone-field > input { margin-top: 0; flex: 1; min-width: 0; }
.phone-field > select.phone-cc { margin-top: 0; width: 9.5rem; flex: none; }
.phone-field.enhanced > select.phone-cc { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cc-btn { display: inline-flex; align-items: center; gap: .45rem; flex: none; height: auto; padding: 0 .6rem; font: inherit; font-size: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); cursor: pointer; white-space: nowrap; }
.cc-btn:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border-strong)); }
.cc-btn:focus-visible, .cc-btn[aria-expanded="true"] { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.cc-btn::after { content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translateY(-2px); margin-left: .1rem; }
.flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; vertical-align: -2px; }
.cc-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; width: min(340px, 92vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg, 0 12px 32px rgba(15, 23, 42, .18)); overflow: hidden; }
.cc-pop input { margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: .65rem .8rem; }
.cc-pop input:focus { box-shadow: none; }
.cc-list { list-style: none; margin: 0; padding: .25rem 0; max-height: 280px; overflow-y: auto; }
.cc-list li { display: flex; align-items: center; gap: .6rem; padding: .42rem .8rem; cursor: pointer; font-size: .87rem; color: var(--text); }
.cc-list li .cc-dial { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-list li.active, .cc-list li:hover { background: var(--surface-3); }
.cc-list li[aria-selected="true"] { font-weight: 600; }
.cc-list .cc-group { cursor: default; padding: .5rem .8rem .2rem; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: none !important; }
@media (max-width: 520px) { .cc-pop { width: 100%; } }
.cc-empty { padding: .7rem .8rem; color: var(--muted); font-size: .85rem; }
.contact-link { display: inline-flex; align-items: center; gap: .45rem; }
.contact-link .ic { width: 16px; height: 16px; color: var(--muted); }
.social-facebook .ic { color: #1877f2; }
.social-instagram .ic { color: #d62976; }
.social-linkedin .ic { color: #0a66c2; }
.upload-form input[type="file"] { max-width: 280px; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.btn-row form { margin: 0; }
.filters { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; }
.filters input, .filters select { width: auto; margin: 0; min-width: 160px; }
.filters input[type="search"] { min-width: 260px; }
.filters .grow { flex: 1; }
.filters-card { padding: 1rem 1.1rem; }
.filters-card .filters { margin-bottom: 0; }
.advanced { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .7rem; }
.advanced summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: .84rem; list-style: none; display: inline-flex; align-items: center; gap: .35rem; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: .2rem; }
.advanced[open] summary::before { transform: rotate(45deg); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 .9rem; margin-top: .9rem; }
.copy-row { display: flex; gap: .5rem; margin-top: .5rem; }
.copy-row input { margin: 0; }
.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .45rem; }
.map-row input, .map-row select { margin: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 36px; padding: 0 .95rem; font: inherit; font-size: .86rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1; transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 22%, var(--border-strong)); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--brand); border-color: color-mix(in srgb, var(--brand) 85%, #000); color: #fff; box-shadow: 0 1px 2px rgba(16, 20, 48, .15), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: color-mix(in srgb, var(--brand) 75%, #000); }
.btn-danger { background: var(--danger); border-color: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
:root[data-theme="dark"] .btn-danger { color: #1a0505; }
.btn-danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border-strong)); }
.btn-danger-outline:hover { background: var(--danger-bg); }
.btn-sm { height: 30px; padding: 0 .7rem; font-size: .79rem; }
.btn-block { width: 100%; }
.btn .ic { width: 16px; height: 16px; vertical-align: 0; }
.link-danger { background: none; border: 0; padding: 0; color: var(--danger); cursor: pointer; font: inherit; font-size: .8rem; }

/* ---------- alerts ---------- */
.alert { position: relative; display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 2.6rem .8rem 1rem; border-radius: 10px; margin-bottom: 1.1rem; border: 1px solid transparent; font-size: .88rem; }
.alert::before { content: ""; flex: none; width: 4px; align-self: stretch; border-radius: 4px; background: currentColor; opacity: .7; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert a { color: inherit; text-decoration: underline; }
.alert-close { position: absolute; right: .55rem; top: .45rem; background: none; border: 0; font-size: 1.2rem; color: inherit; cursor: pointer; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ---------- misc components ---------- */
.dl { display: grid; grid-template-columns: minmax(130px, 32%) 1fr; gap: 0; margin: 0; font-size: .88rem; }
.dl dt, .dl dd { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1.1rem; overflow-x: auto; padding: .25rem; background: var(--surface-3); border-radius: 10px; width: fit-content; max-width: 100%; }
.tabs a { padding: .4rem .85rem; color: var(--muted); border-radius: 8px; white-space: nowrap; font-weight: 500; font-size: .85rem; }
.tabs a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { padding: .55rem .6rem .55rem calc(.6rem + var(--depth) * 1.6rem); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; position: relative; }
.tree li:hover { background: var(--surface-2); }
.tree li.inactive { opacity: .55; }
.tree-type { display: inline-flex; align-items: center; gap: .4rem; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); min-width: 122px; }
.tree-type .ic { width: 16px; height: 16px; flex: none; color: var(--brand); }
.tree-type-site .ic { color: var(--ok); }
.add-menu .menu a .ic { width: 15px; height: 15px; color: var(--brand); }
.tree-actions { margin-left: auto; display: flex; gap: .9rem; font-size: .8rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-3); }
.gallery figcaption { font-size: .76rem; color: var(--muted); display: flex; justify-content: space-between; gap: .3rem; margin-top: .25rem; }
.gallery figcaption form { margin: 0; }
.qr { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); max-width: 100%; height: auto; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); display: grid; gap: .9rem; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -1.5rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--surface); }
.change { font-size: .8rem; }
.change .old, .diff .old { color: var(--danger); text-decoration: line-through; }
.change .new, .diff .new { color: var(--ok); }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0 0 1.2rem; counter-reset: s; }
.steps li { counter-increment: s; padding: .38rem .85rem .38rem .45rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-right: .45rem; border-radius: 50%; background: var(--surface-3); font-weight: 700; font-size: .72rem; }
.steps li.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.steps li.done::before { content: "✓"; background: var(--ok-bg); }
.person { display: flex; gap: 1rem; align-items: center; }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); }
.avatar-lg.placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 700; font-size: 1.25rem; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }
.codes li { margin-bottom: .3rem; }
.totp-setup { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.totp-setup > div { flex: 1; min-width: 260px; }
.secret { font-size: 1rem; letter-spacing: .05em; }
.logo-row { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.logo-box { min-width: 160px; }
.logo-preview { max-width: 220px; max-height: 90px; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
.brand-logo { display: inline-block; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 3px; vertical-align: middle; }
.brand-logo-sm { width: 46px; height: 28px; }
.brand-logo-xs { width: 38px; height: 22px; padding: 2px; border-radius: 5px; flex: none; }
.model-thumb { display: inline-grid; place-items: center; width: 52px; height: 40px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); background: #fff; vertical-align: middle; }
.model-thumb-empty { background: var(--surface-3); color: var(--muted); }
.model-thumb-empty .ic { width: 18px; height: 18px; }
.model-photo { display: block; max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #fff; margin-bottom: 1rem; }
.model-photo-fallback img { object-fit: contain; background: #fff; }
.brand-logo-md { width: 76px; height: 36px; }
.brand-logo-lg { max-width: 220px; max-height: 110px; width: auto; height: auto; padding: 8px; }
.brand-logo-empty { display: inline-grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: .8rem; }
.label-print-form { display: inline-flex; gap: 0; margin: 0; }
.label-print-form select { width: auto; max-width: 240px; height: 36px; margin: 0; padding-top: 0; padding-bottom: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; font-size: .82rem; }
.label-print-form .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.brand-cell { display: inline-flex; align-items: center; gap: .6rem; }
.w-logo { width: 64px; }
.perm-list { margin: 0; padding-left: 1.1rem; font-size: .83rem; color: var(--text-2); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.report-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.05rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.report-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-1px); }
.report-card .ic { color: var(--brand); width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 11%, transparent); margin-bottom: .35rem; }
.report-card strong { font-weight: 650; }
.report-card span { color: var(--muted); font-size: .82rem; }
.sync-item { padding: .85rem 0; border-bottom: 1px solid var(--border); }
.sync-item:target { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.sync-head { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.sync-msg { color: var(--muted); font-size: .84rem; margin: .25rem 0; }
.diff { margin: .3rem 0 .5rem; padding-left: 1.2rem; font-size: .84rem; }
.sig-row { padding: .65rem 0; border-bottom: 1px solid var(--border); }
.prose { max-width: 980px; }
.empty-state { text-align: center; padding: 4.5rem 1rem; }
.error-code { font-family: var(--font-display); font-size: 4.2rem; font-weight: 800; letter-spacing: -.05em; background: linear-gradient(135deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* ---------- signature ---------- */
.signature-field { margin-bottom: 1.1rem; }
.signature-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.signature-pad { width: 100%; height: 170px; background: #fff; border: 1px dashed var(--border-strong); border-radius: 10px; touch-action: none; cursor: crosshair; display: block; }
.req { color: var(--danger); }

/* ---------- label editor ---------- */
.label-editor .editor-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; }
.editor-canvas-wrap { overflow: auto; background: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 14px 14px; }
.zoom-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; font-size: .84rem; color: var(--muted); }
.zoom-row input { width: 180px; margin: 0; box-shadow: none; }
.editor-canvas { position: relative; background: #fff; box-shadow: 0 0 0 1px #94a3b8, var(--shadow-lg); margin: 1.2rem auto; color: #000; overflow: hidden; border-radius: 3px; background-image: linear-gradient(#eef2f7 1px, transparent 1px), linear-gradient(90deg, #eef2f7 1px, transparent 1px); }
.le-el { position: absolute; cursor: move; outline: 1px dashed rgba(91, 91, 246, .4); overflow: hidden; line-height: 1.15; user-select: none; touch-action: none; }
.le-el.selected { outline: 2px solid #5b5bf6; z-index: 5; }
.le-el svg, .le-el img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.le-el.le-rect { border: .3mm solid #000; }
.le-handle { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: #5b5bf6; cursor: nwse-resize; border-radius: 2px 0 0 0; }
.editor-props label { margin-bottom: .6rem; }
.editor-props .grid-2 { gap: .5rem; }

/* ---------- installer (guest card) ---------- */
body.guest { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), var(--bg); }
.guest-wrap { width: 100%; max-width: 420px; padding: 1.5rem; }
.guest-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 1.9rem; }
.guest-brand { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; margin-bottom: 1.4rem; }
.guest-brand img { display: block; height: auto; }
.guest-brand small { color: var(--muted); }
.guest-title { font-size: 1.15rem; margin-bottom: 1rem; }
.guest-links { text-align: center; margin: 1rem 0 0; font-size: .88rem; }
.guest-foot { text-align: center; color: var(--muted); font-size: .78rem; }
.check-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .7rem; font-weight: 800; }
.check-ok { background: var(--ok-bg); color: var(--ok); }
.check-error { background: var(--danger-bg); color: var(--danger); }
.check-warning { background: var(--warn-bg); color: var(--warn); }

/* ---------- authentication (split layout) ---------- */
body.auth { background: var(--surface); --auth-accent: #5b5bf6; --auth-accent-2: #7c7cff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; background: var(--auth-hero-bg); color: #fff; display: flex; align-items: center; }
.auth-hero-inner { position: relative; z-index: 1; width: 100%; max-width: 680px; padding: 3rem 2rem 3rem clamp(2rem, 14%, 7rem); }
.auth-watermark { position: absolute; width: 560px; height: 560px; right: -120px; bottom: -150px; opacity: .07; pointer-events: none; user-select: none; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; margin-bottom: 4.5rem; }
.auth-brand small { display: block; font-size: .72rem; color: #9a9ca8; padding-left: 2px; }
.auth-brand img, .auth-brand svg.auth-logo { display: block; height: auto; }
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .logo-on-light { display: none !important; }
  :root[data-theme="auto"] .logo-on-dark { display: block !important; }
}
.auth-eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--auth-accent-2); margin: 0 0 .6rem; font-weight: 500; }
.auth-claim { font-size: clamp(2rem, 3.2vw, 2.9rem); line-height: 1.12; letter-spacing: -.05em; font-weight: 600; margin: 0 0 1rem; color: #fff; }
.auth-lead { color: #cfd1d8; font-size: 1rem; line-height: 1.75; max-width: 330px; margin: 0; }
.auth-hero-foot { color: #9a9ca8; font-size: .82rem; margin: 4.5rem 0 0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--surface); }
.auth-panel { width: 100%; max-width: 350px; }
.auth-panel .auth-eyebrow { color: var(--auth-accent); font-size: .68rem; }
/* dark theme: the brand blue of the organisation can be very dark, texts and links use its lighter tint */
:root[data-theme="dark"] .auth-panel .auth-eyebrow, :root[data-theme="dark"] .auth-help a { color: var(--auth-accent-2); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .auth-panel .auth-eyebrow, :root[data-theme="auto"] .auth-help a { color: var(--auth-accent-2); }
}
.auth-brand-compact { display: none; margin-bottom: 2rem; color: var(--text); }
.auth-brand-compact small { color: var(--muted); }
.auth-title { font-size: 1.6rem; letter-spacing: -.035em; margin: 0 0 .5rem; font-weight: 700; }
.auth-sub { color: var(--muted); font-size: .88rem; margin: 0 0 1.6rem; }
.auth-form label { font-weight: 400; color: var(--text-2); font-size: .84rem; margin-bottom: 1.1rem; }
.auth-form input { margin-top: .45rem; padding: .7rem .8rem; border-color: var(--border); border-radius: 7px; }
.auth-form input:focus { border-color: var(--auth-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 22%, transparent); }
.auth-submit { margin-top: .8rem; height: 44px; font-size: .95rem; background: var(--auth-accent); border-color: var(--auth-accent); border-radius: 7px; }
.auth-submit:hover { background: color-mix(in srgb, var(--auth-accent) 85%, #000); }
.auth-help { color: var(--muted); font-size: .84rem; line-height: 1.6; margin: .7rem 0 0; }
.auth-help a { color: var(--auth-accent); }
.auth-foot { display: flex; justify-content: space-between; margin-top: 2.6rem; font-size: .72rem; color: var(--muted); }
.auth .alert { font-size: .86rem; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-brand-compact { display: flex; }
  .auth-main { align-items: flex-start; padding-top: 3rem; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-side { grid-template-columns: 1fr; }
  .label-editor .editor-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell, html.sidebar-collapsed .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, 290px); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  /* On phones the drawer always shows labels, whatever the desktop preference. */
  html.sidebar-collapsed .sidebar .brand .brand-full, html.sidebar-collapsed .sidebar .brand .brand-payoff, html.sidebar-collapsed .sidebar .tenant-switch { display: block; }
  html.sidebar-collapsed .sidebar .brand .brand-lockup { display: inline-grid; }
  html.sidebar-collapsed .sidebar .brand .brand-mark { display: none; }
  html.sidebar-collapsed .sidebar .nav a span { display: inline; }
  html.sidebar-collapsed .sidebar .nav a { justify-content: flex-start; padding: .48rem .65rem; }
  html.sidebar-collapsed .sidebar .nav-section { font-size: .64rem; border-top: 0; padding: 1.05rem .65rem .4rem; margin: 0; }
  html.sidebar-collapsed .sidebar .brand { align-items: flex-start; padding: 19px 18px 16px; }
  .collapse-btn { display: none; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 13, 28, .5); backdrop-filter: blur(2px); z-index: 35; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 0 .8rem; height: 56px; }
  .content { padding: 1.1rem .9rem 1.5rem; }
  .user-name, .theme-label, .kbd { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
  .filters input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .filters select, .filters input { flex: 1 1 140px; }
  .bars li { grid-template-columns: 34% 1fr 2.2rem; }
  .codes { columns: 1; }
  .table-wrap { margin: 0 -1.3rem; }
}

.print-header { display: none; }
@media print {
  .print-header { display: flex !important; align-items: center; gap: 14px; padding: 0 0 10px; margin: 0 0 14px; border-bottom: 2px solid var(--brand); color: #000; }
  .print-header img { max-height: 18mm; max-width: 45mm; object-fit: contain; }
  .print-header strong { display: block; font-size: 13pt; }
  .print-header small { display: block; font-size: 8pt; color: #444; }
  .print-header .print-date { margin-left: auto; text-align: right; }
  .sidebar, .topbar, .foot, .actions, .filters, .pagination, .btn, .alert-close, .bulk-bar, form .form-actions { display: none !important; }
  .shell, html.sidebar-collapsed .shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}

/* ---------- asset import ---------- */
.import-map td { vertical-align: middle; }
.import-map select { margin-top: 0; min-width: 230px; }
.import-map tr.is-skipped td:not(:last-child) { opacity: .55; }
.import-map .samples { max-width: 420px; }
.import-preview td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.import-preview td.import-msg { white-space: normal; min-width: 240px; max-width: 420px; }
tr.row-error td { background: color-mix(in srgb, var(--danger-bg) 55%, transparent); }
.import-stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* ---------- historical assignments ---------- */
.legacy-box { border: 1px dashed var(--border-strong); border-radius: 10px; padding: .8rem 1rem .4rem; margin-bottom: 1.2rem; background: var(--surface-2); }
.legacy-box h2 { display: flex; align-items: center; gap: .45rem; }
.legacy-box h2 .ic { width: 17px; height: 17px; color: var(--muted); }
.steps li.active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.steps li.active::before { background: var(--brand); color: #fff; }
.report-group td:first-child { white-space: nowrap; font-weight: 600; }
.report-group h2 .badge { font-weight: 600; }
.import-preview tr.is-skipped td:not(:first-child) { opacity: .5; }
.import-preview .w-check, .import-preview td:first-child input { width: 16px; }

/* ---------- category icons ---------- */
.cat-badge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); color: var(--brand); flex: none; vertical-align: middle; }
.cat-badge .cat-ic { width: 18px; height: 18px; }
th.w-cat, td.w-cat { width: 44px; padding-right: 0; }
.cat-inline { display: inline-flex; align-items: center; gap: .4rem; }
.cat-inline .cat-ic { width: 16px; height: 16px; color: var(--brand); }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.icon-picker .icon-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .3rem .5rem; margin: 0; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; text-align: center; font-weight: 500; color: var(--text-2); background: var(--surface); }
.icon-picker .icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker .icon-choice .cat-ic { width: 24px; height: 24px; color: var(--brand); }
.icon-picker .icon-choice small { font-size: .68rem; line-height: 1.2; color: var(--muted); }
.icon-picker .icon-choice .icon-auto { font-weight: 700; font-size: .78rem; height: 24px; display: grid; place-items: center; color: var(--brand); }
.icon-picker .icon-choice:hover { border-color: var(--border-strong); }
.icon-picker .icon-choice:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.icon-picker .icon-choice:has(input:focus-visible) { box-shadow: var(--ring); }
.map-frame { display: block; width: 100%; height: 340px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-3); margin: .2rem 0 .8rem; }
.location-map h2 { display: flex; align-items: center; gap: .45rem; }
.floorplan { display: block; width: 100%; max-height: 520px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin: .2rem 0 .8rem; }

/* ---------- BI charts (validated categorical palette, light / dark steps) ---------- */
:root {
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100;
  --viz-5: #e87ba4; --viz-6: #008300; --viz-7: #4a3aa7; --viz-8: #e34948;
  --viz-other: #b9b8b1; --viz-grid: #e1e0d9; --viz-axis: #c3c2b7;
  --viz-good: #0ca30c; --viz-warning: #fab219; --viz-critical: #d03b3b;
}
:root[data-theme="dark"] {
  --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500;
  --viz-5: #d55181; --viz-6: #008300; --viz-7: #9085e9; --viz-8: #e66767;
  --viz-other: #5b5b57; --viz-grid: #2c2c2a; --viz-axis: #383835;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500;
    --viz-5: #d55181; --viz-6: #008300; --viz-7: #9085e9; --viz-8: #e66767;
    --viz-other: #5b5b57; --viz-grid: #2c2c2a; --viz-axis: #383835;
  }
}
.s1 { --c: var(--viz-1); } .s2 { --c: var(--viz-2); } .s3 { --c: var(--viz-3); } .s4 { --c: var(--viz-4); }
.s5 { --c: var(--viz-5); } .s6 { --c: var(--viz-6); } .s7 { --c: var(--viz-7); } .s8 { --c: var(--viz-8); }
.s-other { --c: var(--viz-other); }
.st-good { --c: var(--viz-good); } .st-warning { --c: var(--viz-warning); } .st-critical { --c: var(--viz-critical); }
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.2rem; }
.bi-grid .card { margin: 0; }
.bi-wide { grid-column: 1 / -1; }
.bi-kpi { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bi-kpi .stat small { margin-top: .15rem; }
.chart-donut { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; flex: none; }
.donut-track { fill: none; stroke: var(--surface-3); stroke-width: 24; }
.donut-seg { fill: none; stroke: var(--c); stroke-width: 24; cursor: pointer; transition: opacity .15s; outline: none; }
.donut:hover .donut-seg:not(:hover), .donut:focus-within .donut-seg:not(:focus) { opacity: .45; }
.donut-total { font-size: 26px; font-weight: 700; fill: var(--text); font-family: var(--font-display); }
.donut-caption { font-size: 11px; fill: var(--muted); }
.chart-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; flex: 1; min-width: 170px; font-size: .84rem; }
.chart-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 3.4rem; align-items: center; gap: .5rem; color: var(--text); }
.chart-legend.inline { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .7rem; }
.chart-legend.inline li { display: inline-flex; }
.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.lg-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-pct { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.hbars { display: grid; gap: .45rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) 2.5rem; align-items: center; gap: .6rem; font-size: .84rem; border-radius: 6px; outline: none; }
.hbar:hover .hbar-fill, .hbar:focus .hbar-fill { filter: brightness(1.12); }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar-track { height: 14px; display: block; }
.hbar-fill { display: block; height: 100%; background: var(--c); border-radius: 0 4px 4px 0; }
.hbar-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }
.columns { padding-left: 2rem; }
.col-plot { position: relative; height: 200px; margin-bottom: 1.6rem; border-bottom: 1px solid var(--viz-axis); }
.col-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--viz-grid); }
.col-grid span { position: absolute; left: -2rem; top: -.55rem; width: 1.6rem; text-align: right; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-row { position: absolute; inset: 0; display: flex; gap: 2px; align-items: flex-end; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.col-bars { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 12%; }
.col-bar { position: relative; flex: 1; max-width: 34px; background: var(--c); border-radius: 4px 4px 0 0; min-height: 0; cursor: pointer; outline: none; }
.col-bar:hover, .col-bar:focus { filter: brightness(1.12); }
.col-value { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 600; color: var(--text); padding-bottom: 2px; }
.col-label { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); padding-top: .35rem; white-space: nowrap; }
.chart-table { margin-top: .9rem; }
.chart-table summary { cursor: pointer; font-size: .8rem; color: var(--muted); font-weight: 600; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; padding: .35rem .55rem; border-radius: 7px; background: var(--text); color: var(--surface); font-size: .78rem; font-weight: 600; box-shadow: var(--shadow-lg); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
@media (max-width: 520px) { .bi-grid { grid-template-columns: 1fr; } .donut { width: 140px; height: 140px; } }
@media print { .chart-table { display: none; } .bi-grid { grid-template-columns: 1fr 1fr; } }
.org-logo { display: block; height: 30px; max-width: 140px; width: auto; object-fit: contain; padding: 3px 6px; background: #fff; border: 1px solid var(--border); border-radius: 7px; }
@media (max-width: 860px) { .org-logo { height: 26px; max-width: 90px; } }

/* ---------- assignment target ---------- */
.target-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; }
.target-choice .target-option { position: relative; display: flex; align-items: center; gap: .7rem; margin: 0; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.target-choice .target-option input { position: absolute; opacity: 0; pointer-events: none; }
.target-choice .target-option .ic { width: 22px; height: 22px; color: var(--brand); flex: none; }
.target-choice .target-option strong { display: block; color: var(--text); font-size: .9rem; }
.target-choice .target-option small { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
.target-choice .target-option:hover { border-color: var(--border-strong); }
.target-choice .target-option:has(input:checked), .target-choice .target-option.is-active { border-color: var(--brand); box-shadow: var(--ring); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.target-choice .target-option:has(input:focus-visible) { box-shadow: var(--ring); }

/* Public asset page (QR code, no login) */
body.public { background: var(--bg); min-height: 100vh; }
.pub-wrap { max-width: 560px; margin: 0 auto; padding: 1.5rem 16px 2rem; }
.pub-org { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.25rem; }
.pub-org-logo { max-height: 56px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.pub-org-initial { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: #fff; font-size: 1.5rem; font-weight: 700; }
.pub-org-name { font-size: 1.35rem; letter-spacing: -.03em; margin: 0; line-height: 1.2; }
.pub-org-legal { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.pub-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; box-shadow: 0 1px 2px rgba(16, 20, 48, .06); }
.pub-eyebrow { margin: 0 0 .35rem; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pub-cpe-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.pub-cpe { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.pub-what { margin: .8rem 0 .4rem; color: var(--text-2); }
.pub-model { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 600; }
.pub-brand-logo { width: 44px; height: 44px; }
.pub-photo { margin: 1rem 0 0; }
.pub-photo img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.pub-data { margin: 1rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.pub-data div { min-width: 0; }
.pub-data dt { font-size: .74rem; color: var(--muted); margin: 0 0 .15rem; }
.pub-data dd { margin: 0; overflow-wrap: anywhere; }
.pub-note { margin: 1rem 0 0; color: var(--text-2); line-height: 1.6; }
.pub-login { display: flex; justify-content: center; width: 100%; margin-top: 1.4rem; height: 44px; align-items: center; font-size: .95rem; }
.pub-hint { margin: .55rem 0 0; font-size: .78rem; color: var(--muted); text-align: center; }
.pub-contact { margin-top: 1rem; padding: 1rem 1.25rem; border: 1px dashed var(--border); border-radius: 14px; font-size: .88rem; }
.pub-contact h3 { margin: 0 0 .35rem; font-size: .9rem; }
.pub-contact p { margin: 0; color: var(--text-2); line-height: 1.6; }
.pub-foot { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 1.6rem; font-size: .72rem; color: var(--muted); }
@media (max-width: 420px) { .pub-data { grid-template-columns: 1fr; } }

/* Online brand logo search */
.logo-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 1rem; }
.logo-result { margin: 0; display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.logo-result.is-official { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.logo-result-img { height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.logo-result-img img { display: block; width: auto; height: auto; max-width: 100%; max-height: 98px; object-fit: contain; }
.logo-result figcaption { display: flex; flex-direction: column; gap: .2rem; min-width: 0; font-size: .82rem; }
.logo-result figcaption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.logo-result figcaption .badge { align-self: flex-start; }
.logo-result form { margin-top: auto; }
.logo-result form .btn { width: 100%; justify-content: center; }

/* Autocomplete for long selects (employees) */
.ac { position: relative; margin-top: .3rem; }
.ac .ac-input { margin: 0; padding-right: 2rem; }
.ac .ac-clear { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.ac .ac-clear:hover { background: var(--surface-3); color: var(--text); }
.ac .ac-clear[hidden] { display: none !important; }
.ac .ac-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; list-style: none; margin: 0; padding: .25rem 0; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }
.ac-list li { padding: .45rem .8rem; cursor: pointer; font-size: .87rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-list li.active, .ac-list li:hover { background: var(--surface-3); }
.ac-list li.ac-note { cursor: default; color: var(--muted); font-size: .8rem; white-space: normal; background: none; }
.filters .ac { margin-top: 0; min-width: 220px; }
.filters .ac .ac-input { width: 100%; min-width: 0; }

/* "+" next to selects and on-the-fly creation dialog */
.quick-add-row { display: flex; align-items: stretch; gap: .4rem; margin-top: .3rem; }
.quick-add-row > select, .quick-add-row > .ac { flex: 1; min-width: 0; margin-top: 0; }
.quick-add-btn { flex: none; width: 38px; padding: 0; justify-content: center; font-size: 1.15rem; font-weight: 600; line-height: 1; }
.quick-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--border-strong); border-radius: 14px; padding: 1.25rem; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.quick-dialog::backdrop { background: rgba(10, 14, 30, .45); }
.quick-dialog h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.quick-dialog .form-actions { margin-top: 1rem; }

/* Compact CPE-ID column in the asset grid: smaller tabular figures, long hostnames truncated (full name on hover) */
.table td.cpe-cell { white-space: nowrap; width: 1%; padding-right: 6px; }
.cpe-cell strong { font-size: .8rem; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
/* the hostname never widens the column: it takes the width of the CPE-ID and is cut with an ellipsis */
.cpe-cell .cell-sub { width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }

/* Sites and positions: one "new" button per type, "+ aggiungi" menu on each row */
.new-types { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: -.2rem 0 1.1rem; }
.new-types .btn .ic { width: 15px; height: 15px; }
.add-menu { position: relative; }
.add-menu summary { cursor: pointer; list-style: none; color: var(--brand); }
.add-menu summary::-webkit-details-marker { display: none; }
.add-menu summary::after { content: " ▾"; font-size: .7em; }
.add-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .35rem; }
.add-menu .menu a { white-space: nowrap; font-size: .84rem; }

/* Dashboard: "Novità e aggiornamenti" (from CHANGELOG.md), collapsed until clicked */
.whats-new { padding: 0; }
.whats-new > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .7rem; padding: .95rem 1.2rem; border-radius: var(--radius); }
.whats-new > summary::-webkit-details-marker { display: none; }
.whats-new > summary:hover { background: var(--surface-2); }
.whats-new-title { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; font-size: 1rem; }
.whats-new-title .ic { color: var(--brand); }
.whats-new-date { font-size: .82rem; }
.whats-new-toggle { margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.whats-new[open] > summary .whats-new-toggle { transform: rotate(-135deg); }
.whats-new[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.whats-new-body { padding: .4rem 1.2rem 1.1rem; font-size: .9rem; line-height: 1.55; }
.whats-new-body h4 { margin: .9rem 0 .3rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.whats-new-body ul { margin: 0; padding-left: 1.2rem; }
.whats-new-body li { margin: .25rem 0; }
.whats-new-intro { margin: .7rem 0 0; color: var(--text-2); }
.whats-new-older { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.whats-new-older > summary { cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--text-2); }

/* Generic helpers */
.js .js-hide { display: none !important; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.card-title-row h2 { margin: 0; }
.card-title-row .muted { font-size: .82rem; }
.select-compact { width: auto; min-width: 190px; margin: 0; padding-top: .35rem; padding-bottom: .35rem; font-size: .86rem; }
.row-actions .inline-act { display: inline; margin: 0; }
.act-disabled { opacity: .35; cursor: not-allowed; }
.act-disabled:hover { background: none; border-color: transparent; color: var(--muted); }

/* Super Admin › user: organisations and roles */
.memberships td { vertical-align: middle; }

/* Document type with icon (archive): blue = verbali, teal = schede/registri, violet = report/elenchi */
.doc-type { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.doc-type .ic { width: 17px; height: 17px; flex: none; }
.doc-kind-verbale .ic { color: var(--brand); }
.doc-kind-scheda .ic { color: #0d9488; }
.doc-kind-report .ic { color: #7c3aed; }
:root[data-theme="dark"] .doc-kind-scheda .ic { color: #2dd4bf; }
:root[data-theme="dark"] .doc-kind-report .ic { color: #a78bfa; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .doc-kind-scheda .ic { color: #2dd4bf; }
  :root[data-theme="auto"] .doc-kind-report .ic { color: #a78bfa; }
}

/* Tags in the asset grid (last column; each tag filters the inventory) */
.tags-cell { min-width: 120px; }
.tags-cell .chip { text-decoration: none; white-space: nowrap; }
.tags-cell .chip:hover { border-color: var(--brand); color: var(--brand); }

/* Outgoing mail: setup steps for Microsoft Entra */
.howto { margin: .4rem 0 .6rem; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .8rem; background: var(--surface); }
.howto > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--brand); }
.howto ol { margin: .6rem 0 .2rem; padding-left: 1.2rem; font-size: .85rem; line-height: 1.55; }
.howto li { margin-bottom: .35rem; }
.hint.warn { color: var(--warn); }

/* Outgoing mail: log of tests and changes, newest first */
.mail-log { list-style: none; margin: .4rem 0 .5rem; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-3); font: 12.5px/1.5 var(--mono); max-height: 420px; overflow-y: auto; }
.mail-log li { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; padding: .3rem 0 .3rem .6rem; border-left: 3px solid var(--border); margin-bottom: .2rem; }
.mail-log li.ok { border-left-color: var(--ok); }
.mail-log li.err { border-left-color: var(--danger); }
.mail-log li.err .mail-log-text { color: var(--danger); }
.mail-log li.info { border-left-color: var(--info); }
.mail-log time { color: var(--muted); white-space: nowrap; }
.mail-log small { color: var(--muted); font-size: inherit; }
@media (max-width: 640px) { .mail-log li { grid-template-columns: 1fr; } }
