/* Gestionale — stile della versione precedente (legacy/index.html), invariato.
   Cambia solo la provenienza dei font, ora serviti dal server invece che da Google Fonts.
   In fondo: le poche aggiunte della nuova versione (dialoghi, avvisi, campi delle impostazioni). */
@import url(/vendor/fonts/barlow/400.css);
@import url(/vendor/fonts/barlow/500.css);
@import url(/vendor/fonts/barlow/600.css);
@import url(/vendor/fonts/barlow-condensed/500.css);
@import url(/vendor/fonts/barlow-condensed/600.css);
@import url(/vendor/fonts/barlow-condensed/700.css);
/* ── RESET & BASE ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:          #F4F3F0;
  --surface:     #FFFFFF;
  --surface2:    #EDEBE7;
  --border:      #E0DEDA;
  --border2:     #C6C3BD;
  --text:        #1C1B1A;
  --text2:       #6A6762;
  --text3:       #A3A09A;
  --accent:      #CC0000;
  --accent-d:    #A80000;
  --accent-l:    #FBEAEA;
  --accent2:     #8A3A1A;
  --accent2-l:   #F5EBE8;
  --green:       #2A6644;
  --green-l:     #E7F3EC;
  --amber:       #8A5A0A;
  --amber-l:     #FCF2DF;
  --red:         #C03040;
  --red-l:       #FAE9EB;
  --purple:      #5A3A8A;
  --purple-l:    #F0EBFB;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(28,27,26,0.07), 0 1px 2px rgba(28,27,26,0.04);
  --shadow-lg:   0 8px 28px rgba(28,27,26,0.13), 0 2px 6px rgba(28,27,26,0.06);
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
}
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { text-decoration: none; color: inherit; }

/* ── SCROLLBAR ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── OVERLAY / MODAL ─────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(20,18,14,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  backdrop-filter: blur(2px);
}
.overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  padding: 32px;
}
.modal-sm { max-width: 380px; }
.modal h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── FORM ELEMENTS ───────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.93rem;
  transition: border-color .15s;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red-l); color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { color: var(--text2); padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 0.83rem; }
.btn-icon { padding: 7px; border-radius: var(--radius); }

/* ── TAG / BADGE ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}
.badge-in_corso      { background: var(--green-l);  color: var(--green);  }
.badge-sospeso       { background: var(--amber-l);  color: var(--amber);  }
.badge-archiviato    { background: var(--surface2); color: var(--text3);  }
.badge-non_accettato { background: var(--red-l);    color: var(--red);    }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
#header {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.header-brand {
  display: flex; align-items: center; gap: 10px;
}
.header-brand img { height: 36px; width: auto; }
.header-brand-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.header-brand-sub { font-size: 0.75rem; color: var(--text2); font-weight: 400; margin-left: 2px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px 4px 6px;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.user-chip:hover { border-color: var(--border2); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
}
.admin-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent2-l); color: var(--accent2);
  border-radius: 20px; padding: 3px 10px;
  font-size: 0.75rem; font-weight: 500;
  cursor: pointer;
}

/* ── TOOLBAR ─────────────────────────────────────────────────────────────── */
#toolbar {
  padding: 16px 24px 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filter-pills {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pill {
  padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text2);
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
  min-height: 34px;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.toolbar-spacer { flex: 1; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 12px;
}
.search-box input {
  border: none; background: none; outline: none;
  font-size: 0.88rem; color: var(--text); width: 200px;
}
.search-box svg { color: var(--text3); flex-shrink: 0; }

/* ── MAIN LAYOUT ─────────────────────────────────────────────────────────── */
#main {
  padding: 0 24px 40px;
}

/* ── REFERENTE SECTION ───────────────────────────────────────────────────── */
.ref-section { margin-bottom: 36px; }
.ref-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 10px 0;
  border-bottom: 2px solid var(--accent);
  position: sticky; top: 58px; z-index: 40;
  background: linear-gradient(var(--bg) 85%, transparent);
}
.ref-section-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600; flex-shrink: 0;
}
.ref-section-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.ref-section-count { font-size: 0.8rem; color: var(--text2); }

/* ── LAVORO CARD ─────────────────────────────────────────────────────────── */
.lavori-list { display: flex; flex-direction: column; gap: 8px; }

.lavoro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s, transform .12s;
  position: relative;
  user-select: none;
}
.lavoro-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border2); transform: translateY(-1px); }
.lavoro-card.stato-in_corso      { border-left-color: var(--green); }
.lavoro-card.stato-sospeso       { border-left-color: var(--amber); }
.lavoro-card.stato-archiviato    { border-left-color: var(--text3); }
.lavoro-card.stato-non_accettato { border-left-color: var(--red); }
.lavoro-card.dragging {
  box-shadow: var(--shadow-lg);
  opacity: 0.85;
  transform: rotate(1deg);
  z-index: 50;
}
.lavoro-card.drag-over { border-color: var(--accent); border-style: dashed; }
.card-order-btns {
  display: none;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .card-order-btns { display: flex; }
}
.card-order-btn {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: 12px;
  transition: background .15s;
}
.card-order-btn:hover { background: var(--border); color: var(--text); }
.card-order-btn:disabled { opacity: 0.3; cursor: default; }
.lavoro-card.archiviato-card { opacity: 0.55; }

