:root {
  --forest: #1f4d2b;
  --forest-2: #2a6338;
  --web: #3f9a52;
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --text: #16201a;
  --muted: #5d6b61;
  --border: #dbe4dd;
  --focus: #3f9a52;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.05);
  --danger: #c0392b;
  --s-libero: #2f9e4f;   --s-libero-bg: #e3f5e8;
  --s-prenotato: #a86b00; --s-prenotato-bg: #fdf1d8;
  --s-contatto: #1f6fb8;  --s-contatto-bg: #e2eefa;
  --s-trattativa: #7a4bc2; --s-trattativa-bg: #efe7fb;
  --s-chiuso: #1f4d2b;    --s-chiuso-bg: #d7ecd9;
  --s-rifiutato: #b8322a; --s-rifiutato-bg: #fbe4e2;
  --s-sparito: #6b6f73;   --s-sparito-bg: #eceeef;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1 { font-size: 1.7rem; margin: 0 0 .2rem; }
h2 { margin: 0 0 .3rem; }
h3 { margin: 0 0 .6rem; }
.web { color: var(--web); }

/* Barra in alto */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.logo { font-size: 1.65rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); user-select: none; }
.logo span { color: var(--web); }
.logo img { height: 40px; display: block; }
.topbar-right { justify-self: end; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--web); color: var(--web); }
/* Interruttore chiaro/scuro: sole a sinistra, luna a destra, pallino che scorre */
.theme-toggle {
  position: relative; width: 78px; height: 40px; padding: 0; border-radius: 99px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface-2);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center;
  transition: background-color .35s ease, border-color .35s ease;
}
.theme-toggle:hover { border-color: var(--web); }
.theme-toggle:focus-visible { outline: 2px solid var(--web); outline-offset: 2px; }
.tt-knob {
  position: absolute; top: 3px; left: 3px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--forest); box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .35s cubic-bezier(.65,0,.35,1), background-color .35s ease;
}
.tt-ico { position: relative; z-index: 1; transition: opacity .35s ease, color .35s ease, transform .35s ease; }
.tt-sun { color: #fff; opacity: 1; }
.tt-moon { color: var(--text); opacity: .35; }
[data-theme-now="dark"] .tt-knob { transform: translateX(38px); background: var(--web); }
[data-theme-now="dark"] .tt-sun { color: var(--text); opacity: .35; transform: rotate(-30deg); }
[data-theme-now="dark"] .tt-moon { color: #0b0e0c; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tt-knob, .tt-ico, .theme-toggle { transition: none; } }

/* Layout */
.app { display: flex; min-height: calc(100vh - 64px); }
body.logged .topbar { margin-left: 240px; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--forest); color: #fff;
  padding: 96px 14px 18px; display: flex; flex-direction: column; gap: 18px;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 25;
}
body.logged .content { margin-left: 240px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.82); font: inherit; font-size: 1.05rem; font-weight: 600; text-align: left;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: #7fd18e; }
.badge { margin-left: auto; background: #f0b54a; color: #2b1d00; font-size: .75rem; border-radius: 99px; padding: 1px 8px; }
.sidebar-foot { margin-top: auto; font-size: .78rem; color: rgba(255,255,255,.6); padding: 8px; }
.content { flex: 1; min-width: 0; padding: 28px 32px 60px; max-width: 980px; }

/* Card e form */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); margin: 16px 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.big-label { font-size: 1rem; color: var(--text); }
input {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 13px; width: 100%;
}
input:focus { outline: none; border-color: var(--focus); background: var(--surface); }
#qNome, #qCat { font-size: 1.15rem; padding: 14px 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.extra summary { cursor: pointer; color: var(--web); font-weight: 600; padding: 4px 0; }
.extra[open] summary { margin-bottom: 10px; }
.extra .row2 + .row2 { margin-top: 12px; }
.notice { margin: -6px 0 0; font-size: .88rem; background: var(--s-prenotato-bg); color: var(--s-prenotato); padding: 8px 12px; border-radius: 8px; font-weight: 600; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 10px 16px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--web); }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.primary:hover { background: var(--forest-2); }
.btn.big { padding: 14px 20px; font-size: 1.05rem; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.small { padding: 7px 12px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* Accesso */
.auth { display: grid; place-items: start center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 460px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 8px; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Risultati */
.result {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  margin: 12px 0; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border-left: 5px solid var(--sc, var(--border));
}
.result .name { font-weight: 700; font-size: 1.1rem; }
.result .meta { color: var(--muted); font-size: .9rem; }
.result .who { margin-top: 4px; font-size: .95rem; }
.result-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.free-box { text-align: center; padding: 28px 20px; border: 2px dashed var(--s-libero); background: var(--s-libero-bg); border-radius: 14px; margin: 16px 0; }
.free-box .big:not(.btn) { font-size: 1.25rem; font-weight: 700; color: var(--s-libero); }
.list-title { margin: 22px 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.new-hint { text-align: center; margin: 16px 0; }

.pill { display: inline-block; font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.s-libero { color: var(--s-libero); background: var(--s-libero-bg); }
.s-prenotato { color: var(--s-prenotato); background: var(--s-prenotato-bg); }
.s-in_contatto { color: var(--s-contatto); background: var(--s-contatto-bg); }
.s-in_contrattazione { color: var(--s-trattativa); background: var(--s-trattativa-bg); }
.s-chiuso { color: var(--s-chiuso); background: var(--s-chiuso-bg); }
.s-rifiutato { color: var(--s-rifiutato); background: var(--s-rifiutato-bg); }
.s-sparito { color: var(--s-sparito); background: var(--s-sparito-bg); }

/* Affari */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.chip { font: inherit; font-size: .88rem; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.chip.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.deal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 12px 0; border-left: 5px solid var(--sc, var(--border)); }
.deal-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.deal .name { font-weight: 700; font-size: 1.1rem; }
.deal .meta { color: var(--muted); font-size: .9rem; }
.deal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.deal-actions .label { font-size: .85rem; color: var(--muted); margin-right: 4px; }
.status-btn.current, .status-btn.current:disabled { background: var(--forest); color: #fff; border-color: var(--forest); opacity: 1; }
.warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--s-prenotato-bg); color: var(--s-prenotato); font-weight: 600; font-size: .92rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* Account */
.account-card { display: flex; align-items: center; gap: 16px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex-shrink: 0; }
.acc-name { font-weight: 700; font-size: 1.2rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: .85rem; color: var(--muted); }
.howto { margin: 0; padding-left: 20px; }
.howto li { margin: 6px 0; }

/* Modale e avvisi */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--surface); border-radius: 14px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--danger); color: #fff; }

/* Telefono: il menu diventa una barra in basso */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: auto; height: auto; z-index: 30;
    flex-direction: row; padding: 6px; gap: 4px;
  }
  body.logged .topbar, body.logged .content { margin-left: 0; }
  .nav-item { font-size: .75rem; }
  .nav-item { flex-direction: column; gap: 2px; font-size: .75rem; padding: 8px 4px; text-align: center; justify-content: center; }
  .nav-item.active::before { display: none; }
  .badge { position: absolute; top: 2px; right: 18%; margin: 0; }
  .sidebar-foot { display: none; }
  .content { padding: 20px 16px 110px; }
  .row2 { grid-template-columns: 1fr; }
  .result-right { align-items: flex-start; }
  .logo { font-size: 1.4rem; }
  .toast { bottom: 96px; }
}

/* Ricerca: settore obbligatorio */
.row-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.same-sector { font-size: .78rem; font-weight: 700; color: var(--web); margin-left: 6px; }
@media (max-width: 760px) { .row-main { grid-template-columns: 1fr; } }

/* Consegne e organizzazione */
select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 13px; width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
select:focus, textarea:focus { outline: none; border-color: var(--focus); background: var(--surface); }
.section-title { margin: 34px 0 4px; font-size: 1.35rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head h3 { margin: 0; text-transform: capitalize; }
.cal-nav { display: flex; gap: 6px; }
  font: inherit; color: var(--text); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 10px;
  min-height: 64px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
}
.dots { display: flex; flex-wrap: wrap; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.more { font-size: .7rem; color: var(--muted); font-weight: 700; }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.day-head h3 { margin: 0; text-transform: capitalize; }
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.ev:first-child { border-top: 0; }
.ev-time { font-weight: 700; min-width: 100px; font-variant-numeric: tabular-nums; }
.ev-body { flex: 1; min-width: 0; }
.ev-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ev-type .dot { width: 10px; height: 10px; }
.ev-sub { color: var(--muted); font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.ev.done .ev-type, .ev.done .ev-time { text-decoration: line-through; opacity: .55; }
.ev-actions { display: flex; gap: 6px; }
.ev-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.upcoming .ev-time { min-width: 140px; }
@media (max-width: 760px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :first-child { grid-column: 1 / -1; }
  .dot { width: 6px; height: 6px; }
  .ev { flex-wrap: wrap; gap: 6px; }
  .ev-time, .upcoming .ev-time { min-width: 0; width: 100%; }
}

/* Ricerca: campi obbligatori */
.row3b { display: grid; grid-template-columns: 1.3fr .7fr 1fr; gap: 12px; }
.tag-rec { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--web); background: var(--s-libero-bg); border-radius: 99px; padding: 0 8px; margin-left: 4px; }
.small-note { font-size: .84rem; margin: -4px 0 0; }
.match-tag { font-size: .78rem; font-weight: 700; color: var(--s-rifiutato); margin-left: 6px; }
@media (max-width: 760px) { .row3b { grid-template-columns: 1fr 1fr; } .row3b > :last-child { grid-column: 1 / -1; } }

/* Limite prenotazioni */
.limit-box { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.limit-box.blocked { background: var(--s-rifiutato-bg); border-color: var(--s-rifiutato); color: var(--s-rifiutato); }
.limit-row { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; flex-wrap: wrap; }
.limit-bar { height: 8px; border-radius: 99px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.limit-bar i { display: block; height: 100%; background: var(--web); border-radius: 99px; }
.limit-box.blocked .limit-bar i { background: var(--s-rifiutato); }
.limit-msg { font-size: .9rem; margin-top: 6px; }
.blocked-msg { font-size: .85rem; color: var(--s-rifiutato); font-weight: 600; max-width: 220px; text-align: right; }

/* Storico */
.hist { margin-top: 10px; width: 100%; }
.hist summary { cursor: pointer; color: var(--web); font-weight: 600; font-size: .9rem; }
.hist ol { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.hist li { margin: 0 0 10px; font-size: .9rem; position: relative; }
.hist li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--sc, var(--muted)); }
.hist .h-when { color: var(--muted); font-size: .82rem; }
.hist .h-note { white-space: pre-wrap; word-break: break-word; }
.result > div:first-child { flex: 1; min-width: 0; }

/* Guadagni */
.earn-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.earn-row:first-child { border-top: 0; }
.earn-row b { color: var(--s-chiuso); white-space: nowrap; }
#earnList { margin-top: 12px; }
.stat.money b { color: var(--s-chiuso); }

/* Modale con campi */
#modalFields { display: flex; flex-direction: column; gap: 12px; }
#modalFields:empty { display: none; }
.modal-box p:empty { display: none; }
.modal-box h3 { margin: 0; }
.modal-box p { margin: 0; }

.search-actions { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
@media (max-width: 760px) { .search-actions { grid-template-columns: 1fr; } }

/* Calendario: striscia dei giorni + orari */
.cal-card { padding-bottom: 8px; }
.month-pick { flex-direction: row; align-items: center; gap: 8px; color: var(--text); background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 10px; padding: 0 0 0 12px; }
.month-pick:hover { border-color: var(--web); }
.month-pick select { border: 0; background: transparent; font-weight: 700; font-size: 1.05rem; padding: 9px 12px 9px 0; text-transform: capitalize; cursor: pointer; width: auto; }
.month-pick select:focus { background: transparent; }
.strip-wrap { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; }
.strip-arrow { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.strip-arrow:hover { border-color: var(--web); color: var(--web); }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 4px 2px; flex: 1; min-width: 0; }
.ds-day { min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border-radius: 12px; }
.ds-day:hover { background: var(--surface-2); }
.ds-dow { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.ds-num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; border: 2px solid transparent; }
.ds-day.today .ds-num { border-color: var(--web); color: var(--web); }
.ds-day.sel .ds-num { background: var(--forest); border-color: var(--forest); color: #fff; }
.ds-day.weekend .ds-dow { color: var(--s-rifiutato); }
.ds-dots { height: 6px; display: flex; gap: 2px; }
.ds-dots .dot { width: 6px; height: 6px; }
.day-title { margin: 10px 0 8px; text-transform: capitalize; }

.timeline { position: relative; margin: 6px 0 4px; }
.tl-hour { position: relative; height: 60px; border-top: 1px solid var(--border); cursor: pointer; }
.tl-hour:hover { background: var(--surface-2); }
.tl-hour span { position: absolute; left: 0; top: -9px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface); padding-right: 6px; font-variant-numeric: tabular-nums; }
.tl-hour:first-child span { top: 2px; }
.tl-events { position: absolute; top: 0; left: 56px; right: 0; bottom: 0; pointer-events: none; }
.tl-ev {
  position: absolute; pointer-events: auto; border-radius: 8px; padding: 4px 8px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-left: 4px solid var(--c);
  font-size: .85rem; line-height: 1.25; cursor: pointer; box-shadow: var(--shadow);
}
.tl-ev:hover { background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
.tl-ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ev .t { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.tl-ev .s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ev.done { opacity: .5; }
.tl-ev.done b { text-decoration: line-through; }
.tl-now { position: absolute; left: 50px; right: 0; height: 2px; background: var(--now, var(--forest)); pointer-events: none; z-index: 2; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now, var(--forest)); }
@media (max-width: 760px) {
  .strip-wrap { gap: 2px; }
  .strip-arrow { width: 28px; height: 28px; font-size: 1rem; }
  .day-strip { gap: 0; padding: 4px 0; }
  .ds-num { width: 34px; height: 34px; font-size: .95rem; }
  .cal-head { flex-wrap: wrap; }
}
.tl-ev.short { display: flex; align-items: center; gap: 8px; padding-top: 2px; padding-bottom: 2px; }
.tl-ev.short b { flex: 0 1 auto; min-width: 0; }
.tl-ev.short .t { flex-shrink: 0; }
.tl-ev.short .s { display: none; }
[data-theme-now="dark"] .tl-now { --now: var(--web); }

/* Menu a tendina (mese, tipo di impegno): stessi colori del tema */
select option, select optgroup { background: var(--surface); color: var(--text); }
select option:checked { background: var(--forest); color: #fff; }
body:not(.tt-ready) .tt-knob, body:not(.tt-ready) .tt-ico { transition: none; }

/* Suggerimenti città / CAP */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40; margin-top: 4px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  max-height: 260px; overflow-y: auto; padding: 4px;
}
.ac-item { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-weight: 600; }
.ac-item small { color: var(--muted); font-weight: 500; font-size: .8rem; white-space: nowrap; }
.ac-item:hover, .ac-item.on { background: var(--surface-2); }
.ac-item.on { box-shadow: inset 3px 0 0 var(--web); }

/* Provincia / Paese / CAP / Telefono */
.row4 { display: grid; grid-template-columns: 1fr 1.3fr .7fr 1fr; gap: 12px; }
.ac-tag { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.small-note a { color: var(--web); }
@media (max-width: 760px) { .row4 { grid-template-columns: 1fr 1fr; } }
.ac-list { min-width: 340px; }
.ac-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 760px) { .ac-list { min-width: 0; } #cittaList, #capList { left: auto; right: 0; min-width: 260px; } #provList { min-width: 220px; } }

/* Occhio per vedere la password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.pw-eye:hover { color: var(--web); background: var(--surface-2); }
.link-btn { font: inherit; font-weight: 600; font-size: .92rem; color: var(--web); background: none; border: 0; padding: 4px; cursor: pointer; align-self: center; }
.link-btn:hover { text-decoration: underline; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Amministrazione */
.code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.code-row code { font: 700 1.3rem/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--surface-2); border: 1.5px dashed var(--border); border-radius: 10px; padding: 10px 14px; }
.emp {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 10px 0;
}
.emp:hover { border-color: var(--web); }
.emp.off { opacity: .6; }
.avatar.small { width: 44px; height: 44px; font-size: 1rem; }
.emp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.emp-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-nums { display: flex; gap: 14px; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.emp-nums b { color: var(--text); }
.emp-nums .money b { color: var(--s-chiuso); }
.ac-tag.off, .txt-off { color: var(--s-rifiutato); }
.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-weight: 600; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--forest); }
#admDetail .account-card .btn { flex-shrink: 0; }
@media (max-width: 760px) {
  .emp { flex-wrap: wrap; }
  .emp-nums { width: 100%; padding-left: 58px; }
  #admDetail .account-card { flex-wrap: wrap; }
  .nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

/* ===== Soldi: incassi, pagamenti, controlli ===== */
.lv-alert { display: flex; gap: 10px; align-items: flex-start; background: var(--s-prenotato-bg); color: var(--s-prenotato); border-left: 3px solid currentColor;
  border-radius: 8px; padding: 11px 14px; margin: 12px 0; font-size: .92rem; line-height: 1.45; }
.lv-alert-ico { flex-shrink: 0; margin-top: 2px; }
.lv-alert.info, .lv-alert.chk-info { background: var(--s-contatto-bg); color: var(--s-contatto); }
.lv-alert.chk-errore { background: var(--s-rifiutato-bg); color: var(--s-rifiutato); }
.lv-win { background: var(--s-chiuso-bg); color: var(--s-chiuso); border-left: 3px solid currentColor; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.ac-tag.warn { color: var(--s-prenotato); }
.adm-split { grid-column: 1 / -1; margin: 0; }
.earn-row.col { flex-direction: column; align-items: flex-start; gap: 4px; }
.earn-row .split { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--muted); }
.earn-row .split b { color: var(--s-chiuso); }
.earn-row .ac-tag { display: inline-block; width: auto; vertical-align: middle; }
.adm-tabs { margin: 18px 0 8px; }
.chip-n { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; font-size: .72rem; background: var(--s-prenotato); color: #fff; }
.chip-n.err { background: var(--s-rifiutato); }
.chip.active .chip-n { background: #fff; color: var(--forest); }
.wait-tag { color: var(--s-prenotato); font-weight: 600; text-align: right; margin-top: 4px; }
.pay-week { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.pay-card { margin: 12px 0; }
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.pay-sub { font-size: 1.3rem; font-weight: 700; color: var(--s-chiuso); font-variant-numeric: tabular-nums; }
.pay-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin: 14px 0 6px; }
.adm-search { margin: 4px 0 10px; }
.earn-month { display: grid; grid-template-columns: 1.3fr .6fr 1fr 1fr 1fr; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.earn-month:first-of-type { border-top: 0; }
.earn-month.head { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 0; padding-top: 0; }
.earn-month > span:not(:first-child) { text-align: right; }
.earn-month b { color: var(--s-chiuso); }
@media (max-width: 760px) { .earn-month { grid-template-columns: 1.2fr .5fr 1fr 1fr; } .earn-month > span:nth-child(3) { display: none; } }
.notif-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; padding: 10px 12px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .9rem; }
.notif-box.on { background: var(--s-chiuso-bg); color: var(--s-chiuso); border-color: transparent; }
.notif-box.off { background: var(--s-prenotato-bg); color: var(--s-prenotato); border-color: transparent; }

.s-prova { color: var(--s-prenotato); background: var(--s-prenotato-bg); }
/* Dipendenti → In prova: la riga si apre e mostra le attività prese */
.emp-prova { margin: 0 0 10px; }
.emp-prova > summary { list-style: none; }
.emp-prova > summary::-webkit-details-marker { display: none; }
.emp-prova[open] > summary { border-color: var(--web); }
.emp-prova .deal { margin: 8px 0 0 18px; }
@media (max-width: 760px) { .emp-prova .deal { margin-left: 0; } }
