/* Agenda Visite — foglio di stile */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --surface-2: #F8F9F6;
  --line: #DADDD6;
  --line-soft: #ECEEE9;
  --line-strong: #C9CDC5;
  --ink: #1A1F23;
  --ink-2: #3A4147;
  --muted: #545B61;
  --faint: #6B7177;
  --brand: #0E5A61;
  --brand-ink: #0A4247;
  --brand-soft: #E2EEEE;
  --warn-bg: #FBEBD8;
  --warn-ink: #7E3F0E;
  --warn: #C46A1F;
  --danger: #B42318;
  --danger-bg: #F7E1DF;
  --ok-bg: #E2EEEE;
  --ok-ink: #0A4247;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-pop: 0 14px 36px rgba(0,0,0,.18);
  --font: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sidebar: 236px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); }
a:hover { color: var(--brand-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- layout ---------- */
.shell { min-height: 100vh; display: flex; }
.side-col { flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar { width: var(--sidebar); flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 16px; font-weight: 600; }
.brand-text span { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius); text-decoration: none; font-weight: 500; color: var(--ink-2); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav a .label { flex-grow: 1; }
.nav-badge { font-size: 12px; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink); padding: 1px 8px; border-radius: 999px; }
.nav-sep { height: 1px; background: var(--line-soft); margin: 8px 6px; }
.side-spacer { flex-grow: 1; }
.side-team { padding: 0 8px; display: flex; flex-direction: column; gap: 8px; }
.side-team .avatars { display: flex; align-items: center; }
.side-team .avatars .avatar { margin-right: -6px; border: 2px solid var(--surface); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line-soft); }
.side-user a { flex-grow: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.side-user a span { font-size: 12px; color: var(--muted); }
.label-up { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.main { flex-grow: 1; min-width: 0; padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head .kicker { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.cols-400 { grid-template-columns: minmax(0, 1fr) 400px; }
.cols-380 { grid-template-columns: minmax(0, 1fr) 380px; }
.cols-360 { grid-template-columns: minmax(0, 1fr) 360px; }
.cols-left { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.cols > *, .cols-left > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ---------- componenti ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; }
.card-head + .card-body { padding-top: 0; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.section { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line-soft); }
.section:first-child { border-top: none; }
.list-item { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.list-item .grow { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-danger { color: var(--danger); border-color: #E6B8B3; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-ink); font-weight: 600; padding: 0 8px; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.textarea { padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 88px; }
.select { padding: 0 10px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: 2px solid rgba(14,90,97,.18); outline-offset: 0; }
.input[readonly], .textarea[readonly] { background: var(--surface-2); }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius); }
.search input { border: none; outline: none; background: transparent; flex-grow: 1; min-width: 0; font-size: 14px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:has(input:checked) { border: 1.5px solid var(--brand); background: var(--brand-soft); font-weight: 600; }
.pill:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #ECEEE9; color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-danger { background: var(--danger-bg); color: #8A2424; }
.badge-neutral { background: #ECEEE9; color: var(--ink-2); }
.count { font-size: 12px; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink); padding: 2px 9px; border-radius: 999px; }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; color: #fff; font-weight: 600; line-height: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="false"] { border-style: dashed; color: var(--muted); text-decoration: line-through; }
.chip[aria-pressed="false"] .avatar { background: #8A9096 !important; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-bottom: 2px solid transparent; text-decoration: none; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tabs a.active { border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 11px 16px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.table tr:hover td { background: #FBFCFA; }
.table .num { text-align: right; }
.table a.strong { font-weight: 600; color: var(--ink); text-decoration: none; }
.table a.strong:hover { color: var(--brand); text-decoration: underline; }
.cell-stack { display: flex; flex-direction: column; gap: 3px; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px; }
.filters .field { min-width: 150px; }
.filters .grow { flex-grow: 1; min-width: 220px; }

.dl { margin: 0; display: grid; grid-template-columns: 124px minmax(0, 1fr); row-gap: 11px; column-gap: 12px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }

.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.flash-success { background: var(--ok-bg); border-color: #B9D6D4; color: var(--ok-ink); }
.flash-info { background: #E9EEF7; border-color: #C3D0E8; color: #1C3B6B; }
.flash-warning { background: var(--warn-bg); border-color: #EBC79F; color: var(--warn-ink); }
.flash-error { background: var(--danger-bg); border-color: #E6B8B3; color: #8A2424; }
.flash button { margin-left: auto; border: none; background: transparent; cursor: pointer; color: inherit; padding: 0 4px; font-size: 18px; line-height: 1; }

.empty { padding: 28px 18px; text-align: center; color: var(--muted); }

/* timeline scheda azienda */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 96px 20px minmax(0, 1fr); column-gap: 12px; }
.tl-date { display: flex; flex-direction: column; padding-top: 2px; text-align: right; }
.tl-date strong { font-size: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px currentColor; background: currentColor; }
.tl-line { flex-grow: 1; width: 2px; background: var(--line-soft); margin-top: 6px; }
.tl-body { display: flex; flex-direction: column; gap: 8px; padding-bottom: 22px; min-width: 0; }
.tl-docs { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); }
.tl-doc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }

/* report: azioni concordate */
.actions-table { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.actions-table table { width: 100%; min-width: 560px; border-collapse: collapse; }
.actions-table th { text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.actions-table td { padding: 4px 6px; border-top: 1px solid var(--line-soft); }
.actions-table input { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; background: transparent; }
.actions-table input:hover { border-color: var(--line); }
.actions-table input:focus { border-color: var(--brand); outline: none; background: var(--surface); }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px; border: 1.5px dashed #A9AEA6; border-radius: 10px; background: #FAFBF9; text-align: center; cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.file-row .name { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.steps .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #8A9096; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.steps .on { color: var(--brand-ink); font-weight: 600; }
.steps .on .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps .sep { width: 24px; height: 1px; background: var(--line-strong); }

.sticky-side { position: sticky; top: 20px; }
.agenda-slot { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-soft); }
.agenda-slot.current { background: var(--brand-soft); border: 1.5px solid var(--brand); }
.agenda-slot.clash { background: var(--danger-bg); border: 1.5px solid var(--danger); }
.agenda-slot .t { width: 92px; flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding-top: 2px; }

/* login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- calendario (FullCalendar) ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cal-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-title h1 { font-size: 24px; }
.cal-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.segmented { display: flex; padding: 3px; background: #E6E8E3; border-radius: 10px; }
.segmented button { min-height: 38px; padding: 0 14px; border: none; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.cal-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-card { padding: 0; overflow: hidden; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

#calendar { --fc-border-color: var(--line-soft); --fc-today-bg-color: #F4F9F8; --fc-now-indicator-color: var(--danger); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2); font-size: 13px; }
#calendar .fc-scrollgrid { border: none; }
#calendar .fc-col-header-cell { padding: 8px 0; background: var(--surface); }
#calendar .fc-col-header-cell-cushion { color: var(--ink-2); font-weight: 600; text-decoration: none; text-transform: capitalize; }
#calendar .fc-day-today .fc-col-header-cell-cushion { color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 3px 10px; }
#calendar .fc-timegrid-slot { height: 28px; }
#calendar .fc-timegrid-slot-label-cushion, #calendar .fc-timegrid-axis-cushion { font-family: var(--mono); font-size: 11px; color: var(--muted); }
#calendar .fc-timegrid-slot-minor { border-top-style: none; }
#calendar .fc-daygrid-day-number { color: var(--ink); text-decoration: none; font-size: 13px; padding: 6px 8px; }
#calendar .fc-day-other .fc-daygrid-day-number { color: var(--faint); }
#calendar .fc-day-today .fc-daygrid-day-number { background: var(--brand); color: #fff; border-radius: 999px; min-width: 26px; text-align: center; margin: 4px; padding: 3px 6px; }
#calendar .fc-day-sat, #calendar .fc-day-sun { background: #FAFBF9; }
#calendar .fc-event { border-radius: 7px; border-width: 1.5px; cursor: pointer; }
#calendar .fc-timegrid-event { box-shadow: none; }
#calendar .fc-timegrid-event .fc-event-main { padding: 3px 6px; }
#calendar .ev-inviato, #calendar .ev-da_compilare, #calendar .ev-bozza { border-width: 1px; }
#calendar .ev-annullato { opacity: .7; text-decoration: line-through; }
#calendar .fc-event.fc-event-dragging, #calendar .fc-event.fc-event-mirror { box-shadow: 0 10px 24px rgba(0,0,0,.2); opacity: .95; }
#calendar .fc-event-draggable { cursor: grab; }
#calendar .fc-highlight { background: rgba(14,90,97,.12); }
#calendar .fc-daygrid-event { padding: 1px 4px; font-size: 12px; white-space: nowrap; overflow: hidden; }
#calendar .fc-daygrid-dot-event .fc-event-title { font-weight: 500; }
#calendar .fc-more-link { font-size: 12px; color: var(--ink-2); }
#calendar .fc-list-event:hover td { background: var(--surface-2); }
#calendar .fc-list-day-cushion { background: var(--surface-2); text-transform: capitalize; }

.ev { display: flex; flex-direction: column; gap: 1px; height: 100%; overflow: hidden; line-height: 1.25; }
.ev-top { display: flex; align-items: center; gap: 6px; }
.ev-time { font-family: var(--mono); font-size: 11px; }
.ev-ini { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ev-title { font-weight: 600; font-size: 13px; }
.ev-sub { font-size: 12px; }
.ev-tag { align-self: flex-start; margin-top: 2px; font-size: 11px; font-weight: 600; background: #fff; color: var(--warn-ink); padding: 1px 6px; border-radius: 4px; }
.ev-done { font-size: 11px; font-weight: 500; }
.ev-month { display: flex; align-items: center; gap: 5px; overflow: hidden; }
.ev-month .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ev-month .txt { overflow: hidden; text-overflow: ellipsis; }

/* dettaglio evento */
.pop { position: fixed; z-index: 60; right: 24px; top: 24px; width: 380px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pop[hidden] { display: none; }
.pop-head { display: flex; align-items: flex-start; gap: 8px; }
.pop-head .grow { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.pop-move { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pop-move .btn { padding: 0 4px; font-size: 13px; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); width: 600px; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; border-radius: 10px; background: #1F2A2E; color: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.22); font-size: 14px; }
.toast.warn { background: #7E3F0E; }
.toast.err { background: #8A2424; }
.toast[hidden] { display: none; }
.toast .msg { flex-grow: 1; }
.toast .btn { min-height: 38px; background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.toast .x { width: 38px; height: 38px; border: none; background: transparent; color: #fff; cursor: pointer; font-size: 18px; border-radius: 8px; }

/* ---------- stampa ---------- */
@media print {
  .sidebar, .topbar, .bottomnav, .actions, .filters, .btn { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
}

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .sidebar { width: 76px; padding: 18px 10px; align-items: center; }
  .brand-text, .nav a .label, .nav-badge, .side-team, .side-user a, .side-user form { display: none; }
  .brand { padding: 0; }
  .nav a { width: 52px; height: 52px; padding: 0; justify-content: center; position: relative; }
  .nav a .nav-badge-dot { display: flex; }
  .side-user { padding: 14px 0 0; justify-content: center; }
  .main { padding: 22px 22px 40px; }
  .cols, .cols-left, .cols-400, .cols-380, .cols-360 { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
}
.nav-badge-dot { display: none; position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 10px; font-weight: 600; align-items: center; justify-content: center; }

/* ---------- smartphone ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .side-col { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; height: 56px; align-items: center; gap: 10px; padding: 0 12px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .title { font-size: 17px; font-weight: 600; flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 4px 4px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; }
  .bottomnav a { position: relative; min-width: 58px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-2); font-size: 11px; font-weight: 500; }
  .bottomnav a .ic { width: 52px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
  .bottomnav a.active { color: var(--brand-ink); font-weight: 600; }
  .bottomnav a.active .ic { background: var(--brand-soft); }
  .bottomnav .nav-badge-dot { display: flex; top: 0; right: 6px; }
  .main { padding: 14px 12px 104px; gap: 14px; }
  h1 { font-size: 22px; }
  .cal-title h1 { font-size: 20px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .input, .select, .textarea { font-size: 16px; } /* evita lo zoom automatico su iOS */
  .hide-sm { display: none !important; }
  .page-head { align-items: flex-start; }
  .filters { padding: 12px; }
  .filters .field { min-width: 0; flex: 1 1 140px; }
  .tl-item { grid-template-columns: 70px 16px minmax(0, 1fr); column-gap: 8px; }
  .dl { grid-template-columns: 110px minmax(0, 1fr); }
  .pop { left: 8px; right: 8px; top: auto; bottom: 76px; width: auto; }
  .toast { top: 64px; bottom: auto; }
  .fab { display: flex; position: fixed; right: 16px; bottom: 84px; z-index: 44; width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(14,90,97,.35); }
  .card-foot.sticky-sm { position: sticky; bottom: 68px; z-index: 30; }
  .steps { display: none; }
  .table-cards thead { display: none; }
  .table-cards tr { display: block; border-top: 1px solid var(--line-soft); padding: 10px 4px; }
  .table-cards td { display: flex; gap: 10px; border: none; padding: 4px 12px; }
  .table-cards td::before { content: attr(data-label); flex: 0 0 104px; font-size: 12px; color: var(--muted); padding-top: 2px; }
  .table-cards td.main-cell::before { display: none; }
  .table-cards td.num { text-align: left; }
}
.bottomnav, .fab { display: none; }
@media (max-width: 760px) { .bottomnav { display: flex; } .fab { display: flex; } }