.card-top {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px;
}
.drag-handle {
  color: var(--text3); padding: 2px; margin-top: 1px; flex-shrink: 0;
  cursor: grab; transition: color .15s;
}
.drag-handle:hover { color: var(--text2); }
.card-numero {
  font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  font-size: 0.75rem; color: var(--text3); font-weight: 400;
  flex-shrink: 0; margin-top: 2px;
}
.card-titolo {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 600; flex: 1; line-height: 1.3;
  letter-spacing: 0.01em;
}
.card-cliente { font-size: 0.82rem; color: var(--text2); }
.card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.card-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.card-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.8rem; color: var(--text2);
}
.card-meta-item svg { width: 13px; height: 13px; opacity: 0.6; }
.card-refs {
  display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px;
}
.ref-chip {
  padding: 2px 8px; border-radius: 12px;
  background: var(--surface2); color: var(--text2);
  font-size: 0.75rem; font-weight: 500;
}
.ref-chip.me { background: var(--accent-l); color: var(--accent); }

.card-note-preview {
  font-size: 0.8rem; color: var(--text3); margin-top: 6px;
  white-space: pre-wrap; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  max-width: 600px;
}

.priority-badge {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2); color: var(--text2);
  font-size: 0.7rem; font-weight: 700; font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.todo-mini {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--text2); margin-top: 5px;
}
.todo-mini-bar {
  flex: 1; max-width: 80px; height: 4px;
  background: var(--border); border-radius: 2px; overflow: hidden;
}
.todo-mini-fill { height: 100%; background: var(--green); border-radius: 2px; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text3);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: 0.4; }

/* ── DETAIL PANEL ─────────────────────────────────────────────────────────── */
#detail-overlay {
  position: fixed; inset: 0;
  background: rgba(20,18,14,0.5);
  z-index: 200; display: flex; justify-content: flex-end;
  backdrop-filter: blur(2px);
}
#detail-overlay.hidden { display: none; }
#detail-panel {
  background: var(--surface);
  width: 100%; max-width: 680px;
  height: 100vh; overflow-y: auto;
  box-shadow: -8px 0 32px rgba(28,27,26,0.16);
  display: flex; flex-direction: column;
  animation: slideIn .22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0.6; }
  to   { transform: translateX(0);    opacity: 1; }
}
.dp-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px;
  position: sticky; top: 0; background: var(--surface); z-index: 5;
}
.dp-header-text { flex: 1; }
.dp-numero { font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; font-size: 0.78rem; color: var(--text3); margin-bottom: 4px; }
.dp-titolo { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1.25; letter-spacing: 0.01em; }
.dp-cliente { font-size: 0.85rem; color: var(--text2); margin-top: 3px; }
.dp-body { padding: 20px 24px; flex: 1; }
.dp-section { margin-bottom: 24px; }
.dp-section-title {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text3);
  margin-bottom: 12px;
}
.dp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.dp-field { }
.dp-field-label { font-size: 0.75rem; color: var(--text3); margin-bottom: 3px; }
.dp-field-val { font-size: 0.9rem; color: var(--text); }

/* EDIT MODE */
.dp-field input, .dp-field select, .dp-field textarea {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg); color: var(--text);
  font-size: 0.88rem; outline: none; transition: border-color .15s;
}
.dp-field input:focus, .dp-field select:focus, .dp-field textarea:focus { border-color: var(--accent); }
.dp-field textarea { min-height: 70px; resize: vertical; }

/* ── TODO LIST ───────────────────────────────────────────────────────────── */
.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid transparent;
  transition: background .12s;
}
.todo-item:hover { background: var(--surface2); }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text3); }
.todo-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border2); background: var(--surface);
  flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.todo-item.done .todo-check { background: var(--green); border-color: var(--green); }
.todo-text { flex: 1; font-size: 0.88rem; }
.todo-text input {
  width: 100%; border: none; background: none; outline: none;
  font-size: 0.88rem; color: var(--text); font-family: inherit;
}
.todo-del { color: var(--text3); padding: 3px; border-radius: 4px; }
.todo-del:hover { background: var(--red-l); color: var(--red); }
.todo-add-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
}
.todo-add-input {
  flex: 1; padding: 7px 10px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  background: transparent; font-size: 0.88rem;
  outline: none; color: var(--text);
  transition: border-color .15s;
}
.todo-add-input:focus { border-color: var(--accent); border-style: solid; }

