/* zero1dev AI Gateway — webui. Token di marca in brand/tokens.css (tema dark). */

:root {
  /* Alias locali sui token di marca (brand/tokens.css): nessun hex qui. */
  --bg: var(--z1-bg);
  --surface: var(--z1-bg-elevated);
  --surface-2: var(--z1-input-bg);
  --border: var(--z1-border);
  --text: var(--z1-fg);
  --text-dim: var(--z1-muted);
  --text-faint: color-mix(in srgb, var(--z1-fg) 52%, transparent);
  --accent: var(--z1-brand);
  --accent-2: var(--z1-brand);
  --accent-soft: var(--z1-brand-soft);
  /* Un solo accento: gli stati usano i neutri, il rosso solo per gli errori. */
  --success: var(--z1-fg);
  --success-soft: color-mix(in srgb, var(--z1-fg) 10%, transparent);
  --danger: #e5484d;
  --danger-soft: color-mix(in srgb, #e5484d 15%, transparent);
  --warning: var(--z1-fg);
  --radius: var(--z1-radius-md);
  --radius-lg: var(--z1-radius-lg);
  --font: var(--z1-font-ui);
  --font-mono: var(--z1-font-mono);
}

* { box-sizing: border-box; }
/* L'attributo hidden deve vincere anche su elementi con display inline (es. la riga dei pulsanti dei livelli). */
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; flex-shrink: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────────────────── */

.shell {
  display: flex;
  min-height: 100vh;
}

/* Menu laterale (docu/piano-multi-azienda.md §4.6): marchio in card, Azienda in vista, voci, Riduci e utente in fondo.
   Colori solo dai token --z1-*; da 861px "Riduci" lo porta a sole icone (classe rail-collapsed sul body). */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20; /* sopra il contenuto: il pannello utente esce dal menu */
}

.sb-brand { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.brand { display: flex; align-items: center; gap: 10px; }
.sb-brand .brand { padding: 12px 14px; }
.brand-logo { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo img { height: 32px; width: 32px; display: block; }
.brand-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.brand-name small { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-faint); }

/* Azienda in vista (solo piattaforma) */
.scope { display: flex; flex-direction: column; gap: 4px; }
.scope-label { padding-left: 2px; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.scope-select { text-overflow: ellipsis; cursor: pointer; padding: 8px 10px; font-size: 13px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:focus-visible, .rail-toggle:focus-visible, .usermenu-trigger:focus-visible, .usermenu-item:focus-visible { outline: 2px solid var(--z1-brand); outline-offset: -2px; }
/* Voce attiva piena nel colore d'accento; testo scuro di marca per il contrasto. */
.nav-item.active, .nav-item.active:hover { background: var(--accent); color: var(--z1-on-light); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-sep { margin: 8px 0 4px; padding: 12px 12px 0; border-top: 1px solid var(--border); flex-shrink: 0; }
.nav-sep span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }

/* Fondo del menu: Riduci e utente */
.sb-bottom { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border); padding-top: 12px; }

.rail-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--text-dim);
  font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.rail-toggle:hover { background: var(--surface-2); color: var(--text); }
.rail-toggle svg { width: 18px; height: 18px; }
.rail-icon-open, .rail-icon-closed { display: inline-flex; }
.rail-icon-closed { display: none; }

.usermenu { position: relative; }
.usermenu-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--text);
  font-size: 13.5px; text-align: left; cursor: pointer; transition: background 150ms ease;
}
.usermenu-trigger:hover { background: var(--surface-2); }
.usermenu-avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--z1-on-light); font-size: 13px; font-weight: 600;
}
.usermenu-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-panel {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; width: 100%; min-width: 15rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--z1-shadow-strong); overflow: hidden;
}
.usermenu-head { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); display: flex; flex-direction: column; gap: 2px; }
.usermenu-head > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-head-name { color: var(--text); font-weight: 500; font-size: 13.5px; }
.usermenu-k { display: inline-block; min-width: 3.5rem; color: var(--text-faint); }
.usermenu-item {
  display: block; width: 100%; padding: 10px 14px; border: 0; background: transparent; color: var(--text);
  font-size: 13.5px; text-align: left; cursor: pointer; transition: background 150ms ease;
}
.usermenu-item:hover { background: var(--surface-2); }
.usermenu-item.danger { color: var(--danger); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 16px; font-weight: 600; margin: 0; white-space: nowrap; }
.topbar .sub { color: var(--text-faint); font-size: 12.5px; }
/* Azienda in vista, sempre visibile anche con il menu ridotto */
.scope-badge {
  max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 10px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft);
  font-size: 12px; font-weight: 600; color: var(--text);
}

