/* Ospitalo — stile.
   Carta calda, blu notte, terracotta per le azioni. Titoli in serif di sistema,
   testo in sans. Nessun font né libreria esterna. Mobile-first: la sidebar
   diventa una barra in alto; le tabelle scorrono in orizzontale. */
:root {
  --paper: #faf7f1;
  --paper-2: #f1ece2;
  --card: #ffffff;
  --ink: #171e2e;
  --ink-2: #46506a;
  --muted: #7a8194;
  --line: #e7e1d5;
  --line-2: #d6cfbf;
  --navy: #1f3364;          /* indaco medio: fiducia senza cupezza */
  --navy-2: #2a4587;
  --indigo: #3452a3;
  --sky: #5b8def;
  --teal: #1f8a8a;
  --terra: #f2622e;         /* corallo vivo: azione */
  --terra-2: #ff7a45;
  --terra-deep: #d8491a;
  --terra-soft: #ffece4;
  --sand: #efe6d3;
  --gold: #d9b46a;          /* filo d'oro: qualità percepita */
  --ok: #1f9d63;
  --ok-soft: #e2f5ea;
  --warn: #e0a100;
  --danger: #e2453a;
  --danger-soft: #fde7e5;
  --shadow: 0 1px 2px rgba(20,34,74,.04), 0 10px 30px rgba(20,34,74,.07);
  --shadow-lg: 0 30px 70px rgba(20,34,74,.28);
  --glow: 0 10px 28px rgba(242,98,46,.35);
  --r: 14px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); background: radial-gradient(1200px 500px at 70% -10%, #f0f2fa 0%, var(--paper) 60%); color: var(--ink); font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--navy); margin: 0; letter-spacing: -.2px; font-variation-settings: "opsz" 72, "SOFT" 0, "WONK" 0; }
h1 { font-size: 32px; line-height: 1.12; font-weight: 600; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; font-family: var(--sans); font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .6px; font-size: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.logo { font-family: var(--serif); font-size: 24px; color: var(--navy); text-decoration: none; letter-spacing: .3px; }
.logo em { font-style: normal; color: var(--terra); }
.logo small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* ============ LOGIN ============ */
body.login { background: #1c2d5e; overflow-x: hidden; }
.bg { position: fixed; inset: 0; z-index: 0; }
.bg .slide {
  position: absolute; inset: -6%;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1);
  animation: kenburns 36s ease-in-out infinite;
}
.bg .slide:nth-child(1) { animation-delay: 0s; }
.bg .slide:nth-child(2) { animation-delay: 6s; }
.bg .slide:nth-child(3) { animation-delay: 12s; }
.bg .slide:nth-child(4) { animation-delay: 18s; }
.bg .slide:nth-child(5) { animation-delay: 24s; }
.bg .slide:nth-child(6) { animation-delay: 30s; }
@keyframes kenburns {
  0%   { opacity: 0; transform: scale(1) translate(0,0); }
  5%   { opacity: 1; }
  17%  { opacity: 1; }
  24%  { opacity: 0; transform: scale(1.10) translate(-1.5%, 1%); }
  100% { opacity: 0; transform: scale(1.10); }
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(22,38,88,.82) 0%, rgba(30,55,120,.52) 45%, rgba(40,75,150,.20) 100%), linear-gradient(0deg, rgba(242,98,46,.12), rgba(242,98,46,0) 40%);
}
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-copy { padding: 8vh 7vw; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.login-copy .logo { color: #fff; font-size: 34px; }
.login-copy .logo em { color: #ff9a6b; }
.login-copy .logo small { color: rgba(255,255,255,.7); }
.login-copy h1 { color: #fff; font-size: clamp(30px, 4.2vw, 54px); font-weight: 400; max-width: 14em; margin-top: 8vh; }
.login-copy h1 em { font-style: italic; color: #ffb27a; }
.login-copy p.lead { color: rgba(255,255,255,.82); font-size: 17px; max-width: 34em; margin: 18px 0 0; }
.login-copy .feats { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 7px; max-width: 34em; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.45; }
.login-copy .feats li { position: relative; padding-left: 20px; }
.login-copy .feats li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ff9a6b; }
.login-copy .feats b { color: #fff; font-weight: 600; }
.login-copy .feats li.pending { visibility: hidden; }
.login-copy .feats li.landed { animation: featLand .45s ease-out; }
@keyframes featLand { from { opacity: .3; } to { opacity: 1; } }
.feat-card { position: fixed; z-index: 5; box-sizing: border-box; padding: 20px 24px; border-radius: 18px; color: rgba(255,255,255,.9); font-size: 19px; line-height: 1.45;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 50px rgba(10,20,50,.35), inset 0 1px 0 rgba(255,255,255,.25);
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .45s ease, transform .55s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.feat-card.in { opacity: 1; transform: none; }
.feat-card.out { opacity: .35; transition: opacity .55s ease, transform .55s cubic-bezier(.5,0,.2,1); }
.feat-card b { color: #fff; font-weight: 600; display: block; font-size: 23px; margin-bottom: 2px; }
.feat-card .soon { display: inline-block; margin-top: 6px; padding: 0 9px; border-radius: 999px; border: 1px solid rgba(255,178,122,.6); color: #ffb27a; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.feat-skip { margin-top: 12px; background: none; border: 1px solid rgba(255,255,255,.35); color: rgba(255,255,255,.8); border-radius: 999px; padding: 3px 14px; font: 600 12px var(--sans); cursor: pointer; }
.feat-skip:hover { color: #fff; border-color: rgba(255,255,255,.7); }
.login-copy .feats .soon { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; border: 1px solid rgba(255,178,122,.6); color: #ffb27a; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.login-copy .foot { color: rgba(255,255,255,.55); font-size: 12px; }
.login-copy .foot a { color: rgba(255,255,255,.7); }
.login-side { display: flex; align-items: center; justify-content: center; padding: 6vh 6vw; }
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(255,253,249,.94); backdrop-filter: blur(12px);
  border-radius: 20px; padding: 34px 32px 28px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6);
}
.login-card h2 { font-size: 24px; margin-bottom: 4px; }
.login-card .muted { margin-bottom: 18px; }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-copy { padding: 28px 24px 0; }
  .login-copy h1 { margin-top: 24px; font-size: 30px; }
  .login-copy .foot { display: none; }
  .login-side { padding: 20px 16px 40px; align-items: flex-start; }
}

/* ============ APP ============ */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
aside.side {
  background: linear-gradient(180deg, #1c2d5e 0%, #24407f 55%, #2c4f9a 100%); color: #fff; padding: 26px 18px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
}
aside .logo { color: #fff; margin: 0 8px 18px; }
aside .logo em { color: #ff9a6b; }
aside .logo small { color: rgba(255,255,255,.55); }
aside .nav-label { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(255,255,255,.6); margin: 10px 12px 4px; flex-shrink: 0; }
aside .nav {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px;
  color: rgba(255,255,255,.92); text-decoration: none; font-size: 15px; flex-shrink: 0; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: var(--sans);
}
aside .nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; opacity: .85; }
aside .nav:hover { background: rgba(255,255,255,.10); color: #fff; }
aside .nav.active { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 3px 0 0 #ffb27a; }
aside .nav.soon { opacity: .45; cursor: default; }
aside .nav.soon .pill { margin-left: auto; }
aside .me { margin-top: auto; padding: 14px 12px 0; flex-shrink: 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; }
aside .me .name { color: #fff; font-weight: 600; }
aside .me .org { color: rgba(255,255,255,.75); font-size: 13px; }
aside .me button { margin-top: 10px; width: 100%; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); }
aside .me button:hover { background: rgba(255,255,255,.08); }
main.content { padding: 34px 40px 60px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.page-head h1::after { content: ""; display: block; width: 44px; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); margin-top: 8px; border-radius: 2px; }
section.panel { display: none; }
section.panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.topbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside.side { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .25s; z-index: 30; height: 100vh; }
  aside.side.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar .logo { font-size: 20px; }
  .topbar button { padding: 6px 10px; }
  main.content { padding: 20px 16px 60px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
}

/* --- pezzi --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(91,141,239,.22), rgba(91,141,239,0) 65%); pointer-events: none; }
.kpi:nth-child(2)::before { background: linear-gradient(135deg, rgba(45,190,170,.22), rgba(45,190,170,0) 65%); }
.kpi:nth-child(3)::before { background: linear-gradient(135deg, rgba(240,190,90,.30), rgba(240,190,90,0) 65%); }
.kpi:nth-child(4)::before { background: linear-gradient(135deg, rgba(255,122,69,.22), rgba(255,122,69,0) 65%); }
.kpi:nth-child(5)::before { background: linear-gradient(135deg, rgba(60,200,120,.22), rgba(60,200,120,0) 65%); }
.kpi:nth-child(6)::before { background: linear-gradient(135deg, rgba(150,110,240,.22), rgba(150,110,240,0) 65%); }
.kpi .n { font-family: var(--serif); font-size: 36px; color: var(--navy); line-height: 1; font-weight: 600; letter-spacing: -.2px; font-variant-numeric: tabular-nums lining-nums; font-variation-settings: "opsz" 24, "SOFT" 0, "WONK" 0; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi .accent { color: var(--terra); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.apt-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.apt-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(20,34,74,.14); }
.apt-card .band { height: 54px; background-image: linear-gradient(135deg, rgba(255,255,255,.18), rgba(0,0,0,.12)); background-blend-mode: overlay; }
.apt-card .body { margin-top: -22px; }
.apt-card h3 { background: var(--card); display: inline-block; padding: 4px 10px 0 0; border-radius: 8px 8px 0 0; }
.apt-card .body { padding: 16px 18px 18px; }
.apt-card h3 { font-size: 20px; }
.apt-card .addr { color: var(--muted); font-size: 13.5px; margin: 2px 0 12px; min-height: 20px; }
.apt-card .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.apt-card .meta span b { color: var(--navy); font-weight: 600; }
.apt-card.off { opacity: .55; }
.apt-card.add { border-style: dashed; display: flex; align-items: center; justify-content: center; min-height: 140px; color: var(--terra); font-weight: 600; background: transparent; box-shadow: none; }
.apt-card.add:hover { background: var(--terra-soft); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--indigo); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; background: #f2f5fd; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f9f6ef; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.off { background: var(--paper-2); color: var(--muted); }
.pill.role { background: #e6ebfa; color: var(--indigo); }
.pill.soon { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); font-size: 10px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sand); color: var(--navy); font-weight: 800; font-size: 12px; margin-right: 10px; font-family: var(--sans); }

/* --- form --- */
label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 14px 0 5px; font-weight: 600; letter-spacing: .2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,35,58,.10); }
input[type=color] { width: 46px; height: 40px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
input[readonly], textarea[readonly] { background: var(--paper); color: var(--ink-2); }
textarea { min-height: 76px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; gap: 8px; align-items: center; margin: 6px 16px 6px 0; font-weight: 400; color: var(--ink); font-size: 14.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }

button, .btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; transition: background .15s, transform .05s; }
button:hover { background: var(--navy-2); }
button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(135deg, var(--terra-2), var(--terra)); border-color: transparent; box-shadow: var(--glow); }
button.primary:hover { background: linear-gradient(135deg, #ff8a5a, var(--terra-deep)); box-shadow: 0 12px 32px rgba(242,98,46,.45); }
button.ghost { background: transparent; color: var(--navy); border-color: var(--line-2); }
button.ghost:hover { background: var(--paper-2); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.icon { padding: 6px 10px; line-height: 1; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.spacer { flex: 1; }
.msg { padding: 10px 12px; border-radius: 10px; margin: 12px 0 0; font-size: 14px; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.section-title { display: flex; align-items: center; gap: 12px; margin: 26px 0 6px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title h3 { font-size: 16px; }
.section-title .muted { font-size: 12.5px; }

/* --- drawer (scheda laterale) --- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(22,35,58,.35); backdrop-filter: blur(2px); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--card); z-index: 41;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .25s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .dh { display: flex; align-items: center; gap: 12px; padding: 20px 26px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, var(--paper)); }
.drawer .dh h2 { font-size: 22px; }
.drawer .db { padding: 6px 26px 26px; overflow-y: auto; flex: 1; }
.drawer .df { padding: 14px 26px; border-top: 1px solid var(--line); background: var(--paper); display: flex; gap: 10px; align-items: center; }

/* --- dotazioni a tre stati --- */
.amenity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 600px) { .amenity-grid { grid-template-columns: 1fr; } }
.amenity-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.tri { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.tri button { padding: 4px 10px; border: none; border-radius: 0; background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tri button + button { border-left: 1px solid var(--line); }
.tri button:hover { background: var(--paper); }
.tri button.on-yes { background: var(--ok-soft); color: var(--ok); }
.tri button.on-no { background: var(--danger-soft); color: var(--danger); }
.tri button.on-unset { background: var(--paper-2); color: var(--ink-2); }
.amen-ro { font-size: 13px; color: var(--muted); }
.amen-ro.yes { color: var(--ok); font-weight: 600; }
.amen-ro.no { color: var(--danger); }

/* --- calendario a griglia --- */
.cal-card { padding: 0; overflow: hidden; }
.cal-wrap { overflow-x: auto; }
.cal { display: grid; font-size: 12.5px; min-width: max-content; }
.cal .hd, .cal .lbl, .cal .cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal .hd { position: sticky; top: 0; background: var(--paper-2); color: var(--ink-2); text-align: center; padding: 6px 0 4px; font-weight: 600; z-index: 2; line-height: 1.15; }
.cal .hd small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; }
.cal .hd.we { background: #e8e2d4; }
.cal .hd.today { background: var(--navy); color: #fff; }
.cal .hd.today small { color: rgba(255,255,255,.7); }
.cal .corner { position: sticky; left: 0; top: 0; z-index: 4; background: var(--paper-2); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.cal .lbl { position: sticky; left: 0; z-index: 3; background: var(--card); padding: 0 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); border-right: 1px solid var(--line-2); white-space: nowrap; }
.cal .lbl .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cal .row { display: contents; }
.cal .cell { position: relative; height: 44px; }
.cal .cell.we { background: #faf7f0; }
.cal .cell.today { background: rgba(22,35,58,.06); }
.cal .bar {
  position: absolute; top: 8px; height: 28px; border-radius: 14px; color: #fff; font-weight: 600;
  padding: 0 10px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; z-index: 1; box-shadow: 0 2px 6px rgba(20,34,74,.18); font-size: 12px; background-image: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.08));
}
.cal .bar:hover { filter: brightness(1.08); z-index: 2; }
.cal .bar.blocked { background: repeating-linear-gradient(45deg, #b9b3a6, #b9b3a6 6px, #cbc5b8 6px, #cbc5b8 12px) !important; color: #3c3a35; }
.cal .bar.fresh::before { content: "●"; color: #ffd36b; margin-right: 6px; }
.cal .bar.start-before { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.cal .bar.end-after { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.filters select, .filters input { width: auto; min-width: 180px; flex: 1; }
.src { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.src.booking { background: #e3ecfb; color: #1d4ed8; }
.src.airbnb { background: #fde4e8; color: #c2185b; }
.src.expedia { background: #fff2cc; color: #8a6d00; }
.src.direct { background: var(--ok-soft); color: var(--ok); }
.src.other { background: var(--paper-2); color: var(--muted); }
.pill.cancelled { background: var(--danger-soft); color: var(--danger); }
.pill.blocked { background: #ece8df; color: #5c574c; }
.pill.no_show { background: #fff2cc; color: #8a6d00; }
.ch-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; }
.ch-card h3 { display: flex; align-items: center; gap: 10px; }
.ch-card .st { font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.ch-card .st.err { color: var(--danger); }
.ch-card .feed { font-size: 13px; color: var(--ink-2); padding: 4px 0; border-top: 1px dashed var(--line); word-break: break-all; }
.ch-card .feed b { color: var(--navy); }
.detail dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; font-size: 14.5px; }
.detail dt { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; padding-top: 2px; }
.detail dd { margin: 0; }
.feed-row { display: grid; grid-template-columns: 1fr 2fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 700px) { .feed-row { grid-template-columns: 1fr; } }

/* --- drawer a schede, campi multilingua --- */
.drawer.wide { width: min(820px, 100%); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.drawer.full { width: min(calc(100vw - 250px), 100%); }
@media (max-width: 900px) { .drawer.full { width: 100%; } }
.dtabs { display: flex; gap: 2px; padding: 0 26px; border-bottom: 1px solid var(--line); background: var(--paper); overflow-x: auto; }
.dtab { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 12px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.dtab:hover { background: none; color: var(--navy); }
.dtab.active { color: var(--terra-deep); border-bottom-color: var(--terra); }
.i18n { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.i18n .ltabs { display: flex; background: var(--paper); border-bottom: 1px solid var(--line); }
.i18n .ltabs button { background: none; border: none; border-radius: 0; color: var(--muted); padding: 5px 12px; font-size: 12px; font-weight: 600; letter-spacing: .4px; }
.i18n .ltabs button.active { color: var(--navy); background: #fff; }
.i18n .ltabs button.filled::after { content: "•"; color: var(--ok); margin-left: 4px; }
.i18n .ltabs button.auto::after { content: "• auto"; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.i18n .ltabs .spacer { flex: 1; }
.i18n .ltabs .ltr { color: var(--coral, #f2622e); font-weight: 600; font-size: 12px; padding: 5px 12px; }
.i18n .ltabs .ltr:disabled { color: var(--muted); }
.lang-list { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 10px; }
.i18n textarea, .i18n input { border: none; border-radius: 0; }
.i18n textarea:focus, .i18n input:focus { box-shadow: none; }
.i18n .hint { font-size: 12px; color: var(--muted); padding: 4px 12px 8px; }
.sec-block { margin: 18px 0 8px; }
.sec-block .sec-hint { font-size: 12.5px; color: var(--muted); margin: -2px 0 6px; }
.tech-group { margin: 22px 0 6px; }
.app-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.app-row .k { font-weight: 600; color: var(--navy); }
.app-row .m { color: var(--ink-2); font-size: 14px; }
.app-row .man { font-size: 13px; margin-top: 4px; }
.app-row .man a { color: var(--terra); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); aspect-ratio: 4/3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .cover { position: absolute; top: 6px; left: 6px; background: var(--terra); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: .4px; }
.photo .tools { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .15s; }
.photo:hover .tools { opacity: 1; }
.photo .tools button { padding: 3px 8px; font-size: 11px; background: rgba(255,255,255,.9); color: var(--ink); border-color: transparent; }
.photo.drop { display: flex; align-items: center; justify-content: center; border-style: dashed; cursor: pointer; color: var(--terra); font-weight: 600; font-size: 13px; text-align: center; padding: 10px; }
.faq-item { padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.faq-item:hover { background: #f9f6ef; }
.faq-item .q { font-weight: 600; color: var(--navy); }
.faq-item .a { color: var(--ink-2); font-size: 14px; margin-top: 2px; white-space: pre-line; }
.faq-item .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.faq-item.off { opacity: .5; }

/* --- Oggi --- */
.today-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.today-col h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.today-col h3 .n { font-family: var(--sans); font-size: 12px; background: var(--paper-2); color: var(--ink-2); border-radius: 999px; padding: 2px 9px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; border-left: 5px solid var(--line-2); }
.tcard:hover { background: #fbf9f4; }
.tcard .t1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tcard .name { font-weight: 700; color: var(--navy); }
.tcard .apt { font-size: 13px; color: var(--ink-2); }
.tcard .t2 { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; align-items: center; }
.tcard .time { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--navy); font-variant-numeric: tabular-nums lining-nums; font-variation-settings: "opsz" 24, "SOFT" 0; }
.tcard.done { opacity: .55; }
.reg { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.reg.ok { background: var(--ok-soft); color: var(--ok); }
.reg.open { background: #fff2cc; color: #8a6d00; }
.reg.no { background: var(--danger-soft); color: var(--danger); }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.link-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.occ-table td { font-size: 13.5px; }
.doc-photos { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.doc-photos img { height: 140px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); }
.ops-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: var(--card); }
.ops-toggle.on { background: var(--ok-soft); border-color: #bfe3cc; }
.ops-toggle input { width: 20px; height: 20px; accent-color: var(--ok); }
.ops-toggle .who { font-size: 12.5px; color: var(--muted); }

/* --- transizione "il titolo che atterra" ---
   Il nome della sezione compare grande al centro dell'area, come un titolo di
   capitolo, poi vola al suo posto in alto a sinistra rimpicciolendosi; il
   contenuto sale in scena a scaglioni. Un alone di luce calda si spegne dietro. */
main.content { position: relative; }
section.panel.arriving .page-head h1 { visibility: hidden; }
section.panel.arriving .page-head .sub, section.panel.arriving .page-head > :not(:first-child) { animation: rise .45s .38s both; }
section.panel.arriving > :not(.page-head) { animation: rise .55s .30s cubic-bezier(.2,.8,.2,1) both; }
section.panel.arriving .stagger > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
section.panel.leaving { display: block; position: absolute; top: var(--pad-y, 34px); left: var(--pad-x, 40px); right: var(--pad-x, 40px); pointer-events: none; animation: sink .22s ease both; }
@keyframes sink { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.title-fly { position: fixed; z-index: 40; pointer-events: none; font-family: var(--serif); font-weight: 600; font-variation-settings: "opsz" 100, "SOFT" 0, "WONK" 0; color: var(--navy); white-space: nowrap; line-height: 1.15; letter-spacing: .1px; transform-origin: left top; will-change: transform, font-size; }
.title-glow { position: fixed; z-index: 39; pointer-events: none; width: 520px; height: 520px; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255,122,69,.40) 0%, rgba(255,122,69,.14) 35%, rgba(255,122,69,0) 70%); animation: glow .75s ease-out both; }
@keyframes glow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }
@media (max-width: 900px) { main.content { --pad-x: 16px; --pad-y: 20px; } }
@media (prefers-reduced-motion: reduce) { .title-fly, .title-glow { display: none; } section.panel.arriving .page-head h1 { visibility: visible; } section.panel.arriving > :not(.page-head), section.panel.arriving .stagger > *, section.panel.arriving .page-head .sub { animation: fade .25s ease; } section.panel.leaving { display: none; } }

/* --- hero home --- */
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-radius: 18px; padding: 26px 28px;
  background: linear-gradient(120deg, #1f3364 0%, #2a4587 55%, #3a5fb3 100%); color: #fff; box-shadow: 0 20px 50px rgba(42,69,135,.28); position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,122,69,.55), rgba(255,122,69,0) 70%); }
.hero-card h3 { color: #fff; font-size: 22px; }
.hero-card p { color: rgba(255,255,255,.82); margin: 6px 0 0; max-width: 46em; }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; }
button.ghost.light { color: #fff; border-color: rgba(255,255,255,.35); }
button.ghost.light:hover { background: rgba(255,255,255,.1); }

/* --- manutenzione --- */
.pr-item { display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pr-item:hover { background: #f9f6ef; }
.pr-item .bar { width: 6px; height: 44px; border-radius: 3px; }
.pr-item .t { font-weight: 700; color: var(--navy); }
.pr-item .m { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.pr-item .r { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pr-item .r b { display: block; color: var(--navy); font-family: var(--serif); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums lining-nums; font-variation-settings: "opsz" 24, "SOFT" 0; }
.pill.aperto { background: var(--danger-soft); color: var(--danger); }
.pill.programmato { background: #e6ebfa; color: var(--indigo); }
.pill.in_corso { background: #fff2cc; color: #8a6d00; }
.pill.chiuso { background: var(--ok-soft); color: var(--ok); }
.pill.annullato { background: var(--paper-2); color: var(--muted); }
.prio { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.prio.bassa { background: #9aa3b5; } .prio.media { background: #3b62e0; } .prio.alta { background: #f2a900; } .prio.urgente { background: var(--danger); box-shadow: 0 0 0 3px rgba(226,69,58,.18); }
.triage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.triage label.opt { display: block; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0; font-weight: 400; color: var(--ink); }
.triage label.opt b { display: block; color: var(--navy); margin-bottom: 2px; }
.triage label.opt.on { border-color: var(--terra); background: var(--terra-soft); }
.timeline { border-left: 2px solid var(--line-2); margin: 8px 0 0 8px; padding-left: 16px; }
.tl { position: relative; padding: 4px 0 12px; font-size: 14px; }
.tl::before { content: ""; position: absolute; left: -22px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.tl.chiuso::before { background: var(--ok); } .tl.creato::before { background: var(--terra); } .tl.programmato::before, .tl.assegnato::before { background: var(--indigo); } .tl.costo::before { background: var(--gold); }
.tl .who { color: var(--muted); font-size: 12.5px; }
.pr-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pr-photos img { height: 90px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.stat-bar { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.stat-bar .lbl { width: 140px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-bar .trk { flex: 1; height: 12px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.stat-bar .fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--indigo), var(--sky)); }
.stat-bar .val { width: 90px; text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }

table td, .cal .hd, .g-date .v { font-variant-numeric: tabular-nums; }

/* --- griglia prezzi mese --- */
.rg-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; flex-wrap: wrap; }
.rg-head h3 { font-size: 20px; min-width: 200px; }
.rg-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rg { border-collapse: separate; border-spacing: 0; min-width: max-content; font-size: 13px; }
.rg th, .rg td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; }
.rg th { background: var(--paper-2); color: var(--ink-2); font-weight: 600; font-size: 11px; line-height: 1.1; padding: 6px 0 4px; min-width: 31px; position: sticky; top: 0; z-index: 2; text-transform: none; letter-spacing: 0; }
.rg th small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.rg th.we { background: #ebe6da; }
.rg th.today { background: var(--navy); color: #fff; } .rg th.today small { color: rgba(255,255,255,.75); }
.rg th.lbl, .rg td.lbl { position: sticky; left: 0; z-index: 3; background: var(--card); text-align: left; padding: 8px 12px; font-weight: 600; color: var(--navy); white-space: nowrap; border-right: 1px solid var(--line-2); min-width: 190px; }
.rg th.lbl { z-index: 4; background: var(--paper-2); }
.rg td.lbl small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.rg td.c { height: 40px; min-width: 31px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink); cursor: default; user-select: none; }
.rg td.c.we { background: #faf7f0; }
.rg td.c.today { box-shadow: inset 0 0 0 2px rgba(31,51,100,.35); }
.rg td.c.ed { cursor: pointer; }
.rg td.c.ed:hover { background: var(--terra-soft); }
.rg td.c.sel { background: #ffd9c7 !important; box-shadow: inset 0 0 0 2px var(--terra); }
.rg td.c.per { color: var(--navy); font-weight: 700; }
.rg td.c.none { color: var(--muted); }
.rg tr.derived td.c { color: var(--ink-2); background: #fbfaf7; }
.rg tr.min td.c { font-size: 11.5px; color: var(--muted); height: 30px; }
.rg-pop { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; width: 300px; }
.rg-pop h4 { margin: 0 0 8px; font-size: 12px; }
.rg-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.rg-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
details.rg-settings { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; background: var(--card); margin-top: 12px; }
details.rg-settings summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--navy); list-style: none; display: flex; align-items: center; gap: 10px; }
details.rg-settings summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
details.rg-settings[open] summary::after { content: "▴"; }
details.rg-settings .body { padding: 0 0 14px; }


/* --- Chat ospiti (fase 4b) ------------------------------------------------ */
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: #fff4d6; color: #8a6400; }
.chat-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: start; padding: 12px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.chat-row:first-child { border-top: 0; }
.chat-row:hover { background: #f6f8fd; }
.chat-row.unread .who b { color: var(--indigo); }
.chat-row .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.chat-row .last { margin-top: 4px; font-size: 13px; color: #333; }
.chat-row .meta { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.small { font-size: 12px; }
.chat-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.chat-state { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chat-state select { width: auto; }
.chat-state select, .chat-state input { padding: 6px 8px; font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.thread { max-height: 46vh; overflow: auto; padding: 10px; background: var(--paper-2, #f4f6fb); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.bubble.guest { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.bot { align-self: flex-end; background: #eef2fc; border-color: #d9e1f7; border-bottom-right-radius: 4px; }
.bubble.staff { align-self: flex-end; background: #e6f6ec; border-color: #cfe9d9; border-bottom-right-radius: 4px; }
.bubble .bh { font-size: 11.5px; font-weight: 700; margin-bottom: 3px; }
.bubble .bt { white-space: pre-line; }
.chat-compose { margin-top: 10px; }
.chat-compose textarea { width: 100%; min-height: 84px; }
.chat-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }


/* --- Economia -------------------------------------------------------------- */
.month-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.month-nav h3 { margin: 0; min-width: 190px; text-align: center; }
.tbl.eco td.num, .tbl.eco th.num, .tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl.eco tr.total td { border-top: 2px solid var(--indigo); font-weight: 600; }
.eco-fc { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.eco-total { font-size: 18px; font-family: Fraunces, serif; }
.eco-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 170px; margin-top: 8px; }
.eb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; cursor: pointer; }
.eb .bar { width: 70%; background: #c9d4f2; border-radius: 6px 6px 0 0; min-height: 2px; transition: background .2s; }
.eb.cur .bar, .eb:hover .bar { background: var(--indigo); }
.eb .lab { font-size: 11px; color: var(--muted); margin-top: 4px; }
.eb .val { font-size: 11px; font-weight: 600; }
.eb .val.neg { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; background: #fff; }
.eco-model { padding: 8px 0; border-top: 1px solid var(--line); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl.eco { min-width: 980px; }
.ical-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; margin: 6px 0; }
.ical-row input { font-size: 12px; font-family: ui-monospace, monospace; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f8fd; }

/* Economia — schema Ambrosiana */
.eco-h { margin: 26px 0 10px; }
.dash-tiles { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-tile { flex: 1 1 260px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.dash-tile .n { font-family: Fraunces, serif; font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-tile .l { color: var(--muted); margin-top: 4px; }
.dash-tile .hint { margin-top: 6px; font-size: 13px; color: var(--indigo); }
.dash-tile.tile-netto { border-left: 5px solid var(--indigo); }
.dash-tile.tile-cleaning { border-left: 5px solid #eb6834; } .dash-tile.tile-cleaning .n { color: #eb6834; }
.dash-tile.tile-real { border-left: 5px solid var(--ok); } .dash-tile.tile-real .n { color: var(--ok); }
.eco-info { font-size: 13.5px; line-height: 1.5; }
.donut-row { display: flex; gap: 16px; flex-wrap: wrap; }
.donut-card { flex: 1 1 300px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.donut-card h4 { margin: 0 0 8px; }
.donut-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center .dl { font-size: 11px; color: var(--muted); } .donut-center .dv { font-weight: 700; font-size: 15px; }
.donut-legend { margin-top: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.legend-label { flex: 1; } .legend-value { font-variant-numeric: tabular-nums; }
.eco-details { margin-top: 12px; } .eco-details summary { cursor: pointer; margin-bottom: 8px; }
.tbl.eco-voci tr.strong td { font-weight: 700; background: #f6f8fd; }
.split-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.split-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.split-card h4 { margin: 0 0 10px; }
.split-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.split-row:first-of-type { border-top: 0; }
.split-row.total { border-top: 2px solid var(--indigo); font-weight: 700; }
.split-row.muted { color: var(--muted); font-size: 13px; }

.chat-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chat-filters button.small, button.small { padding: 5px 10px; font-size: 12.5px; }
.chat-row.archived { opacity: .6; }
.warn-txt { color: var(--danger); }
.chat-channel { width: auto; padding: 6px 8px; }
.chat-state label { font-size: 12px; color: var(--muted); display: inline-flex; flex-direction: column; gap: 2px; }
.switch.small { font-weight: 500; font-size: 13px; }

/* Chat ospiti: due colonne (come il Centro comunicazioni di Ambrosiana) */
.cc-layout { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.cc-sidebar { padding: 14px; position: sticky; top: 16px; }
.cc-sidebar #chatSearch { width: 100%; }
.cc-list { max-height: calc(100vh - 330px); overflow: auto; margin-top: 4px; }
.cc-list .chat-row { grid-template-columns: 10px 1fr; padding: 10px 6px; border-radius: 8px; }
.cc-list .chat-row .meta { grid-column: 2; text-align: left; align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 4px 8px; }
.cc-list .chat-row.active { background: #eef2fc; box-shadow: inset 3px 0 0 var(--indigo); }
.cc-thread { padding: 16px 18px; min-height: 60vh; }
.cc-thread-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.cc-thread .thread { max-height: 52vh; }
@media (max-width: 900px) { .cc-layout { grid-template-columns: 1fr; } .cc-sidebar { position: static; } .cc-list { max-height: 40vh; } }

.tcard .t3 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tcard .t3 .act { padding: 4px 9px; font-size: 12px; }
.today-cols { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Piattaforma (superadmin) */
.acting-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px; background: #fff4d6; color: #5b4300; border-bottom: 1px solid #f0dca0; font-size: 13.5px; }
.pf-row.current .who b { color: var(--indigo); }

/* Pagina Leo (23/9/2026): anteprima del messaggio d'ingresso come arriva su WhatsApp */
.leo-preview { white-space: pre-wrap; font-family: inherit; font-size: 13.5px; background: var(--bg-soft, #f6f7f9); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; }

/* Home "come Ambrosiana" (23/9/2026): arrivi con bottoni rosso/verde Fast check-in e Codici */
.ci-card { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--card, #fff); border: 1px solid var(--line, #e6e8ee); border-left: 5px solid #1f3a5f; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.ci-main { min-width: 200px; flex: 1; }
.ci-date { font-size: 13px; color: var(--muted, #667); }
.ci-name { font-weight: 600; font-size: 16px; margin: 2px 0; }
.ci-apt { font-size: 13.5px; color: var(--muted, #667); }
.ci-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.ci-state { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 150px; }
.state-btn { border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 14px; color: #fff; cursor: pointer; width: 100%; }
.state-btn.ok { background: #1e8e3e; }
.state-btn.no { background: #d93025; }
.state-btn:disabled { opacity: .55; cursor: not-allowed; }
.state-sub { font-size: 12px; color: var(--muted, #667); text-align: center; }
@media (max-width: 600px) { .ci-actions { width: 100%; } .ci-state { flex: 1; min-width: 0; } }

/* Importi prenotazione (come Ambrosiana) e avviso Economia — 29/9/2026 */
.chk-inline{display:flex;align-items:center;gap:8px;font-weight:400;margin-top:6px}
.chk-inline input{width:auto;margin:0}
.price-summary{margin:12px 0 4px;padding:12px 14px;border-radius:10px;background:#f4f6fb;border:1px solid #e3e8f2}
.price-summary .tot{font-size:1.15rem;font-weight:700}
.eco-missing{margin:0 0 16px;padding:12px 16px;border-radius:10px;background:#fff4e5;border:1px solid #f3c78b;color:#6b4200}
.eco-missing ul{margin:8px 0 0;padding-left:18px}
.eco-missing a{color:#6b4200;font-weight:600}

/* Allegati chat (29/9/2026) */
.bubble .atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bubble .atts img { max-width: 180px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); display: block; object-fit: cover; }
.bubble .att-doc { display: inline-block; padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.att-pending { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.att-pending:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2, #f4f6fb); font-size: 12.5px; max-width: 100%; }
.att-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.chat-compose.drop { outline: 2px dashed #3452a3; outline-offset: 4px; border-radius: 10px; }

/* Prezzo a notte nelle notti libere (vista proprietario, 13/10/2026): a destra, così non finisce sotto la mezza barra del giorno di partenza. */
.cal-price { position: absolute; right: 2px; bottom: 3px; font-size: 10px; font-weight: 600; color: var(--muted, #7b7f8a); font-variant-numeric: tabular-nums; pointer-events: none; }
