/* Fibora — OSP Network 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: #ff6400;
  --accent: #ff8a40;
  --brand-ink: #0b1a2b;
  --link: #c24a00;
  --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: 0;
  --radius-sm: 0;
  --sidebar: 256px;
  --sidebar-mini: 72px;
  --side-bg: #091c30;
  --side-bg-2: #0e2742;
  --side-border: rgba(255, 255, 255, .07);
  --side-text: #a9afcb;
  --side-text-strong: #ffffff;
  --side-muted: #6c7398;
  --auth-hero-bg: #091c30;
  --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: #071624;
  --link: #ff8a40;
  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: #071624;
    --link: #ff8a40;
    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(--link); 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: 0; }
pre { background: var(--surface-3); padding: .85rem 1rem; border-radius: 0; 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; }
/* The Fibora lockup is taller than NexoraOne's wordmark (37 px against 21): tighter paddings keep the organisation
   switcher at about the same height as in NexoraOne. */
.brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .35rem; padding: 14px 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: 5px; }
.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: 0; 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: 0; 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(255, 100, 0, .3); }
.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: 0; 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(255, 100, 0, .16); color: var(--side-text-strong); }
.nav a.active .ic { opacity: 1; color: #c3dd6c; }
.nav a.active::before { content: ""; position: absolute; left: -.7rem; top: 8px; bottom: 8px; width: 3px; border-radius: 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; background: linear-gradient(135deg, var(--brand), var(--accent)); color: var(--brand-ink); 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--link); }
.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: 0; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 0; }
.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: 0; 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(--link); }
.act-primary:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--link); 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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 ---------- */
/* Crisp edges and text: a clearly darker 1px border, solid weight, no sub-pixel movement on press. */
.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; letter-spacing: .005em;
  color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--text) 16%, var(--border-strong)); border-radius: 0;
  box-shadow: 0 1px 1px rgba(16, 20, 48, .06); cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 30%, var(--border-strong)); text-decoration: none; }
.btn:active { box-shadow: inset 0 1px 2px rgba(16, 20, 48, .18); }
.btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 70%, var(--text)); outline-offset: 2px; }
/* orange primary: flat brand colour (no gradient, no inner highlight), dark bold label (contrast > 8:1) */
.btn-primary { color: var(--brand-ink); font-weight: 700; background: var(--brand); background-image: none;
  border-color: color-mix(in srgb, var(--brand) 80%, #000); box-shadow: none; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 90%, #000); border-color: color-mix(in srgb, var(--brand) 75%, #000); }
.btn-primary:active { background: color-mix(in srgb, var(--brand) 84%, #000); box-shadow: none; }
:where(:root[data-theme="dark"]) .btn { border-color: #4a4a52; background: #19191c; }
:where(:root[data-theme="dark"]) .btn:hover { border-color: #5e5e68; background: #222226; }
:where(:root[data-theme="dark"]) .btn-primary { border-color: var(--brand); background: var(--brand); box-shadow: none; }
:where(:root[data-theme="dark"]) .btn-primary:hover { background: color-mix(in srgb, var(--brand) 90%, #fff); }
@media (prefers-color-scheme: dark) {
  :where(:root[data-theme="auto"]) .btn { border-color: #4a4a52; background: #19191c; }
  :where(:root[data-theme="auto"]) .btn:hover { border-color: #5e5e68; background: #222226; }
  :where(:root[data-theme="auto"]) .btn-primary { border-color: var(--brand); background: var(--brand); box-shadow: none; }
  :where(:root[data-theme="auto"]) .btn-primary:hover { background: color-mix(in srgb, var(--brand) 90%, #fff); }
}
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: not-allowed; filter: grayscale(.35); }
.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); }
:where(: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: 0; margin-bottom: 1.1rem; border: 1px solid transparent; font-size: .88rem; }
.alert::before { content: ""; flex: none; width: 4px; align-self: stretch; border-radius: 0; 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: 0; width: fit-content; max-width: 100%; }
.tabs a { padding: .4rem .85rem; color: var(--muted); border-radius: 0; 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(--link); }
.tree-type-site .ic { color: var(--ok); }
.add-menu .menu a .ic { width: 15px; height: 15px; color: var(--link); }
.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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; border: 1px solid var(--border); }
.brand-logo { display: inline-block; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 0; padding: 3px; vertical-align: middle; }
.brand-logo-sm { width: 46px; height: 28px; }
.brand-logo-xs { width: 38px; height: 22px; padding: 2px; border-radius: 0; flex: none; }
.model-thumb { display: inline-grid; place-items: center; width: 52px; height: 40px; object-fit: cover; border-radius: 0; 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: 0; 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: 0; border-right: 0; font-size: .82rem; }
.label-print-form .btn { border-radius: 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: 0; 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(--link); width: 34px; height: 34px; padding: 8px; border-radius: 0; 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: 0; 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: 0; 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: 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: 0; 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: 0; 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: var(--brand); --auth-accent-2: var(--accent); }
.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-name-note { color: #b4b6c0; font-size: .85rem; line-height: 1.6; max-width: 330px; margin: 2.5rem 0 0; }
.auth-name-note strong { color: #e6ebf2; font-weight: 600; }
.auth-hero-foot { color: #9a9ca8; font-size: .82rem; margin: 4.5rem 0 0; }
.auth-name-note + .auth-hero-foot { margin-top: 1.25rem; }
.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(--link); 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: 0; }
.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: 0; }
.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(--link); }
.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: 14px 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: 0; 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(--link); 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: var(--brand-ink); }
.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: 0; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); color: var(--link); 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; }
/* asset sheet subtitle: icon, category, brand/model and name on one aligned line */
.page-head p.asset-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; line-height: 1.4; }
.cat-inline .cat-ic { width: 16px; height: 16px; color: var(--link); }
.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: 0; 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(--link); }
.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(--link); }
.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: 0; 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: 0; 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: 0; 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: 0; 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; }
.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: 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: 0; 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: 0; }
@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: 0; 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(--link); 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: 0; padding: 6px; }
.pub-org-initial { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 0; 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: 0; 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: 0; }
.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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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: 0; 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(--link); }
.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: 0; 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: 0; }
.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(--link); }
.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: 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(--link); }
.doc-kind-scheda .ic { color: var(--brand); }
.doc-kind-report .ic { color: #7c3aed; }
:root[data-theme="dark"] .doc-kind-scheda .ic { color: var(--accent); }
:root[data-theme="dark"] .doc-kind-report .ic { color: #a78bfa; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .doc-kind-scheda .ic { color: var(--accent); }
  :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(--link); }

/* Outgoing mail: setup steps for Microsoft Entra */
.howto { margin: .4rem 0 .6rem; border: 1px solid var(--border); border-radius: 0; padding: .55rem .8rem; background: var(--surface); }
.howto > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--link); }
.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: 0; 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; } }

/* Super Admin › Impostazioni applicazione: one card per section */
.settings-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.settings-card { display: flex; gap: .9rem; align-items: flex-start; text-decoration: none; color: var(--text); margin: 0; border: 1px solid var(--border); }
.settings-card:hover { border-color: var(--brand); box-shadow: var(--ring); }
.settings-card > .ic { width: 26px; height: 26px; color: var(--link); flex: none; margin-top: .1rem; }
.settings-card strong { display: block; font-size: 1rem; margin-bottom: .2rem; }
.settings-card small { display: block; color: var(--muted); margin-bottom: .45rem; }
.settings-card em { display: block; font-style: normal; font-size: .82rem; }
.settings-card.warn em { color: var(--warn); }

/* New asset: free CPE-IDs to reuse or cancel */
.cpe-free { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn-bg) 55%, var(--surface)); margin-bottom: 1rem; }
.cpe-choice { display: grid; gap: .55rem; }
.cpe-choice .check { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.cpe-choice select { width: auto; min-width: 180px; margin: 0; }

/* Asset grid: hover card on the CPE-ID */
.asset-peek { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.18)); font-size: .82rem; line-height: 1.45; pointer-events: none; white-space: normal; }
.asset-peek-head { margin-bottom: .45rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.asset-peek-head strong { font-family: var(--mono); }
.asset-peek-head span { display: block; color: var(--muted); }
.asset-peek dl { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .7rem; margin: 0; }
.asset-peek dt { color: var(--muted); }
.asset-peek dd { margin: 0; word-break: break-word; }
.asset-peek-notes { margin: .5rem 0 0; padding-top: .45rem; border-top: 1px solid var(--border); white-space: normal; }

/* Card whose actions sit at its bottom edge (e.g. Super Admin › tenant: "Salva modifiche") */
.card-actions { display: flex; flex-direction: column; }
.card-actions > .form-actions { margin-top: auto; padding-top: 1rem; }
.btn-warning { background: var(--warn); border-color: color-mix(in srgb, var(--warn) 85%, #000); color: #fff; }
.btn-warning:hover { filter: brightness(1.06); }
:where(:root[data-theme="dark"]) .btn-warning { color: #1a1205; }
.backup-choice { border: 1px solid var(--border); border-radius: 0; padding: .7rem .9rem .5rem; margin: 0 0 .9rem; }
.backup-choice legend { font-weight: 600; padding: 0 .3rem; font-size: .9rem; }
.backup-choice .check { display: flex; align-items: flex-start; gap: .55rem; margin: .35rem 0; }
.backup-choice .check input { margin-top: .2rem; }
.backup-choice small { display: block; color: var(--muted); font-weight: 400; }
.totp-input { max-width: 10rem; letter-spacing: .2em; }
.copy-from .check { display: flex; align-items: flex-start; gap: .55rem; }
.copy-from .check input { margin-top: .2rem; }
.copy-from .check small { display: block; color: var(--muted); font-size: .78rem; }
.backup-import { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin: .4rem 0 1rem; }
.backup-import label { margin: 0; }
.upper::placeholder { text-transform: none; }

/* Asset form: a field across both columns (e.g. VLAN with its "+") */
.grid-2 > .field-wide { grid-column: 1 / -1; }

/* ---------- Row actions in the grids ----------
   every action always in its own slot (an empty slot keeps the others in place), no floating shadow,
   bigger targets on touch screens, rows as cards on smartphones. */
.act-label { display: none; }
.act-slot { visibility: hidden; }
button.act { background: none; padding: 0; font: inherit; cursor: pointer; }
button.act:hover { background: var(--surface-3); }
button.act-danger:hover { background: var(--danger-bg); }
.row-actions .inline-act { display: inline-block; }
.row-actions, th.actions-col { box-shadow: 1.4rem 0 0 var(--surface); border-left: 1px solid var(--border); }
@media (pointer: coarse) {
  .row-actions .act { width: 40px; height: 40px; }
  .row-actions .act .ic { width: 18px; height: 18px; }
}
@media (max-width: 640px) {
  .grid-assets { min-width: 0; }
  .grid-assets thead { display: none; }
  .grid-assets, .grid-assets tbody { display: block; }
  .grid-assets { width: 100%; }
  .grid-assets tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .2rem .55rem; align-items: center;
    padding: .7rem .75rem; margin-bottom: .6rem; border: 1px solid var(--border); border-radius: 0; background: var(--surface); }
  .grid-assets td { display: block; border: 0; padding: 0; min-width: 0; white-space: normal; }
  /* first line of the card: icon · CPE-ID and name · status · selection */
  .grid-assets td.w-cat { grid-row: 1; grid-column: 1; }
  .grid-assets td.cpe-cell { grid-row: 1; grid-column: 2; width: auto; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid-assets td.c-status { grid-row: 1; grid-column: 3; }
  .grid-assets td:nth-child(2) { grid-row: 1; grid-column: 4; }
  .grid-assets .asset-peek { display: none !important; }
  .grid-assets td:empty { display: none; }
  .grid-assets td[data-label] { grid-column: 1 / -1; font-size: .85rem; }
  .grid-assets td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .78rem; }
  .grid-assets td.c-model::before { content: ""; }
  .grid-assets .cpe-cell { min-width: 0; }
  /* every other grid with row actions: one card per row, the field names taken from the column headers */
  .grid-cards thead { display: none; }
  .grid-cards, .grid-cards tbody, .grid-cards tr { display: block; width: 100%; min-width: 0; }
  .grid-cards tr { padding: .7rem .75rem; margin-bottom: .6rem; border: 1px solid var(--border); border-radius: 0; background: var(--surface); }
  .grid-cards td { display: block; border: 0; padding: .12rem 0; white-space: normal; font-size: .85rem; min-width: 0; }
  .grid-cards td:first-child { font-size: .95rem; font-weight: 600; }
  .grid-cards td:empty, .grid-cards td.row-actions:not(:has(.act:not(.act-slot))) { display: none; }
  .grid-cards td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); font-size: .78rem; font-weight: 400; }
  .grid-cards td[colspan] { text-align: center; }
  :is(.grid-assets, .grid-cards) .row-actions { grid-column: 1 / -1; position: static; box-shadow: none; border-left: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .4rem;
    border-left: 0; border-top: 1px solid var(--border); padding-top: .55rem; margin-top: .35rem; background: none; }
  :is(.grid-assets, .grid-cards) .row-actions .act { width: auto; height: auto; margin: 0; padding: .45rem .2rem; display: flex; flex-direction: column; gap: .15rem;
    align-items: center; border: 1px solid var(--border); border-radius: 0; }
  :is(.grid-assets, .grid-cards) .row-actions .act-slot { border-color: transparent; }
  :is(.grid-assets, .grid-cards) .row-actions .inline-act { display: block; }
  :is(.grid-assets, .grid-cards) .row-actions .inline-act .act { width: 100%; height: 100%; }
  :is(.grid-assets, .grid-cards) .act-label { display: block; font-size: .72rem; line-height: 1.1; }
}
/* long press on a touch screen: the name of the action */
.act-tip { position: fixed; z-index: 70; transform: translate(-50%, -120%); background: var(--text); color: var(--surface); font-size: .78rem;
  padding: .3rem .55rem; border-radius: 0; pointer-events: none; white-space: nowrap; }

/* ---------- 2FA code: one box per digit (built by app.js on input[data-otp]; without JS the plain field stays) ---------- */
.otp-boxes { display: flex; gap: .45rem; margin-top: .45rem; }
.otp-boxes input.otp-box { width: 2.7rem; min-width: 0; height: 3.1rem; margin: 0; padding: 0; text-align: center; font: 600 1.35rem/1 var(--mono);
  border: 1px solid var(--border-strong); border-radius: 0; background: var(--surface); color: var(--text); caret-color: var(--brand); }
.otp-boxes input.otp-box:nth-child(4) { margin-left: .55rem; }
.otp-boxes input.otp-box:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.auth-form .otp-boxes input.otp-box { border-color: color-mix(in srgb, currentColor 35%, transparent); }
.auth-form .otp-boxes input.otp-box:focus { border-color: var(--auth-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 22%, transparent); }
.otp-boxes.otp-error input.otp-box { border-color: var(--danger); }
.otp-boxes[hidden], .otp-toggle[hidden] { display: none; }
.otp-toggle { display: inline-block; margin: -.4rem 0 1rem; padding: 0; background: none; border: 0; font: inherit; font-size: .82rem; color: var(--link); cursor: pointer; text-decoration: underline; }
@media (max-width: 380px) { .otp-boxes { gap: .3rem; } .otp-boxes input.otp-box { width: 2.3rem; height: 2.8rem; font-size: 1.15rem; } .otp-boxes input.otp-box:nth-child(4) { margin-left: .3rem; } }

/* ===================== Fibora — HR area (employee files, workflows, deadlines, assistant) ===================== */
.quick-dialog.hr-wide { width: min(620px, calc(100vw - 32px)); }
.hr-mt { margin-top: 1rem; }
.hr-crumb { margin: 0 0 .35rem; font-size: .84rem; }
.hr-matr { font-family: var(--mono); font-size: .84rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.hr-empty { color: var(--muted); text-align: center; padding: 1.4rem .7rem; }
.hr-late td:first-child { color: var(--danger); font-weight: 600; }
.hr-narrow { max-width: 860px; }
.hr-select { max-width: 420px; }
.badge-demo { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #7c3aed; }
.stat-danger .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.timeline time { display: block; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .who { display: block; font-size: .76rem; color: var(--muted); }
/* progress bar */
.hr-bar { display: inline-block; width: 96px; height: 8px; background: var(--surface-3); border-radius: 0; overflow: hidden; vertical-align: middle; margin-right: .5rem; }
.hr-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 0; }
/* workflow flow chart */
.hr-process-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.hr-process-head h2 { margin: 0; }
.hr-process-head .hr-bar { width: 120px; }
.hr-flow { list-style: none; margin: 0; padding: 0; }
.hr-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: .9rem; position: relative; padding-bottom: 1.1rem; }
.hr-step:last-child { padding-bottom: 0; }
.hr-step:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 2px; background: var(--border); }
.hr-step.done:not(:last-child)::before { background: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.hr-step .dot { width: 30px; height: 30px; border-radius: 0; display: grid; place-items: center; font-weight: 700; font-size: .78rem; border: 2px solid var(--brand); color: var(--text); background: var(--surface); }
.hr-step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.hr-step.done .dot .ic { width: 15px; height: 15px; vertical-align: 0; }
.hr-step.blocked .dot { border-color: var(--border-strong); color: var(--muted); }
.hr-step .row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.hr-step .row strong { font-weight: 600; }
.hr-step.blocked .row strong { color: var(--muted); }
.hr-step .meta { font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.hr-step .actions { margin-top: .6rem; }
.hr-docs { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .25rem; font-size: .83rem; }
.hr-docs li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.hr-docs .ic { width: 15px; height: 15px; color: var(--muted); vertical-align: 0; }
/* workflow templates */
.hr-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.2rem; }
.hr-templates .card { margin: 0; }
.hr-tpl-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: .55rem; }
.hr-tpl-steps li { counter-increment: s; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .5rem; font-size: .86rem; }
.hr-tpl-steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 0; background: var(--surface-3); font-weight: 700; font-size: .72rem; color: var(--text-2); }
.hr-tpl-steps small { display: block; color: var(--muted); }
/* assistant */
.hr-answer { margin-top: 1rem; padding: .9rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; }
.hr-answer p { margin: 0 0 .45rem; }
.hr-answer p:last-child { margin: 0; }
@media (max-width: 860px) { .hr-templates { grid-template-columns: 1fr; } }

