/* =========================================================================
   AffittaFacile CRM - Stile
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --navy: #1A2D52;
  --navy-2: #111F3A;
  --blue: #2A4A7F;
  --gold: #B08D57;
  --light-blue: #D6E0EF;
  --green: #2E8540;
  --green-soft: #D6EBD9;
  --orange: #B08D57;
  --orange-soft: #F0E6D4;
  --red: #B94A48;
  --red-soft: #F4D5D4;
  --violet: #6F5BA8;
  --violet-soft: #E2DAF1;
  --amber: #B08D57;
  --grey-0: #FFFFFF;
  --grey-50: #F8F4ED;
  --grey-100: #EDE8DF;
  --grey-200: #D8D0C4;
  --grey-300: #C2B8A8;
  --grey-500: #8A9AB5;
  --grey-700: #44567A;
  --grey-900: #1A2D52;
  --shadow-sm: 0 1px 2px rgba(26, 45, 82, 0.05);
  --shadow: 0 2px 8px rgba(26, 45, 82, 0.08);
  --shadow-lg: 0 8px 24px rgba(26, 45, 82, 0.10);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Calibri", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--grey-900);
  background: var(--grey-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
.hidden { display: none !important; }
.subtle { color: var(--grey-500); font-size: 13px; margin: 4px 0 0; }
.hint { color: var(--grey-500); font-size: 12px; margin-top: 12px; }
code {
  background: var(--grey-100);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* Serif headings — brand voice */
h1, h2 {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: -0.02em;
}

/* =========================================================================
   LAYOUT
   ========================================================================= */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: var(--grey-0);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 6px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.brand-title .dot { color: var(--gold); }
.brand-sub { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1.8px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  background: none;
  border: 0;
  color: rgba(255,255,255,0.78);
  padding: 10px 12px;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  transition: background .15s ease;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active {
  background: rgba(255,255,255,0.14);
  color: white;
  font-weight: 600;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.nav-item.active .nav-badge { background: var(--orange); }

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
}

.main {
  padding: 28px 36px 64px;
  max-width: 1480px;
}

/* =========================================================================
   PAGE HEAD
   ========================================================================= */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-head h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.2px;
  font-weight: 600;
  color: var(--navy);
}

.head-actions {
  display: flex;
  gap: 8px;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-primary:hover { background: var(--navy-2); }

.btn-secondary {
  background: white;
  color: var(--grey-700);
  border-color: var(--grey-200);
}
.btn-secondary:hover { background: var(--grey-50); border-color: var(--grey-300); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #A03A38; }

.btn-ghost {
  background: transparent;
  color: var(--grey-700);
  padding: 6px 10px;
  font-size: 12.5px;
}
.btn-ghost:hover { background: var(--grey-100); }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.link {
  background: none;
  border: 0;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

/* =========================================================================
   CARDS / FORM / TABLE
   ========================================================================= */

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--grey-100);
  overflow: hidden;
}

.section {
  padding: 18px 20px;
  margin-bottom: 16px;
}
.section legend {
  font-weight: 600;
  color: var(--navy);
  font-size: 13px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Filters */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.filter label {
  display: block;
  font-size: 11.5px;
  color: var(--grey-500);
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter input, .filter select {
  width: 100%;
}

/* Inputs */
input[type="text"], input[type="email"], input[type="url"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: white;
  color: var(--grey-900);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 92, 138, 0.12);
}
textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 12.5px;
  color: var(--grey-700);
  font-weight: 500;
}
label input, label select, label textarea {
  margin-top: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.span-2 { grid-column: span 2; }

/* =========================================================================
   LEADS TABLE
   ========================================================================= */

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.leads-table th {
  background: var(--grey-50);
  color: var(--grey-500);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--grey-100);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}
.leads-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: middle;
}
.leads-table tr.lead-row { cursor: pointer; transition: background .12s; }
.leads-table tr.lead-row:hover { background: var(--grey-50); }
.leads-table tr.lead-row.open { background: var(--light-blue); }
.leads-table tr.lead-detail td { padding: 0; background: var(--grey-50); }
.leads-table .num { text-align: right; }
.leads-table .w-score { width: 70px; }
.leads-table .w-stato { width: 140px; }
.leads-table .w-date { width: 110px; white-space: nowrap; }
.leads-table .w-actions { width: 36px; text-align: right; }

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 6px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12.5px;
  color: white;
}
.score-high   { background: var(--green); }
.score-medium { background: var(--amber); }
.score-low    { background: var(--grey-500); }
.score-skip   { background: var(--red); }