.content { padding: 24px; flex: 1; }

.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .sidebar { transition: width 200ms cubic-bezier(0.22, 1, 0.36, 1); }
}

/* Menu ridotto a sole icone: solo da 861px (sotto resta il cassetto) */
@media (min-width: 861px) {
  body.rail-collapsed .sidebar { width: 76px; padding: 12px; }
  body.rail-collapsed .brand-name, body.rail-collapsed .scope, body.rail-collapsed .nav-item span,
  body.rail-collapsed .nav-sep span, body.rail-collapsed .rail-toggle-label, body.rail-collapsed .usermenu-name { display: none; }
  body.rail-collapsed .sb-brand .brand { justify-content: center; padding: 10px 0; }
  body.rail-collapsed .nav-item { justify-content: center; padding: 0; height: 44px; }
  body.rail-collapsed .nav-sep { padding: 0; margin: 8px 4px; }
  body.rail-collapsed .rail-toggle { justify-content: center; padding: 0; height: 44px; }
  body.rail-collapsed .rail-icon-open { display: none; }
  body.rail-collapsed .rail-icon-closed { display: inline-flex; }
  body.rail-collapsed .usermenu-trigger { justify-content: center; padding: 6px 0; }
  body.rail-collapsed .usermenu-panel { width: 15rem; }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; height: auto; transform: translateX(-100%); transition: transform 200ms ease; }
  .sidebar.open { transform: translateX(0); }
  .rail-toggle { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .nav-toggle { display: inline-flex; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* Budget dell'Azienda: barra di consumo */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.meter-fill.full { background: var(--danger); }

/* ── Componenti ─────────────────────────────────────────────────────── */

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

/* Box impostazioni esplodibili (<details>) */
.settings-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 14px; overflow: hidden; }
.settings-box summary { display: flex; align-items: center; gap: 8px; padding: 16px 18px; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; user-select: none; }
.settings-box summary::-webkit-details-marker { display: none; }
.settings-box summary .chevron { margin-left: auto; color: var(--text-faint); transition: transform 150ms ease; }
.settings-box[open] summary .chevron { transform: rotate(90deg); }
.settings-box-body { padding: 0 18px 18px; border-top: 1px solid var(--border); }
.settings-box-body .card { border: none; padding: 0; }

/* Riga modulo (toggle + label/descrizione) nel box Ottimizzazione token */
.module-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.module-row:last-child { border-bottom: none; }
.module-row input { width: 16px; height: 16px; accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.module-info { display: flex; flex-direction: column; gap: 2px; }
.module-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.module-desc { font-size: 12px; color: var(--text-faint); }

.stat-tile { display: flex; flex-direction: column; gap: 6px; }
.stat-tile .label { font-size: 12px; color: var(--text-faint); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-tile .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-tile .value.accent { color: var(--accent-2); }
.stat-tile .delta { font-size: 12px; color: var(--text-dim); }

.section-title { font-size: 14px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .hint { font-size: 12px; font-weight: 400; color: var(--text-faint); margin-left: auto; }
.section-title svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-faint); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.on { background: var(--success-soft); color: var(--success); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: var(--surface-2); color: var(--text-dim); }
.badge.sm { padding: 2px 7px; font-size: 10.5px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 150ms ease, border-color 150ms ease, opacity 150ms;
}
.btn:hover { background: color-mix(in srgb, var(--z1-fg) 8%, var(--surface-2)); border-color: color-mix(in srgb, var(--z1-fg) 30%, transparent); }
.btn:focus-visible { outline: 2px solid var(--z1-brand); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--z1-brand-hover); border-color: var(--z1-brand-hover); }
.btn.danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

/* Azioni di riga: icone senza bordo, allineate a destra, tooltip via title */
.row-actions { flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-actions-sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-dim); cursor: pointer; transition: background 150ms ease, color 150ms ease; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--z1-brand); outline-offset: 2px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn svg { width: 16px; height: 16px; }

.toolbar select { width: auto; min-width: 180px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-faint); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { margin: 4px 0; }

/* Form */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.field .helper { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="email"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; color: var(--text); font-size: 13.5px; font-family: inherit;
}
/* Cromo nativo di type="date"/type="time" (icona calendario/orologio,
   indicatori) resta chiaro anche su sfondo scuro se non forzato — stesso bug
   gia' visto su type="email"/type="date", stessa correzione. */
input[type="date"], input[type="time"] { color-scheme: dark; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--z1-brand); outline-offset: 2px; border-color: var(--accent); }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
@media (max-width: 560px) { .checkbox-grid { grid-template-columns: 1fr 1fr; } }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 12.5px; font-family: var(--font-mono); }
.chip button { background: none; border: none; color: var(--text-faint); cursor: pointer; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chip button:hover { background: var(--danger-soft); color: var(--danger); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 560px; padding: 22px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h2 { font-size: 16px; margin: 0; }
.modal-header button { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; font-size: 13px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: toast-in 200ms ease; }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.status-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.status-row:last-child { border-bottom: none; }
.status-row .k { color: var(--text-dim); flex-shrink: 0; }
/* Valori lunghi (URL del price map, ecc.) vanno a capo invece di uscire dal
   riquadro — min-width:0 serve perche' il figlio di un flex item non si
   restringe sotto il proprio contenuto senza, anche con word-break. */
.status-row .v { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); text-align: right; word-break: break-all; min-width: 0; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent-2); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.login-card .brand { padding: 0 0 20px; border: none; justify-content: center; }
.login-card .brand-logo img { height: 40px; width: 40px; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.route-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px; }
.route-card .name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.route-card .meta { color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); }
.route-card .actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Dipendenti (card, non tabella — troppo stretta con 5+ azioni per riga) ── */