/* ===================== Fibora — employee personal area (/personale): no side menu ===================== */
body.portal { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.portal-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.portal-top-inner { max-width: 1180px; margin: 0 auto; height: 64px; padding: 0 1.4rem; display: flex; align-items: center; gap: 1.1rem; }
.portal-brand { display: flex; align-items: center; flex: none; }
.portal-brand img { display: block; height: 34px; width: auto; }
.portal-org { display: flex; align-items: center; gap: .55rem; padding-left: 1.1rem; border-left: 1px solid var(--border); color: var(--text-2); font-size: .86rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-org img { height: 26px; max-width: 110px; object-fit: contain; padding: 2px 5px; background: #fff; border: 1px solid var(--border); border-radius: 0; }
.portal-nav { display: flex; gap: .25rem; margin-left: 1rem; padding: .25rem; background: var(--surface-3); border-radius: 0; }
.portal-nav a { display: flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 0; color: var(--muted); font-weight: 500; font-size: .85rem; white-space: nowrap; }
.portal-nav a .ic { width: 16px; height: 16px; }
.portal-nav a:hover { color: var(--text); text-decoration: none; }
.portal-nav a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.portal-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.4rem 2.4rem; }
.portal-foot { max-width: 1180px; width: 100%; margin: 0 auto; padding: 1rem 1.4rem 1.6rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .76rem; }

/* welcome banner in the brand colour, with the Fibora mark as watermark */
.portal-hero { position: relative; overflow: hidden; border-radius: 0; padding: 2rem 2.1rem; margin-bottom: 1.3rem; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 55%, transparent) 0%, transparent 55%),
              linear-gradient(135deg, #0b2440 0%, #091c30 55%, color-mix(in srgb, var(--brand) 35%, #091c30) 100%);
  box-shadow: 0 18px 40px -22px rgba(9, 28, 48, .65); }
.portal-hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 320px; height: 320px; opacity: .09;
  background: url("../img/mark-white.svg") center / contain no-repeat; pointer-events: none; }
