/* ============ Gestionale Spedizioni ============ */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #1a2233;
  --muted: #667085;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-50: #eff4ff;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --sidebar: #0f1b33;
  --sidebar-text: #c6d0e3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.grow { flex: 1; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: #fff; padding: 18px 18px 14px; }
.brand-lg { color: var(--text); font-size: 20px; padding: 0 0 12px; justify-content: center; }
.brand-logo { font-size: 20px; }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; overflow-y: auto; }
.nav-caption { color: #7f939d; font-size: 11px; padding: 3px 12px 8px; text-transform: capitalize; }
.nav a { color: var(--sidebar-text); padding: 9px 12px; border-radius: 8px; display: flex; gap: 10px; align-items: center; font-weight: 500; }
.nav-group-toggle { width: 100%; border: 0; background: transparent; color: var(--sidebar-text); padding: 9px 12px; border-radius: 0; display: flex; gap: 10px; align-items: center; font: inherit; cursor: pointer; text-align: left; }
.nav-group-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-group-toggle .nav-chevron { margin-left: auto; font-size: 18px; }
.nav-group.open .nav-group-toggle { background: transparent; color: var(--sidebar-text); }
.nav-submenu { display: none; margin: 0 -10px; padding: 0 0 6px 20px; background: rgba(255,255,255,.08); }
.nav-group.open .nav-submenu { display: block; }
.nav a.nav-subitem { border-radius: 0; padding: 6px 12px 6px 0; font-size: 12.5px; color: #8fa8b2; }
.nav a.nav-subitem:hover { color: #fff; background: transparent; }
.nav a.nav-subitem.active { color: #fff; background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 #60a5fa; font-weight: 700; }
.nav-arrow { margin-left: auto; font-size: 18px; color: #aabac0; }
.badge-new { margin-left: auto; background: #3194bb; color: #fff; border-radius: 3px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.nav-cta { background: var(--primary); color: #fff; margin: 6px 0; }
.nav a.nav-cta:hover { background: var(--primary-600); }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.nav-badge { margin-left: auto; background: #f59e0b; color: #111; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 8px 4px; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot .btn-ghost { color: var(--sidebar-text); }
.user-box { font-size: 12px; line-height: 1.3; }
.user-box b { color: #fff; font-size: 13px; display: block; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 20; }
.quick-search { flex: 1; max-width: 560px; }
.quick-search input { width: 100%; }
.menu-btn { display: none; }
.view { padding: 24px; max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-code { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.btn-code:hover { background: #e0e7ff; }
.page-sub { color: var(--muted); margin-top: 2px; }

/* ---------- card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.card-head h2 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
.grid > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }

/* KPI */
.kpi { display: block; color: inherit; }
.kpi:hover { text-decoration: none; border-color: #c7d4ea; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.warn .value { color: var(--warning); }
.kpi.danger .value { color: var(--danger); }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bars .bar i { display: block; width: 100%; max-width: 34px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bar i.zero { background: var(--border); }
.bars .bar span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 100%; }
.bars .bar b { font-size: 11px; font-weight: 600; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.hbar .name { width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { flex: 1; background: var(--surface-2); border-radius: 4px; height: 10px; overflow: hidden; }
.hbar .fill { background: var(--primary); height: 100%; }
.hbar .n { width: 36px; text-align: right; font-weight: 600; }

/* ---------- form ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 550; color: #344054; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: #fff; border: 1px solid #cfd6e1; border-radius: 8px; padding: 8px 10px;
  min-height: 38px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--primary); }
input[readonly] { background: var(--surface-2); }
textarea { min-height: 70px; resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.c-1 { grid-column: span 1; } .c-2 { grid-column: span 2; } .c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; }
.c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-9 { grid-column: span 9; } .c-10 { grid-column: span 10; } .c-11 { grid-column: span 11; } .c-12 { grid-column: span 12; }
.req::after { content: " *"; color: var(--danger); }
.form-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.input-group { display: flex; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { border: 1px solid #cfd6e1; border-left: 0; background: var(--surface-2); padding: 0 10px; display: flex; align-items: center;
  border-radius: 0 8px 8px 0; color: var(--muted); font-size: 13px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { min-width: 150px; }
.filters .search { flex: 1; min-width: 220px; }

/* ---------- bottoni ---------- */
.btn { font: inherit; font-weight: 550; font-size: 13.5px; border: 1px solid #cfd6e1; background: #fff; color: var(--text); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; white-space: nowrap; line-height: 1; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-danger { color: var(--danger); border-color: #f3c2c2; }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.95); background: var(--success); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); }
.btn-sm { padding: 5px 10px; min-height: 30px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 5px 8px; min-height: 30px; }

/* ---------- tabelle ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: #fafbfd; }
tbody tr.clickable { cursor: pointer; }
tbody tr.selected { background: var(--primary-50); }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-compact th, .table-compact td { padding: 7px 10px; }
.tracking-carrier-row td { background: #eef4ff; border-top: 2px solid #b8cdfc; color: #173b83; font-size: 15px; padding-top: 12px; }
.tracking-carrier-row:first-child td { border-top: 0; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
table input { min-height: 34px; padding: 6px 8px; }

/* selezione multipla */
.bulkbar { display: flex; align-items: center; gap: 8px; background: var(--primary-50); border: 1px solid #c9d8fb; padding: 8px 12px; border-radius: 8px;
  margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-gray { background: #f2f4f7; color: #475467; }
.b-blue { background: #eff4ff; color: #1d4ed8; }
.b-indigo { background: #eef0ff; color: #4338ca; }
.b-amber { background: #fff7e6; color: #b45309; }
.b-green { background: #ecfdf3; color: #15803d; }
.b-red { background: #fef2f2; color: #b91c1c; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f2f4f7; font-size: 12px; font-weight: 600; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 550; padding: 10px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs button .count { background: #eef2f7; border-radius: 999px; padding: 1px 7px; font-size: 11.5px; margin-left: 4px; }

/* definizioni */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.address { line-height: 1.55; }
.address b { font-size: 15px; }

/* riepilogo costi */
.quote { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.quote .row { display: flex; justify-content: space-between; padding: 3px 0; }
.quote .row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 15px; }
.warn-box { background: #fff7e6; color: #92400e; border: 1px solid #fde3b0; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.info-box { background: var(--primary-50); color: #1e3a8a; border: 1px solid #c9d8fb; padding: 10px 14px; border-radius: 8px; font-size: 13px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff;
  border: 2px solid var(--primary); }
.timeline li:first-child::before { background: var(--primary); }
.timeline .when { font-size: 12px; color: var(--muted); }

/* autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .15); z-index: 50; max-height: 280px; overflow-y: auto; }
.ac-list div { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f3f6; }
.ac-list div:last-child { border-bottom: 0; }
.ac-list div:hover, .ac-list div.active { background: var(--primary-50); }

/* ---------- modale ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.lg { max-width: 860px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2);
  border-radius: 0 0 12px 12px; }

/* toast */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 420px;
  animation: slidein .2s ease-out; font-size: 13.5px; }
.toast.error { background: var(--danger); }
.toast.success { background: #15803d; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* login */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f1b33, #1e3a8a); padding: 16px; }
.login-card { background: #fff; padding: 32px; border-radius: 14px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .3); }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 6px; align-items: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -250px; z-index: 60; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-flex; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid > * { grid-column: span 12; }
}
@media (max-width: 560px) {
  .item-detail { grid-template-columns: 1fr; gap: 18px; }
  .item-detail-image { min-height: 240px; }
  .item-detail-image img { height: min(50vh, 360px); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 20px; }
  .bars { gap: 2px; }
  .bars .bar:nth-child(even) span { visibility: hidden; }
  .dl { grid-template-columns: 1fr; }
}

/* ---------- ordini / preparazione ---------- */
.progress { background: #eef2f7; border-radius: 999px; height: 8px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .2s; }
.progress.done > span { background: var(--success); }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #f2f4f7; border: 1px solid var(--border); display: block; }
.thumb.ph { display: flex; align-items: center; justify-content: center; color: #98a2b3; font-size: 18px; }
.scan-box { display: flex; gap: 10px; align-items: center; background: var(--primary-50); border: 2px dashed #9db8f5; border-radius: 10px; padding: 12px 14px; }
.scan-box input { font-size: 17px; font-family: ui-monospace, Consolas, monospace; min-height: 46px; }
.scan-box.ok { border-color: var(--success); background: #ecfdf3; }
.scan-box.err { border-color: var(--danger); background: #fef2f2; }
.qty-ctl { display: inline-flex; align-items: center; gap: 4px; }
.qty-ctl b { min-width: 42px; text-align: center; font-size: 15px; }
tr.picked-done td { background: #f3fbf6; }
.item-row { cursor: pointer; }
.item-row:focus-visible td { outline: 2px solid var(--primary); outline-offset: -2px; }
.item-detail { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, .8fr); gap: 28px; align-items: start; }
.item-detail-image { min-height: 340px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.item-detail-image img { display: block; width: 100%; height: min(58vh, 520px); object-fit: contain; cursor: zoom-in; }
.item-detail-image img:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.product-variants { margin-top: 24px; }
.product-variants h3 { margin-bottom: 8px; }
.product-image-zoom { display: flex; align-items: center; justify-content: center; min-height: 60vh; background: #f8fafc; border-radius: 10px; }
.product-image-zoom img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.item-detail-placeholder { color: #98a2b3; font-size: 64px; }
.item-detail-info { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.item-detail-info div { display: flex; flex-direction: column; gap: 4px; }
tr.flash td { animation: flash 1s ease-out; }
@keyframes flash { from { background: #bbf7d0; } to { background: transparent; } }
.big-check { color: var(--success); font-size: 18px; font-weight: 700; }
.dashboard-attention { padding: 0; overflow: hidden; margin-top: 16px; }
.dashboard-attention .card-head { padding: 16px 18px 0; }
.attention-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--text); }
.attention-row:hover { background: var(--surface-2); text-decoration: none; }
.attention-row b { color: var(--warning); }
.danger-text { color: var(--danger); font-weight: 650; }
.status-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid #b7e4c7; background: #ecfdf3; margin-bottom: 16px; }
.status-banner.warn { border-color: #fde3b0; background: #fff7e6; }
.status-banner.danger { border-color: #fecaca; background: #fef2f2; }
.shop-card .card-head h2 { display: flex; gap: 8px; align-items: center; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
code.inline { background: #f2f4f7; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }

/* ---------- spazi (clienti) ---------- */
.space-switch select { min-width: 220px; font-weight: 600; background: var(--primary-50); border-color: #c9d8fb; }
.space-banner { background: #fff7e6; border-bottom: 1px solid #fde3b0; color: #92400e; padding: 8px 24px; display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; flex-wrap: wrap; }
.space-banner .btn { min-height: 28px; padding: 4px 10px; font-size: 12.5px; }
.client-chip { display: inline-block; background: rgba(255,255,255,.12); color: #fff; font-size: 11.5px; border-radius: 6px; padding: 2px 8px; margin-top: 2px; }

/* ---- gerarchia clienti, magazzino ---- */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.space-banner.all { background: #eef4ff; border-bottom-color: #c7d7fe; color: #1e3a8a; }
.scan-form { display: flex; gap: 8px; }
.scan-form input { flex: 1; font-size: 17px; padding: 12px 14px; }
.scan-last { margin-top: 12px; border-radius: 10px; padding: 12px 14px; border: 1px solid var(--border); }
.scan-last.ok { background: #ecfdf3; border-color: #a6f4c5; }
.scan-last.warn { background: #fffaeb; border-color: #fedf89; }
.scan-last.err { background: #fef3f2; border-color: #fecdca; color: var(--danger); }
.scan-carrier { font-size: 26px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.hub-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.hub-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub-carrier { font-size: 18px; font-weight: 750; }
.hub-group .table-wrap { margin-top: 10px; }
.list-link { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.list-link:first-of-type { border-top: 0; }
.list-link:hover b { color: var(--primary, #2563eb); }
.tree-name { display: flex; align-items: center; gap: 6px; }
.tree-indent { display: inline-block; color: var(--muted); }
.tag-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.access-list { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.access-list label { display: flex; flex-direction: row; gap: 8px; align-items: center; padding: 5px 0; font-weight: 500; font-size: 13.5px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 10px; font-weight: 650; }
.cell-main.mono, td.mono { white-space: nowrap; }
/* ---- verifica in due passaggi ---- */
.twofa-card { max-width: 420px; }
.code-input { font-size: 24px; letter-spacing: .25em; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; }
.qr-box { display: flex; justify-content: center; }
.qr-box svg { width: 200px; height: 200px; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.center { text-align: center; }
/* ---- notifiche ---- */
.notif-wrap { position: relative; margin-left: auto; }
.notif-btn { font-size: 18px; position: relative; min-width: 40px; }
.notif-count { position: absolute; top: 2px; right: 0; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 5px; line-height: 1.3; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,27,51,.18); z-index: 60; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif-enable { margin: 10px 14px 0; width: calc(100% - 28px); }
.notif-list { max-height: 420px; overflow: auto; padding: 6px 0; }
.notif-item { display: block; padding: 9px 14px; color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { border-left-color: var(--primary, #2563eb); background: #f5f8ff; }
.notif-title { font-weight: 650; }