/* ── SPESE ───────────────────────────────────────────────────────────────── */
.spese-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.spese-table th {
  text-align: left; padding: 6px 8px;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text3); border-bottom: 1px solid var(--border);
}
.spese-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.spese-table tr:last-child td { border-bottom: none; }
.spese-table input {
  width: 100%; border: none; background: none; outline: none;
  font-size: 0.85rem; color: var(--text); font-family: inherit;
}
.spese-totale-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px; margin-top: 6px;
  background: var(--surface2); border-radius: var(--radius);
  font-weight: 600; font-size: 0.9rem;
}
.admin-section { border-top: 2px dashed var(--border); padding-top: 16px; }
.admin-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--accent2); margin-bottom: 12px;
}

/* ── LOGIN SCREEN ────────────────────────────────────────────────────────── */
#login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
#login-overlay.hidden { display: none; }
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%; max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo svg { width: 44px; height: 44px; margin: 0 auto 10px; display: block; }
.login-logo h1 { font-size: 1.2rem; font-weight: 600; }
.login-logo p { font-size: 0.83rem; color: var(--text2); }
.user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.user-btn {
  padding: 16px 10px; border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg); text-align: center;
  cursor: pointer; transition: all .15s;
  min-height: 96px;
}
.user-btn:active { transform: scale(0.97); }
.user-btn:hover { border-color: var(--accent); background: var(--accent-l); }
.user-btn.selected { border-color: var(--accent); background: var(--accent-l); }
.user-btn-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 600;
  margin: 0 auto 8px;
}
.user-btn-name { font-size: 0.85rem; font-weight: 500; }
.user-btn-role { font-size: 0.72rem; color: var(--text2); }

/* ── PIN modal ───────────────────────────────────────────────────────────── */
.pin-input {
  width: 100%; text-align: center;
  font-size: 1.8rem; font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  letter-spacing: 0.3em; padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--bg);
  outline: none; transition: border-color .15s;
}
.pin-input:focus { border-color: var(--accent); }
.pin-error { color: var(--red); font-size: 0.83rem; text-align: center; margin-top: 8px; }

/* ── FAB ─────────────────────────────────────────────────────────────────── */
#fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 14px rgba(204,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s; z-index: 50; border: none;
}
#fab:hover { background: var(--accent-d); box-shadow: 0 6px 20px rgba(204,0,0,0.4); transform: scale(1.05); }
#fab svg { width: 24px; height: 24px; }

/* ── UTILITY ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.mono { font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.text-sm { font-size: 0.83rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text2); }
.text-danger { color: var(--red); }
.fw-600 { font-weight: 600; }

/* tag referenti multi-select */
.chips-input {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg);
  cursor: text; min-height: 38px;
}
.chips-input .chip {
  padding: 2px 8px 2px 10px; border-radius: 20px;
  background: var(--accent-l); color: var(--accent);
  font-size: 0.78rem; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.chips-input .chip button { line-height: 1; font-size: 1rem; color: inherit; opacity: 0.6; }
.chips-input .chip button:hover { opacity: 1; }
.chips-input select {
  border: none; background: none; outline: none;
  font-size: 0.85rem; color: var(--text2); flex: 1; min-width: 80px;
}

/* referente colors */
.c0 { background: #CC0000; }
.c1 { background: #2A6644; }
.c2 { background: #8A2D4A; }
.c3 { background: #5A3A8A; }
.c4 { background: #8A5A0A; }
.c5 { background: #1A6A7A; }
.c6 { background: #6A4A1A; }
.c7 { background: #3A6A2A; }

/* ══ AGGIUNTE DELLA VERSIONE 2 ═══════════════════════════════════════════ */

/* campi delle impostazioni (prima erano stili scritti nell'HTML) */
.settings-input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); outline: none; font-size: 0.88rem; color: var(--text);
}
.settings-input:focus { border-color: var(--accent); }
.settings-input.errore { border-color: var(--red); }
.pin-small { font-family: var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: .2em; }
.login-versione { text-align: center; margin-top: 14px; font-size: 0.7rem; color: var(--text3); letter-spacing: .04em; }
.dp-field.span2 { grid-column: 1 / -1; }

/* avvisi brevi in basso */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: var(--radius);
  font-size: 0.88rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 3000; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.errore { background: var(--red); }

/* dialoghi (al posto di alert e confirm del browser) */
.dialogo-overlay {
  position: fixed; inset: 0; background: rgba(20,18,14,0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 2000;
}
.dialogo { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; padding: 26px 28px 22px; }
.dialogo h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.dialogo p { font-size: 0.9rem; color: var(--text2); white-space: pre-line; }
.dialogo .modal-footer { margin-top: 20px; flex-wrap: wrap; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #A02030; }

/* telefoni: l'intestazione non deve uscire dallo schermo (nella vecchia app «Impostazioni» veniva tagliato) */
@media (max-width: 480px) {
  #header { padding: 0 14px; }
  .testo-impostazioni { display: none; }
}

/* «I miei lavori»: senza la linea rossa sotto l'intestazione (richiesta del 9/10/2026) */
.ref-section-header.personale { border-bottom: none; }