.portal-hero-body { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.4rem; }
.portal-avatar { flex: none; width: 76px; height: 76px; border-radius: 0; display: grid; place-items: center; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
.portal-hero h1 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.04em; line-height: 1.15; color: #fff; }
.portal-hero-eyebrow { margin: 0 0 .25rem; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: color-mix(in srgb, var(--brand) 70%, #fff); font-weight: 600; }
.portal-hero-sub { margin: .3rem 0 0; color: #cfd6e0; font-size: .95rem; }
.portal-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.portal-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 0; font-size: .8rem; color: #e6ebf1;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.portal-chip .ic { width: 15px; height: 15px; color: color-mix(in srgb, var(--brand) 75%, #fff); }
.portal-chip strong { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.portal-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-stat-text { font-size: 1.25rem; }

/* documents */
.portal-card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.portal-card-head h2 { margin: 0; }
.portal-search { display: flex; align-items: center; gap: .4rem; padding: 0 .7rem; border: 1px solid var(--border); border-radius: 0; background: var(--surface-2); min-width: 220px; }
.portal-search .ic { width: 16px; height: 16px; color: var(--muted); }
.portal-search input { border: 0; background: none; padding: .45rem 0; box-shadow: none; min-width: 0; flex: 1; }
.portal-search input:focus { outline: none; box-shadow: none; }
.portal-doc { display: inline-flex; align-items: center; gap: .65rem; }
.portal-file { flex: none; display: inline-grid; place-items: center; width: 38px; height: 44px; border-radius: 0; font-size: .62rem; font-weight: 800; letter-spacing: .02em;
  color: #fff; background: #64748b; position: relative; clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.portal-file-pdf { background: #dc2626; }
.portal-file-docx { background: #2563eb; }
.portal-file-xlsx, .portal-file-csv { background: #16a34a; }
.portal-file-jpg, .portal-file-jpeg, .portal-file-png { background: #9333ea; }
.portal-file-txt { background: #475569; }
.portal-empty { text-align: center; padding: 2.2rem 1rem 1.6rem; }
.portal-empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 0; margin-bottom: .8rem;
  background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--link); }
.portal-empty-icon .ic { width: 30px; height: 30px; }
.portal-empty h3 { margin: 0 0 .35rem; }
.portal-empty p { margin: 0 auto; max-width: 420px; color: var(--muted); }

@media (max-width: 860px) {
  .portal-top-inner { padding: 0 .9rem; gap: .6rem; height: 58px; }
  .portal-org { display: none; }
  .portal-nav { margin-left: 0; }
  .portal-nav a span { display: none; }
  .portal-nav a { padding: .45rem .6rem; }
  .portal-main { padding: 1rem .9rem 2rem; }
  .portal-hero { padding: 1.4rem 1.2rem; border-radius: 0; }
  .portal-hero-body { gap: 1rem; }
  .portal-avatar { width: 58px; height: 58px; border-radius: 0; font-size: 1.3rem; }
  .portal-foot { flex-direction: column; padding: 1rem .9rem 1.4rem; }
  .portal-stats { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .portal-brand img { height: 28px; } .portal-search { min-width: 0; width: 100%; } }
@media (max-width: 860px) {
  .portal .grid-cards td:last-child { padding-top: .5rem; }
  .portal .grid-cards td:last-child .btn { width: 100%; justify-content: center; }
}

/* ===================== integrations (same as NexoraOne) ===================== */
.org-linked { display: flex; align-items: center; gap: .4rem; margin: .2rem 0 .6rem; }
.org-linked .ic { color: var(--ok); }
.grid-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.grid-bulk-actions { display: inline-flex; align-items: center; gap: .45rem; margin-left: auto; }
.grid-bulk-actions[hidden] { display: none; }
.sync-grid tr.is-pending td { background: color-mix(in srgb, var(--warn-bg) 55%, var(--surface)); }
.table-hover.sync-grid tbody tr.is-pending:hover td { background: color-mix(in srgb, var(--warn-bg) 80%, var(--surface)); }
/* ---------- integrations: the two directions ---------- */
.direction-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; }
.direction { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 0; font-size: .78rem; font-weight: 600;
  background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--link); }
.direction .ic { width: 14px; height: 14px; }
.indent { margin: -.3rem 0 .8rem 1.6rem; }
.int-title { display: flex; align-items: center; gap: .55rem; }
.int-logo { width: 28px; height: 28px; flex: none; border-radius: 0; object-fit: contain; }
.int-logo-lg { width: 36px; height: 36px; border-radius: 0; }
.int-logo-sm { width: 16px; height: 16px; border-radius: 0; }
.int-logo-text { display: inline-grid; place-items: center; background: #173f5f; color: #fff; font: 700 .62rem/1 var(--font); letter-spacing: .02em; }
.int-logo-lg.int-logo-text { font-size: .75rem; }
.int-logo-sm.int-logo-text { font-size: .45rem; }
.nav a .nav-badge { margin-left: auto; min-width: 1.35rem; padding: .05rem .4rem; border-radius: 0; background: var(--brand); color: var(--brand-ink); font-size: .7rem; font-weight: 700; text-align: center; }
html.sidebar-collapsed .nav a .nav-badge { position: absolute; top: 4px; right: 6px; min-width: 0; padding: 0 .3rem; font-size: .6rem; }

/* ---------- personal area: holiday and leave requests ---------- */
.check-group { border: 0; padding: 0; margin: 0 0 .4rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
[data-leave-type][hidden] { display: none !important; }

/* ---------- equipment (dotazioni) ---------- */
.eq-thumb { width: 40px; height: 40px; border-radius: 0; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); flex: none; }
.eq-thumb svg { width: 20px; height: 20px; }
.eq-photo { width: 100%; max-height: 320px; object-fit: contain; border-radius: 0; display: block; background: var(--surface-3); }
.eq-records, .eq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.eq-list li { display: flex; gap: .7rem; align-items: flex-start; }
[data-kinds][hidden] { display: none !important; }
.eq-due { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---------- editor of the HR processes ---------- */
.wf-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .8rem; }
.wf-step { border: 1px solid var(--border); border-radius: 0; padding: .8rem .9rem; background: var(--surface-2, var(--surface)); }
.wf-step-head { display: flex; align-items: center; gap: .6rem; }
.wf-num { flex: none; display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 0; background: var(--brand); color: #fff; font-weight: 700; }
.wf-title { flex: 1; min-width: 0; font-weight: 600; }
.wf-tools { display: flex; gap: .25rem; flex: none; }
.wf-tools .btn { min-width: 2rem; justify-content: center; }
.wf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; margin-top: .5rem; }
.wf-when { display: flex; gap: .4rem; margin-top: .3rem; }
.wf-when input { width: 6rem; flex: none; margin-top: 0; }
.wf-when select { flex: 1; margin-top: 0; }
.wf-flags { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: .5rem 0 .2rem; }
.wf-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; align-items: flex-start; }
.wf-actions { flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.wf-actions form { margin: 0; }
.wf-inactive { opacity: .7; }
[data-wf-hint][hidden] { display: none !important; }
@media (max-width: 640px) { .wf-grid { grid-template-columns: 1fr; } .wf-step-head { flex-wrap: wrap; } }
.wf-instructions { background: var(--surface-3); border-radius: 0; padding: .4rem .6rem; margin-top: .3rem; }
[data-done-only][hidden], [data-judgment-show][hidden] { display: none !important; }

/* ---------- reminders preview ---------- */
.rem-title { font-size: .95rem; margin: 1rem 0 .4rem; }
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .88rem; }
.rem-list li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.rem-list li.late a { color: var(--danger); }

/* ---------- employee file: employment data ---------- */
.hr-mb { margin-bottom: .8rem; }
.dl-2 { grid-template-columns: minmax(150px, 22%) 1fr minmax(150px, 22%) 1fr; }
@media (max-width: 900px) { .dl-2 { grid-template-columns: minmax(130px, 38%) 1fr; } }
[data-leave-only][hidden] { display: none !important; }
/* ---------- absence calendar (month grid) and team page ---------- */
.cal-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.cal-head h2 { margin: 0 .4rem; min-width: 10ch; text-align: center; }
.abs-wrap { overflow-x: auto; }
.abs-grid { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.abs-grid th, .abs-grid td { border: 1px solid var(--border); text-align: center; padding: 0; height: 28px; min-width: 26px; }
.abs-grid thead th { font-weight: 600; padding: .2rem 0; background: var(--surface-2); }
.abs-grid thead th span { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.abs-grid .abs-name { text-align: left; padding: 0 .6rem; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 500; min-width: 170px; }
.abs-grid thead .abs-name { background: var(--surface-2); }
.abs-grid .abs-dep th { text-align: left; padding: .35rem .6rem; background: var(--surface-3); font-weight: 600; }
.abs-grid .off, .abs-legend .off { background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 3px, var(--surface-2) 3px, var(--surface-2) 6px); }
.abs { font-weight: 700; color: #fff; background: #64748b; }
.abs-ferie { background: #16a34a; } .abs-permesso, .abs-ex_festivita { background: #0891b2; }
.abs-malattia { background: #dc2626; } .abs-legge104 { background: #7c3aed; }
.abs-congedo_parentale, .abs-maternita_paternita { background: #db2777; }
.abs-matrimonio, .abs-lutto, .abs-studio, .abs-donazione_sangue { background: #d97706; }
.abs.pending { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 3px, transparent 3px 7px); opacity: .8; }
.abs-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .8rem; font-size: 12.5px; color: var(--muted); }
.abs-legend b { display: inline-block; min-width: 24px; padding: 1px 4px; text-align: center; border-radius: 0; border: 1px solid var(--border); }
form.inline { display: inline; }
.inline-details { display: inline-block; vertical-align: top; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > form { margin-top: .5rem; min-width: 260px; }
/* ---------- training: requirements, compliance ---------- */
[data-kind-for][hidden] { display: none !important; }
.req-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .35rem; }
.req-list li { display: flex; align-items: center; gap: .5rem; }
.req-list .link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
.req-list .link-btn:hover { color: var(--danger); }
.req-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.req-add select, .req-add input { width: auto; max-width: 100%; }
.req-add input[type=number] { width: 5rem; }
.req-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.req-chip { display: inline-flex; gap: .3rem; align-items: baseline; padding: 2px 8px; border-radius: 0; font-size: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.req-chip small { color: var(--muted); }
.req-chip.req-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.req-chip.req-soon { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.req-chip.req-expired, .req-chip.req-missing { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.req-chip.req-ok small, .req-chip.req-soon small, .req-chip.req-expired small, .req-chip.req-missing small { color: inherit; opacity: .8; }
.pct-bar { display: inline-block; width: 80px; height: 8px; border-radius: 0; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.pct-bar i { display: block; height: 100%; background: var(--danger); }
.pct-bar i.ok { background: var(--ok); } .pct-bar i.warn { background: var(--warn); }
/* ---------- communications: notice board ---------- */
.board-body { line-height: 1.6; white-space: normal; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.board-list li { padding: .6rem .2rem; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: baseline; }
.board-list li:last-child { border-bottom: 0; }
.board-list li .cell-sub { flex-basis: 100%; }
.board-list li.is-new strong { color: var(--link); }
/* ---------- employee file: personal data ---------- */
.dl-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.1rem 0 .4rem; font-weight: 600; }
.dl-title:first-of-type { margin-top: .2rem; }
/* ---------- alignment: KPI tiles (values on the same line), dashboard rows, BI cards ---------- */
.stats .stat-label { line-height: 1.3; min-height: 2.6em; }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bi-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { .bi-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats-4, .bi-kpi { grid-template-columns: 1fr; } .stats .stat-label { min-height: 0; } }
.bi-card { display: flex; flex-direction: column; }
.bi-card > h2 { min-height: 1.5em; }
.bi-card > .chart-table { margin-top: auto; padding-top: .9rem; }
.hr-bar + small { display: inline-block; min-width: 2.6em; text-align: right; }
.emp-compact td { vertical-align: middle; }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 0; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; }
.portal-nav a .nav-count { display: inline-grid; }
/* ---------- employee file: profile card first, actions underneath ---------- */
.emp-profile { display: flex; gap: 1.2rem; align-items: flex-start; }
.emp-profile .emp-avatar { width: 64px; height: 64px; font-size: 1.4rem; flex: none; }
.emp-profile-main { flex: 1; min-width: 0; }
.emp-profile h1 { margin: 0 0 .7rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.5rem; }
.emp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem 1.2rem; margin: 0; }
.emp-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.emp-facts dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.page-head.emp-actions { margin-top: -.2rem; }
.page-head.emp-actions .actions { justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 560px) { .emp-profile { flex-direction: column; } }
/* ---------- reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.report-tile { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 0; background: var(--surface-2); color: var(--text); }
.report-tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.report-tile span { font-size: .85rem; color: var(--text-2); }
.report-tile small { margin-top: auto; }
.report-summary { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table { font-size: .86rem; }
@media print { .no-print, .sidebar, .topbar { display: none !important; } .report-table { font-size: 9pt; } }
.emp-photo-box { display: flex; flex-direction: column; align-items: center; gap: .25rem; flex: none; }
.emp-photo { width: 76px; height: 76px; border-radius: 0; object-fit: cover; border: 1px solid var(--border); }
.emp-photo-form { display: inline; margin: 0; }
.emp-photo-box .link-btn { background: none; border: 0; padding: 0; color: var(--link); font-size: .75rem; cursor: pointer; }
.emp-photo-box .link-btn:hover { text-decoration: underline; }
.portal-photo { width: 76px; height: 76px; border-radius: 0; object-fit: cover; flex: none; }
/* ---------- stable layout when switching pages: no width change of the active tab, room for the scrollbar always kept ---------- */
html { scrollbar-gutter: stable; }
.portal-nav a, .portal-nav a.active { font-weight: 600; }
.portal-nav a { border: 1px solid transparent; }
.portal-nav a.active { border-color: var(--border); }
.tabs a, .tabs a.active { font-weight: 600; }

/* ===================== tablet and phone (2.3.1) ===================== */
/* grid items may shrink below their content (long tab bars, tables, codes) instead of widening the page */
.grid-side > *, .grid-2 > *, .grid-3 > *, .bi-grid > *, .stats > * { min-width: 0; }
@media (max-width: 1100px) { .grid-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  /* page head: title on its own line, actions wrap under it with comfortable touch targets */
  .page-head { flex-wrap: wrap; gap: .8rem; }
  .page-head .actions { flex-wrap: wrap; gap: .5rem; width: 100%; }
  .page-head h1 { font-size: 1.45rem; }
  /* tab bars scroll sideways inside their own width */
  .tabs { width: 100%; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .org-logo { display: none; }
  .global-search { min-width: 0; }
  /* what's new: title and badges wrap, the chevron stays at the right */
  .whats-new > summary { flex-wrap: wrap; row-gap: .3rem; padding: .8rem 1rem; }
  .whats-new-toggle { margin-left: auto; }
  /* employee file: photo and name side by side, the facts in two columns */
  .emp-profile { flex-direction: row; gap: .9rem; flex-wrap: wrap; }
  .emp-profile .emp-avatar, .emp-photo { width: 56px; height: 56px; border-radius: 0; font-size: 1.15rem; }
  .emp-profile h1 { font-size: 1.25rem; margin-bottom: .5rem; }
  .emp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .9rem; }
  .emp-actions .actions .btn { flex: 1 1 calc(50% - .5rem); justify-content: center; }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .board-list li { display: block; }
  .board-list li .badge { margin: .2rem .3rem 0 0; }
  .board-list li > a { display: block; }
  .cal-head { flex-wrap: wrap; }
  .abs-grid .abs-name { min-width: 120px; }
  .req-add { flex-direction: column; align-items: stretch; }
  dialog.quick-dialog { width: calc(100vw - 1.2rem); max-width: none; margin: auto; max-height: calc(100vh - 1.2rem); }
}
@media (max-width: 560px) {
  /* KPI tiles: two compact columns instead of one tall column */
  .stats-4, .bi-kpi, .report-summary, .stats.small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stats .stat { padding: .75rem .8rem .8rem; }
  .stats .stat-label { min-height: 2.6em; padding-right: 30px; font-size: .74rem; }
  .stats .stat-value { font-size: 1.45rem; }
  .stats .stat small { font-size: .72rem; line-height: 1.3; }
  .stat-icon { width: 26px; height: 26px; right: .6rem; top: .6rem; border-radius: 0; }
  .stat-icon .ic { width: 14px; height: 14px; }
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emp-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .emp-actions .actions .btn { flex: 1 1 calc(50% - .3rem); font-size: .82rem; padding-left: .5rem; padding-right: .5rem; }
  .emp-actions .actions .btn-primary { flex-basis: 100%; }
  .emp-actions .actions { gap: .4rem; }
  .card { padding: 1rem .9rem; }
  .table-wrap { margin: 0 -.9rem; }
}
@media (max-width: 560px) { .card.whats-new { padding: 0; } }
/* personal area on phones: the mark instead of the lockup, compact menu, nothing wider than the screen */
.portal-mark { display: none; }
.board-list li > * { min-width: 0; max-width: 100%; }
.board-list .cell-sub { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  html body .portal-top .portal-brand img.logo-on-light, html body .portal-top .portal-brand img.logo-on-dark { display: none !important; }
  .portal-mark { display: block; height: 32px; width: 32px; }
  .portal-top-inner { gap: .4rem; padding: 0 .6rem; }
  .portal-nav { gap: .1rem; padding: .2rem; flex: 1; justify-content: space-between; min-width: 0; }
  .portal-nav a { padding: .45rem .5rem; position: relative; }
  .portal-nav a .nav-count { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .portal .top-actions { gap: .1rem; }
  .portal .theme-btn { padding: .4rem; }
  .portal .user-menu summary { padding: .2rem; }
  .portal-hero { padding: 1.1rem 1rem; }
  .portal-hero h1 { font-size: 1.35rem; }
  .portal-chips { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  /* two-column tiles: an odd last tile takes the whole row instead of leaving a hole */
  .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .alert { display: block; }
  .alert > .ic, .alert > svg { vertical-align: -3px; margin-right: .3rem; }
}

/* 2.4.0 — dotazioni come gli asset di NexoraOne */
[data-qty-off] { display: none !important; }
.eq-head-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.eq-head-sub .cat-inline { font-weight: 600; color: var(--text-2); }
.stock-model { display: flex; align-items: center; gap: .6rem; }
.stock-model .model-thumb { flex: none; }
/* empty fields are not shown (as in NexoraOne): a label whose value is empty disappears with it */
.dl dd:empty, .dl dt:has(+ dd:empty) { display: none; }

/* Anagrafica: edited inside its card, main data first and the rest in collapsible sections */
.personal-form .grid-3.tight, .personal-form .grid-addr.tight { gap: .2rem 1rem; }
.grid-addr { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 2fr) minmax(0, .8fr); gap: .2rem 1rem; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.acc { margin-top: 1.1rem; border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.acc > details + details { border-top: 1px solid var(--border); }
.acc > details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; font-weight: 600; }
.acc > details > summary::-webkit-details-marker { display: none; }
.acc > details > summary:hover { background: var(--surface-2); }
.acc > details[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.acc-meta { margin-left: auto; font-size: .8rem; font-weight: 500; color: var(--muted); }
.acc-toggle { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; }
.acc > details[open] > summary .acc-toggle { transform: rotate(-135deg); }
.acc > details > :not(summary) { padding: .9rem 1rem .4rem; margin: 0; }
.acc-inline { margin: .2rem 0 .4rem; }
.acc-inline > summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--link); margin-bottom: .5rem; }
@media (max-width: 760px) {
  .personal-form .grid-3, .grid-addr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-addr > label:first-child, .span-2, .span-3 { grid-column: 1 / -1; }
  .personal-form .grid-3 > span:empty { display: none; }
}

/* Dashboard › Da fare oggi */
.todo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.4rem; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.todo-list a { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 0; color: var(--text); text-decoration: none; }
.todo-list a:hover { border-color: var(--brand); background: var(--surface-2); }
.todo-list small { display: block; color: var(--muted); font-size: .78rem; }
.todo-count { flex: none; min-width: 2.1rem; height: 2.1rem; padding: 0 .4rem; border-radius: 0; display: grid; place-items: center; font-weight: 700;
  background: color-mix(in srgb, var(--warn, #d97706) 14%, var(--surface)); color: var(--warn, #b45309); }
.privacy-text { line-height: 1.6; margin-bottom: 1rem; }
@media (max-width: 860px) { .todo-grid { grid-template-columns: minmax(0, 1fr); } }
/* «Da fare oggi» closed like the release notes: a notification counter */
.todo-badge { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .45rem; border-radius: 0; font-size: .78rem; font-weight: 700;
  background: var(--warn, #d97706); color: #fff; }
.todo-badge-late { background: var(--danger, #dc2626); }
.todo-card .whats-new-body.todo-grid { padding-top: 1rem; }

/* ---------- user manual (as in NexoraOne, Fibora orange) ---------- */
.manual { --nx-blue: var(--brand); }
/* dark theme: headings in the text colour (#00529E on black is not readable), the blue stays on bars and borders */
:root[data-theme="dark"] .manual-body h3, :root[data-theme="dark"] .manual-toc li.active > a { color: var(--text); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .manual-body h3, :root[data-theme="auto"] .manual-toc li.active > a { color: var(--text); } }
.manual { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.manual-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .7rem; max-height: calc(100vh - 6rem); overflow: auto; }
.manual-search input { width: 100%; margin: 0; }
.manual-pdf { align-self: flex-start; }
.manual-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.manual-toc > ol > li { counter-increment: ch; margin: .1rem 0; }
.manual-toc > ol > li > a::before { content: counter(ch) ". "; color: var(--muted); }
.manual-toc a { display: block; padding: .3rem .55rem; border-radius: 0; color: var(--text); font-size: .9rem; }
.manual-toc a:hover { background: var(--surface-2); text-decoration: none; }
.manual-toc li.active > a { background: color-mix(in srgb, var(--nx-blue) 12%, transparent); color: var(--nx-blue); font-weight: 600; }
.manual-toc ul { list-style: none; margin: .15rem 0 .4rem .9rem; padding: 0 0 0 .5rem; border-left: 2px solid var(--border); }
.manual-toc ul a { font-size: .84rem; color: var(--text-2); padding: .2rem .5rem; }
.manual-body { max-width: 900px; line-height: 1.65; }
.manual-body h2 { font-size: 1.7rem; margin: .2rem 0 1rem; }
.manual-body h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; color: var(--nx-blue); scroll-margin-top: 5rem; }
.manual-body h4 { font-size: 1rem; margin: 1.3rem 0 .4rem; scroll-margin-top: 5rem; }
.manual-body ul, .manual-body ol { padding-left: 1.4rem; }
.manual-body li { margin: .25rem 0; }
.manual-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; padding: .7rem .9rem; overflow: auto; font-size: .85rem; }
.manual-crumb { margin: 0 0 .3rem; font-size: .84rem; }
.manual-callout { margin: 1rem 0; padding: .7rem .9rem; border-radius: 0; border-left: 4px solid var(--nx-blue); background: color-mix(in srgb, var(--nx-blue) 8%, transparent); }
.manual-callout.manual-warning { border-left-color: var(--warn); background: var(--warn-bg); }
.manual-callout.manual-tip { border-left-color: var(--ok); background: var(--ok-bg); }
.manual-table { margin: .8rem 0; }
.manual-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.manual-index li { margin: .5rem 0; }
.manual-index span { display: block; font-size: .84rem; }
.manual-results { list-style: none; padding: 0; }
.manual-results li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.manual-results p { margin: .2rem 0 0; font-size: .88rem; color: var(--text-2); }
@media (max-width: 900px) {
  .manual { grid-template-columns: 1fr; }
  .manual-side { position: static; max-height: none; }
}
.manual-figure { margin: 1.2rem 0 1.4rem; text-align: center; }
.manual-figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow); background: #fff; }
.manual-figure figcaption { margin-top: .5rem; font-size: .84rem; color: var(--muted); }
.change-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; }

/* ---------- Organigramma ---------- */
.hidden-form { display: none; }
.org-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1rem; align-items: start; }
.org-layout:not(.org-editing) { grid-template-columns: minmax(0, 1fr); }
.org-panel { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .6rem; max-height: calc(100vh - 2rem); }
.org-panel h2 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .4rem; }
.org-panel .hint { margin: 0; }
.org-source { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; min-height: 80px; }
.org-chip { display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; border: 1px solid var(--border); border-radius: 0; background: var(--surface); cursor: grab; font-size: .88rem; line-height: 1.25; }
.org-chip:hover { border-color: var(--brand); background: var(--surface-2); }
.org-chip small { display: block; color: var(--muted); font-size: .76rem; }
.org-chip-position { border-style: dashed; color: var(--link); font-weight: 600; }
.org-chip-position .ic { width: 18px; height: 18px; }
.org-all-in { font-size: .85rem; padding: .3rem; }
.org-board { padding: 0; overflow: hidden; }
.org-toolbar { display: flex; gap: .35rem; flex-wrap: wrap; padding: .6rem .75rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.org-canvas { overflow: auto; min-height: 60vh; padding: 1.5rem 1rem 2rem; }
.org-canvas.org-drop-root { background: color-mix(in srgb, var(--brand) 7%, transparent); outline: 2px dashed color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: -8px; }
.org-zoom { width: max-content; min-width: 100%; }
.page-head select[data-org-switch] { width: auto; max-width: 280px; }
.org-empty { text-align: center; padding: 4rem 1rem; }

/* tree with connectors */
.org-tree, .org-tree ul { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; }
.org-tree ul { padding-top: 22px; position: relative; }
.org-tree li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.org-tree > li { padding-top: 0; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 22px; border-top: 2px solid var(--border-strong); }
.org-tree li::before { right: 50%; }
.org-tree li::after { left: 50%; border-left: 2px solid var(--border-strong); }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree ul > li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid var(--border-strong); border-radius: 0; }
.org-tree li:first-child::after { border-radius: 0; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--border-strong); }
.org-tree > li::before, .org-tree > li::after { display: none; }

.org-node { --org-color: var(--brand); position: relative; width: 190px; padding: .7rem .6rem .6rem; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--org-color); border-radius: 0; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; font-size: .85rem; line-height: 1.25; }
.org-editing .org-node { cursor: grab; }
.org-node.org-position { background: var(--surface-2); border-style: dashed; border-top-style: solid; }
.org-node.org-gone { opacity: .6; }
.org-avatar { width: 42px; height: 42px; border-radius: 0; object-fit: cover; flex: none; margin-bottom: .2rem; }
.org-avatar-empty { display: grid; place-items: center; background: color-mix(in srgb, var(--org-color, var(--brand)) 18%, var(--surface)); color: var(--text-2); font-weight: 700; font-size: .85rem; }
.org-avatar-empty .ic { width: 20px; height: 20px; }
.org-avatar-sm { width: 30px; height: 30px; font-size: .72rem; margin: 0; }
.org-name { font-weight: 650; color: var(--text); word-break: break-word; }
a.org-name:hover { color: var(--link); }
.org-role { color: var(--text-2); font-size: .8rem; }
.org-dept { color: var(--muted); font-size: .75rem; }
.org-tools { position: absolute; top: -14px; right: -6px; display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow); padding: 1px; }
.org-tools .act { width: 26px; height: 26px; margin: 0; }
.org-node:hover .org-tools, .org-node:focus-within .org-tools { display: flex; }
.org-dragging { opacity: .45; }
.org-drop-child { outline: 2px solid var(--brand); outline-offset: 2px; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.org-drop-before { box-shadow: -6px 0 0 -1px var(--brand), var(--shadow); }
.org-drop-after { box-shadow: 6px 0 0 -1px var(--brand), var(--shadow); }

/* dialog */
.org-kind, .org-colors { border: 0; padding: 0; margin: 0; display: flex; gap: .9rem; flex-wrap: wrap; }
.org-colors legend { font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.org-colors { gap: .4rem; }
.org-color input { position: absolute; opacity: 0; }
.org-swatch { display: inline-block; width: 26px; height: 26px; border-radius: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.org-swatch-none { background: repeating-linear-gradient(45deg, var(--surface) 0 4px, var(--surface-3) 4px 8px); }
.org-color input:checked + .org-swatch { box-shadow: 0 0 0 2px var(--text); }
.org-color input:focus-visible + .org-swatch { box-shadow: var(--ring), 0 0 0 2px var(--text); }

@media (max-width: 960px) {
  .org-layout { grid-template-columns: minmax(0, 1fr); }
  .org-panel { position: static; max-height: 320px; }
}
@media print {
  .org-panel, .org-toolbar, .org-tools { display: none !important; }
  .org-layout { display: block; }
  .org-board { border: 0; box-shadow: none; }
  .org-canvas { overflow: visible; min-height: 0; padding: 0; }
  .org-zoom { zoom: 1 !important; width: auto; }
  .org-node { box-shadow: none; break-inside: avoid; }
}
/* a team without sub-levels: boxes in a column on a vertical line */
.org-tree ul.org-stack { flex-direction: column; align-items: center; gap: 10px; }
.org-tree ul.org-stack::before { bottom: 30px; height: auto; }
.org-tree ul.org-stack > li { padding: 0; }
.org-tree ul.org-stack > li::before, .org-tree ul.org-stack > li::after { display: none; }
.org-tree .org-node { z-index: 1; }
.org-stack .org-drop-before { box-shadow: 0 -6px 0 -1px var(--brand), var(--shadow); }
.org-stack .org-drop-after { box-shadow: 0 6px 0 -1px var(--brand), var(--shadow); }

/* ---------- Riepilogo paghe ---------- */
.payroll-month { display: inline-flex; align-items: center; gap: .3rem; }
.payroll-month input[type="month"] { width: auto; min-width: 150px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.payroll-history-title { font-size: .9rem; margin: 1.2rem 0 .5rem; color: var(--muted); }
.payroll-history { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.payroll-history li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .9rem; }
#items, #hires, #terminations, #changes, #deadlines, #absences, #data, #note { scroll-margin-top: 80px; }

/* ---------- Pagina di stato (aggiornamento in corso, servizio non disponibile), come NexoraOne ---------- */
.status-panel { text-align: left; }
.status-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 0; margin: .4rem 0 1.1rem; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.status-icon svg { width: 28px; height: 28px; }
.status-icon-spin svg { animation: status-spin 2.4s linear infinite; }
@keyframes status-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status-icon-spin svg { animation: none; } }
.status-title { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 .5rem; }
.status-lead { color: var(--text-2); font-size: 1rem; line-height: 1.6; margin: 0 0 1.2rem; }
.status-detail { border: 1px solid var(--border); border-radius: 0; padding: .9rem 1rem; background: var(--surface-2); font-size: .88rem; line-height: 1.55; margin-bottom: 1.4rem; }
.status-detail p { margin: 0 0 .5rem; }
.status-detail pre { margin: 0; padding: .55rem .75rem; border-radius: 0; background: var(--surface); border: 1px solid var(--border); font-size: .88rem; overflow: auto; }
.status-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.status-actions .muted { font-size: .84rem; }

/* ---------- Competenze e curriculum ---------- */
.skill-level { display: inline-flex; gap: 3px; vertical-align: middle; }
.skill-level i { width: 9px; height: 9px; border-radius: 0; background: var(--surface-3); border: 1px solid var(--border-strong); }
.skill-level i.on { background: var(--brand); border-color: color-mix(in srgb, var(--brand) 70%, #000); }
.skill-level i.req { background: transparent; border: 1.5px dashed var(--danger); }
.skill-level.gap i.on { background: var(--warn); border-color: color-mix(in srgb, var(--warn) 70%, #000); }
.skill-level-name { font-size: .85rem; color: var(--text-2); }
.skill-legend .skill-level { margin: 0 .2rem 0 .5rem; }
.inline-level { display: inline-flex; align-items: center; gap: .5rem; }
.inline-level select { width: auto; padding-top: .2rem; padding-bottom: .2rem; font-size: .85rem; }
.row-muted td, .row-muted th { opacity: .6; }
.cell-wrap { white-space: normal; max-width: 340px; }
.skill-base-form { margin: 0 0 .8rem; }
.skill-matrix-wrap { max-height: 72vh; overflow: auto; }
.skill-matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.skill-matrix th, .skill-matrix td { border-bottom: 1px solid var(--border); }
.skill-matrix .sm-person { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 220px; max-width: 260px; text-align: left; font-weight: 500; }
.skill-matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); vertical-align: bottom; }
.skill-matrix thead .sm-person { z-index: 4; }
.skill-matrix .sm-skill { height: 150px; width: 38px; min-width: 38px; padding: .3rem 0; }
.skill-matrix .sm-skill span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 140px; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; font-weight: 600; color: var(--text-2); }
.skill-matrix .sm-cell { text-align: center; padding: .45rem .2rem; }
.skill-matrix .sm-cell .skill-level { flex-direction: column-reverse; gap: 2px; }
.skill-matrix .sm-cell .skill-level i { width: 8px; height: 8px; }
.skill-matrix .sm-required { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.skill-matrix tbody tr:hover td, .skill-matrix tbody tr:hover th { background: var(--surface-2); }
.skill-matrix tfoot th, .skill-matrix tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--border-strong); }
.skill-matrix .sm-cov.sm-none { color: var(--danger); }
.skill-matrix .sm-cov.sm-one { color: var(--warn); }
.cv-current { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .2rem 0 1rem; }
.cv-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 0; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); flex: none; }
.cv-meta { flex: 1 1 260px; min-width: 0; }
.cv-meta strong { word-break: break-all; }
.cv-upload { border-top: 1px solid var(--border); padding-top: 1rem; }
.cv-old-title { font-size: .9rem; color: var(--muted); margin: 1.2rem 0 .4rem; }
.cv-delete { margin-top: 1rem; }
.cv-snippet { display: block; font-size: .85rem; color: var(--text-2); quotes: "«" "»"; }
.cv-proposals .check-col { width: 36px; text-align: center; }
.cv-proposals select { width: auto; }
.skill-matrix th { text-transform: none; letter-spacing: normal; }
.skill-matrix tbody .sm-person a { font-weight: 600; }
.skill-matrix .sm-skill { height: 190px; }
.skill-matrix .sm-skill span { max-height: 180px; font-size: .8rem; }
.skill-base-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.skill-base-form select { width: auto; max-width: 100%; }
.alert .skill-base-form { margin: .5rem 0 0; }

/* ---------- Menu laterale: sezioni richiudibili ---------- */
button.nav-section { display: flex; align-items: center; gap: .4rem; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; border-radius: 0; }
button.nav-section span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; }
button.nav-section:hover { color: var(--side-text-strong); }
button.nav-section:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.nav-section .ic { width: 13px; height: 13px; transition: transform .15s; opacity: .7; }
button.nav-section[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.nav-section-badge { display: none; font-size: .62rem; letter-spacing: 0; text-transform: none; }
button.nav-section[aria-expanded="false"] .nav-section-badge { display: inline-flex; }
.nav-group[hidden] { display: none; }
html.sidebar-collapsed .nav-group[hidden] { display: block; }
html.sidebar-collapsed button.nav-section { pointer-events: none; }
html.sidebar-collapsed button.nav-section .ic, html.sidebar-collapsed .nav-section-badge { display: none; }
.nav > .nav-group:first-child { margin-top: .5rem; }
/* ---------- Dotazioni per mansione ---------- */
.kit-qty { font-weight: 700; color: var(--link); min-width: 2.2em; display: inline-block; }
.kit-qty-input { width: 5em !important; }

/* ===================================================================== Fibora: OSP network ===== */
.stat-sub { color: var(--muted); font-size: .76rem; }
a.stat:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-1px); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .6rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 900px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.list > li { padding: .5rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.list.compact > li { padding: .3rem 0; font-size: .88rem; }
ol.list { list-style: decimal inside; }
ol.list > li { display: list-item; }
.numbered { margin: 0; padding-left: 1.2rem; display: grid; gap: .55rem; font-size: .9rem; color: var(--text-2); }
.tree-list { list-style: none; margin: .2rem 0 .8rem; padding: 0 0 0 .9rem; border-left: 2px solid var(--border); display: grid; gap: .35rem; font-size: .86rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.btn-xs { padding: .15rem .45rem; font-size: .75rem; min-height: 0; }
.w-xs { width: 5.5rem !important; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.choice-row { border: 0; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.choice-row legend { font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: .35rem; }
.choice-row .check small { display: block; color: var(--muted); font-size: .76rem; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.add-inline { margin-top: .8rem; }
.add-inline > summary { list-style: none; cursor: pointer; width: fit-content; }
.add-inline > summary::-webkit-details-marker { display: none; }
.add-inline[open] > summary { margin-bottom: .8rem; }
.meter { display: inline-block; width: 70px; height: 7px; border-radius: 0; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 0; }

/* type of point, infrastructure, owner */
.node-type { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-2); font-size: .84rem; white-space: nowrap; }
.node-type .ic { color: var(--nt); width: 18px; height: 18px; padding: 2px; border-radius: 0; background: color-mix(in srgb, var(--nt) 14%, transparent); }
h1 .node-type .ic { width: 28px; height: 28px; vertical-align: -5px; }
.infra { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--text-2); }
.infra i { display: inline-block; width: 26px; height: 0; border-top: 4px solid var(--oc, var(--brand)); border-radius: 0; }
.infra-fender i { border-top-style: dashed; }
.infra-tubo i { border-top-style: dotted; border-top-width: 5px; }
.infra.big i { width: 36px; border-top-width: 6px; }
.owner-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; white-space: nowrap; }
.owner-chip::before { content: ""; width: 10px; height: 10px; border-radius: 0; background: var(--oc); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.type-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.type-bars li { display: grid; grid-template-columns: 150px 1fr 3rem; gap: .7rem; align-items: center; }
.type-bars .bar { height: 8px; background: var(--surface-3); border-radius: 0; overflow: hidden; }
.type-bars .bar i { display: block; height: 100%; border-radius: 0; }
.type-bars strong { text-align: right; font-variant-numeric: tabular-nums; }

/* fibre colours */
.fiber-dot { display: inline-block; width: 13px; height: 13px; border-radius: 0; background: var(--fc); border: 1px solid rgba(0, 0, 0, .25); vertical-align: -2px; margin-right: 2px; }
.fiber-dot.ringed { box-shadow: inset 0 0 0 2px var(--fc), inset 0 0 0 3.5px #111; }
.fiber-dot.ringed2 { box-shadow: inset 0 0 0 1.5px var(--fc), inset 0 0 0 3px #111, inset 0 0 0 4px var(--fc), inset 0 0 0 5.5px #111; }
.tube.filler .fiber-dot { background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(0, 0, 0, .18) 3px 4px); }
.tube-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.tube { display: inline-flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .7rem; color: var(--muted); }
.tube .fiber-dot { width: 22px; height: 22px; }
.tube-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.fiber-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.fiber-tube { border: 1px solid var(--border); border-radius: 0; padding: .6rem .7rem; display: grid; gap: .3rem; }
.fiber-tube h3 { margin: 0 0 .2rem; font-size: .85rem; }
.color-pick { display: grid; grid-template-columns: 4.2rem 1fr; align-items: center; gap: .4rem; font-size: .8rem; margin: 0; }
.color-pick select { padding: .2rem .4rem; font-size: .8rem; min-height: 0; }
.fiber-table td { padding-top: .3rem; padding-bottom: .3rem; }

/* splices */
.splice-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-bottom: .6rem; }
.splice-grid fieldset { border: 1px solid var(--border); border-radius: 0; padding: .6rem .8rem; margin: 0; display: grid; gap: .5rem; }
.splice-grid legend { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0 .3rem; }
.splice-arrow { font-size: 1.6rem; color: var(--brand); }
.splice-join { color: var(--brand); font-weight: 700; text-align: center; }
.diagram-wrap { overflow-x: auto; }
.splice-diagram { max-width: 100%; height: auto; font-family: var(--font); }
.sd-box { fill: color-mix(in srgb, var(--brand) 6%, transparent); stroke: color-mix(in srgb, var(--brand) 55%, transparent); stroke-width: 2; }
.sd-title { font-weight: 700; font-size: 14px; fill: var(--text); }
.sd-cable { fill: var(--surface-2); stroke: var(--border-strong); }
.sd-label { font-size: 12px; font-weight: 700; fill: var(--text-2); }
.sd-fiber { font-size: 11px; fill: var(--text-2); }
.sd-line { fill: none; stroke-width: 2.4; }
.sd-dot { stroke: rgba(0, 0, 0, .35); }
.sd-joint { fill: var(--text); }

/* fibre trace */
.trace { list-style: none; margin: 0; padding: 0 0 0 1.2rem; border-left: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); display: grid; gap: .55rem; }
.trace li { position: relative; font-size: .9rem; }
.trace li::before { content: ""; position: absolute; left: -1.62rem; top: .4rem; width: 11px; height: 11px; border-radius: 0; background: var(--surface); border: 2px solid var(--brand); }
.trace .trace-end::before { background: var(--brand); width: 13px; height: 13px; left: -1.7rem; }
.trace .trace-splice { color: var(--muted); font-size: .84rem; }
.trace .trace-splice::before { border-radius: 0; transform: rotate(45deg); }
.trace .trace-hop.start { font-weight: 600; }
.trace-fiber { margin-right: .3rem; }

/* route content tree (as IQGeo: infrastructure > cables) */
.content-tree, .content-tree ul { list-style: none; margin: 0; padding: 0; }
.content-tree ul { padding-left: 1.2rem; margin-top: .4rem; border-left: 2px dashed var(--border); display: grid; gap: .45rem; }
.content-tree .ct-node { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .88rem; }
.route-pick { margin: 0 0 .6rem; padding-left: 1.3rem; display: grid; gap: .35rem; font-size: .86rem; }

/* projects */
.phase-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; padding: 0; }
.phase-steps li { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem .3rem .35rem; border-radius: 0; background: var(--surface); border: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.phase-steps li span { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 0; background: var(--surface-3); font-weight: 700; font-size: .72rem; }
.phase-steps li.done { color: var(--text-2); }
.phase-steps li.done span { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.phase-steps li.current { border-color: var(--brand); color: var(--text); font-weight: 600; }
.phase-steps li.current span { background: var(--brand); color: #1b1203; }
.timeline li.warn::before { background: var(--danger); }
.timeline time { font-size: .78rem; color: var(--muted); font-weight: 600; }
.search-list .ic { color: var(--link); }

/* printable reports */
.report .report-head { border-bottom: 2px solid var(--brand); margin-bottom: 1rem; padding-bottom: .6rem; }
.report .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--link); font-weight: 700; margin: 0; }
.report h1 { margin: .1rem 0 .5rem; }
.report h2 { margin-top: 1.3rem; font-size: 1rem; background: var(--side-bg); color: #fff; padding: .35rem .6rem; border-radius: 0; }
.dl.inline { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.dl.inline dt, .dl.inline dd { border: 0; padding: 0; }
.dl.inline dd { margin-right: .4rem; font-weight: 600; }
@media print {
  .report h2 { background: #091c30 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fiber-dot, .sd-line { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===================================================================== map workspace (IQGeo-like) ===== */
body.page-map .content { max-width: none; padding: 0; display: flex; flex-direction: column; }
body.page-map .foot { display: none; }
body.page-map .content > .alert { margin: .6rem .8rem 0; }
.gis { display: flex; flex-direction: column; height: calc(100vh - 62px); min-height: 480px; }
.gis-toolbar { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; padding: .55rem .8rem; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 1001; }
.gis-search { position: relative; flex: none; margin-bottom: .7rem; display: flex; align-items: center; gap: .4rem; background: var(--surface-3); border: 1px solid var(--border); border-radius: 0; padding: 0 .6rem; }
.gis-search input { border: 0; background: transparent; padding: .45rem 0; width: 100%; box-shadow: none; }
.gis-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; list-style: none; margin: 0; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.gis-search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .4rem .5rem; border-radius: 0; cursor: pointer; color: var(--text); }
.gis-search-results button:hover { background: var(--surface-3); }
.gis-search-results small { color: var(--muted); }
.gis-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; flex: 1; min-width: 0; }
.tool, .tool-menu > summary { display: inline-flex; align-items: center; gap: .35rem; height: 34px; box-sizing: border-box; padding: 0 .6rem; white-space: nowrap; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 0; font-size: .82rem; font-weight: 600; cursor: pointer; list-style: none; }
.tool-menu > summary::-webkit-details-marker { display: none; }
.tool:hover, .tool-menu > summary:hover { border-color: var(--border-strong); color: var(--text); }
.tool.active, .tool-menu > summary.active { background: var(--brand); border-color: var(--brand); color: #1b1203; }
.tool .ic { width: 17px; height: 17px; }
.tool-menu { position: relative; }
.tool-menu .menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 1002; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); padding: .3rem; display: grid; min-width: 190px; }
.tool-menu .menu button { border: 0; background: none; text-align: left; padding: .4rem .5rem; border-radius: 0; cursor: pointer; }
.tool-menu .menu button:hover { background: var(--surface-3); }
.gis-base { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.gis-base label { margin: 0; }
.gis-base select { width: 100%; margin-top: .25rem; }
.gis-tools .tool-check { display: inline-flex; margin: 0; font-weight: 600; color: var(--text-2); }

.gis-body { flex: 1; display: grid; grid-template-columns: 384px 1fr; min-height: 0; }
.gis-panel { background: var(--surface); border-right: 1px solid var(--border); overflow: auto; padding: .7rem .9rem 1rem; min-height: 0; }
.gis-tabs { width: 100%; }
.gis-tabs button { flex: 1; border: 0; background: none; padding: .45rem .6rem; border-radius: 0; font-weight: 600; color: var(--muted); cursor: pointer; }
.gis-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.gis-pane h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .4rem; }
.gis-pane h2 { font-size: 1.05rem; margin: 0; }
.gis-hint { font-size: .86rem; color: var(--text-2); }
.gis-hint ul { padding-left: 1.1rem; display: grid; gap: .35rem; }
.gis-d-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .7rem; }
.gis-d-head p { margin: .1rem 0 0; font-size: .84rem; }
.gis-pane .dl { font-size: .84rem; }
.gis-pane .btn-row { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; }
/* every layer row on the same grid: box, symbol in a fixed slot, name, count (nothing overlaps the name) */
.layer-row, label.check.layer-row { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr) auto; align-items: center; column-gap: .5rem; margin: .3rem 0; font-size: .86rem; }
label.check.layer-row input { margin: 0; }
.layer-row > .sym-leg, .layer-row > .layer-sym { justify-self: center; }
.layer-row > .sym-leg { overflow: hidden; }
.layer-sym.sym-drop { height: 0; border-top: 2px dashed #e11d48; }
.layer-sym.sym-none { visibility: hidden; }
.layer-count { color: var(--muted); font-size: .76rem; margin-left: auto; }
.gis-map-wrap { position: relative; min-height: 0; }
.gis-map { position: absolute; inset: 0; background: #e5e3df; }
.gis-status { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 1000; background: rgba(9, 28, 48, .92); color: #fff; padding: .5rem .9rem; border-radius: 0; font-size: .84rem; box-shadow: var(--shadow-lg); max-width: min(680px, 90%); text-align: center; }
.gis-ctx { position: absolute; z-index: 1001; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); padding: .3rem; }
.gis-ctx button { font-size: .84rem; white-space: nowrap; }
.gis-ctx[hidden] { display: none; }
.gis-status:empty, .gis-status[hidden] { display: none; }
.gis-status.error { background: rgba(194, 43, 43, .95); }
.gis-status.ok { background: rgba(19, 138, 75, .95); }
[data-tool-active="node"] .gis-map, [data-tool-active="route"] .gis-map, [data-tool-active="customer"] .gis-map, [data-tool-active="measure"] .gis-map, [data-tool-active="streetview"] .gis-map { cursor: crosshair; }
/* markers: one shape per type of point */
.mk-wrap { background: none; border: 0; display: grid; place-items: center; }
.mk { display: block; width: 12px; height: 12px; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3); }
.mk-pozzetto { border-radius: 2px; }
.mk-pop { width: 18px; height: 18px; border-radius: 4px; border-width: 3px; }
.mk-cno { width: 16px; height: 16px; border-radius: 4px; }
.mk-roe { width: 14px; height: 14px; border-radius: 50%; }
.mk-pte { width: 11px; height: 11px; transform: rotate(45deg); }
.mk-palo { width: 9px; height: 9px; border-radius: 50%; }
.mk-armadio { width: 12px; height: 16px; border-radius: 2px; }
.mk-altro { width: 9px; height: 9px; border-radius: 50%; }
.mk.st-planned { opacity: .75; border-style: dashed; }
.mk.st-decommissioned { opacity: .4; }
.mk-customer { width: 12px; height: 12px; background: #e11d48; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); --c: #e11d48; }
.mk-customer.cs-prospect { background: #fda4af; }
.mk-customer.cs-ceased { background: #9ca3af; }
.gis-d-head .mk { flex: 0 0 auto; }
.leaflet-tooltip.mk-label { font-size: 11px; padding: 1px 5px; }
.leaflet-container { font-family: var(--font); }
html[data-theme="dark"] .gis-map { background: #1d2733; }
@media (max-width: 900px) {
  .gis { height: auto; }
  .gis-body { grid-template-columns: 1fr; }
  .gis-map-wrap { height: 62vh; order: -1; }
  .gis-panel { border-right: 0; border-top: 1px solid var(--border); max-height: none; }
  .tool span { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .splice-grid { grid-template-columns: 1fr; }
  .splice-arrow { transform: rotate(90deg); justify-self: center; }
  .type-bars li { grid-template-columns: 110px 1fr 2.5rem; }
}

/* map: address search and road following */
.gis-search-sep { padding: .35rem .5rem .15rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 1px solid var(--border); margin-top: .2rem; }
.geo-pin { display: block; width: 22px; height: 22px; margin: 2px; background: #e11d48; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.tool-check { gap: .4rem; }
.tool-check input { margin: 0; accent-color: var(--brand); }

/* ---------- workspace of the map (IQGeo style): Equipment / Cable trees, connect dialog, trace (8 px grid) ---------- */
.gis-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.gis-tabs button { justify-content: center; }
.btn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 8px; }
.btn-grid .btn { width: 100%; justify-content: center; }
.ws-pane { padding-top: 4px; }
.ws-empty { padding: 16px 0; font-size: .86rem; }
.ws-head { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 0 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.ws-head-inline { flex-direction: row; align-items: center; justify-content: space-between; }
.ws-head > div:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.ws-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ws-actions .btn { width: 100%; justify-content: center; }
.ws-head-inline .ws-actions { display: flex; }
.ws-head-inline .ws-actions .btn { width: auto; }
.ws-actions .btn .ic, .btn-grid .btn .ic { width: 15px; height: 15px; }
.ws-sub { display: flex; align-items: center; gap: 8px; }
.ws-sub .ic { width: 15px; height: 15px; }
.ws-tree, .ws-tree ul { list-style: none; margin: 0; padding: 0; }
.ws-tree ul { margin-left: 12px; padding-left: 8px; border-left: 1px dashed var(--border-strong); }
.ws-row { display: grid; grid-template-columns: 16px 24px minmax(0, 1fr) auto 28px; align-items: center; gap: 4px 8px; min-height: 32px; padding: 0 4px; border-radius: 0; font-size: .84rem; }
.ws-row:hover { background: var(--surface-3); }
.ws-row .ws-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 0; background: color-mix(in srgb, var(--brand) 12%, transparent); color: color-mix(in srgb, var(--brand) 75%, var(--text)); }
.ws-ico .ic, .ws-ico svg { width: 15px; height: 15px; }
.ws-caret { width: 16px; height: 16px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); position: relative; }
.ws-caret::before { content: ""; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .12s; }
.ws-caret.open::before { transform: rotate(45deg); }
.ws-caret.none { cursor: default; }
.ws-caret.none::before { display: none; }
.ws-chip { font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--border); border-radius: 0; padding: 1px 8px; white-space: nowrap; }
.ws-more { width: 28px; height: 28px; border: 0; background: none; border-radius: 0; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.ws-more:hover { background: var(--surface); color: var(--text); }
.ws-side { grid-template-columns: 16px 36px minmax(0, 1fr) auto 28px; }
.ws-side-tag { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-align: center; border-radius: 0; padding: 2px 0; background: var(--info-bg); color: var(--info); }
.ws-cont { font-family: var(--mono); font-size: .72rem; color: var(--brand); }
.ws-pins { margin-left: 12px !important; padding-left: 8px !important; display: grid; gap: 0; }
.ws-pin { display: grid; grid-template-columns: 12px 32px auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 24px; padding: 0 4px; border-radius: 0; font-size: .78rem; cursor: pointer; }
.ws-pin:hover { background: var(--surface-3); }
.ws-pin.used .pin-to { color: var(--text); }
.ws-pin .pin-n { font-variant-numeric: tabular-nums; text-align: right; color: var(--text-2); font-weight: 600; }
.ws-pin .pin-c { color: var(--muted); white-space: nowrap; }
.ws-pin .pin-to { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pin .pin-term { color: var(--brand); letter-spacing: 2px; }
.fdot { display: inline-block; width: 12px; height: 12px; border-radius: 0; border: 1px solid rgba(0, 0, 0, .25); flex: none; }
.pdot { display: inline-block; width: 10px; height: 10px; border-radius: 0; border: 1.5px solid var(--muted); }
.used .pdot { background: var(--brand); border-color: var(--brand); }
.ws-flat { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: .84rem; }
.ws-flat .icon-btn { padding: 0 6px; }
.ws-menu { position: fixed; z-index: 2000; min-width: 232px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); padding: 4px; }
.ws-menu button { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center; width: 100%; min-height: 32px; padding: 0 8px; font-size: .84rem; }
.ws-menu button .ic { width: 16px; height: 16px; color: var(--muted); }
.ws-menu button.danger { color: var(--danger); }
.ws-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.ws-menu[hidden] { display: none; }
.menu-title { margin: 8px 8px 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
/* trace in the Details pane */
.ws-trace { margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ws-trace h4 { margin: 8px 0; font-size: .8rem; }
.ws-trace-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ws-trace-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; min-height: 28px; padding: 0 8px 0 calc(8px + var(--depth, 0) * 8px); border-radius: 0; font-size: .8rem; cursor: pointer; }
.ws-trace-list li:hover { background: var(--surface-3); }
.ws-trace-list li > span:first-child { display: block; min-width: 0; padding: 4px 0; line-height: 1.35; overflow-wrap: anywhere; }
.ws-trace-list li > span:first-child > .ic, .ws-trace-list li > span:first-child > .fdot { vertical-align: -2px; margin-right: 4px; }
.ws-trace-list .trace-num { align-self: start; padding-top: 4px; white-space: nowrap; color: var(--muted); }
.ws-trace-list .ic { width: 14px; height: 14px; color: var(--muted); }
.trace-num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .76rem; white-space: nowrap; margin-left: auto; }
.trace .trace-num { margin-left: 8px; }
.trace .trace-equip { font-weight: 600; }
.trace li { padding-left: calc(var(--depth, 0) * 8px); }
.danger-text { color: var(--danger); }
.otdr-pin { background: #c22b2b !important; }
/* floating bar of the new cable */
.ws-floatbar { position: absolute; z-index: 1001; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); font-size: .84rem; max-width: calc(100% - 32px); }
.ws-floatbar > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-floatbar .ic { width: 16px; height: 16px; color: #7c3aed; }
.ws-floatbar[hidden] { display: none; }
/* connect dialog: two aligned columns */
dialog.dlg-wide { width: min(880px, calc(100vw - 32px)); }
dialog.dlg-xl { width: min(1180px, calc(100vw - 32px)); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dlg-head h2 { margin: 0; }
.connect-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.connect-col { display: grid; grid-template-rows: auto auto 1fr; gap: 8px; min-width: 0; }
.connect-col label { margin: 0; }
.connect-filter { width: 100%; }
.pin-list { height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 0; padding: 4px; background: var(--surface-2); display: grid; align-content: start; gap: 2px; }
.pin-btn { display: grid; grid-template-columns: 12px 32px auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 0; background: none; font: inherit; font-size: .8rem; text-align: left; cursor: pointer; color: var(--text); }
.pin-btn:hover { background: var(--surface-3); }
.pin-btn.on { background: color-mix(in srgb, var(--brand) 18%, transparent); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.pin-btn.used { color: var(--muted); }
.pin-btn .pin-n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pin-btn .pin-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connect-meta { margin-top: 16px; }
.connect-summary { margin: 8px 0 0; padding: 8px 12px; border-radius: 0; background: var(--surface-3); font-size: .86rem; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.schematic-wrap { overflow: auto; max-height: calc(100vh - 140px); border: 1px solid var(--border); border-radius: 0; background: var(--surface-2); padding: 8px; }
.schematic-wrap img, .schematic-wrap svg { display: block; max-width: none; }
/* structure page: equipment tree */
.eq-tree, .eq-tree ul { list-style: none; margin: 0; padding: 0; }
.eq-tree ul { margin-left: 16px; padding-left: 8px; border-left: 1px dashed var(--border-strong); }
.eq-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto 32px; align-items: center; gap: 8px; min-height: 36px; font-size: .86rem; }
.eq-row form { margin: 0; }
.eq-row .eq-meta { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eq-badge { display: inline-flex; align-items: center; gap: 6px; }
.eq-badge .ic { width: 16px; height: 16px; color: var(--brand); }
.inline-form.wrap { margin-top: 16px; align-items: flex-end; }
form.inline { display: inline; margin: 0; }
.align-end { align-self: end; min-height: 38px; display: flex; align-items: center; }
@media (max-width: 860px) {
  .connect-cols { grid-template-columns: 1fr; }
  .pin-list { height: 220px; }
  .btn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ========== «Rete» 3.0: the network application on the model of IQGeo Network Manager Telecom ========== */
body.page-rete .global-search { visibility: hidden; }
body.page-rete .content { max-width: none; padding: 0; display: flex; flex-direction: column; }
body.page-rete .foot { display: none; }
.rete { display: flex; flex-direction: column; height: calc(100vh - 62px); min-height: 520px; background: var(--surface); }
.rete-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); position: relative; z-index: 1001; container-type: inline-size; container-name: retebar; }
.rete-search { position: relative; flex: 0 1 380px; min-width: 220px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 0; }
.rete-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 100, 0, .15); background: var(--surface); }
.rete-search input { border: 0; background: transparent; box-shadow: none; padding: 0; height: 36px; width: 100%; margin: 0; }
.rete-search .ic { width: 17px; height: 17px; color: var(--muted); flex: none; }
.rete-search-results { position: absolute; top: calc(100% + 6px); left: 0; width: max(100%, 460px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; z-index: 1100; }
.rete-search-results li { margin: 0; }
.rete-search-results button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 0; cursor: pointer; color: var(--text); font: inherit; }
.rete-search-results button:hover { background: var(--surface-3); }
.rete-search-results small { color: var(--muted); }
.rete-search-results .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.rete-search-results li.muted { padding: 8px; }
.rete-search-sep { padding: 8px 8px 3px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rete-query { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 8px; }
.rete-query > span:first-child { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.rete-query-scope { display: inline-flex; gap: 4px; }
.rete-query-scope button { width: auto; padding: 4px 8px; font-size: .75rem; border: 1px solid var(--border); border-radius: 0; }
.rete-tools { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.rete-tools-sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.rete-tool { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px; border: 1px solid transparent; background: none; border-radius: 0; color: var(--text-2); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rete-tool .ic { width: 19px; height: 19px; }
.rete-tool:hover { background: var(--surface-3); color: var(--text); }
.rete-tool.active { background: rgba(255, 100, 0, .12); border-color: rgba(255, 100, 0, .45); color: var(--link); }
.rete-tool[data-tool="add"] { background: var(--brand); color: #1b1203; }
.rete-tool[data-tool="add"]:hover { filter: brightness(1.05); }
/* the toolbar shows the labels only when they fit in the bar itself (the menu on the left may be open or reduced):
   below that, icons with their title on hover; «Aggiungi oggetto» keeps its label */
@container retebar (max-width: 1460px) { .rete-tool span { display: none; } .rete-tool { padding: 0 9px; } .rete-tool[data-tool="add"] span { display: inline; } }
@container retebar (max-width: 760px) { .rete-tool[data-tool="add"] span { display: none; } }
.rete-body { flex: 1; display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
/* the Details / Layers panel is reduced to a strip with Dettagli, Livelli and the arrow until there is something to
   show (panel.js): the map takes the rest of the width */
.rete-panel-head { display: flex; align-items: center; gap: 6px; margin: 12px 14px 0; }
.rete-panel-head .rete-tabs.tabs { margin: 0; flex: 1; }
.rete-panel-toggle .ic { transition: transform .15s; }
.rete:not(.panel-open) .rete-body { grid-template-columns: 56px minmax(0, 1fr); }
.rete:not(.panel-open) .rete-pane { display: none; }
.rete:not(.panel-open) .rete-panel-head { flex-direction: column; align-items: stretch; margin: 8px 6px 0; gap: 8px; }
.rete:not(.panel-open) .rete-panel-toggle { order: -1; align-self: center; }
.rete:not(.panel-open) .rete-panel-toggle .ic { transform: rotate(180deg); }
.rete:not(.panel-open) .rete-tabs.tabs { grid-template-columns: 1fr; }
.rete:not(.panel-open) .rete-tabs.tabs button { padding: 0; height: 40px; }
.rete:not(.panel-open) .rete-tabs.tabs button span { display: none; }
.rete:not(.panel-open) .rete-tabs.tabs button.active { background: none; box-shadow: none; color: var(--muted); }
.rete:not(.panel-open) .rete-tabs.tabs button.active .ic { color: inherit; }
.rete:not(.panel-open) .rete-tabs.tabs button:hover { background: var(--surface); color: var(--text); }
@media (max-width: 900px) {
  .rete:not(.panel-open) .rete-body { grid-template-columns: 1fr; }
  .rete:not(.panel-open) .rete-panel-head { flex-direction: row; margin: 8px 14px; }
  .rete:not(.panel-open) .rete-panel-toggle { order: 0; }
  .rete:not(.panel-open) .rete-panel-toggle .ic { transform: rotate(-90deg); }
  .rete:not(.panel-open) .rete-tabs.tabs { grid-template-columns: 1fr 1fr; }
  .rete:not(.panel-open) .rete-tabs.tabs button span { display: inline; }
}
.rete-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--surface); }
.rete-pane { flex: 1; overflow: auto; padding: 12px 14px 20px; min-height: 0; }
.rete-pane h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 16px 0 6px; }
.rete-pane h3:first-child { margin-top: 4px; }
.rete-map-wrap { position: relative; min-width: 0; min-height: 0; }
.rete-map { position: absolute; inset: 0; background: #e9ecef; }
.rete-map.drawing { cursor: crosshair; }
.rete-map.drawing .leaflet-interactive { cursor: crosshair; }
.rete-status { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; max-width: min(760px, calc(100% - 40px)); padding: 9px 16px; border-radius: 0; background: #0b1a2b; color: #fff; font-size: .84rem; box-shadow: var(--shadow-lg); text-align: center; }
.rete-status.ok { background: #0f5132; }
.rete-status.error { background: #8a1c1c; }
.rete-empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.rete-empty .ic { width: 38px; height: 38px; color: var(--brand); }
.rete-empty strong { color: var(--text); }
.rete-loading { padding: 16px 0; }
.rete-d-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.rete-d-ico { flex: none; width: 40px; height: 40px; border-radius: 0; background: rgba(255, 100, 0, .1); color: var(--link); display: grid; place-items: center; }
.rete-d-ico .ic { width: 22px; height: 22px; }
.rete-d-title { min-width: 0; }
.rete-d-title small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.rete-d-title h2 { margin: 1px 0 0; font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.rete-d-title p { margin: 2px 0 0; font-size: .82rem; }
.rete-d-bar { display: flex; gap: 6px; padding: 8px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.rete-ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; flex: none; }
.rete-ibtn .ic { width: 18px; height: 18px; }
.rete-ibtn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-3); }
.rete-ibtn.on { background: rgba(255, 100, 0, .12); border-color: rgba(255, 100, 0, .45); color: var(--link); }
.rete-d-sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 4px; }
.rete-dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 0; margin: 0; font-size: .86rem; }
.rete-dl dt { color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); }
.rete-dl dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.rete-links dd a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.rete-links .ic { width: 15px; height: 15px; }
.rete-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rete-li { display: flex; align-items: center; gap: 4px; border-radius: 0; }
.rete-li:hover { background: var(--surface-3); }
.rete-li-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.rete-li-main .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.rete-li-main span { min-width: 0; display: flex; flex-direction: column; }
.rete-li-main small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rete-li-act { border: 0; background: none; width: 30px; height: 30px; border-radius: 0; color: var(--muted); cursor: pointer; display: grid; place-items: center; opacity: 0; }
.rete-li:hover .rete-li-act { opacity: 1; }
.rete-li-act:hover { background: var(--surface); color: var(--text); }
.rete-li-act .ic { width: 16px; height: 16px; }
.rete-group { margin: 6px 0; }
.rete-group summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; padding: 6px 4px; }
.rete-group summary .ic { width: 16px; height: 16px; color: var(--muted); }
.rete-editor .alert { margin: 0 0 10px; }
.rete-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.rete-f { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .8rem; color: var(--text-2); font-weight: 500; min-width: 0; }
.rete-f.wide { grid-column: 1 / -1; }
.rete-f > span { font-weight: 600; }
.rete-f input, .rete-f select, .rete-f textarea { width: 100%; margin: 0; }
.rete-f .quick-add-row { display: flex; gap: 6px; }
.rete-f .field-error { color: #c22b2b; font-style: normal; font-size: .76rem; }
.rete-geo { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 10px 12px; border-radius: 0; background: var(--surface-3); font-size: .84rem; }
.rete-geo p { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rete-geo .ic { width: 16px; height: 16px; color: var(--link); }
.rete-geo.pending { color: var(--muted); }
.rete-geo .btn-row { display: flex; gap: 8px; }
.rete-ed-actions { position: sticky; bottom: -20px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 16px -14px -20px; padding: 12px 14px; background: var(--surface); border-top: 1px solid var(--border); }
.rete-ed-right { display: inline-flex; gap: 8px; }
.btn-split { display: inline-flex; }
.btn-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 9px; border-left: 1px solid rgba(0, 0, 0, .15); }
.btn-danger-ghost { color: #c22b2b; border-color: transparent; background: none; }
.btn-danger-ghost:hover { background: rgba(194, 43, 43, .08); }
.btn-danger { background: #c22b2b; border-color: #c22b2b; color: #fff; }
.rete-confirm-list { max-height: 220px; overflow: auto; margin: 6px 0 10px; padding-left: 18px; font-size: .86rem; }
#rete-confirm { max-width: 460px; }
.rete-dlg-del { margin: 14px 0 0; }
.rete-tree-sec { margin-top: 18px; }
.rete-tree-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rete-tree-head h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .74rem; }
.rete-tree-head h3 .ic { width: 15px; height: 15px; }
.rete-tree-filter { width: 100%; margin: 0 0 6px; height: 32px; }
.ws-root { background: var(--surface-3); }
.ws-pin { cursor: pointer; user-select: none; }
.ws-pin.on { background: rgba(255, 100, 0, .14); }
.pin-term.t-both { color: #138a4b; }
.pin-term.t-up, .pin-term.t-down { color: #a35b06; }
.pin-term.t-none { color: #c22b2b; }
.ws-row.drop-ok { outline: 2px solid #138a4b; outline-offset: -2px; background: rgba(19, 138, 75, .08); }
.ws-row.drop-ok::before { content: "\2713"; color: #138a4b; font-weight: 700; margin-right: 4px; }
.ws-row.drop-no { outline: 2px dashed #c22b2b; outline-offset: -2px; }
.ws-row[draggable="true"] { cursor: grab; }
.rete-maptools { position: absolute; right: 12px; bottom: 34px; z-index: 850; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); }
.rete-maptools-drag { cursor: move; color: var(--muted); padding: 0 4px; font-size: .8rem; user-select: none; }
.rete-maptools-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 0; background: none; border-radius: 0; color: var(--text-2); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.rete-maptools-btn .ic { width: 17px; height: 17px; }
.rete-maptools-btn:hover { background: var(--surface-3); }
.rete-maptools.active-mode [data-sel-mode], .rete-maptools.adding [data-sel-mode] { background: rgba(255, 100, 0, .12); color: var(--link); }
.rete-side, .rete-schematic, .rete-measure { position: absolute; top: 12px; right: 134px; z-index: 860; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); }
.rete-side { width: 300px; max-height: calc(100% - 80px); display: flex; flex-direction: column; }
.rete-measure { width: 260px; padding-bottom: 6px; }
.rete-measure .rete-dl, .rete-measure .hint { margin: 0 12px; }
.rete-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
.rete-side-head strong { display: inline-flex; align-items: center; gap: 6px; }
.rete-side-head .ic { width: 16px; height: 16px; }
.rete-side-head > span { display: inline-flex; gap: 6px; }
.rete-palette { overflow: auto; padding: 8px 12px 12px; }
.rete-palette h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 12px 0 6px; }
.rete-pal-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rete-pal-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px 6px; border: 1px solid var(--border); border-radius: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: .74rem; line-height: 1.2; text-align: center; cursor: pointer; text-decoration: none; }
.rete-pal-item:hover { border-color: var(--brand); color: var(--text); background: rgba(255, 100, 0, .05); }
.rete-pal-item .ic { width: 22px; height: 22px; color: var(--link); }
.rete-pal-item span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rete-schematic { width: min(640px, calc(100% - 200px)); height: min(520px, calc(100% - 80px)); display: flex; flex-direction: column; }
.rete-schematic.expanded { top: 8px; right: 8px; left: 8px; bottom: 8px; width: auto; height: auto; }
.rete-schematic-body { flex: 1; overflow: auto; padding: 10px; }
.rete-schematic-body svg { width: 100%; height: auto; }
/* navigation of the map (top right): pan arrows around «whole network», zoom, base map — one column of 36 px buttons */
.rete-nav { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rete-nav button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 0; background: var(--surface); color: var(--text-2); cursor: pointer; }
.rete-nav button .ic { width: 18px; height: 18px; }
.rete-nav button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.rete-nav button:disabled { opacity: .4; cursor: default; }
.rete-nav-pad { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px); padding: 3px; border-radius: 0; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 1px 5px rgba(0, 0, 0, .18); }
.rete-nav-pad button { width: 34px; height: 34px; border-radius: 0; }
.rete-nav-pad [data-nav=up] { grid-area: 1 / 2; } .rete-nav-pad [data-nav=left] { grid-area: 2 / 1; } .rete-nav-pad [data-nav=fit] { grid-area: 2 / 2; color: var(--link); }
.rete-nav-pad [data-nav=right] { grid-area: 2 / 3; } .rete-nav-pad [data-nav=down] { grid-area: 3 / 2; }
.rete-nav-bar { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 0; background: var(--surface); box-shadow: 0 1px 5px rgba(0, 0, 0, .18); }
.rete-nav-bar > button:first-child { border-radius: 0; } .rete-nav-bar > button:last-of-type { border-radius: 0; }
.rete-nav-bar > button:only-of-type { border-radius: 0; }
.rete-nav-bar > button + button { border-top: 1px solid var(--border); }
.rete-basemaps { position: relative; }
.rete-basemaps-list { position: absolute; right: 44px; top: 0; display: grid; min-width: 170px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); }
.rete-basemaps-list[hidden] { display: none; }
.rete-basemaps-list button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 0; cursor: pointer; font: inherit; color: var(--text); }
.rete-basemaps-list button:hover, .rete-basemaps-list button.active { background: var(--surface-3); }
.rete-menu { position: fixed; z-index: 3000; min-width: 220px; max-height: 80vh; overflow: auto; }
.rete-menu button[disabled] { opacity: .45; cursor: default; }
.rete-menu .menu-title { margin: 0; padding: 6px 10px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.rete-add-filter { width: 100%; margin: 0 0 10px; }
.rete-add-group h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 6px; }
.rete-add-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.rete-add-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 0; background: var(--surface); text-align: left; cursor: pointer; font: inherit; font-size: .82rem; color: var(--text); min-height: 42px; }
.rete-add-item:hover { border-color: var(--brand); background: rgba(255, 100, 0, .05); }
.rete-add-item .ic { width: 18px; height: 18px; color: var(--link); flex: none; }
.rete-grid { max-height: 60vh; overflow: auto; }
.rete-grid th { cursor: pointer; }
.rete-pin.on { background: rgba(255, 100, 0, .14); border-color: var(--brand); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.layer-sym { display: inline-block; width: 26px; height: 6px; border-radius: 0; vertical-align: middle; }
.sym-conduit { background: rgba(15, 23, 42, .25); height: 9px; }
.sym-cable { background: linear-gradient(#c8101e 0 35%, #111827 35% 65%, #c8101e 65%); height: 6px; }
.geo-v-wrap { background: none; border: 0; }
.geo-v { display: block; width: 12px; height: 12px; margin: 1px; border-radius: 3px; background: #fff; border: 2px solid #ff6400; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.geo-v-end { border-radius: 50%; width: 14px; height: 14px; margin: 0; background: #ff6400; border-color: #fff; }
.geo-v-snap { background: #138a4b; }
.geo-v-mid { width: 8px; height: 8px; margin: 3px; border-radius: 50%; background: rgba(255, 255, 255, .9); border: 1.5px solid #ff6400; opacity: .9; }
.geo-v-point { width: 16px; height: 16px; margin: -1px; border-radius: 50%; background: #ff6400; border: 3px solid #fff; }
@media (max-width: 900px) {
  .rete { height: auto; }
  .rete-body { grid-template-columns: 1fr; }
  .rete-map-wrap { height: 62vh; order: -1; }
  .rete-panel { border-right: 0; border-top: 1px solid var(--border); }
  .rete-bar { flex-wrap: wrap; }
  .rete-search { flex: 1 1 100%; }
  .rete-fields { grid-template-columns: 1fr; }
}

/* Rete: tabs of the panel, as the tabs of the suite (segmented, active one white) */
.rete-tabs.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: auto; max-width: none; margin: 12px 14px 0; padding: 4px; background: var(--surface-3); border-radius: 0; }
.rete-tabs.tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; background: none; border-radius: 0; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; box-shadow: none; }
.rete-tabs.tabs button .ic { width: 16px; height: 16px; }
.rete-tabs.tabs button:hover { color: var(--text); }
.rete-tabs.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.rete-tabs.tabs button.active .ic { color: var(--link); }
/* symbols of the network */
.sym-wrap { background: none; border: 0; }
.sym-wrap svg { display: block; overflow: visible; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); }
.sym-wrap.planned svg { opacity: .78; }
.sym-wrap.planned svg > g > *:first-child { stroke-dasharray: 3 2; }
.leaflet-tooltip.sym-label { padding: 0 5px; font-size: 10.5px; font-weight: 700; line-height: 16px; color: #1e293b; background: rgba(255, 255, 255, .92); border: 0; border-radius: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.leaflet-tooltip.sym-label::before { display: none; }
.leaflet-tile-pane .tiles-soft { filter: saturate(.35) brightness(1.04) contrast(.92); }
:root[data-theme="dark"] .leaflet-tile-pane .tiles-soft { filter: saturate(.3) brightness(.62) contrast(1.1) invert(.92) hue-rotate(180deg); }
.sym-leg { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: middle; }
.sym-leg svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.sym-route { background: #475569; height: 4px; }
.rete-legend { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: .78rem; color: var(--text-2); }
.rete-legend li { display: flex; align-items: center; gap: 6px; }
.lg-line { display: inline-block; width: 26px; height: 0; border-top: 4px solid #475569; border-radius: 0; }
.lg-aerea { border-top-style: dashed; }
.lg-facciata { border-top-style: dotted; }
.lg-planned { border-top: 4px dashed #94a3b8; }
/* structures: badge in the colour of the type with the icon of the application */
.sym-badge { position: relative; display: grid; place-items: center; box-sizing: border-box; border-radius: 50%; background: var(--sf); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.sym-badge .ic { width: 62%; height: 62%; stroke-width: 2.2; }
.sym-badge.sym-small { border-width: 1.5px; }
.sym-badge.sym-small .ic { width: 36%; height: 36%; }
.sym-badge.st-planned { border-style: dashed; opacity: .82; }
.sym-badge.st-decommissioned { opacity: .5; }
.sym-dot { position: absolute; top: -2px; right: -2px; width: 31%; height: 31%; min-width: 6px; min-height: 6px; border-radius: 50%; background: #ff6400; border: 1.5px solid #fff; }
.sym-leg .sym-badge { border-width: 1.5px; }
/* context menus of Rete: solid, as the menus of the suite */
.menu.rete-menu { background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); padding: .35rem; }
.rete-menu button { font-size: .85rem; padding: .45rem .6rem; }
.rete-menu button .ic, .rete-menu button > .ic { width: 16px; height: 16px; flex: none; color: var(--muted); }
.rete-menu button:hover .ic { color: var(--link); }
.rete-menu button.danger, .rete-menu button.danger .ic { color: #c22b2b; }
.rete-menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem .2rem; }
.rete-menu span.ic { display: inline-block; }
.rete-side, .rete-schematic, .rete-measure, .rete-maptools, .rete-search-results, .rete-basemaps-list { background: var(--surface); opacity: 1; }
.rete-status { opacity: .97; }

/* vertices while editing a geometry: bigger, easy to grab */
.geo-v-wrap { display: grid; place-items: center; cursor: move; }
.geo-v { width: 14px; height: 14px; margin: 0; border-radius: 3px; background: #fff; border: 2.5px solid #ff6400; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.geo-v-end { width: 16px; height: 16px; border-radius: 50%; background: #ff6400; border: 3px solid #fff; }
.geo-v-snap { background: #138a4b; }
.geo-v-mid { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #ff6400; opacity: .95; }
.geo-v-wrap:hover .geo-v { transform: scale(1.25); }
.rete-geo p { display: block; line-height: 1.5; }
.rete-geo p .ic { vertical-align: -3px; margin-right: 4px; }
.rete-geo .btn-row { margin-top: 2px; }
/* vertices: white and dark blue, a colour no owner uses (the line keeps the owner colour) */
.geo-v { border-color: #0f172a; }
.geo-v-end { background: #0f172a; border-color: #fff; }
.geo-v-snap { background: #138a4b; }
.geo-v-mid { border-color: #0f172a; }
.geo-v-point { background: #0f172a; }
/* cursor: arrow on the map and on the objects; hand only while the space bar is held (pan) */
.rete-map.leaflet-container, .rete-map .leaflet-grab, .rete-map .leaflet-interactive, .rete-map .leaflet-marker-icon { cursor: default; }
.rete-map.pan-mode, .rete-map.pan-mode .leaflet-grab, .rete-map.pan-mode .leaflet-interactive, .rete-map.pan-mode .leaflet-marker-icon { cursor: grab; }
.rete-map.pan-mode.leaflet-dragging, .rete-map.pan-mode .leaflet-dragging .leaflet-grab { cursor: grabbing; }
.rete-map.drawing, .rete-map.drawing .leaflet-interactive { cursor: crosshair; }
.rete-map .geo-v-wrap { cursor: move; }
/* balloon with the contents of a structure or a route */
.leaflet-tooltip.rete-popup { padding: 10px 12px; border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow-lg); background: var(--surface); color: var(--text);
  white-space: normal; min-width: 220px; max-width: 340px; font-size: .82rem; pointer-events: auto; cursor: default; }
.leaflet-tooltip-left.rete-popup::before { border-left-color: var(--surface); }
.rete-pop { position: relative; }
.rete-pop-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.rete-pop-x:hover { background: var(--hover, rgba(0,0,0,.06)); color: var(--text); }
.rete-pop h4 { padding-right: 22px; }
.rete-pop h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .9rem; }
.rete-pop h4 .ic { width: 16px; height: 16px; color: var(--link); }
.rete-pop ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.rete-pop li { display: flex; align-items: center; gap: 6px; padding: 3px 0 3px calc(var(--d, 0) * 14px); border-bottom: 1px solid var(--border); }
.rete-pop li .ic { width: 15px; height: 15px; color: var(--muted); flex: none; }
.rete-pop li small { color: var(--muted); }
.rete-pop p { margin: 6px 0 0; display: flex; align-items: center; gap: 5px; }
.rete-pop p .ic { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Super Admin › Stato server */
.srv { display: grid; gap: 1rem; }
.srv[hidden] { display: none; }
.srv-head h1 .ic { width: 26px; height: 26px; vertical-align: -4px; color: var(--brand); }
.srv-live { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--muted); margin-right: .4rem; }
.srv-live i { width: 9px; height: 9px; border-radius: 0; background: var(--ok); animation: srv-pulse 2s infinite; }
.srv-live.stale i { background: var(--danger); animation: none; }
@keyframes srv-pulse { 0% { box-shadow: 0 0 0 0 rgba(19, 138, 75, .45); } 70% { box-shadow: 0 0 0 8px rgba(19, 138, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(19, 138, 75, 0); } }
.srv-empty h2 .ic { color: var(--warn); }
.srv-banner { display: flex; gap: .9rem; align-items: flex-start; padding: .95rem 1.1rem; border-radius: 0; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.srv-banner strong { font-size: 1.05rem; }
.srv-banner p { margin: .2rem 0 0; color: var(--muted); }
.srv-banner ul { margin: .35rem 0 0; padding-left: 1.1rem; display: grid; gap: .15rem; }
.srv-banner li.lv-crit { color: var(--danger); } .srv-banner li.lv-warn { color: var(--warn); }
.srv-banner-ic { width: 38px; height: 38px; border-radius: 0; display: grid; place-items: center; flex: none; }
.srv-banner-ic .ic { width: 22px; height: 22px; }
.srv-banner.lv-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); } .srv-banner.lv-ok .srv-banner-ic { background: var(--ok-bg); color: var(--ok); }
.srv-banner.lv-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); } .srv-banner.lv-warn .srv-banner-ic { background: var(--warn-bg); color: var(--warn); }
.srv-banner.lv-crit { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); } .srv-banner.lv-crit .srv-banner-ic { background: var(--danger-bg); color: var(--danger); }
.srv-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; }
.srv-gauge { display: flex; flex-direction: column; justify-content: space-between; gap: .6rem; padding: .9rem .9rem .7rem; margin: 0; }
.srv-gauge-top { display: flex; gap: .9rem; align-items: center; }
.srv-gauge > h3 { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .95rem; }
.srv-gauge > h3 .ic { width: 17px; height: 17px; color: var(--muted); }
.srv-ring-wrap { position: relative; width: 78px; height: 78px; flex: none; }
.srv-ring { width: 78px; height: 78px; }
.srv-ring circle { fill: none; stroke-width: 9; }
.srv-ring .bg { stroke: var(--surface-3, #eef0f6); }
.srv-ring .fg { stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.srv-ring.lv-ok .fg { stroke: var(--ok); } .srv-ring.lv-warn .fg { stroke: #f59e0b; } .srv-ring.lv-crit .fg { stroke: var(--danger); } .srv-ring.lv-muted .fg { stroke: var(--muted); }
.srv-ring-val { position: absolute; inset: 0; display: grid; place-items: center; }
.srv-ring-val strong { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.srv-ring-val strong small { font-size: .7rem; color: var(--muted); font-weight: 500; }
.srv-ring-val .ic { width: 28px; height: 28px; color: var(--brand); }
.srv-gauge-info { min-width: 0; }
.srv-gauge-info h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .35rem; font-size: .95rem; }
.srv-gauge-info h3 .ic { width: 17px; height: 17px; color: var(--muted); }
.srv-gauge-info p { margin: .12rem 0; font-size: .8rem; color: var(--muted); }
.srv-gauge-info b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.srv-gauge-trend { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: flex-end; }
.srv-spark { width: 100%; height: 46px; display: block; }
.srv-spark .line { fill: none; stroke: var(--brand); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.srv-spark .area { fill: color-mix(in srgb, var(--brand) 14%, transparent); stroke: none; }
.srv-card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; }
.srv-card-head h2 { display: flex; align-items: center; gap: .45rem; margin: 0; }
.srv-card-head h2 .ic { width: 19px; height: 19px; color: var(--brand); }
.srv .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.srv .seg button { border: 0; background: var(--surface); padding: .35rem .75rem; font: inherit; font-size: .82rem; color: var(--text-2); cursor: pointer; }
.srv .seg button + button { border-left: 1px solid var(--border); }
.srv .seg button.active { background: var(--brand); color: #fff; }
.srv-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem 1.4rem; }
.srv-chart { position: relative; }
.srv-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.srv-chart h3 { margin: 0 0 .3rem; font-size: .88rem; }
.srv-chart svg { width: 100%; height: auto; display: block; }
.srv-chart .grid { stroke: var(--border); stroke-width: 1; }
.srv-chart .ax { fill: var(--muted); font-size: 10px; font-family: inherit; }
.srv-chart .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.srv-chart .area { stroke: none; }
.srv-chart .c0.line { stroke: var(--brand); } .srv-chart .c0.area { fill: color-mix(in srgb, var(--brand) 13%, transparent); }
.srv-chart .c1.line { stroke: #2563eb; } .srv-chart .c1.area { fill: rgba(37, 99, 235, .08); }
.srv-chart .cursor { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
.srv-legend { display: inline-flex; gap: .7rem; font-size: .75rem; color: var(--muted); }
.srv-legend i, .srv-tip i { display: inline-block; width: 10px; height: 3px; border-radius: 0; margin-right: .3rem; vertical-align: middle; }
.srv-legend i.c0, .srv-tip i.c0 { background: var(--brand); } .srv-legend i.c1, .srv-tip i.c1 { background: #2563eb; }
.srv-tip { position: absolute; top: 28px; min-width: 150px; padding: .45rem .6rem; border-radius: 0; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: .78rem; display: grid; gap: .15rem; pointer-events: none; z-index: 2; }
.srv-tip[hidden] { display: none; }
.srv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 1rem; align-items: start; }
.srv-cols > .card, .srv > .card { margin: 0; }
.srv-list { display: grid; }
.srv-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .1rem; border-bottom: 1px solid var(--border); }
.srv-row:last-child { border-bottom: 0; }
.srv-row-main { flex: 1; min-width: 0; display: grid; }
.srv-row-main strong { display: flex; align-items: center; gap: .35rem; font-size: .9rem; }
.srv-row-main strong .ic { width: 15px; height: 15px; color: var(--muted); }
.srv-row-main small, .srv-row-side small { color: var(--muted); font-size: .76rem; }
.srv-row-side { display: grid; justify-items: end; gap: .15rem; text-align: right; }
.srv-dot { width: 10px; height: 10px; border-radius: 0; flex: none; }
.srv-dot.lv-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .srv-dot.lv-crit { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.srv-pill { display: inline-block; padding: .12rem .55rem; border-radius: 0; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.srv-pill.lv-ok { background: var(--ok-bg); color: var(--ok); } .srv-pill.lv-warn { background: var(--warn-bg); color: var(--warn); }
.srv-pill.lv-crit { background: var(--danger-bg); color: var(--danger); } .srv-pill.lv-muted { background: var(--muted-bg, #f0f1f5); color: var(--muted); }
.srv-facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; font-size: .86rem; }
.srv-facts dt { color: var(--muted); }
.srv-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.srv-table { margin-top: .9rem; }
.srv-warn { display: flex; align-items: center; gap: .4rem; color: var(--warn); font-size: .85rem; }
.srv-warn .ic { width: 16px; height: 16px; }
@media (max-width: 720px) { .srv-chart-grid, .srv-cols { grid-template-columns: 1fr; } .srv-facts { grid-template-columns: 1fr; } .srv-facts dt { margin-top: .3rem; } }

/* ---------------------------------------------------------------- Rete › Path Finder */
.pf-form { display: grid; gap: .55rem; padding: .2rem .1rem .6rem; }
.pf-form label { font-size: .82rem; }
.pf-field { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: .5rem; }
.pf-label { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.pf-value { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-height: 32px; }
.pf-value .rete-ibtn.active { background: var(--brand); color: #fff; }
.pf-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 0; border: 1px solid var(--border); background: var(--surface-2); font: inherit; font-size: .8rem; font-weight: 600; color: var(--text); cursor: pointer; }
.pf-chip .ic { width: 14px; height: 14px; }
.pf-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0 0 .1rem; }
.pf-port { display: flex; align-items: center; gap: .35rem; flex-wrap: nowrap; }
.pf-port select { flex: 1; min-width: 0; }
.pf-port input { width: 72px; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pf-actions { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .3rem; }
.pf-results { display: grid; gap: .5rem; }
.pf-path { border: 1px solid var(--border); border-radius: 0; padding: .55rem .7rem; cursor: pointer; background: var(--surface); }
.pf-path:hover { border-color: var(--border-strong); }
.pf-path.on { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124, 58, 237, .15); cursor: default; }
.pf-path-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .88rem; }
.pf-path-head span { font-variant-numeric: tabular-nums; font-weight: 600; }
.pf-badges { display: flex; gap: .35rem; margin-top: .35rem; flex-wrap: wrap; }
.pf-b { font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 0; background: var(--surface-3); color: var(--text-2); }
.pf-b.new { background: #fef3c7; color: #92400e; } .pf-b.ex { background: var(--ok-bg); color: var(--ok); }
.pf-steps { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: 2px; font-size: .8rem; }
.pf-steps li { display: grid; grid-template-columns: 16px 1fr auto; gap: .4rem; align-items: center; padding: .25rem .3rem; border-radius: 0; cursor: pointer; }
.pf-steps li:hover { background: var(--surface-3); }
.pf-steps li .ic { width: 14px; height: 14px; color: #7c3aed; }
.pf-steps li.new { background: #fefce8; } .pf-steps li.new .ic { color: #ca8a04; }
.pf-steps li.ex .ic { color: var(--ok); }
.pf-steps li em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-end { font-size: .78rem; margin: .4rem 0 0; }
.pf-warn { color: var(--warn); font-weight: 600; }
.pf-none { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem; border-radius: 0; background: var(--warn-bg); color: var(--warn); font-size: .84rem; }
.pf-none .ic { width: 18px; height: 18px; flex: none; }
.pf-end-pin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #7c3aed; color: #fff; font-weight: 700; font-size: .72rem; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.pf-confirm { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .3rem; font-size: .85rem; }
.pf-confirm .ic { width: 14px; height: 14px; color: #ca8a04; vertical-align: -2px; }
#rete-map.picking, #rete-map.picking .leaflet-interactive { cursor: crosshair !important; }
[data-theme="dark"] .pf-b.new, [data-theme="dark"] .pf-steps li.new { background: rgba(250, 204, 21, .14); color: #facc15; }

/* ---------------------------------------------------------------- Rete › Design */
.ds-mark { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 800; display: flex; align-items: center; gap: .6rem;
  padding: .45rem .55rem .45rem .7rem; border-radius: 0; background: var(--surface); border: 2px solid #ea580c; box-shadow: var(--shadow-lg); font-size: .82rem; max-width: calc(100% - 140px); }
.ds-mark[hidden] { display: none; }
.ds-mark small { display: block; color: #ea580c; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .66rem; }
.ds-mark strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.ds-mark-ic { width: 30px; height: 30px; border-radius: 0; display: grid; place-items: center; background: #fff1e6; color: #ea580c; flex: none; }
.ds-mark-ic .ic { width: 18px; height: 18px; }
.ds-mark .btn .ic { width: 14px; height: 14px; }
.ds-ro { font-size: .72rem; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: .1rem .45rem; border-radius: 0; }
.rete-map-wrap.ds-open::after { content: ""; position: absolute; inset: 0; border: 3px solid rgba(234, 88, 12, .6); pointer-events: none; z-index: 700; }
.ds-label-wrap { background: none; border: 0; }
.ds-label { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .45rem; border-radius: 0; background: #7c3aed; color: #fff; font-size: .72rem; font-weight: 700;
  white-space: nowrap; transform: translate(-50%, -130%); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); cursor: pointer; }
.ds-label.on { background: #ea580c; }
.ds-label .ic { width: 12px; height: 12px; }
.ds-ico { background: #fff1e6 !important; color: #ea580c !important; }
.ds-state { display: inline-block; white-space: nowrap; padding: .1rem .5rem; border-radius: 0; font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.ds-state.st-progettazione { background: var(--info-bg); color: var(--info); } .ds-state.st-in_approvazione { background: var(--warn-bg); color: var(--warn); }
.ds-state.st-approvato { background: var(--ok-bg); color: var(--ok); } .ds-state.st-in_costruzione { background: #fff1e6; color: #c2410c; }
.ds-state.st-completato, .ds-state.st-annullato { background: var(--surface-3); color: var(--muted); }
.ds-openflag { font-size: .72rem; font-weight: 700; color: #ea580c; }
.ds-fields { margin-top: .4rem; }
.ds-counts { float: right; display: inline-flex; gap: .4rem; font-style: normal; }
.ds-counts i { font-style: normal; font-weight: 700; font-size: .78rem; }
.op-insert { color: var(--ok); } .op-update { color: #c2410c; } .op-delete { color: var(--danger); }
.ds-group h4 { margin: .6rem 0 .25rem; font-size: .82rem; color: var(--text-2); }
.ds-group h4 small { color: var(--muted); font-weight: 500; }
.ds-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ds-changes li { display: grid; grid-template-columns: 16px 1fr; gap: .45rem; align-items: start; padding: .3rem .35rem; border-radius: 0; font-size: .8rem; }
.ds-changes li[data-ds-go] { cursor: pointer; }
.ds-changes li[data-ds-go]:hover { background: var(--surface-3); }
.ds-changes li .ic { width: 14px; height: 14px; margin-top: 2px; }
.ds-changes li.op-insert .ic { color: var(--ok); } .ds-changes li.op-update .ic { color: #c2410c; } .ds-changes li.op-delete .ic { color: var(--danger); }
.ds-changes li strong { color: var(--text); }
.ds-changes li small { color: var(--muted); }
.ds-field { display: block; color: var(--muted); font-size: .76rem; }
.ds-field s { color: var(--muted); opacity: .8; }
.ds-check { margin: .6rem 0; padding: .6rem .7rem; border-radius: 0; font-size: .8rem; }
.ds-check.ok { background: var(--ok-bg); color: var(--ok); } .ds-check.ko { background: var(--warn-bg); color: var(--text); }
.ds-check strong { display: flex; align-items: center; gap: .35rem; }
.ds-check strong .ic { width: 16px; height: 16px; }
.ds-check h5 { margin: .55rem 0 .2rem; font-size: .78rem; }
.ds-check ul { margin: 0; padding-left: 1rem; display: grid; gap: .2rem; }
.ds-fixable { font-size: .7rem; font-weight: 700; color: var(--ok); }
#rete-map.drawing, #rete-map.drawing .leaflet-interactive { cursor: crosshair !important; }

/* ---------------------------------------------------------------- Rete › Circuiti */
.ci-ico { background: #ecfeff !important; color: #0891b2 !important; }
.ci-list { list-style: none; margin: .3rem 0; padding: 0; display: grid; gap: 2px; }
.ci-list li { display: grid; grid-template-columns: 14px 1fr; gap: .5rem; align-items: center; padding: .4rem .45rem; border-radius: 0; cursor: pointer; font-size: .84rem; }
.ci-list li:hover { background: var(--surface-3); }
.ci-list li .ic { width: 15px; height: 15px; color: var(--muted); }
.ci-list li small { display: block; color: var(--muted); font-size: .76rem; }
.ci-dot { width: 10px; height: 10px; border-radius: 0; }
.ci-dot.ok { background: var(--ok); } .ci-dot.ko { background: var(--danger); }
.ci-ok, .ci-ko { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; }
.ci-ok { color: var(--ok); } .ci-ko { color: var(--danger); }
.ci-ok .ic, .ci-ko .ic { width: 15px; height: 15px; }
.ci-search { margin: .3rem 0 .5rem; }
.ci-search input { width: 100%; }
.ci-steps { list-style: none; margin: .2rem 0; padding: 0; display: grid; gap: 2px; font-size: .8rem; }
.ci-steps li { display: grid; grid-template-columns: 16px 1fr auto; gap: .45rem; align-items: center; padding: .28rem .35rem; border-radius: 0; cursor: pointer; }
.ci-steps li:hover { background: var(--surface-3); }
.ci-steps li .ic { width: 14px; height: 14px; color: var(--muted); }
.ci-steps li.ci-conn .ic { color: #0891b2; }
.ci-steps li em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-steps .fdot { width: 11px; height: 11px; border-radius: 0; display: inline-block; border: 1px solid rgba(0, 0, 0, .25); }
.ci-port { border: 1px solid var(--border); border-radius: 0; padding: .45rem .6rem .55rem; margin: 0; display: grid; gap: .4rem; }
.ci-port legend { font-size: .8rem; font-weight: 600; color: var(--text-2); padding: 0 .3rem; }
.pin-ci { display: inline-flex; align-items: center; gap: 2px; margin-left: .3rem; padding: 0 .35rem; border-radius: 0; background: #ecfeff; color: #0e7490; font-size: .7rem; font-weight: 700; }
.pin-ci .ic { width: 11px; height: 11px; }
[data-theme="dark"] .pin-ci, [data-theme="dark"] .ci-ico { background: rgba(8, 145, 178, .18) !important; color: #67e8f9 !important; }

/* ---------------------------------------------------------------- Distinta materiali e listino */
.bom-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.bom-total div { display: grid; gap: .15rem; }
.bom-total span { font-size: .8rem; color: var(--muted); }
.bom-total strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bom-total .grand strong { color: var(--brand); font-size: 1.5rem; }
.bom-table td, .price-table td { vertical-align: middle; }
.bom-table tfoot td { font-weight: 600; border-top: 2px solid var(--border-strong); }
.price-table input { width: 100%; min-width: 0; }
.price-table input.num { text-align: right; max-width: 120px; margin-left: auto; display: block; }
.warn-text { color: var(--warn); }
@media print { .bom-total { grid-template-columns: repeat(3, 1fr); } .bom-head .actions { display: none; } }
@media (max-width: 720px) { .bom-total { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Rete › Markup e rilievo */
.an-wrap { background: none; border: 0; }
.an-pin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 2px solid var(--ac); color: var(--ac); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.an-pin .ic { width: 15px; height: 15px; }
.an-pin.an-pericolo { border-radius: 50%; background: var(--ac); color: #fff; }
.an-pin.an-text { border-radius: 50%; width: 14px; height: 14px; }
.an-pin.an-text .ic { display: none; }
.leaflet-tooltip.an-text { background: #fff7ed; border: 1.5px solid #ea580c; color: #7c2d12; font-weight: 600; border-radius: 0; padding: .3rem .55rem; max-width: 260px; white-space: normal; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.leaflet-tooltip.an-text::before { border-right-color: #ea580c; }
.an-pop h4 small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.an-pop p { margin: .3rem 0; }
.an-photo { display: block; max-width: 100%; max-height: 200px; border-radius: 0; margin: .3rem 0; }
.rete-pal-item:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------------- Rete › Validazione */
.vl-sum { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border-radius: 0; margin: .2rem 0 .6rem; font-size: .86rem; }
.vl-sum .ic { width: 18px; height: 18px; flex: none; }
.vl-sum.ok { background: var(--ok-bg); color: var(--ok); } .vl-sum.warn { background: var(--warn-bg); color: var(--warn); } .vl-sum.ko { background: var(--danger-bg); color: var(--danger); }
.vl-check { border: 1px solid var(--border); border-radius: 0; margin-bottom: .4rem; overflow: hidden; }
.vl-head { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; gap: .5rem; align-items: center; padding: .5rem .6rem; border: 0; background: var(--surface); font: inherit; font-size: .84rem; text-align: left; cursor: pointer; color: var(--text); }
.vl-head:hover { background: var(--surface-3); }
.vl-head i { width: 10px; height: 10px; border-radius: 0; }
.vl-check.error .vl-head i { background: var(--danger); } .vl-check.warning .vl-head i { background: #f59e0b; }
.vl-head b { font-variant-numeric: tabular-nums; padding: .05rem .5rem; border-radius: 0; background: var(--surface-3); font-size: .76rem; }
.vl-check ul { list-style: none; margin: 0; padding: .2rem .3rem .4rem; border-top: 1px solid var(--border); max-height: 320px; overflow: auto; }
.vl-check li { padding: .3rem .4rem; border-radius: 0; font-size: .78rem; cursor: pointer; }
.vl-check li:hover { background: var(--surface-3); }
.vl-check li span { color: var(--muted); }

.bm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.bm-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; align-items: center; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 0; }
.bm-list li small { color: var(--muted); }
.bm-list .btn .ic { width: 14px; height: 14px; }

.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; font-size: .9rem; }
.dl-grid dt { color: var(--muted); }
.dl-grid dd { margin: 0; }

/* 3.1 — Info fibra e porta: LOC nell'albero, gruppi della modifica, anteprima della propagazione */
.pin-loc { margin-left: .3rem; padding: 0 .35rem; border-radius: 0; background: #f0fdf4; color: #15803d; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.pin-loc.loc-riserva { background: #fffbeb; color: #b45309; }
.pin-loc.loc-morta { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
[data-theme="dark"] .pin-loc { background: rgba(22, 163, 74, .18); color: #86efac; }
.fi-group { border: 1px solid var(--border, #e5e7ef); border-radius: 0; padding: .4rem .7rem .6rem; margin: 0 0 .6rem; }
.fi-group legend { padding: 0 .3rem; font-weight: 600; }
.fi-attrs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .4rem 0 .6rem; }
.fi-list { max-height: 180px; overflow: auto; margin: .3rem 0 0; padding-left: 1.2rem; font-size: .8rem; columns: 2; }
.ws-chip.bad { background: #fee2e2; color: #b91c1c; }
.rete-grid tr.on td { background: #fff3eb; }

/* 3.1 — Posa in serie */
.rete-strand { width: 300px; }
.rete-strand .st-tabs { display: flex; gap: .25rem; margin: .2rem 0 .5rem; }
.rete-strand .st-tabs button { flex: 1; padding: .3rem; border: 1px solid var(--border, #e5e7ef); border-radius: 0; background: transparent; cursor: pointer; font-weight: 600; }
.rete-strand .st-tabs button.active { background: #FF6400; border-color: #FF6400; color: #fff; }
.rete-strand .rete-f { display: block; margin-bottom: .35rem; }
.rete-strand .rete-f select { width: 100%; }
.rete-strand .st-count { margin: .3rem 0; font-weight: 600; }
.rete-strand .st-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.rete-strand .st-actions .btn.active { outline: 2px solid #FF6400; }
.rete-strand > *:not(.rete-side-head) { margin-left: 12px; margin-right: 12px; }

/* 3.1 — Correttore dati */
.rete-fixer { width: 340px; max-height: 70vh; overflow: auto; }
.rete-fixer > *:not(.rete-side-head) { margin-left: 12px; margin-right: 12px; }
.rete-fixer h4 { margin: .6rem 12px .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #6b7280); }
.rete-fixer .fx-ops { display: flex; flex-wrap: wrap; gap: .35rem; }
.rete-fixer .fx-list { list-style: none; padding: 0; }
.rete-fixer .fx-list li { display: flex; align-items: center; gap: .4rem; padding: .3rem 0; border-bottom: 1px solid var(--border, #e5e7ef); }
.rete-fixer .fx-go { flex: 1; display: flex; flex-direction: column; align-items: flex-start; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.rete-fixer .fx-go small { color: var(--muted, #6b7280); }
.rete-grid tr.bad td { background: #fef2f2; }
.rete-confirm-list { margin: .3rem 0 .6rem; padding-left: 1.2rem; }

.rete-map.grabbing, .rete-map.grabbing * { cursor: grabbing !important; }

/* the selection breathes, so it is seen also among many objects */
@keyframes sel-glow { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .45; } }
.rete-map path.sel-glow { animation: sel-glow 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .rete-map path.sel-glow { animation: none; } }

.rete-pop li[data-pop-go] { cursor: pointer; border-radius: 0; }
.rete-pop li[data-pop-go]:hover { background: var(--surface-3); }
.rete-pop li[data-pop-go]:hover strong { color: var(--link); text-decoration: underline; }

/* ---------------------------------------------------------------- Rete › selezione multipla */
/* inside the «Clic singolo» box (.rete-maptools), right above it, right edges aligned */
.sel-box { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 2; width: 300px; max-height: min(360px, calc(100vh - 330px)); display: flex; flex-direction: column;
  background: var(--surface); border: 2px solid #06b6d4; border-radius: 0; box-shadow: var(--shadow-lg); cursor: default; }
.rete-maptools.has-sel { z-index: 1001; }
.sel-box.sel-box-below { bottom: auto; top: calc(100% + 8px); }
.sel-box.sel-box-left { right: auto; left: 0; }
.sel-box.sel-box-free { right: 12px; bottom: 84px; z-index: 850; }
.sel-box[hidden] { display: none; }
.sel-box-list { min-height: 2.2rem; }
.sel-box-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sel-box-list li small { color: var(--muted); font-size: .72rem; flex: none; }
.sel-box-head { display: flex; align-items: center; justify-content: space-between; padding: .45rem .5rem .3rem .75rem; }
.sel-box-head strong { font-size: .88rem; }
.sel-box-kinds { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0 .7rem .4rem; }
.sel-box-kinds span { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 600; padding: .1rem .5rem; border-radius: 0; background: #ecfeff; color: #0e7490; }
.sel-box-kinds .ic { width: 13px; height: 13px; }
.sel-box-list { list-style: none; margin: 0; padding: .2rem .35rem; overflow: auto; flex: 1; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sel-box-list li { display: flex; align-items: center; gap: .4rem; padding: .22rem .4rem; border-radius: 0; font-size: .8rem; cursor: pointer; }
.sel-box-list li:hover { background: var(--surface-3); }
.sel-box-list li .ic { width: 14px; height: 14px; color: var(--muted); flex: none; }
.sel-box-actions { display: flex; gap: .35rem; justify-content: flex-end; padding: .45rem .5rem; }
.sel-box-actions .ic { width: 14px; height: 14px; }
.rete-ibtn.danger { color: var(--danger); }
.del-list { margin: .2rem 0 .6rem; padding-left: 1.1rem; max-height: 220px; overflow: auto; font-size: .85rem; display: grid; gap: .15rem; }
.del-list.warn li { color: var(--text); } .del-list.warn li strong { color: #c2410c; }
.del-list.ko li { color: var(--muted); } .del-list.ko li strong { color: var(--danger); }
[data-theme="dark"] .sel-box-kinds span { background: rgba(8, 145, 178, .18); color: #67e8f9; }

/* ---------------------------------------------------------------- Rete › simboli quadrati (Impostazioni › Mappa) */
.sym-badge.sym-sq { border-radius: 0; }
.sym-badge.sym-sq.sym-small { border-radius: 0; }
.sel-sq-wrap { pointer-events: none; }
.sel-sq-out, .sel-sq { position: absolute; box-sizing: border-box; border-radius: 0; }
.sel-sq-out { inset: 0; border: 2px solid var(--c); opacity: .5; }
.sel-sq { border: 4px solid var(--c); background: color-mix(in srgb, var(--c) 26%, transparent); }
.sel-sq.sel-glow { animation: sel-sq-glow 1.6s ease-in-out infinite; }
@keyframes sel-sq-glow { 0%, 100% { border-color: var(--c); } 50% { border-color: color-mix(in srgb, var(--c) 45%, transparent); } }
@media (prefers-reduced-motion: reduce) { .sel-sq.sel-glow { animation: none; } }

/* ---------------------------------------------------------------- Spigoli vivi (come NexoraOne 3.0.0-rc.79 e Hitora 2.16)
   Angoli a 0 nei valori sopra, senza eccezioni nell'interfaccia (anche avatar, pallini indicatori e campioni di colore);
   sulla mappa i simboli seguono Impostazioni › Mappa › Forma dei simboli. Niente ombre su schede, pulsanti e campi: le
   schede compensano con il bordo più marcato. Restano l'ombra delle finestre e dei riquadri sopra la mappa e l'anello di focus. */
.card, .stat, .report-card, .pub-card, .org-node, .settings-card { box-shadow: none; border-color: var(--border-strong); }
a.stat:hover, .report-card:hover { box-shadow: none; transform: none; }
.btn, .btn:active, .btn-primary, .cc-btn, .tabs a.active, .portal-nav a.active, .gis-tabs button.active, .rete-tabs.tabs button.active, input, select, textarea { box-shadow: none; }
input:focus, select:focus, textarea:focus, .cc-btn:focus-visible, .cc-btn[aria-expanded="true"] { box-shadow: var(--ring); }
.avatar, .org-avatar { overflow: hidden; object-fit: cover; }
.manual-figure img { box-shadow: none; border: 1px solid var(--border-strong); }

/* ---------------------------------------------------------------- Impostazioni › Mappa › colori dei simboli */
.sym-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem .9rem; margin: .3rem 0 .6rem; }
.form .sym-color, .sym-color { display: flex; flex-direction: row; align-items: center; gap: .55rem; margin: 0; font-size: .86rem; font-weight: 500; }
.form .sym-color input[type="color"], .sym-color input[type="color"] { width: 38px; height: 30px; padding: 2px; margin: 0; flex: none; }
.sym-color small { display: block; color: var(--muted); font-size: .72rem; }

/* ---------------------------------------------------------------- selettore colore di Fibora (app.js) */
input[type="color"] { cursor: pointer; }
.cpick { position: fixed; z-index: 3000; width: 236px; padding: .55rem; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.cpick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cpick-sw { width: 26px; height: 26px; padding: 0; border: 1px solid rgba(0, 0, 0, .2); background: var(--c); cursor: pointer; }
.cpick-sw:hover, .cpick-sw:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.cpick-sw.on { outline: 2px solid var(--brand); outline-offset: 1px; }
.cpick-row { display: flex; align-items: center; gap: .35rem; margin-top: .5rem; }
.cpick-now { width: 26px; height: 26px; flex: none; background: var(--c); border: 1px solid rgba(0, 0, 0, .2); }
.cpick .cpick-hex { flex: 1; min-width: 0; height: 30px; margin: 0; padding: .2rem .45rem; font-family: var(--mono, monospace); font-size: .82rem; }
.cpick .cpick-hex.bad { border-color: var(--danger); }
.cpick-more { display: block; width: 100%; margin-top: .4rem; padding: .3rem; border: 0; background: none; color: var(--link); font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
.cpick-more:hover { text-decoration: underline; }

/* palette pronte dei simboli */
.sym-palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; margin: .3rem 0 .8rem; }
.sym-palette { display: flex; flex-direction: column; align-items: stretch; gap: .35rem; padding: .5rem .6rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; text-align: left; cursor: pointer; }
.sym-palette:hover { border-color: var(--brand); }
.sym-palette.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.sym-palette small { color: var(--muted); font-weight: 400; font-size: .74rem; }
.sym-palette-strip { display: flex; height: 14px; }
.sym-palette-strip i { flex: 1; background: var(--c); }

/* ---------------------------------------------------------------- Rete › pallino sulle tratte con contenuto (tubi, cavi) */
.route-dot-wrap { pointer-events: none; }
.route-dot { display: block; width: 12px; height: 12px; border-radius: 50%; background: #facc15; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(17, 24, 39, .7); box-sizing: border-box; }
.layer-sym.sym-routedot { width: 12px; height: 12px; border-radius: 50%; background: #facc15; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
/* square symbols (Impostazioni › Mappa): the dots go square with them — on the structures, on the routes, at the
   anchor of a fanned-out symbol and in the legend of the layers */
.leader-sq-wrap { pointer-events: none; }
.leader-sq { display: block; width: 8px; height: 8px; border: 1.5px solid #fff; box-sizing: border-box; }
.shape-square .route-dot, .shape-square .sym-dot, .shape-square .layer-sym.sym-routedot { border-radius: 0; }
