/* ==========================================================================
   ATRIO — Pannello amministratore (prototipo desktop)
   ========================================================================== */

body { background: var(--paper); min-height: 100vh; }

.shell { display: flex; min-height: 100vh; }

/* ------------------------------------------------------------- sidebar */
.side {
  width: 254px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(185deg, #0E2322, #163329 60%, #0B1C1B);
  color: #D7E8E7; padding: 20px 14px 14px;
}
.side .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.side .brand .logo { height: 34px; width: auto; flex: none; align-self: center; object-fit: contain; max-width: none; }
.side .brand .mk { display: none; width: 40px; height: 40px; border-radius: 12px; place-items: center; background: rgba(255,255,255,.12); color: #fff; flex: none; }
.side .brand .mk svg { width: 22px; height: 22px; }
.side .brand b { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: #fff; letter-spacing: .01em; display: block; }
.side .brand small { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7D9C9A; font-weight: 600; }

.nav-t { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #6D8B89; padding: 16px 10px 7px; }
.nav-i {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 11px; font-size: 14.5px; font-weight: 550;
  color: #B2CBC9; transition: background .18s, color .18s; position: relative;
}
.nav-i:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-i.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 650; }
.nav-i.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--copper-500); }
.nav-i svg { width: 19px; height: 19px; flex: none; }
.nav-i .cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.13); padding: 2px 7px; border-radius: 99px; }
.nav-i .cnt.hot { background: var(--copper-600); color: #fff; }

.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.06); }
.side .me .av { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg,#46908D,#2A6F6C); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; flex: none; }
.side .me b { font-size: 13.5px; color: #fff; display: block; }
.side .me small { font-size: 11.5px; color: #7D9C9A; }

@media (max-width: 1120px) {
  .side { width: 72px; padding: 20px 10px 14px; align-items: center; }
  .side .brand { padding: 4px 0 20px; }
  .side .brand .txt, .side .nav-t, .side .nav-i span.lbl, .side .me .txt { display: none; }
  .side .brand .mk { display: grid; }
  .nav-i { justify-content: center; padding: 11px 0; }
  .nav-i .cnt { position: absolute; top: 3px; right: 3px; margin: 0; font-size: 10px; padding: 1px 5px; }
  .nav-i.on::before { left: -10px; }
}

/* ---------------------------------------------------------------- main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  position: sticky; top: 0; z-index: 40; height: 74px; flex: none;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px); box-shadow: 0 1px 0 var(--line);
}
.top h1 { font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: .015em; margin: 0; }
.top .crumb { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 1px; }
.top .sp { flex: 1; }

.srch { position: relative; width: 290px; }
.srch input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 14.5px;
  transition: border-color .2s, box-shadow .2s;
}
.srch input:focus { outline: none; border-color: var(--pine-500); box-shadow: 0 0 0 4px var(--pine-50); }
.srch svg { position: absolute; left: 13px; top: 11px; width: 19px; height: 19px; color: var(--ink-4); pointer-events: none; }

.ibtn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); transition: background .18s, color .18s; position: relative; }
.ibtn:hover { background: rgba(20,28,25,.06); color: var(--ink); }
.ibtn svg { width: 21px; height: 21px; }
.ibtn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 99px; background: var(--copper-500); box-shadow: 0 0 0 2.5px var(--paper); }

.content { padding: 26px 28px 70px; flex: 1; animation: atr-fade-up .45s var(--e-out) both; }

/* ------------------------------------------------------------ elementi */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 17px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  transition: background .18s, transform .16s var(--e-spring), box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.975); }
.btn--primary { background: var(--pine-700); color: #fff; box-shadow: 0 2px 8px rgba(29,91,89,.22); }
.btn--primary:hover { background: var(--pine-600); }
.btn--copper { background: var(--copper-600); color: #fff; box-shadow: 0 2px 8px rgba(180,97,58,.26); }
.btn--copper:hover { background: var(--copper-500); }
.btn--light { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn--light:hover { border-color: var(--ink-4); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: rgba(20,28,25,.055); color: var(--ink); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line-2); }
.panel-h h2 { font-size: 15.5px; font-weight: 650; margin: 0; letter-spacing: -.005em; }
.panel-h .sp { flex: 1; }
.panel-h small { font-size: 13px; color: var(--ink-3); }
.panel-b { padding: 18px 20px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g23 { grid-template-columns: 1.65fr 1fr; }
@media (max-width: 1300px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g23 { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .g3, .g2 { grid-template-columns: 1fr; } }

/* KPI */
.kpi { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px 20px 17px; box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.kpi .kl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.kpi .kl svg { width: 16px; height: 16px; }
.kpi .kv { font-family: var(--font-display); font-size: 33px; font-weight: 400; letter-spacing: .015em; margin: 9px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .kd { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .kd b { font-weight: 650; }
.kpi .kd .up { color: var(--ok); } .kpi .kd .dn { color: var(--danger); }
.kpi.accent { background: linear-gradient(150deg, #1D5B59, #2A6F6C 60%, #153735); border-color: transparent; color: #fff; }
.kpi.accent .kl { color: #9DBDBB; } .kpi.accent .kd { color: #B2CBC9; }

/* tabella */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface);
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--pine-50); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .who { display: flex; align-items: center; gap: 11px; }
.tbl .who b { font-weight: 600; display: block; }
.tbl .who small { color: var(--ink-3); font-size: 12.5px; }

.av {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .01em;
  background: linear-gradient(145deg, #46908D, #2A6F6C);
}
.av.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 20px; }
.av.c1 { background: linear-gradient(145deg,#D07A4B,#B4613A); }
.av.c2 { background: linear-gradient(145deg,#6E93AE,#3F6A89); }
.av.c3 { background: linear-gradient(145deg,#9A8CB8,#6B5B96); }
.av.c4 { background: linear-gradient(145deg,#C2975A,#9A7132); }

/* filtri */
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.fchip {
  height: 38px; padding: 0 14px; border-radius: 11px; font-size: 13.8px; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px; transition: all .18s;
}
.fchip:hover { border-color: var(--ink-4); }
.fchip.on { background: var(--pine-700); border-color: var(--pine-700); color: #fff; }
.fchip svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------- grafici */
.chart { width: 100%; }
.chart-hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.chart-hero { font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: .015em; font-variant-numeric: tabular-nums; }
.chart-sub { font-size: 13px; color: var(--ink-3); }

.plot { position: relative; padding: 26px 0 0 40px; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bars .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.bars .gl span { position: absolute; left: -40px; top: -8px; width: 33px; text-align: right; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.bar-col .bv {
  display: block; width: 100%; max-width: 52px; flex: none;
  border-radius: 4px 4px 0 0; background: var(--pine-600);
  transition: background .2s; transform-origin: bottom;
  animation: bar-grow .6s var(--e-out) both;
}
.bar-col:hover .bv { background: var(--pine-700); }
.bar-col.cur .bv { background: var(--copper-500); }
.bar-col.cur:hover .bv { background: var(--copper-600); }
.bar-col .bl {
  position: absolute; left: -6px; right: -6px; text-align: center;
  font-size: 12px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums;
}
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar-col:nth-child(3) .bv { animation-delay: .03s } .bar-col:nth-child(4) .bv { animation-delay: .06s }
.bar-col:nth-child(5) .bv { animation-delay: .09s } .bar-col:nth-child(6) .bv { animation-delay: .12s }
.bar-col:nth-child(7) .bv { animation-delay: .15s } .bar-col:nth-child(8) .bv { animation-delay: .18s }

.xaxis { display: flex; gap: 10px; margin-top: 10px; }
.xaxis span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 600; }

.hbars { display: grid; gap: 13px; margin-top: 6px; }
.hbar { display: grid; grid-template-columns: 136px 1fr 46px; align-items: center; gap: 12px; }
.hbar .hl { font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.hbar .ht { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.hbar .hf { display: block; height: 100%; border-radius: 99px; background: var(--pine-600); transform-origin: left; animation: hbar-grow .7s var(--e-out) both; }
.hbar:hover .hf { background: var(--pine-700); }
.hbar .hv { font-size: 13.5px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
@keyframes hbar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.tipbox {
  position: fixed; z-index: 200; pointer-events: none; background: var(--pine-800); color: #fff;
  padding: 8px 11px; border-radius: 10px; font-size: 12.8px; line-height: 1.4; box-shadow: var(--sh-3);
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.tipbox.show { opacity: 1; }
.tipbox b { font-weight: 650; }

/* ------------------------------------------------------------- feed */
.feed { display: grid; }
.feed-i { display: flex; gap: 12px; padding: 12px 0; }
.feed-i + .feed-i { border-top: 1px solid var(--line-2); }
.feed-i .fi { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--pine-50); color: var(--pine-700); }
.feed-i .fi.ai { background: var(--ai-100); color: var(--ai-600); }
.feed-i .fi svg { width: 17px; height: 17px; }
.feed-i .ft { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.feed-i .ft b { color: var(--ink); font-weight: 650; }
.feed-i .fw { font-size: 12.5px; color: var(--ink-4); white-space: nowrap; }

/* --------------------------------------------------------- scheda */
.person-hd { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.person-hd .pn { flex: 1; min-width: 0; }
.person-hd h2 { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: .015em; margin: 0 0 5px; }
.person-hd .pm { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.person-hd .acts { display: flex; gap: 8px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs::-webkit-scrollbar { height: 0; }
.tab2 {
  padding: 11px 15px; font-size: 14.2px; font-weight: 600; color: var(--ink-3);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .18s, border-color .18s;
}
.tab2:hover { color: var(--ink); }
.tab2.on { color: var(--pine-700); border-color: var(--pine-700); }

.lrow { display: flex; align-items: center; gap: 13px; padding: 13px 0; }
.lrow + .lrow { border-top: 1px solid var(--line-2); }
.lrow .li { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--pine-50); color: var(--pine-700); }
.lrow .li svg { width: 19px; height: 19px; }
.lrow .li.off { background: var(--paper-2); color: var(--ink-4); }
.lrow .li.copper { background: var(--copper-100); color: var(--copper-700); }
.lrow .li.ai { background: var(--ai-100); color: var(--ai-600); }
.lrow .lt { flex: 1; min-width: 0; }
.lrow .lt b { display: block; font-size: 14.5px; font-weight: 600; }
.lrow .lt small { display: block; font-size: 12.8px; color: var(--ink-3); margin-top: 2px; }
.lrow .lr { flex: none; display: flex; align-items: center; gap: 10px; }

.kv2 { display: grid; grid-template-columns: 150px 1fr; gap: 5px 16px; font-size: 14.2px; }
.kv2 dt { color: var(--ink-3); padding: 7px 0; }
.kv2 dd { margin: 0; padding: 7px 0; font-weight: 600; }

/* switch */
.sw {
  flex: none; width: 46px; height: 27px; border-radius: 99px; background: #DAD4CA; position: relative;
  transition: background .3s var(--e-out);
}
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 99px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: transform .3s var(--e-spring); }
.sw::before {
  content: ''; position: absolute; left: 10px; top: 50%; width: 9px; height: 5px;
  border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff;
  transform: translateY(-70%) rotate(-45deg); opacity: 0; transition: opacity .25s .05s;
}
.sw.on::before { opacity: 1; }
.sw.on { background: var(--ok); }
.sw.on::after { transform: translateX(19px); }

/* drawer + modale */
.scrim2 { position: fixed; inset: 0; z-index: 150; background: rgba(10,22,21,.4); backdrop-filter: blur(2px); opacity: 0; transition: opacity .3s; }
.scrim2.show { opacity: 1; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw; z-index: 160;
  background: var(--surface); box-shadow: -20px 0 60px rgba(14,35,34,.2);
  transform: translateX(100%); transition: transform .4s var(--e-out);
  display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); flex: none; }
.drawer-h h3 { font-size: 17px; font-weight: 650; margin: 0; flex: 1; }
.drawer-b { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; flex: none; }

.modal {
  position: fixed; top: 50%; left: 50%; z-index: 160; width: 560px; max-width: 94vw; max-height: 88vh;
  transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-4);
  display: flex; flex-direction: column; transition: opacity .28s, transform .32s var(--e-out);
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.modal-h { padding: 22px 24px 4px; }
.modal-h h3 { font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: .015em; margin: 0; }
.modal-h p { font-size: 14px; color: var(--ink-2); margin: 7px 0 0; line-height: 1.5; }
.modal-b { padding: 18px 24px; overflow-y: auto; }
.modal-f { padding: 14px 24px 20px; display: flex; gap: 9px; justify-content: flex-end; }

/* campi */
.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 12.8px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.fld input, .fld select, .fld textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 14.5px; transition: border-color .2s, box-shadow .2s;
}
.fld textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 92px; line-height: 1.5; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--pine-500); box-shadow: 0 0 0 4px var(--pine-50); }
.fld .hint { font-size: 12.3px; color: var(--ink-3); margin-top: 5px; line-height: 1.45; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--r-md); padding: 30px 20px; text-align: center;
  color: var(--ink-3); transition: border-color .2s, background .2s; cursor: pointer;
}
.drop:hover { border-color: var(--pine-500); background: var(--pine-50); }
.drop svg { width: 26px; height: 26px; margin: 0 auto 10px; color: var(--ink-4); }
.drop b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 4px; }
.drop small { font-size: 12.8px; }

/* note / toast */
.note2 { display: flex; gap: 11px; padding: 13px 15px; border-radius: 12px; background: var(--info-bg); color: #255A79; font-size: 13.4px; line-height: 1.5; }
.note2 svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note2.warn { background: var(--warn-bg); color: #8A6213; }
.note2.ok { background: var(--ok-bg); color: #1F5C42; }

.toasts2 { position: fixed; right: 24px; bottom: 24px; z-index: 300; display: grid; gap: 9px; }
.toast2 {
  display: flex; align-items: center; gap: 11px; padding: 13px 17px; border-radius: 13px;
  background: var(--pine-800); color: #fff; box-shadow: var(--sh-3); font-size: 14.2px; font-weight: 500;
  animation: t2-in .4s var(--e-spring) both;
}
.toast2.out { animation: t2-out .3s forwards; }
.toast2 svg { width: 19px; height: 19px; flex: none; color: #86D9B0; }
.toast2.warn { background: var(--copper-700); } .toast2.warn svg { color: #F6D9C5; }
@keyframes t2-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes t2-out { to { opacity: 0; transform: translateY(10px); } }

/* login admin */
.alogin {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center;
  background: radial-gradient(900px 520px at 20% -10%, #1D5B59, transparent 62%), linear-gradient(165deg, #0E2322, #143432 55%, #0B1C1B);
}
.alogin.hide { animation: al-out .5s var(--e-in-out) forwards; }
@keyframes al-out { to { opacity: 0; visibility: hidden; } }
.alogin .box { width: 396px; max-width: 92vw; background: var(--surface); border-radius: var(--r-xl); padding: 34px 32px 28px; box-shadow: var(--sh-4); animation: atr-fade-up .6s var(--e-out) both; }
.alogin .lg-logo { height: 42px; width: auto; margin-bottom: 22px; flex: none; align-self: flex-start; object-fit: contain; max-width: none; }
.alogin h1 { font-family: var(--font-display); font-size: 26px; font-weight: 400; letter-spacing: .015em; margin: 0 0 6px; }
.alogin p { font-size: 14px; color: var(--ink-2); margin: 0 0 22px; line-height: 1.5; }
.alogin .foot { text-align: center; font-size: 12.3px; color: var(--ink-4); margin-top: 18px; line-height: 1.6; }

.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: color .2s, gap .25s var(--e-out); }
.back-link:hover { color: var(--copper-600); gap: 11px; }
.back-link svg { width: 15px; height: 15px; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg { width: 34px; height: 34px; margin: 0 auto 14px; color: var(--ink-4); }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 5px; }
.empty small { font-size: 13.5px; }

/* ======================================================================
   Scelta dello stabile: primo passo dopo l'accesso, e sempre richiamabile
   ====================================================================== */
.picker {
  position: fixed; inset: 0; z-index: 380; display: grid; place-items: center; padding: 32px 24px;
  background: radial-gradient(900px 520px at 20% -10%, #1D5B59, transparent 62%),
              linear-gradient(165deg, #0E2322, #143432 55%, #0B1C1B);
  overflow-y: auto;
}
.picker.hide { animation: al-out .45s var(--e-in-out) forwards; }
.pk-box { width: 100%; max-width: 920px; animation: atr-fade-up .55s var(--e-out) both; }
.pk-h { margin-bottom: 26px; }
.pk-h .logo { height: 40px; width: auto; margin-bottom: 20px; flex: none; align-self: flex-start; object-fit: contain; max-width: none; }
.pk-h h1 { font-family: var(--font-display); font-weight: 400; font-size: 38px; letter-spacing: .015em; color: #fff; margin: 0 0 8px; }
.pk-h p { font-size: 15px; color: #A6BCBA; margin: 0; line-height: 1.55; }

.pk-list { display: grid; gap: 12px; }

.pk-row {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  padding: 18px 20px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.1);
  color: #D7E8E7; transition: transform .3s var(--e-out), background .25s, border-color .25s, box-shadow .3s;
  animation: atr-fade-up .55s var(--e-out) both;
}
.pk-row:nth-child(2) { animation-delay: .07s } .pk-row:nth-child(3) { animation-delay: .14s }
.pk-row:hover { transform: translateX(4px); background: rgba(255,255,255,.1); border-color: rgba(232,167,126,.6); box-shadow: 0 18px 38px rgba(0,0,0,.28); }
.pk-row.on { border-color: rgba(232,167,126,.75); background: rgba(255,255,255,.1); }
.pk-row .pi { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.pk-row .pi svg { width: 23px; height: 23px; }
.pk-row .pk-n { flex: none; width: 232px; }
.pk-row .pk-n b { display: block; font-size: 19px; font-weight: 600; color: #fff; }
.pk-row .pk-n small { display: block; font-size: 13.5px; color: #9DBDBB; margin-top: 2px; }
.pk-row .pk-st { flex: 1; display: flex; gap: 26px; flex-wrap: wrap; }
.pk-row .pk-st div { font-size: 12px; color: #9DBDBB; }
.pk-row .pk-st div b { display: block; font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 1px; font-variant-numeric: tabular-nums; }
.pk-row .pk-go { flex: none; color: #E8A77E; transition: transform .3s var(--e-out); }
.pk-row .pk-go svg { width: 20px; height: 20px; }
.pk-row:hover .pk-go { transform: translateX(4px); }

@media (max-width: 880px) {
  .pk-row { flex-wrap: wrap; }
  .pk-row .pk-n { width: auto; flex: 1; }
  .pk-row .pk-st { width: 100%; gap: 18px; }
}

/* commutatore nella barra laterale */
.switcher {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 12px; margin-bottom: 4px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: #D7E8E7; transition: background .2s, border-color .2s;
}
.switcher:hover { background: rgba(255,255,255,.12); border-color: rgba(232,167,126,.5); }
.switcher .sw-ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--copper-600); color: #fff; }
.switcher .sw-ic svg { width: 17px; height: 17px; }
.switcher .sw-t { flex: 1; min-width: 0; }
.switcher .sw-t small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7D9C9A; }
.switcher .sw-t b { display: block; font-size: 13.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher .sw-c { flex: none; color: #7D9C9A; }
.switcher .sw-c svg { width: 16px; height: 16px; }
@media (max-width: 1120px) { .switcher { justify-content: center; padding: 10px 0; } }


/* --- viola: tutto ciò che è intelligenza artificiale (DS 2026) ---------- */
.badge--ai { background: var(--ai-100); color: var(--ai-700); }
.btn--ai { background: var(--ai-600); color: #fff; box-shadow: 0 2px 8px rgba(76,58,122,.28); }
.btn--ai:hover { background: var(--ai-500); }
.bolla-ai {
  background: var(--ai-100); border: 1px solid var(--ai-200); color: var(--ai-700);
  border-radius: 14px; border-bottom-right-radius: 5px; padding: 12px 14px;
  font-size: 14px; line-height: 1.5;
}
.bolla-ai b { color: var(--ai-600); }
.note2.ai { background: var(--ai-100); color: var(--ai-700); }

/* ======================================================================
   Agenda: calendario settimanale degli appuntamenti.
   Usato dal pannello amministratore e da quello delle pulizie.
   ====================================================================== */
.cal-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-top .per { font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: .015em; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2); transition: border-color .18s, color .18s; }
.cal-nav button:hover { border-color: var(--ink-4); color: var(--ink); }
.cal-nav button svg { width: 17px; height: 17px; }

.cal { overflow-x: auto; }
.cal-inner { min-width: 860px; }
.cal-head { display: grid; grid-template-columns: 58px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-head .ch { padding: 10px 8px; text-align: center; border-left: 1px solid var(--line-2); }
.cal-head .ch:first-child { border-left: 0; }
.cal-head .ch b { display: block; font-size: 13px; font-weight: 650; text-transform: capitalize; }
.cal-head .ch small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.cal-head .ch.oggi b { color: var(--copper-600); }
.cal-head .ch.oggi small { color: var(--copper-600); }
.cal-head .ch.wknd { background: var(--paper); }

.cal-body { display: grid; grid-template-columns: 58px repeat(7, 1fr); position: relative; }
.cal-gutter { position: relative; }
.cal-gutter span { position: absolute; right: 8px; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; transform: translateY(-6px); }
.cal-col { position: relative; border-left: 1px solid var(--line-2); }
.cal-col.wknd { background: var(--paper); }
.cal-col.oggi { background: color-mix(in srgb, var(--pine-50) 70%, transparent); }
.cal-hline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-2); pointer-events: none; }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--copper-500); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 99px; background: var(--copper-500); }

.cal-ev {
  position: absolute; border-radius: 9px; padding: 5px 7px; overflow: hidden;
  font-size: 12px; line-height: 1.3; text-align: left; z-index: 2;
  background: var(--pine-50); color: var(--pine-800); border-left: 3px solid var(--pine-600);
  box-shadow: 0 1px 3px rgba(20,28,25,.07);
  transition: transform .18s var(--e-out), box-shadow .2s, filter .2s;
}
.cal-ev:hover { transform: translateY(-1px); box-shadow: var(--sh-2); filter: brightness(.99); z-index: 4; }
.cal-ev b { display: block; font-weight: 650; font-size: 12.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev small { display: block; font-size: 11.3px; opacity: .78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev .ei { position: absolute; right: 5px; top: 5px; opacity: .45; }
.cal-ev .ei svg { width: 13px; height: 13px; }
.cal-ev.attesa   { background: var(--warn-bg);   color: #7A5610; border-left-color: var(--warn); border-top: 1px dashed var(--warn); border-right: 1px dashed var(--warn); border-bottom: 1px dashed var(--warn); }
.cal-ev.fatto    { background: var(--paper-2);   color: var(--ink-3); border-left-color: var(--ink-4); }
.cal-ev.rifiutato{ background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }
.cal-ev.rifiutato b { text-decoration: line-through; }

/* legenda */
.cal-leg { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 12.8px; color: var(--ink-3); }
.cal-leg i { display: inline-flex; align-items: center; gap: 7px; font-style: normal; }
.cal-leg i::before { content: ''; width: 11px; height: 11px; border-radius: 4px; background: var(--pine-600); }
.cal-leg i.attesa::before   { background: var(--warn); }
.cal-leg i.fatto::before    { background: var(--ink-4); }
.cal-leg i.rifiutato::before{ background: var(--danger); }

/* ------------------------------------------- richieste da confermare */
.rq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 1100px) { .rq-grid { grid-template-columns: 1fr; } }
.rq {
  background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--warn);
  border-radius: var(--r-md); box-shadow: var(--sh-1); padding: 17px 18px 15px;
  animation: atr-fade-up .45s var(--e-out) both;
}
.rq.urgente { border-left-color: var(--danger); }
.rq-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.rq-h .li { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--pine-50); color: var(--pine-700); }
.rq-h .li svg { width: 20px; height: 20px; }
.rq-h .t { flex: 1; min-width: 0; }
.rq-h .t b { display: block; font-size: 15.5px; font-weight: 650; }
.rq-h .t small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.rq-when { font-family: var(--font-display); font-size: 19px; letter-spacing: .015em; white-space: nowrap; }
.rq-when small { display: block; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; text-align: right; }
.rq-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rq-note { display: flex; gap: 9px; font-size: 13.2px; line-height: 1.5; color: var(--ink-2); background: var(--paper); border-radius: 11px; padding: 10px 12px; margin-bottom: 13px; }
.rq-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ink-4); }
.rq-f { display: flex; gap: 8px; align-items: center; }
.rq-f .sp { flex: 1; }

/* ------------------------------------------------- giro di oggi */
.giro { position: relative; padding-left: 26px; }
.giro::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.giro-i { position: relative; display: flex; align-items: center; gap: 13px; padding: 13px 0; }
.giro-i + .giro-i { border-top: 1px solid var(--line-2); }
.giro-i::before { content: ''; position: absolute; left: -23px; top: 50%; width: 10px; height: 10px; border-radius: 99px; background: var(--surface); border: 2.5px solid var(--pine-500); transform: translateY(-50%); }
.giro-i.fatto::before { background: var(--ok); border-color: var(--ok); }
.giro-i.attesa::before { border-color: var(--warn); }
.giro-ora { font-family: var(--font-display); font-size: 20px; letter-spacing: .015em; width: 58px; flex: none; font-variant-numeric: tabular-nums; }
.giro-i .lt { flex: 1; min-width: 0; }
.giro-i .lt b { display: block; font-size: 14.8px; font-weight: 600; }
.giro-i .lt small { display: block; font-size: 12.8px; color: var(--ink-3); margin-top: 2px; }
.giro-i .lr { display: flex; align-items: center; gap: 9px; flex: none; }

/* maiuscola solo sulla prima lettera: «venerdì 6 novembre» → «Venerdì 6 novembre» */
.cap { display: inline-block; }
.cap::first-letter { text-transform: uppercase; }

/* ------------------------------------------- comunicazioni agli inquilini */
.cm-read { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 124px; }
.cm-read small { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cm-prog { display: block; width: 124px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.cm-fill { display: block; height: 100%; border-radius: 99px; background: var(--pine-700); transition: width .5s var(--e-out, ease); }
.drawer-b .cm-prog { width: 100%; height: 8px; }