.stato-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.stato-da-contattare       { background: var(--orange-soft); color: #8B4F1B; }
.stato-contattato          { background: var(--light-blue); color: var(--navy); }
.stato-risposto            { background: var(--light-blue); color: var(--navy); }
.stato-appuntamento-fissato { background: var(--violet-soft); color: #4D3F84; }
.stato-trattativa          { background: var(--violet-soft); color: #4D3F84; }
.stato-firmato             { background: var(--green-soft); color: #155724; }
.stato-perso               { background: var(--red-soft); color: #6A1A18; }
.stato-non-interessato     { background: var(--grey-100); color: var(--grey-500); }
.stato-attivo              { background: var(--green-soft); color: #155724; }
.stato-in-pausa            { background: var(--orange-soft); color: #8B4F1B; }
.stato-cessato             { background: var(--grey-100); color: var(--grey-500); }
.stato-sospeso             { background: var(--orange-soft); color: #8B4F1B; }
.stato-rinnovato           { background: var(--green-soft); color: #155724; }

/* Lead detail (espanso inline) */
.lead-detail-inner {
  padding: 24px 28px;
  background: white;
  margin: 0 14px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-grid .span-2 { grid-column: span 2; }
.detail-block h4 {
  margin: 0 0 6px;
  font-size: 11.5px;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.detail-block .value { font-size: 13.5px; }
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-100);
}

.message-box {
  background: var(--grey-50);
  border: 1px dashed var(--grey-300);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
  font-family: -apple-system, "Helvetica Neue", sans-serif;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--grey-500);
}

/* =========================================================================
   ADD FORM
   ========================================================================= */
.form-grid {
  display: grid;
  gap: 0;
  border: 0;
}
.form-grid fieldset { border: 0; padding: 18px 20px; margin: 0 0 16px; }

/* =========================================================================
   DASHBOARD
   ========================================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--grey-100);
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--grey-500);
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--navy);
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11px;
  color: var(--grey-500);
  margin-top: 2px;
}
.kpi-navy   { border-top: 3px solid var(--navy); }
.kpi-orange { border-top: 3px solid var(--orange); }
.kpi-blue   { border-top: 3px solid var(--blue); }
.kpi-green  { border-top: 3px solid var(--green); }
.kpi-red    { border-top: 3px solid var(--red); }
.kpi-violet { border-top: 3px solid var(--violet); }
.kpi-grey   { border-top: 3px solid var(--grey-500); }
.kpi-hot    { background: linear-gradient(135deg, #F0E6D4, #E8D5B8); border: 1px solid var(--gold); }
.kpi-hot .kpi-value { color: var(--navy-2); }
.kpi-hot .kpi-label { color: var(--navy); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-grid .span-2 { grid-column: span 2; }
.chart-card { padding: 18px 20px; }
.chart-card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--grey-500);
}

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 1fr 60px;
  align-items: center;
  gap: 8px;
}
.bar-label {
  font-size: 12.5px;
  color: var(--grey-700);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar-track {
  flex: 1;
  height: 22px;
  background: var(--grey-100);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  transition: width .4s ease;
}
.bar-value {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
}

/* Donut chart (semplice CSS) */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
.donut-legend { flex: 1; }
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 4px 0;
}
.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-num {
  margin-left: auto;
  font-weight: 600;
  color: var(--navy);
}

/* =========================================================================
   CONFIG PAGE
   ========================================================================= */

.template-preview {
  background: var(--grey-50);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--grey-200);
  font-family: -apple-system, "Helvetica Neue", sans-serif;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--grey-700);
  margin: 12px 0 0;
}

/* =========================================================================
   IMPORT (AI)
   ========================================================================= */

#import-input {
  width: 100%;
  font-family: -apple-system, "Helvetica Neue", monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 200px;
}

.import-status-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.import-status-card.error {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #6A1A18;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--grey-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.import-preview {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 12px;
  border: 1px solid #b5d6b9;
}
.import-preview .row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--grey-100);
}
.import-preview .row:last-child { border-bottom: 0; }
.import-preview .key {
  font-weight: 600;
  color: var(--grey-500);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.import-preview .val { color: var(--grey-900); white-space: pre-wrap; }

/* =========================================================================
   SUBTABS (dentro la vista cliente)
   ========================================================================= */
.subtabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.subtab {
  background: none;
  border: 0;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--grey-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  font-weight: 500;
}
.subtab:hover { color: var(--navy); }
.subtab.active {
  color: var(--navy);
  border-bottom-color: var(--orange);
  font-weight: 600;
}
.subtab-content { animation: fade-in .2s ease; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   IMMOBILE CARDS
   ========================================================================= */
.immobile-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.immobile-card:hover { box-shadow: var(--shadow); }

.immobile-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border-left: 3px solid var(--blue);
}
.immobile-head:hover { background: var(--grey-50); }
.immobile-card.open .immobile-head { background: var(--grey-100); border-left-color: var(--gold); }
.immobile-head h4 { margin: 0 0 2px; font-size: 14.5px; color: var(--navy); }
.immobile-head .meta {
  font-size: 12.5px;
  color: var(--grey-500);
}
.immobile-head .stats-mini {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 12px;
}
.stats-mini-item { text-align: center; }
.stats-mini-item .v { font-weight: 700; color: var(--navy); font-size: 14px; }
.stats-mini-item .l { color: var(--grey-500); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; }

.immobile-body {
  padding: 16px 18px;
  border-top: 1px solid var(--grey-100);
  background: var(--grey-50);
}
.immobile-card:not(.open) .immobile-body { display: none; }

.immobile-section {
  margin-bottom: 16px;
}
.immobile-section:last-child { margin-bottom: 0; }
.immobile-section-title {
  font-size: 11.5px;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Stanze pills */
.stanze-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.stanza-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.stanza-card:hover { border-color: var(--blue); }
.stanza-card .nome { font-weight: 600; color: var(--navy); font-size: 13px; }
.stanza-card .tipo { font-size: 11.5px; color: var(--grey-500); }
.stanza-card .canone {
  font-weight: 700;
  color: var(--green);
  margin-top: 4px;
  font-size: 13px;
}
.stanza-stato-Libera     { border-left: 3px solid var(--green); }
.stanza-stato-Occupata   { border-left: 3px solid var(--orange); }
.stanza-stato-Riservata  { border-left: 3px solid var(--violet); }
.stanza-stato-In-pulizia { border-left: 3px solid var(--blue); }
.stanza-stato-In-manutenzione { border-left: 3px solid var(--red); }

.stanza-stato-pill {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 4px;
  display: inline-block;
}

/* =========================================================================
   DROPZONE (upload file)
   ========================================================================= */
.dropzone {
  border: 2px dashed var(--grey-300);
  border-radius: var(--radius);
  background: var(--grey-50);
  padding: 32px 20px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
}
.dropzone:hover {
  border-color: var(--blue);
  background: var(--light-blue);
}
.dropzone.dragover {
  border-color: var(--orange);
  background: var(--orange-soft);
}
.dropzone-content { color: var(--grey-700); font-size: 13.5px; }
.dropzone-content > div { margin-top: 6px; }
.dropzone-content strong { color: var(--navy); }

.doc-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.doc-card:hover { box-shadow: var(--shadow-sm); }
.doc-icon {
  width: 36px; height: 36px;
  background: var(--light-blue);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-weight: 600;
  color: var(--navy);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-meta { font-size: 11.5px; color: var(--grey-500); }
.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* =========================================================================
   MODAL
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in .15s;
}
.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--grey-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { margin: 0; color: var(--navy); font-size: 15px; }
.modal-head button {
  background: none; border: 0; cursor: pointer;
  font-size: 16px; color: var(--grey-500);
  padding: 4px 8px;
}
.modal-head button:hover { color: var(--red); }
#modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--grey-100);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--grey-50);
}

/* =========================================================================
   CONTRATTO DI GESTIONE BOX
   ========================================================================= */
.contratto-gestione-box {
  background: linear-gradient(135deg, #fafbfd, #f5f7fa);
  margin-bottom: 16px;
}
.contratto-gestione-box ul {
  font-size: 12.5px;
}
.contratto-gestione-box ul li {
  margin-bottom: 2px;
  color: var(--grey-700);
}

/* =========================================================================
   ATTIVITA stati
   ========================================================================= */
.attivita-stato-Programmata { color: var(--orange); }
.attivita-stato-In-corso { color: var(--blue); }
.attivita-stato-Completata { color: var(--green); }
.attivita-stato-Annullata { color: var(--grey-500); text-decoration: line-through; }

.attivita-tipo-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--light-blue);
  color: var(--navy);
}

/* =========================================================================
   TOAST
   ========================================================================= */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toast-in .25s ease;
}
.toast.toast-error { background: var(--red); }
.toast.toast-success { background: var(--green); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1100px) {
  .app { grid-template-columns: 200px 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span-2 { grid-column: span 1; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 16px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-footer { display: none; }
  .main { padding: 20px 16px 40px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
