*{ box-sizing:border-box; }
html, body{ height:100%; }

:root{
  /* tema sito */
  --primary:#0078D7; --primary-2:#3ca6ff;
  --ok:#28a745; --ok-2:#64e07e;
  --line:#e2e8f0; --line-2:#e3eefd;
  --bg:#f8fcff; --bg-2:#e3eefd;
  --ink:#232a33; --muted:#556; --ink-2:#284881;

  /* dimensioni timetable */
  --time-w:56px;   /* colonna orari */
  --col-w:72px;    /* colonna attrezzo (mobile) */
  --cell-h:28px;   /* altezza min cella (mobile) */
  --gap:4px;       /* spaziatura tra celle */
  --badge-fs:11px;

  /* tema timetable */
  --surface:#fff;
  --border:#e5e7eb;
  --radius:8px;
  --accent:#0c7a54;
  --accent-2:#2f855a; /* gradiente header timetable */
}

body, h1, h2, h3, p, ul, li, a, button, input, select, textarea{
  margin:0; padding:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
}
body{ background:#f4f6f8; color:#111827; font-size:14px; }

/* 2) LAYOUT GENERALE */
.page{ min-height:100vh; display:flex; flex-direction:column; }
.content{ flex:1; padding:20px; }
.layout{ display:block; } /* compat vecchio markup */
.container{ width:100%; max-width:2400px; margin:0 auto; }
.site-footer{ text-align:center; padding:12px 0; color:#557; font-size:13px; }
footer a { color:#111827; text-decoration:none; }
footer a:hover { background:rgba(255,255,255,.10); } 
footer a.active { background:#fff; color:var(--primary); } 

/* 3) HEADER / NAVBAR */
.site-header .navbar{
  background:linear-gradient(90deg,var(--primary) 70%,var(--primary-2) 100%);
   padding: 4px 12px; border-radius:8px; margin:4px auto 0; max-width:1400px;
}
.site-header .navbar .navbar-brand,
.site-header .navbar .nav-link{ color:#fff; padding: 2px 10px; line-height:1.2; }
.site-header .navbar .navbar-brand{ padding: 2px 10px; font-size:1.05rem; line-height:1.2; }
.site-header .navbar .nav-link:hover{ opacity:.95; }
.site-header .dropdown-menu{ border-radius:10px; }

/* tema sabbia compat */
.navbar{ background:#2f6e57; }
.navbar .navbar-brand,
.navbar .nav-link{ color:#fff; }
.navbar .nav-link.active{ position:relative; }
.navbar .nav-link.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px;
  background:#fff; border-radius:2px;
}
.dropdown-menu{ min-width:220px; }

/* avatar */
.avatar{
  width:32px; height:32px; border-radius:999px; background:#e6f2ec; color:#2f6e57;
  display:flex; align-items:center; justify-content:center; font-weight:700; letter-spacing:.5px;
}

/* hero header pagina */
header{
  background:linear-gradient(90deg,var(--primary) 70%,var(--primary-2) 100%);
  color:#fff; padding:20px; border-radius:12px;
  box-shadow:0 2px 10px rgba(40,72,129,0.07); margin-bottom:16px;
}
header h1{ font-size:24px; }
header p{ font-size:14px; opacity:.95; margin-top:2px; }

/* fix bootstrap collapse vecchio */
@media (min-width:768px){
  .navbar-expand-md .navbar-collapse{ display:flex!important; flex-basis:auto!important; }
}

/* 4) BOX / CARDS / DASHBOARD */
.box{
  background:#fff; border:1px solid var(--line); border-radius:10px;
  padding:16px; margin:16px 0;
}
.dashboard{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px; margin-top:16px;
}
.cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:18px; }
.card{
  background:#fff; border:1px solid var(--line); border-radius:10px; padding:18px; text-align:center;
  transition:box-shadow .2s ease;
}
.card:hover{ box-shadow:0 3px 8px rgba(0,0,0,.12); }
.card h3{ margin:0 0 8px; font-size:18px; }
.card h5{ font-weight:700; }
.card p{ font-size:13px; color:#555; }
.card .btn{ font-weight:600; }
.card a{
  display:inline-block; margin-top:10px; padding:8px 14px; background:#3182ce; color:#fff;
  border-radius:6px; text-decoration:none;
}
.card a:hover{ background:#2b6cb0; }

/* stepper */
.stepper{ display:flex; gap:12px; margin:14px 0 20px; }
.step{ display:flex; align-items:center; gap:8px; opacity:.8; }
.step .dot{
  width:26px; height:26px; border-radius:999px; background:#e7efe9; color:#2f6e57;
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.step.done{ opacity:1; }
.step.done .dot{ background:#2f6e57; color:#fff; }

/* 5) FORM / BUTTONS */
form label{ display:block; margin:6px 0; font-weight:600; color:var(--ink-2); }

/* campi testo */
input[type="text"], input[type="number"], input[type="time"], input[type="email"],
select, textarea{
  width:100%; padding:9px 10px; border:1.3px solid #b8dafc; border-radius:6px;
  font-size:14px; background:#f7fbff; transition:border .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus{
  outline:none; border-color:var(--primary); box-shadow:0 0 7px rgba(0,120,215,0.17);
}

/* bottoni */
button, input[type="submit"], .btn{
  background:linear-gradient(90deg,var(--ok) 50%,var(--ok-2) 100%);
  color:#fff; border:none; padding:10px 18px; border-radius:6px; cursor:pointer;
  font-size:14px; font-weight:600; box-shadow:0 1px 4px rgba(40,72,129,0.08);
  transition:filter .2s;
}
button:hover, .btn:hover, input[type="submit"]:hover{ filter:brightness(.95); }
a.btn-mini{
  display:inline-block; padding:6px 10px; border:1px solid #b8dafc; border-radius:6px;
  text-decoration:none; color:var(--ink-2);
}
a.btn-mini:hover{ background:#eaf6fe; }

/* 6) TABELLE GENERALI */
.tabella-scroll{ width:100%; overflow-x:auto; padding-bottom:6px; }
table{
  width:100%; border-collapse:separate; border-spacing:0; margin-top:10px; background:#fff;
  border-radius:10px; overflow:hidden; font-size:14px;
}
th, td{ border:1px solid var(--line-2); padding:10px 8px; text-align:left; }
th{
  background:linear-gradient(90deg,var(--primary) 65%,var(--primary-2) 100%);
  color:#fff; font-weight:600; letter-spacing:.3px;
}
tbody tr:nth-child(even){ background:#f7fbff; }
tbody tr:hover{ background:#eef6ff; }

/* 7) MESSAGGI */
.msg-error{ color:#c53030; font-weight:700; margin:8px 0; }
.msg-success{ color:#2f855a; font-weight:700; margin:8px 0; }

/* 8) SEZIONE VINCOLI */
.vincoli table{ table-layout:fixed; overflow:visible; }
.vincoli th:nth-child(1), .vincoli td:nth-child(1){ width:56px; }
.vincoli th:nth-child(8), .vincoli td:nth-child(8){ width:92px; }
.vincoli th:nth-child(9), .vincoli td:nth-child(9){ width:110px; }
.vincoli th:last-child, .vincoli td:last-child{ padding-right:14px; }
.vincoli th.active, .vincoli td.active{ width:80px; white-space:nowrap; text-align:center; }
.vincoli th.actions, .vincoli td.actions{ width:140px; white-space:nowrap; }
.vincoli td.actions form{ display:inline-block; margin-left:6px; }
.vincoli td.actions button{ padding:6px 10px; }

/* switch */
.switch{ position:relative; display:inline-block; width:42px; height:24px; vertical-align:middle; }
.switch input{ display:none; }
.switch .slider{
  position:absolute; inset:0; background:#ddd; border-radius:999px; transition:.18s ease;
  border:1px solid var(--line);
}
.switch .slider:before{
  content:""; position:absolute; width:18px; height:18px; left:3px; top:2px;
  background:#fff; border-radius:50%; transition:.18s ease; box-shadow:0 1px 2px rgba(0,0,0,.15);
}
.switch input:checked + .slider{ background:var(--ok); }
.switch input:checked + .slider:before{ transform:translateX(17px); }

.badge-soft{
  display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--line);
  background:#f6f2eb; color:#7a6d5e;
}
.badge-soft.ok{ background:#ecf3ee; color:#2f5a43; border-color:#d7e6dd; }
.badge-soft.muted{ background:#f5eae6; color:#7a4c3f; border-color:#ead5cf; }

/* 9) TIMETABLE (legacy scoped) */
.timetable{ --cols:16; --slot-w:100px; --time-w:84px; }
.timetable .layout-flex{ display:flex; gap:14px; align-items:flex-start; }
.timetable .palette{
  flex:0 1 240px; background:#fbfcfe; border:1px solid var(--line); border-radius:10px; padding:10px;
}
.timetable .grid{ flex:1; border:1px solid var(--line); border-radius:10px; overflow:auto; padding:8px; user-select:none; }
.timetable .container{ max-width:clamp(1400px,96vw,2000px); }
.timetable .grid table{
  table-layout:fixed;
  width:calc(var(--time-w) + var(--cols) * var(--slot-w));
  min-width:calc(var(--time-w) + var(--cols) * var(--slot-w));
  max-width:none;
}
.timetable .grid th:first-child, .timetable .time-col{
  width:var(--time-w); min-width:var(--time-w); max-width:var(--time-w);
  white-space:nowrap; position:sticky; left:0; z-index:2; background:#fff;
}
.timetable .grid th:not(:first-child),
.timetable .grid td.dropzone,
.timetable .grid td.cell{
  width:var(--slot-w); min-width:var(--slot-w); max-width:var(--slot-w);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.timetable td.cell.is-disabled{ background:#efe7dd; color:#9a8f84; pointer-events:none; }
.timetable .dropzone.hover{ outline:2px solid #3182ce; background:rgba(49,130,206,.08); }
.timetable .grid thead th{ position:sticky; top:0; z-index:3; box-shadow:0 2px 6px rgba(0,0,0,.08); }
.timetable .grid th, .timetable .grid td{ padding:6px 6px; }
.timetable .badge{
  display:inline-block; padding:2px 8px; border-radius:6px; font-size:12px; margin:3px 0;
  border:1px solid rgba(0,0,0,.12); white-space:nowrap; cursor:pointer;
}
.timetable .badge.selected{ outline:4px solid #3182ce; box-shadow:0 0 0 3px rgba(49,130,206,.15); transform:translateZ(0); }
.timetable .badge-used{ opacity:.7; }
.timetable .badge.hidden{ display:none !important; }
.timetable .badge:focus-visible{ outline:3px solid #94c2ff; outline-offset:2px; }
.timetable .dropzone:focus-visible{ outline:2px dashed #3182ce; background:#eaf6fe; }
.timetable td.cell{ cursor:crosshair; }
.timetable .cell{ min-width:140px; min-height:34px; text-align:left; }
.timetable .cell.selecting{ background:#d9ecff !important; }
.timetable .cell.selecting-start{ outline:2px solid #3182ce; }
.timetable .cell.highlight{ background:#eaf6fe !important; }
.timetable .cell.highlight-start{ background:#cfeaff !important; }
.timetable .duration-bar{
  display:inline-block; padding:2px 8px; border-radius:8px; font-size:12px;
  background:rgba(49,130,206,.15); border:1px solid rgba(49,130,206,.35);
}
.timetable .grid-wrap{ display:flex; gap:16px; }
.timetable .groups-panel{
  min-width:260px; max-width:320px; background:#fbfcfe; border:1px solid var(--line); border-radius:10px; padding:12px;
}
.timetable .group-item{
  display:flex; align-items:center; gap:8px; padding:6px 8px; border:1px solid #e1e8f0; border-radius:8px; margin:6px 0; cursor:pointer;
}
.timetable .group-item:hover{ background:#f3f8ff; }
.timetable .group-color{ width:14px; height:14px; border-radius:4px; border:1px solid rgba(0,0,0,0.12); }
.timetable .group-selected{ outline:2px solid var(--primary); background:#eaf6fe; }
.timetable #selbar{
  margin:10px 0; padding:8px 10px; border:1px solid #cbd5e0; border-radius:8px; background:#f8fbff;
  display:none; align-items:center; justify-content:space-between; gap:8px;
}
.timetable .small{ font-size:12px; color:#667; }
.timetable header .small{ color:rgba(255,255,255,.92); text-shadow:0 1px 0 rgba(0,0,0,.15); }

/* responsive timetable legacy */
@media (max-width:900px){
  .timetable .layout-flex{ flex-direction:column; }
  .timetable .palette{ width:50%; flex:0 0 auto; }
}

/* 10) THEME: Sabbia + Salvia (warm) */
body.theme-sabbia{
  --primary:#4f7d62; --primary-2:#78a38c;
  --ok:#6e8d63; --ok-2:#9fbc8c;
  --line:#e6ded2; --line-2:#efe7dc;
  --bg:#f7f3ee; --bg-2:#efe7dd;
  --ink:#2f2a24; --muted:#6b5f53; --ink-2:#4b5f53;
}
.theme-sabbia tbody tr:nth-child(even){ background:#faf6f0; }
.theme-sabbia tbody tr:hover{ background:#f1ece4; }
.theme-sabbia .timetable .dropzone.target{ outline:2px dashed #5f8a75; background:#ecf3ee; }
.theme-sabbia .timetable .cell.selecting{ background:#e6efe9 !important; }
.theme-sabbia .timetable .cell.selecting-start{ outline:2px solid #5f8a75; }
.theme-sabbia .timetable .cell.highlight{ background:#f6f1e6 !important; }
.theme-sabbia .timetable .cell.highlight-start{ background:#efe6d7 !important; }
.theme-sabbia .timetable .duration-bar{ background:rgba(95,138,117,.18); border-color:rgba(95,138,117,.35); }
.theme-sabbia .timetable .badge:focus-visible{ outline:3px solid #96c3ad; }
.theme-sabbia .timetable .dropzone:focus-visible{ outline:2px dashed #5f8a75; background:#ecf3ee; }
.theme-sabbia .card a{ background:var(--primary); }
.theme-sabbia .card a:hover{ background:#406953; }
.theme-sabbia .timetable .dropzone.hover{ outline:2px solid #5f8a75; background:#e8f1ec; }

/* 12) TEMPLATE “ULTIMO SCELTO” (override finale / custom) */

.container{ max-width:980px; margin:6px auto; padding:10px; } /* container compatto per il template scelto */
h2{ font-size:20px; } /* i margini sono gestiti da .day-toggle */

/* wrapper con scroll interno (sticky visibili) */
.table-wrap{
  overflow:auto; border-radius:12px; background:var(--surface);
  border:1px solid var(--border); padding:8px; max-height:70vh; /* regola/rimuovi per scroll di pagina */
}

/* tabella / griglia – scopo al solo wrapper del template */
.table-wrap > table{
  border-collapse:separate; border-spacing:var(--gap); min-width:100%;
  overflow:visible !important; border-radius:0; margin-top:0;
}

/* ===== Header riga STICKY ===== */
.table-wrap thead th{
  position:sticky; top:0; z-index:3; /* sopra alla prima colonna sticky */
  background:linear-gradient(180deg,var(--accent),var(--accent-2));
  color:#fff; border-radius:var(--radius); padding:6px 0; text-align:center;
  box-shadow:0 2px 0 rgba(0,0,0,.06);
}

/* intestazioni verticali compatte */
.att-head{
  width:var(--col-w); writing-mode:vertical-rl; transform:rotate(180deg);
  letter-spacing:.5px; font-size:12px; padding:6px 0; white-space:nowrap;
}

/* ===== Prima colonna (orari) STICKY ===== */
.time-col{
  position:sticky; left:0; z-index:2; width:var(--time-w); background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius); padding:1px; text-align:center;
  box-shadow:2px 0 0 rgba(0,0,0,.06);
}

/* ===== Cella d’angolo (Ora) – top+left sticky ===== */
.table-wrap thead th.time-col{
  left:0; top:0; z-index:4; background:var(--surface); color:#374151;
  box-shadow:2px 0 0 rgba(0,0,0,.06), 0 2px 0 rgba(0,0,0,.06);
}

/* celle del template */
.table-wrap td{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  vertical-align:middle; text-align:center; min-width:var(--col-w); min-height:var(--cell-h); padding:1px;
}
.table-wrap td.empty{ background:transparent; border-color:transparent; }

/* Forza testo scuro nei badge del planning, senza toccare Bootstrap */
.table-wrap .badge,
.palette .badge,
.badge[data-src="grid"]{
  --bs-badge-color:#111827; color:#111827 !important; text-shadow:none;
}
.table-wrap .badge small,
.timetable .grid .badge small{ opacity:.9; }

/* badge del template (SCOPATO al wrapper per non impattare Bootstrap) */
.table-wrap .badge{
  display:flex; flex-direction:column; justify-content:center; align-items:center;
  width:100%; box-sizing:border-box; padding:4px 6px; border-radius:6px;
  border:1px solid rgba(0,0,0,.06); font-size:var(--badge-fs); line-height:1.15;
  white-space:normal; word-break:break-word; min-height:calc(var(--cell-h) - 4px); margin:2px 0;
}
.table-wrap .badge .row1{ font-weight:600; }
.table-wrap .badge .row2{ opacity:.85; }

/* legenda del template */
.legend{ display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; }
.legend-item{ display:flex; align-items:center; gap:6px; font-size:13px; }
.dot{ width:13px; height:13px; border-radius:50%; border:1px solid rgba(0,0,0,.12); display:inline-block; }

/* ===== Toggle giorno (chevron CSS + evidenza riga) ===== */
h2.day-toggle{
  display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none;
  margin:8px 0 12px; padding:8px 10px; color:var(--accent);
  border:1px solid transparent; border-radius:10px; transition:background .2s,border-color .2s,box-shadow .2s;
}
h2.day-toggle::before{
  content:''; width:0; height:0; flex:0 0 auto; border:6px solid transparent;
  border-left-color:currentColor; transition:transform .2s ease;
}
h2.day-toggle.is-open::before{ transform:rotate(90deg); }
h2.day-toggle.is-open{
  background:linear-gradient(180deg,#e9f6f1,#e2f3ee);
  border-color:#cfe9df; box-shadow:0 2px 6px rgba(0,0,0,.04);
}

.table-wrap[hidden]{ display:none; }

@media (min-width:769px){
  :root{ --col-w:100px; --cell-h:32px; --badge-fs:12px; }
  .att-head{ writing-mode:horizontal-tb; transform:none; font-size:13px; padding:8px; }
  .table-wrap thead th{ padding:10px 6px; }
}

/* DENSITÀ COMPATTA per schermo */
.table-wrap.tight-rows{
  --gap:1.5px;
  --cell-h:14px;
  --badge-fs:9.5px;
}
.table-wrap.tight-rows thead th{ padding:4px 0; }
.table-wrap.tight-rows .time-col{ padding:4px; }
.table-wrap.tight-rows td{ padding:2px; }
.table-wrap.tight-rows .badge{
  padding:2px 4px; margin:1px 0; line-height:1.05;
  min-height:calc(var(--cell-h) - 2px);
}

/* Miglioria: chevron SVG via mask (override del triangolino CSS) */
@supports ((-webkit-mask:url("")) or (mask:url(""))){
  h2.day-toggle::before{
    width:var(--chev,18px); height:var(--chev,18px); flex:0 0 var(--chev,18px);
    border:0; background-color:currentColor;
    -webkit-mask:url("data:image/svg+xml;utf8,\
      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
        <path d='M9 6l6 6-6 6' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' fill='none'/>\
      </svg>") center/contain no-repeat;
            mask:url("data:image/svg+xml;utf8,\
      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
        <path d='M9 6l6 6-6 6' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' fill='none'/>\
      </svg>") center/contain no-repeat;
    opacity:.9; transition:transform .2s ease, opacity .15s;
  }
  h2.day-toggle:hover::before{ opacity:1; }
}
/* resta valida la rotazione quando aperto */
h2.day-toggle.is-open::before{ transform:rotate(90deg); }

/* ===== Desktop wide solo per stampa_planning_desk.php ===== */
@media (min-width:1200px){
  .planning-desk .container{ max-width:2200px; } /* prova: 1600/1760/1800… */
  .planning-desk .site-header .navbar{ max-width:1600px; }

  /* preset opzionali (commentati) */
  /* .planning-desk{ --col-w:110px; --time-w:72px; --cell-h:32px; --badge-fs:12px; } */
}

/* Variante elastica (alternativa al blocco sopra)
@media (min-width:1200px){
  body.planning-desk{
    --col-w:clamp(96px,6.4vw,128px);
    --time-w:clamp(64px,4.6vw,84px);
    --cell-h:32px;
    --badge-fs:12px;
  }
  body.planning-desk .container,
  body.planning-desk .site-header .navbar{
    max-width:min(1800px,96vw);
  }
}
*/

/* 11) STAMPA (unificata) */
.print-head{ display:none; }
@media print{
  *{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  :root{
    --gap: 2px;
    --cell-h: 20px;
    --badge-fs: 9.5px;
    --time-w: 52px;
    --col-w: 78px;          /* riduci se hai molte colonne */
  }

  /* nascondi elementi non utili */
  .no-print, .site-header, footer{ display:none !important; }
  /* layout piena pagina */
  body{ background:#fff !important; }
  .container{ max-width:none !important; width:100% !important; margin:0 !important; padding:0 !important; }
  .box{ background:#fff !important; border:0 !important; box-shadow:none !important; margin:0 0 6mm !important; padding:0 !important; }


  /* wrapper tabella */
  .table-wrap{
    --border:#c1c9d6;       /* griglia un po’ più scura */
    overflow:visible !important; max-height:none !important;
    border:0; padding:0; background:#fff !important;
  }
  .table-wrap > table{ width:100% !important; table-layout:fixed; border-spacing:var(--gap); }

  /* niente sticky/ombre */
  .table-wrap thead th, .time-col{ position:static !important; box-shadow:none !important; }
  .table-wrap thead th{
    background: linear-gradient(180deg, var(--accent), var(--accent-2)) !important;
    color:#fff !important;
    padding:4px 0; border-radius:3px;
    text-align:center;
    white-space: nowrap;
  }
  /* Cella d’angolo "Ora" e prima colonna orari chiari */
  .table-wrap thead th.time-col,
  .time-col{
    background:#fff !important; color:#000 !important;
    border-radius:3px; padding:4px;
  }


  /* celle/griglia */
  .table-wrap td{
    background:#fff; border: .8px solid var(--border);
    border-radius:3px; padding:1.5px; min-height:var(--cell-h);
  }
  .table-wrap td, .att-head{ min-width: 0 !important; } /* override della width: var(--col-w) */
  .table-wrap td.empty{ border-color:var(--border) !important; } /* mostra la griglia anche sulle celle vuote */

  /* badge più compatti */
  .table-wrap .badge{ padding:1px 3px; margin:0; line-height:1.05; font-size:var(--badge-fs); }
  .table-wrap .badge .row2{ display:none; } /* seconda riga opzionale fuori stampa */

  /* intestazioni verticali -> orizzontali in stampa */
  .att-head{ writing-mode:horizontal-tb !important; transform:none !important; font-size:11px !important; }

  /* spezzamento pagine: tieni l’header unito */
  h2, h2.day-toggle{ break-after:avoid-page; background:none !important; border:none !important; color:#000 !important; margin:8px 0 6px; padding:0; }
  .table-wrap thead{
    break-inside:avoid; break-after:avoid;
    display: table-header-group !important;
  }
  .table-wrap tbody{ break-inside:auto !important; page-break-inside:auto !important; }
  .table-wrap tr{ break-inside:avoid; }
  /*.table-wrap tfoot{ display: table-footer-group !important; } /* se un domani aggiungi un footer */

  /* Riga titolo "print-head": verdino chiaro come a video */
  .print-head{ display: table-row !important; }
  .table-wrap thead tr.print-head th.print-title{
    background: linear-gradient(180deg, #e9f6f1, #e2f3ee) !important;
    color:#000 !important;
    border: 1px solid #cfe9df;          /* opzionale, sottile */
    padding: 0 0 2mm 0 !important;
    text-align: left;
  }
  /* testo del titolo: eredita il colore, niente margini extra */
  .table-wrap thead tr.print-head th.print-title h2, .table-wrap thead tr.print-head th.print-title p{ margin: 0; color: inherit; }
  .page-break{
    display:block;
    height:0;
    break-after:page;           /* standard */
    page-break-after:always;    /* legacy */
  }
  /* evita che un giorno venga spezzato */
  .day-block, .table-wrap, .table-wrap > table{
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
/* fuori da @media per compatibilità */
@page{ size:A4 landscape; margin:6mm; }