.group-chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.group-chip {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 8px 8px 8px 14px;
}
.group-chip-info { display: flex; flex-direction: column; gap: 2px; }
.group-chip-name { font-weight: 600; font-size: 13.5px; }
.group-chip-count { font-size: 11.5px; color: var(--text-faint); }
.group-chip-add {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px dashed var(--border); border-radius: var(--radius-lg);
  color: var(--text-dim); font-size: 13px; font-weight: 500; padding: 10px 16px;
  cursor: pointer; transition: border-color 150ms ease, color 150ms ease;
}
.group-chip-add:hover { border-color: var(--accent); color: var(--text); }

.emp-list { display: flex; flex-direction: column; gap: 12px; }
.emp-card { display: flex; flex-direction: column; gap: 16px; }
.emp-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.emp-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.emp-email { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-group-field { display: flex; align-items: center; gap: 8px; }
.emp-group-field .k { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.emp-group-field select { width: auto; min-width: 160px; }
.emp-ignore-auth-field { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.emp-ignore-auth-field .k { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.emp-ignore-auth-field input { width: 15px; height: 15px; accent-color: var(--accent); }
.emp-card-stats {
  display: flex; flex-wrap: wrap; gap: 28px;
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.emp-stat { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.emp-stat .k { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.emp-card-actions { margin-left: auto; align-self: center; }

.access-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 8px; transition: background 150ms; cursor: pointer; position: relative; }
.access-row:hover { background: var(--surface-2); }
.access-row.dragging { opacity: 0.4; background: var(--surface-2); border: 1px dashed var(--accent); }
.access-row.disabled { opacity: 0.6; }
.access-drag-handle { color: var(--text-faint); cursor: grab; padding: 2px 0; margin-top: 2px; }
.access-drag-handle:active { cursor: grabbing; }
.access-check { display: flex; align-items: center; margin-top: 2px; }
.access-check input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.access-row-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.access-row-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.access-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.access-row-toggle { flex-shrink: 0; margin-left: 8px; }
.access-list-sortable { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }

/* Listino prezzi: tabella larga con filtri per colonna */
.table-scroll { overflow: auto; max-height: calc(100vh - 250px); }
.table-scroll table { width: max-content; min-width: 100%; }
.table-scroll thead th { position: sticky; background: var(--surface); z-index: 2; white-space: nowrap; }
.table-scroll thead tr:first-child th { top: 0; cursor: pointer; user-select: none; }
.table-scroll thead tr.filter-row th { top: 33px; padding: 4px 6px; cursor: default; text-transform: none; }
.table-scroll .filter-row input, .table-scroll .filter-row select { width: 100%; min-width: 64px; font-size: 12px; padding: 4px 6px; }
.table-scroll td { white-space: nowrap; }
.sort-ind { color: var(--accent-2); margin-left: 4px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 4px 2px; color: var(--text-dim); font-size: 12.5px; flex-wrap: wrap; }
