/* Stile condiviso con GestioneWeb: palette e struttura da synapse.css / portal.css.
   Riferimento consultato in sola lettura: GestioneWeb.Server/wwwroot, 17/11/2026. */
:root {
  --ink: #132238;
  --muted: #5f6f82;
  --line: #dce3ea;
  --paper: #fff;
  --wash: #f4f7fa;
  --blue: #1463d9;
  --blue-dark: #0d4ba7;
  --navy: #10233d;
  --green: #167254;
  --amber: #946313;
  --red: #c8333c;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif; background: var(--wash); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
button { cursor: pointer; font-weight: 600; border: 1px solid #bdc8d4; border-radius: 7px; padding: 9px 14px; background: #fff; color: var(--ink); }
button:hover { background: #f0f4f8; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-size: 29px; line-height: 1.25; margin-bottom: 7px; font-weight: 650; }
h2 { font-size: 17px; margin-bottom: 0; }
h3 { font-size: 15px; margin-bottom: 9px; }
p { color: var(--muted); }
.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { color: var(--blue); border-color: #cad7e7; }
.text-button { padding: 0; border: 0; background: none; color: var(--blue); font-size: 12px; font-weight: 600; }
.text-button:hover { background: none; text-decoration: underline; }
.primary, .secondary { font-size: 12px; white-space: nowrap; }
.wide { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); }
.small, small { font-size: 12px; }
.eyebrow { display: block; font-size: 10px; letter-spacing: .13em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }

/* Banda superiore a tutta larghezza, anche nella schermata di accesso. */
.topbar { height: 113px; min-width: 0; background: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; color: #fff; }
.brand { display: flex; gap: 15px; align-items: center; color: #fff; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand svg { flex-shrink: 0; }
.brand small { display: block; font-size: 9px; letter-spacing: .19em; font-weight: 650; color: #a9c7f7; margin-bottom: 2px; }
.brand strong { display: block; font-size: 29px; letter-spacing: -.045em; line-height: 1.15; }
.brand strong span { font-weight: 350; color: #d8e6fb; }
.brand em { font-size: 11px; color: #afbdd0; font-style: normal; display: block; margin-top: 5px; }
.header-meta { text-align: right; font-size: 12px; color: #adbed5; flex-shrink: 0; }
.header-meta > span { display: block; color: #edf3fc; font-size: 13px; margin-bottom: 7px; }
.header-button { padding: 2px 8px; margin-left: 12px; color: #fff; border-color: #667b95; background: transparent; font-size: 11px; }
.header-button:hover { background: #263d5b; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #167254; margin-right: 5px; }

/* Menu laterale bianco e scorrimento indipendente del contenuto. */
.workspace { display: flex; height: 100%; min-height: 0; overflow: hidden; }
.sidebar { width: 224px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 30px 16px 20px; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
#sidebar-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; margin-bottom: 13px; }
.sidebar-toggle { display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin: 0; width: 36px; height: 36px; padding: 0; border: 1px solid #d8e3f2; background: #f7faff; color: #28578a; }
#sidebar-toggle-icon { font-size: 22px; line-height: 1; font-weight: 700; }
#sidebar-toggle-text { display: none; }
.workspace.sidebar-collapsed > .sidebar { position: relative; z-index: 10; width: 0; flex: 0 0 0; min-width: 0; padding: 0; border: 0; background: transparent; overflow: visible; }
.workspace.sidebar-collapsed .sidebar-header { margin: 0; }
.workspace.sidebar-collapsed .side-caption { display: none; }
.workspace.sidebar-collapsed .sidebar-toggle { position: fixed; z-index: 10; top: 170px; left: 0; display: flex; flex-direction: column; gap: 9px; margin: 0; width: 35px; height: 130px; padding: 9px 3px; border: 1px solid #b6cce8; border-left: 0; border-radius: 0 11px 11px 0; background: #eaf3ff; box-shadow: 2px 2px 7px #14243d1a; color: #1755a3; }
.workspace.sidebar-collapsed #sidebar-toggle-text { display: block; font-size: 10px; font-weight: 750; letter-spacing: .17em; writing-mode: vertical-rl; text-orientation: mixed; }
.workspace.sidebar-collapsed .sidebar-toggle:hover { background: #d9eafd; }
.sidebar-toggle:focus-visible { outline: 3px solid #1768d1; outline-offset: 2px; }
.workspace.sidebar-collapsed .main-content { max-width: none; padding-left: 44px; }
.side-caption { padding-left: 8px; color: #7b8899; font-size: 10px; letter-spacing: .1em; font-weight: 700; white-space: nowrap; }
.sidebar nav { display: grid; gap: 5px; align-content: start; }
.nav { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 11px 14px; border: 0; border-radius: 7px; color: #5b6b80; background: transparent; font-weight: 550; font-size: 13px; text-align: left; white-space: nowrap; }
.nav:hover { background: #f4f7fa; text-decoration: none; }
.nav.active { background: #eaf2ff; color: var(--blue); font-weight: 700; }
.nav > span { display: inline-grid; place-items: center; width: 18px; flex-shrink: 0; font-size: 18px; line-height: 1; }
.nav b { font-size: 10px; margin-left: auto; padding: 1px 6px; background: #fff; border-radius: 4px; }
.sidebar-bottom { margin-top: auto; padding: 35px 15px 0; font-size: 11px; color: var(--muted); }
.sidebar-bottom p { font-size: 11px; line-height: 1.7; margin: 8px 0 14px; }
.version-tag { font-size: 8px; letter-spacing: .1em; color: #8390a2; }
main { flex: 1; min-width: 0; min-height: 0; height: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.main-content { width: 100%; max-width: 1800px; margin: 0 auto; padding: 25px 32px 18px; }
.environment-banner { display: flex; gap: 18px; align-items: center; padding: 9px 13px; margin-bottom: 25px; border: 1px solid #cbdcf1; border-radius: 6px; background: #edf4fd; color: #3567a8; font-size: 9px; letter-spacing: .1em; font-weight: 750; }
.environment-banner span { font-size: 11px; letter-spacing: 0; color: #486585; font-weight: 400; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.page-heading p { margin-bottom: 0; font-size: 13px; }
.page-heading .eyebrow b { font-weight: 700; }

/* Schede, riepiloghi e tabelle. Il verde è riservato agli stati positivi. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stats article { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; box-shadow: 0 2px 8px #14243d03; }
.stats article > span { display: block; font-size: 10px; letter-spacing: .04em; font-weight: 600; color: #637287; }
.stats article > div { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 2px; }
.stats strong { font-size: 34px; font-weight: 650; letter-spacing: -.055em; line-height: 1.4; }
.stats small { font-size: 11px; color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #eef4ff; color: var(--blue); font-size: 19px; font-style: normal; }
.stats article:last-child .stat-icon { background: #eaf6f1; color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px #14243d03; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid #edf0f4; margin-bottom: 0; }
.panel .eyebrow { font-size: 9px; margin-bottom: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; border-radius: 5px; padding: 4px 7px; white-space: nowrap; background: #edf1f6; color: #68788c; }
.green { background: #eaf6ef; color: #27764e; }
.blue { background: #edf4ff; color: #416ea9; }
.orange { background: #fff5e4; color: #946313; }
.destination-card { display: flex; gap: 12px; align-items: center; padding: 17px 0; border-bottom: 1px solid #edf0f4; }
.destination-pin { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; background: #f1f5fa; border-radius: 7px; color: #5e7492; font-size: 18px; }
.destination-card h3 { font-size: 12px; font-weight: 600; margin: 0 0 3px; }
.destination-card p { font-size: 10px; margin: 0; }
.destination-count { margin-left: auto; text-align: right; font-size: 12px; white-space: nowrap; }
.destination-count small { display: block; color: var(--muted); font-size: 10px; }
.route-panel > .text-button { margin-top: 18px; font-size: 11px; }
.quick-panel h2 { margin-bottom: 20px; }
.step { display: flex; gap: 12px; align-items: start; margin: 19px 0; }
.step > b { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid #dce5ef; border-radius: 7px; font-size: 10px; color: #5e7492; background: #f8fafc; }
.step strong { font-size: 12px; font-weight: 600; }
.step p { font-size: 11px; margin: 3px 0 0; }
.inspection-link { display: flex; align-items: center; gap: 8px; background: #edf4ff; color: var(--blue); border: 1px solid #d6e3f4; font-size: 11px; border-radius: 6px; padding: 13px; margin-top: 20px; }
.inspection-link span { margin-left: auto; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 14px; gap: 10px; }
.section-title .text-button { font-size: 11px; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { background: #f8fafc; color: #6c7b8e; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; font-weight: 650; padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-size: 12px; padding: 15px 18px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbfe; }
td small { display: block; font-size: 10px; color: #8290a2; margin-top: 3px; }
.doc-number { color: var(--blue); font-size: 12px; font-weight: 650; background: none; padding: 0; border: 0; text-align: left; white-space: nowrap; }
.doc-number:hover { background: none; text-decoration: underline; }
td input[type=checkbox], th input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--blue); }
.empty { padding: 38px 22px; text-align: center; color: var(--muted); font-size: 12px; background: #fff; border-radius: 8px; }
.empty strong { display: block; color: #46596e; font-size: 14px; margin-bottom: 5px; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #6f8096; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 17px; font-size: 10px; }
footer b { font-weight: 600; }
footer .text-button { font-size: 11px; }

/* Form operativi e finestre di conferma. */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; }
.toolbar > div { margin-right: auto; }
.toolbar b { font-size: 12px; }
.toolbar small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.load-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.load-grid h2 { font-size: 19px; margin-bottom: 12px; }
.load-grid p { font-size: 12px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 600; color: #516276; margin-bottom: 17px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #cbd4df; border-radius: 6px; background: #fff; color: var(--ink); }
input:not([type=checkbox]), select { height: 39px; }
textarea { min-height: 90px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #929eb0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.scan-form { display: flex; align-items: end; gap: 10px; margin: 22px 0 14px; }
.scan-form label { flex: 1; margin: 0; }
.scan-form button { min-height: 39px; }
.scan-list { margin: 22px 0; }
.scan-item, .available-item, .trip-item { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid #edf0f4; }
.scan-item > b, .available-item > div, .trip-item > div { flex: 1; min-width: 0; }
.scan-item > b { overflow-wrap: anywhere; font-size: 12px; }
.scan-item button { border: 1px solid #e9c5c7; background: #fff; color: var(--red); border-radius: 5px; padding: 0 8px; font-size: 20px; }
.available-item b { display: block; font-size: 12px; }
.available-item small, .trip-item small { display: block; color: var(--muted); font-size: 10px; }
.trip-item > div > b { font-size: 12px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.filters label { flex: 1; min-width: 130px; margin: 0; }
.filters label:first-child { flex: 1.6; min-width: 210px; }
.filters input, .filters select { font-size: 12px; }
.filters button { min-height: 39px; }
.error { color: var(--red); font-size: 12px; }
.banner { padding: 14px; background: #fff0ed; border: 1px solid #efd0ca; border-radius: 7px; margin-bottom: 16px; }
.notice { padding: 14px 18px; border: 1px solid #d6e1f0; background: #f0f5fc; border-radius: 8px; color: #486585; font-size: 12px; margin-bottom: 20px; line-height: 1.7; }
dialog { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 100px #10233d35; padding: 24px; width: min(630px, calc(100vw - 32px)); max-height: 90dvh; color: var(--ink); }
dialog::backdrop { background: #10233d70; backdrop-filter: blur(2px); }
.modal-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.modal-heading h2 { font-size: 21px; }
.close-dialog { border: 0; background: transparent; color: #6c7c90; font-size: 24px; line-height: 1; padding: 2px 6px; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 12px; margin-bottom: 22px; overflow-wrap: anywhere; }
.detail-meta small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.detail-meta .table-wrap { font-size: 11px; }
video { width: 100%; border-radius: 8px; margin-top: 15px; max-height: 300px; background: var(--navy); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Login compatto, come la scheda di accesso di GestioneWeb. */
.login-screen { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.login-card { display: block; width: calc(100% - 32px); max-width: 410px; margin: 75px auto; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.login-card h1 { font-size: 24px; margin-top: 10px; }
.login-card p { font-size: 12px; }
.login-card label { margin: 18px 0; }
.login-card .primary { margin-top: 15px; }
.login-card .error:empty { display: none; }
.demo-box { padding: 14px; margin-top: 22px; border: 1px solid #cbdcf1; border-radius: 7px; background: #edf4fd; color: #486585; font-size: 12px; }
.demo-box p { margin: 8px 0; font-size: 12px; }
.demo-box small { font-size: 10px; color: #486585; }

@media (max-width: 1100px) {
  .brand strong { font-size: 26px; }
  .sidebar { width: 205px; padding-inline: 12px; }
  .nav { gap: 9px; padding-inline: 11px; font-size: 12px; }
  .main-content { padding: 24px 20px 18px; }
  .stats { gap: 12px; }
  .stats article { padding: 16px; }
  .stats article > span { font-size: 9px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar > div { width: 100%; }
}
@media (max-width: 900px) {
  .sidebar { width: 185px; }
  .side-caption { padding-left: 0; font-size: 9px; letter-spacing: .08em; }
  .nav { gap: 8px; font-size: 11px; padding-inline: 8px; }
  .topbar { padding-inline: 20px; }
  .brand strong { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .load-grid { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 25px; }
  .quick-panel { display: none; }
  .environment-banner { align-items: start; flex-direction: column; gap: 3px; }
}
@media (max-width: 600px) {
  body { height: auto; min-height: 100dvh; display: block; overflow: auto; }
  .topbar { height: 100px; padding: 0 16px; gap: 10px; }
  .brand { gap: 9px; min-width: 0; }
  .brand svg { width: 32px; height: 32px; }
  .brand small { font-size: 8px; letter-spacing: .12em; }
  .brand strong { font-size: 21px; }
  .brand strong span { display: block; }
  .brand em { display: none; }
  .header-meta { font-size: 10px; }
  .header-meta > span { font-size: 11px; margin-bottom: 5px; }
  .header-meta time { display: block; font-size: 9px; margin-bottom: 6px; }
  .header-button { font-size: 11px; min-height: 30px; margin-left: 0; }
  .workspace { display: block; height: auto; overflow: visible; }
  .sidebar { width: 100%; height: auto; display: block; overflow: visible; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-header { margin-bottom: 8px; }
  .workspace.sidebar-collapsed > .sidebar { width: 0; height: 0; }
  .workspace.sidebar-collapsed .sidebar-toggle { top: 125px; width: 32px; height: 116px; padding: 8px 3px; gap: 8px; border-radius: 0 10px 10px 0; }
  .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; overflow-y: hidden; gap: 5px; }
  .nav { width: auto; min-height: 42px; flex-shrink: 0; padding: 10px 12px; font-size: 12px; }
  .nav b { display: none; }
  main { width: 100%; height: auto; overflow: visible; scrollbar-gutter: auto; }
  .main-content { padding: 18px 14px; }
  .environment-banner { margin-bottom: 20px; }
  .page-heading { align-items: start; gap: 10px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 12px; }
  .page-heading .eyebrow { font-size: 9px; letter-spacing: .08em; }
  .page-heading > .primary { padding: 9px 10px; font-size: 11px; }
  .stats { gap: 10px; }
  .stats article { padding: 14px; }
  .stats article > span { font-size: 9px; }
  .stats strong { font-size: 28px; }
  .stats small { font-size: 10px; }
  .panel { padding: 16px; }
  .panel-heading { align-items: start; }
  .panel-heading h2 { font-size: 16px; }
  .destination-card { gap: 9px; }
  .destination-card h3 { font-size: 12px; }
  .destination-card p { font-size: 10px; }
  .destination-count { font-size: 11px; }
  .destination-count small { font-size: 9px; }
  .toolbar { padding: 14px; gap: 9px; }
  .toolbar small { font-size: 10px; }
  .toolbar button { font-size: 11px; padding-inline: 9px; }
  .filters { padding: 14px; }
  .filters label { min-width: 115px; }
  .filters label:first-child { min-width: 100%; }
  footer { flex-wrap: wrap; font-size: 9px; gap: 10px; }
  footer > span:nth-child(2) { max-width: 220px; }
  .login-card { margin: 30px auto; padding: 25px; }
  .trip-item { flex-wrap: wrap; }
  .detail-meta { grid-template-columns: 1fr; }
  dialog { padding: 20px; }
}
@media (pointer: coarse) {
  button.primary, button.secondary { min-height: 42px; }
  input:not([type=checkbox]), select, textarea { font-size: 16px; }
  .close-dialog { min-width: 36px; min-height: 36px; }
}
