/* ════════════════════════════════════════════════════════════════════════════
   KAM Agency — tema della Demo Gestionale (stile del sito kamagency.it)
   Caricato per ULTIMO in ogni pagina da strumenti/rebrand.py.
   Caratteri KAM, angoli netti, linee sottili al posto delle ombre,
   etichette in mono maiuscolo, inchiostro + oro + crema.
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --kam-ink: #002A62; --kam-ink-2: #0B3B7A; --kam-oro: #00AAF0; --kam-oro-dk: #0077B6;
  --kam-crema: #EEF3F8; --kam-carta: #FFFFFF; --kam-linea: rgba(0,42,98,.13); --kam-linea-forte: rgba(0,42,98,.26);
  --kam-testo-2: #4A5B73;
  --ui-radius: 6px;
  --ui-border: var(--kam-linea);
  --ui-shadow: none;
  --ui-shadow-hover: 0 0 0 1px var(--kam-linea-forte);
  --dash-radius: 6px;
}

/* ── Caratteri: un solo carattere (KAM Sans), maiuscole solo dove servono ── */
body, .form-control, .form-select, .btn, input, select, textarea, .modal, .dropdown-menu, .tooltip, .popover,
h1, h2, h3, h4, h5, h6, .sec-header-text h5, .dash-hero h1, .dash-hero h2, .dash-hero h3, .modal-title,
.dash-kpi-value, .stat-val, .hsc-val, .pres-stats-val, .app-nav-brand span, .login-logo-wrap span,
.app-table thead th, .filter-label, .stat-label, .hsc-label, .pres-stats-label, .dash-kpi-label, .badge, .tip-chip,
.nav-pill-btn, .ft-tab-btn, .pres-tab, .field-label, .form-label, .dash-hero small, .sec-header-text small {
  font-family: 'Inter Var', 'Helvetica Neue', Arial, sans-serif !important;
}
.kam-demo-badge { font-family: 'Inter Var', sans-serif !important; }
body { background: var(--kam-crema) !important; color: var(--kam-ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .sec-header-text h5, .modal-title { font-weight: 650 !important; letter-spacing: -.015em; }
.dash-kpi-value, .stat-val, .hsc-val, .pres-stats-val { font-weight: 650 !important; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.app-table thead th { text-transform: uppercase; letter-spacing: .03em !important; font-weight: 600 !important; font-size: .68rem !important; color: var(--kam-testo-2) !important; }
.filter-label, .stat-label, .hsc-label, .pres-stats-label, .dash-kpi-label, .form-label {
  text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; color: var(--kam-testo-2) !important;
}
.nav-pill-btn, .ft-tab-btn, .pres-tab { text-transform: none; letter-spacing: 0; font-size: .86rem !important; font-weight: 500 !important; }
.sec-header-text small { font-size: .78rem !important; color: var(--kam-testo-2) !important; }
td, .app-table td { font-variant-numeric: tabular-nums; }
.app-table td { font-size: .84rem !important; }
.app-table td:nth-last-child(2) { white-space: nowrap; }

/* ── Barra in alto ─────────────────────────────────────────────────────────── */
.app-nav { background: var(--kam-ink) !important; border-bottom: 2px solid var(--kam-oro) !important; box-shadow: none !important; }
.app-nav-brand span { color: var(--kam-crema) !important; font-weight: 700 !important; }
.nav-pill-btn { border-radius: 4px !important; color: rgba(238,243,248,.78) !important; }
.nav-pill-btn:hover { color: var(--kam-crema) !important; background: rgba(238,243,248,.08) !important; }
.nav-pill-btn.active { background: transparent !important; color: var(--kam-oro) !important; box-shadow: inset 0 -2px 0 var(--kam-oro) !important; border-radius: 0 !important; }

/* ── Superfici: carta su crema, linee sottili, niente ombre ───────────────── */
.sec-header, .filters-bar, .app-card, .card, .ft-tab-bar, .pres-tabs-bar, .stats-strip .stat-chip, .home-stat-card,
.pres-stats-card, .dash-kpi, .modal-content, .table-responsive, .dropdown-menu, .list-group-item {
  border-radius: var(--ui-radius) !important; box-shadow: none !important; border-color: var(--kam-linea) !important;
}
.sec-header, .filters-bar, .app-card, .card, .dash-kpi, .home-stat-card, .stats-strip .stat-chip, .pres-stats-card, .modal-content {
  background: var(--kam-carta) !important;
}
.dash-kpi:hover, .home-stat-card:hover, .stats-strip .stat-chip:hover { box-shadow: 0 0 0 1px var(--kam-linea-forte) !important; transform: none !important; }
.dash-kpi::before { height: 2px !important; background: var(--kam-oro) !important; }
.stats-strip .stat-chip, .home-stat-card, .pres-stats-card { border-left: 2px solid var(--chip-accent, var(--kam-oro)) !important; }

/* icona dell'intestazione: quadrato inchiostro con icona oro */
.sec-header-icon, .dash-kpi-icon, .home-stat-card .hsc-icon {
  background: var(--kam-ink) !important; color: var(--kam-oro) !important; border-radius: 4px !important; box-shadow: none !important;
}

/* intestazioni scure dei report */
.dash-hero { background: var(--kam-ink) !important; border-radius: var(--ui-radius) !important; border-bottom: 2px solid var(--kam-oro); }

/* ── Tabelle ───────────────────────────────────────────────────────────────── */
.app-table thead th { background: transparent !important; border-bottom: 1px solid var(--kam-linea-forte) !important; }
.app-table td { border-color: var(--kam-linea) !important; }
.app-table tbody tr:hover td { background: rgba(0,170,240,.07) !important; }

/* ── Schede in alto ────────────────────────────────────────────────────────── */
.ft-tab-bar, .pres-tabs-bar { background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--kam-linea-forte) !important; border-radius: 0 !important; padding: 0 !important; gap: 0 !important; }
.ft-tab-btn, .pres-tab { border-radius: 0 !important; background: transparent !important; color: var(--kam-testo-2) !important; padding: .55rem 1rem !important; }
.ft-tab-btn.active, .pres-tab.active { background: transparent !important; color: var(--kam-ink) !important; box-shadow: inset 0 -2px 0 var(--kam-oro) !important; }

/* ── Bottoni e campi ───────────────────────────────────────────────────────── */
.btn, .btn-reset, .form-control, .form-select, .filters-bar .form-control, .filters-bar .form-select, .sec-header .btn { border-radius: 4px !important; }
.btn-primary, .btn-dark { background: var(--kam-ink) !important; border-color: var(--kam-ink) !important; color: var(--kam-crema) !important; }
.btn-primary:hover, .btn-dark:hover { background: var(--kam-oro) !important; border-color: var(--kam-oro) !important; color: var(--kam-ink) !important; }
.form-control:focus, .form-select:focus { border-color: var(--kam-oro) !important; box-shadow: 0 0 0 3px rgba(0,170,240,.22) !important; }
.badge, .tip-chip { border-radius: 3px !important; font-weight: 500 !important; letter-spacing: .03em; }
.filters-bar .form-control, .filters-bar .form-select { background-color: #fff !important; }

/* ════════════════════════════════════════════════════════════════════════════
   Panoramica (strumenti/cruscotto): indicatori, grafici e pannelli, dettaglio al clic
   ════════════════════════════════════════════════════════════════════════════ */
.sec-home.dash-home-v2 { padding-top: 0 !important; align-items: stretch !important; }
.kc { width: 100%; max-width: 1320px; margin: 0 auto; padding: 2rem 1.5rem 1.5rem; color: var(--kam-ink); }
.kc-testa { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.kc-titolo { font-size: 1.75rem !important; font-weight: 650 !important; margin: 0; letter-spacing: -.025em; }
.kc-data-oggi { font-size: .88rem; color: var(--kam-testo-2); margin-top: .15rem; }
.kc-data-oggi::first-letter { text-transform: uppercase; }
.kc-aggiorna { border: 1px solid var(--kam-linea); background: var(--kam-carta); border-radius: 10px; width: 38px; height: 38px; color: var(--kam-testo-2); }
.kc-aggiorna:hover { color: var(--kam-ink); border-color: var(--kam-linea-forte); }
.kc-badge { display: inline-block; vertical-align: middle; margin-left: .3rem; background: #B4412F; color: #fff; font-size: .7rem; font-weight: 600; border-radius: 999px; padding: .05rem .45rem; }
.kc-su { color: #2E7D46; font-weight: 600; } .kc-giu { color: #B4412F; font-weight: 600; }
.kc-testa-dx { display: flex; align-items: center; gap: .5rem; flex: 0 1 430px; }

/* griglia a 12 colonne: 4 indicatori in alto, poi pannelli */
.kc-griglia { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; margin-top: 1.3rem; }
.kc-p { grid-column: span 4; background: var(--kam-carta); border: 1px solid var(--kam-linea); border-radius: 16px; padding: 1.05rem 1.2rem 1.15rem;
  display: flex; flex-direction: column; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.kc-p.kc-kpi { grid-column: span 3; }
.kc-p.kc-w8 { grid-column: span 8; } .kc-p.kc-w6 { grid-column: span 6; } .kc-p.kc-w4 { grid-column: span 4; }
.kc-p-apribile { cursor: pointer; }
.kc-p-apribile:hover { border-color: rgba(0,170,240,.6); box-shadow: 0 10px 28px -18px rgba(0,42,98,.45); }
.kc-p-testa { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.kc-p-testa h3 { font-size: .9rem !important; font-weight: 600 !important; color: var(--kam-testo-2); margin: 0; letter-spacing: 0; flex: 1; min-width: 0; }
.kc-p-apri { font-size: .78rem; color: var(--kam-linea-forte); transition: color .15s, transform .15s; }
.kc-p:not(.kc-p-apribile) .kc-p-apri { display: none; }
.kc-p-apribile:hover .kc-p-apri { color: var(--kam-oro-dk); transform: translateX(2px); }
.kc-p-corpo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kc-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(0,170,240,.16); color: var(--kam-oro-dk); font-size: .85rem; }
.kc-carica { height: 120px; border-radius: 10px; background: linear-gradient(90deg, rgba(0,42,98,.04), rgba(0,42,98,.08), rgba(0,42,98,.04)); background-size: 200% 100%; animation: kcCarica 1.2s infinite linear; }
@keyframes kcCarica { to { background-position: -200% 0; } }

.kc-num { font-size: 1.9rem; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-num-m { font-size: 1.45rem; }
.kc-sub { font-size: .8rem; color: var(--kam-testo-2); margin-top: .2rem; }
.kc-cap { font-size: .74rem; color: var(--kam-testo-2); margin: .9rem 0 .4rem; font-weight: 500; }
.kc-delta { display: inline-flex; align-items: center; gap: .15rem; font-weight: 600; font-size: .76rem; padding: .05rem .4rem; border-radius: 999px; }
.kc-delta-su { background: rgba(46,125,70,.12); color: #2E7D46; } .kc-delta-giu { background: rgba(180,65,47,.12); color: #B4412F; }
.kc-mini { display: flex; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--kam-linea); font-size: .78rem; color: var(--kam-testo-2); }
.kc-mini span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-mini b { color: var(--kam-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.kc-mini-az { cursor: pointer; align-items: center; color: var(--kam-ink); }
.kc-mini-az:hover { color: var(--kam-oro-dk); }
.kc-mini-az i.bi-bell { color: var(--kam-oro-dk); margin-right: .2rem; }
.kc-riga-num { display: flex; gap: 1.6rem; margin-bottom: .8rem; }

/* barra a segmenti con legenda */
.kc-seg { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: rgba(0,42,98,.07); gap: 2px; margin-top: .2rem; }
.kc-seg i { display: block; height: 100%; }
.kc-leg { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .5rem 0 .8rem; font-size: .72rem; color: var(--kam-testo-2); }
.kc-leg span { display: inline-flex; align-items: center; gap: .3rem; }
.kc-leg b { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.kc-leg em { font-style: normal; color: var(--kam-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.kc-c0 { background: var(--kam-oro); } .kc-c1 { background: #5E9C70; } .kc-c2 { background: #D9822B; } .kc-c3 { background: #B4412F; } .kc-c4 { background: rgba(0,42,98,.28); }
/* righe compatte nei pannelli */
.kc-r2 { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--kam-linea); font-size: .82rem; color: var(--kam-ink) !important; text-decoration: none !important; }
.kc-r2:last-child { border-bottom: 0; }
a.kc-r2:hover, .kc-r2[role="button"]:hover { color: var(--kam-oro-dk) !important; cursor: pointer; }
.kc-r2 > span:not(.kc-r2-data) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--kam-testo-2); }
.kc-r2 em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-r2-data { flex: none; width: 3.6rem; font-size: .74rem; color: var(--kam-testo-2); }
.kc-tutto-ok { display: flex; align-items: center; gap: .5rem; padding: 1.2rem 0; color: #2E7D46; font-size: .88rem; }

/* elenchi compatti nelle schede */
.kc-elenco { margin-top: .8rem; }
.kc-r2-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--kam-ink) !important; font-weight: 500; }
.kc-r2 .kc-r2-val { flex: none !important; font-size: .76rem; color: var(--kam-testo-2); }
.kc-r2-ok em, .kc-r2-ok .kc-r2-nome { color: var(--kam-testo-2) !important; font-weight: 500; }
.kc-ok-ico { color: #2E7D46; font-size: .85rem; }
.kc-r2 .kc-st { font-size: .68rem; }
.kc-altre { font-size: .76rem; color: var(--kam-testo-2); padding-top: .45rem; }
.kc-tenue { color: var(--kam-testo-2); opacity: .7; }

/* confronto con lo stesso periodo dell'anno prima */
.kc-confronto { display: flex; align-items: center; gap: .7rem; margin-top: auto; padding: .7rem .8rem; border-radius: 10px; background: rgba(0,42,98,.04); font-size: .82rem; }
.kc-p-corpo > .kc-sub + .kc-confronto { margin-top: 1rem; }
.kc-confronto > span:first-child { flex: 1; min-width: 0; font-weight: 500; }
.kc-confronto > span:first-child::first-letter { text-transform: uppercase; }
.kc-confronto small { display: block; text-transform: none; font-weight: 400; color: var(--kam-testo-2); font-size: .74rem; }
.kc-confronto b { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-confronto + .kc-mini { margin-top: .9rem; }

/* tabelle nelle finestre */
.kc-tab { width: 100%; border-collapse: collapse; margin: .5rem 0 .3rem; font-size: .86rem; font-variant-numeric: tabular-nums; }
.kc-tab th { font-size: .72rem; font-weight: 600; color: var(--kam-testo-2); text-align: right; padding: .5rem .6rem; border-bottom: 1px solid var(--kam-linea-forte); white-space: nowrap; }
.kc-tab th:first-child, .kc-tab td:first-child { text-align: left; padding-left: 0; }
.kc-tab th::first-letter { text-transform: uppercase; }
.kc-tab td { text-align: right; padding: .6rem .6rem; border-bottom: 1px solid var(--kam-linea); white-space: nowrap; vertical-align: middle; }
.kc-tab td:last-child, .kc-tab th:last-child { padding-right: 0; }
.kc-tab td small { display: block; font-size: .72rem; color: var(--kam-testo-2); font-weight: 400; }
.kc-tab td:first-child { white-space: normal; }
.kc-tab-nome { font-weight: 600; }
.kc-tab tfoot td { font-weight: 650; border-bottom: 0; border-top: 1px solid var(--kam-linea-forte); }
.kc-tab tbody tr[role="button"] { cursor: pointer; }
.kc-tab tbody tr[role="button"]:hover td { background: rgba(0,170,240,.08); }
.kc-tab .kc-delta { font-size: .74rem; }
.kc-quota { display: block; height: 4px; max-width: 220px; background: rgba(0,42,98,.07); border-radius: 2px; margin-top: .35rem; overflow: hidden; }
.kc-quota i { display: block; height: 100%; background: var(--kam-oro); }

/* crediti e debiti: fasce di anzianità */
.kc-fasce { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: .8rem 0 1rem; }
.kc-fascia { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: left; padding: .8rem .9rem; border-radius: 12px;
  background: var(--kam-carta); border: 1px solid var(--kam-linea); border-top: 4px solid var(--fc); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.kc-fascia:hover { box-shadow: 0 8px 20px -14px rgba(0,42,98,.5); }
.kc-fascia.kc-sel { background: color-mix(in srgb, var(--fc) 9%, var(--kam-carta)); border-color: var(--fc); }
.kc-fascia-t { font-size: .78rem; font-weight: 600; color: var(--fc); }
.kc-fascia-v { font-size: 1.3rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kc-fascia-p { display: block; width: 100%; height: 5px; border-radius: 3px; background: rgba(0,42,98,.07); overflow: hidden; }
.kc-fascia-p i { display: block; height: 100%; background: var(--fc); }
.kc-fascia-s { font-size: .72rem; color: var(--kam-testo-2); line-height: 1.3; }
.kc-fb0 { --fc: #0077B6; } .kc-fb1 { --fc: #4E8A60; } .kc-fb2 { --fc: #D9822B; } .kc-fb3 { --fc: #B4412F; }
.kc-tab-testa { display: flex; justify-content: space-between; align-items: center; font-size: .76rem; color: var(--kam-testo-2); }
.kc-link { border: 0; background: none; color: var(--kam-oro-dk); font-size: .8rem; font-weight: 600; padding: 0; }
.kc-tab-scorri { overflow-x: auto; }
.kc-tab-partite td:not(:first-child):not(:last-child) { font-size: .82rem; }
.kc-tab-partite td.kc-f0 { color: #0077B6; } .kc-tab-partite td.kc-f1 { color: #3F7550; }
.kc-tab-partite td.kc-f2 { color: #B9671A; } .kc-tab-partite td.kc-f3 { color: #B4412F; font-weight: 600; }
.kc-tab-partite td.kc-sel { background: rgba(0,170,240,.1); }

/* commesse: in corso / senza valori */
.kc-fasi.kc-fasi-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kc-fase-n { font-size: .74rem; color: var(--kam-testo-2); margin: -.4rem .2rem .2rem; }
.kc-comm-val { display: flex; gap: 1.1rem; font-size: .84rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .3rem; }
.kc-comm-val small { display: block; font-size: .68rem; font-weight: 400; color: var(--kam-testo-2); }

@media (max-width: 820px) {
  .kc-fasce { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kc-fasi.kc-fasi-2 { grid-template-columns: 1fr; }
  .kc-tab { font-size: .8rem; }
}

@media (max-width: 1250px) {
  .kc-p.kc-kpi { grid-column: span 6; }
  .kc-p.kc-w8, .kc-p.kc-w6 { grid-column: span 12; }
  .kc-p.kc-w4 { grid-column: span 6; }
}

/* finestra di dettaglio */
.kc-modal { border-radius: 16px !important; border: 0 !important; overflow: hidden; color: var(--kam-ink); }
.kc-modal-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.2rem 1.4rem .9rem; border-bottom: 1px solid var(--kam-linea); }
.kc-modal-titolo { font-size: 1.15rem; font-weight: 650; letter-spacing: -.015em; }
.kc-modal-tot { font-size: .9rem; color: var(--kam-testo-2); margin-top: .1rem; font-variant-numeric: tabular-nums; }
.kc-modal-corpo { padding: .4rem 1.4rem !important; }
.kc-modal-piede { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.4rem; border-top: 1px solid var(--kam-linea); font-size: .78rem; color: var(--kam-testo-2); }
.kc-vai { border: 0; background: var(--kam-ink); color: var(--kam-crema); border-radius: 999px; padding: .45rem 1rem; font-size: .84rem; font-weight: 500; white-space: nowrap; margin-left: auto; }
.kc-vai:hover { background: var(--kam-oro); color: var(--kam-ink); }
.kc-r { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--kam-linea); }
.kc-r:last-child { border-bottom: 0; }
.kc-r-tenue { opacity: .55; }
.kc-r-sx { font-size: .78rem; color: var(--kam-testo-2); white-space: nowrap; min-width: 0; }
.kc-r-sx:empty { display: none; }
.kc-r-sx:empty + .kc-r-nome { grid-column: 1 / 3; }
.kc-r-nome { font-size: .9rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-r-nome small { display: block; font-size: .78rem; color: var(--kam-testo-2); font-weight: 400; }
.kc-r-dx { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-st { font-style: normal; font-size: .72rem; font-weight: 500; padding: .1rem .5rem; border-radius: 999px; background: rgba(0,42,98,.07); color: var(--kam-testo-2); }
.kc-st-ok { background: rgba(46,125,70,.12); color: #2E7D46; }
.kc-st-ko { background: rgba(180,65,47,.12); color: #B4412F; }
.kc-targa { font-weight: 600; letter-spacing: .03em; }
.kc-vuoto { padding: 1rem 0; font-size: .85rem; color: var(--kam-testo-2); }
.kc-testo { padding: 1rem 0; font-size: .9rem; line-height: 1.5; color: var(--kam-testo-2); }

.kc-fasi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; padding: .6rem 0; }
.kc-fase { background: rgba(0,42,98,.035); border-radius: 12px; padding: .7rem; display: flex; flex-direction: column; gap: .5rem; }
.kc-fase-t { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; padding: 0 .2rem .2rem; }
.kc-fase-t b { color: var(--kam-testo-2); font-weight: 600; }
.kc-comm { display: flex; flex-direction: column; gap: .15rem; background: var(--kam-carta); border: 1px solid var(--kam-linea); border-radius: 10px; padding: .6rem .7rem; color: var(--kam-ink) !important; text-decoration: none !important; }
.kc-comm:hover { border-color: rgba(0,170,240,.6); }
.kc-comm-1 { display: flex; gap: .35rem; font-size: .86rem; align-items: baseline; }
.kc-comm-1 em { margin-left: auto; font-style: normal; font-size: .74rem; color: var(--kam-testo-2); white-space: nowrap; }
.kc-comm-2 { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-comm-3 { font-size: .74rem; color: var(--kam-testo-2); }
.kc-avanz { display: block; height: 4px; background: var(--kam-linea); border-radius: 2px; margin: .25rem 0 .1rem; overflow: hidden; }
.kc-avanz i { display: block; height: 100%; background: var(--kam-oro); border-radius: 2px; }

/* menu "Altro" nella barra */
.kc-altro .dropdown-toggle::after { margin-left: .4rem; vertical-align: .15em; }
.kc-altro-menu { padding: 1rem 1.1rem !important; border: 1px solid var(--kam-linea) !important; border-radius: 14px !important; background: var(--kam-carta) !important; box-shadow: 0 16px 40px -18px rgba(0,42,98,.45) !important; z-index: 3000; }
.kc-altro-menu.show { display: grid !important; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: .4rem 1.2rem; }
.kc-altro-gruppo h6 { font-size: .78rem !important; font-weight: 600 !important; color: var(--kam-testo-2); margin: 0 0 .3rem .5rem; letter-spacing: 0; }
.kc-altro-menu .dropdown-item { cursor: pointer; font-size: .88rem; padding: .42rem .5rem; border-radius: 8px; display: flex; align-items: center; gap: .55rem; }
.kc-altro-menu .dropdown-item i { color: var(--kam-oro-dk); font-size: .95rem; width: 1rem; text-align: center; }
.kc-altro-menu .dropdown-item:hover { background: rgba(0,170,240,.14); color: var(--kam-ink); }

/* notifiche push in fondo, allineate al cruscotto */
.sec-home.dash-home-v2 > .dash-panel { width: calc(100% - 3rem); max-width: calc(1320px - 3rem); margin: 1rem auto 2rem !important; background: var(--kam-carta) !important; border: 1px solid var(--kam-linea) !important; border-radius: 14px !important; box-shadow: none !important; }

@media (max-width: 820px) {
  .kc { padding: 1.2rem .9rem 1rem; }
  .kc-titolo { font-size: 1.45rem !important; }
  .kc-griglia { gap: .7rem; margin-top: 1rem; }
  .kc-p.kc-kpi, .kc-p.kc-w8, .kc-p.kc-w6, .kc-p.kc-w4 { grid-column: span 12; }
  .kc-p { padding: .95rem 1rem 1rem; border-radius: 14px; }
  .kc-num { font-size: 1.6rem; }
  .kc-testa { flex-wrap: wrap; gap: .7rem; }
  .kc-testa-dx { flex: 1 1 100%; }
  .kc-fasi { grid-template-columns: 1fr; }
  .kc-modal-corpo { padding: .3rem 1rem !important; }
  .kc-modal-testa, .kc-modal-piede { padding-left: 1rem; padding-right: 1rem; }
  #kcModal .modal-dialog { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; min-height: 0; align-items: flex-end; }
  #kcModal .kc-modal { border-radius: 16px 16px 0 0 !important; max-height: 88vh; }
  .sec-home.dash-home-v2 > .dash-panel { width: calc(100% - 1.8rem); }
  .kc-altro-menu.show { position: fixed !important; inset: auto 0 0 0 !important; transform: none !important; width: 100vw; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 80vh; overflow-y: auto; border-radius: 16px 16px 0 0 !important; }
  .kc-altro-menu .dropdown-item { white-space: normal; line-height: 1.25; min-width: 0; }
}

/* ── Ricerca rapida, azioni rapide, righe cliccabili ───────────────────────── */
.kc-cerca-campo { display: flex; align-items: center; gap: .7rem; width: 100%; margin: 0; padding: .6rem .9rem;
  background: var(--kam-carta); border: 1px solid var(--kam-linea); border-radius: 12px; color: var(--kam-testo-2); font-size: .92rem; text-align: left; transition: border-color .15s, box-shadow .15s; }
.kc-cerca-campo:hover { border-color: rgba(0,170,240,.6); box-shadow: 0 6px 18px -12px rgba(0,42,98,.35); }
.kc-cerca-campo span { flex: 1; }
.kc-cerca-campo kbd, .kc-cerca-testa kbd { background: rgba(0,42,98,.06); color: var(--kam-testo-2); border: 1px solid var(--kam-linea); border-radius: 6px; font-size: .7rem; padding: .1rem .4rem; font-family: inherit; box-shadow: none; }
.kc-azioni { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.kc-azione { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--kam-linea); background: transparent; border-radius: 999px; padding: .42rem .9rem; font-size: .84rem; font-weight: 500; color: var(--kam-ink); transition: background .15s, border-color .15s; }
.kc-azione i { color: var(--kam-oro-dk); }
.kc-azione:hover { background: var(--kam-ink); border-color: var(--kam-ink); color: var(--kam-crema); }
.kc-azione:hover i { color: var(--kam-oro); }
.kc-r[role="button"] { cursor: pointer; border-radius: 8px; margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; }
.kc-r[role="button"]:hover { background: rgba(0,170,240,.1); }
.kc-r-forte .kc-r-nome, .kc-r-forte .kc-r-dx { color: var(--kam-ink); font-weight: 650; }
.kc-r-nome::first-letter { text-transform: uppercase; }
.kc-fase-sola { padding: .7rem; margin: .7rem 0; }
.kc-nav-cerca { padding-left: .7rem !important; padding-right: .7rem !important; }
.kc-altro-corto.show { grid-template-columns: repeat(2, minmax(170px, 1fr)) !important; }

.kc-cerca-dialog { max-width: 620px; margin-top: 12vh; }
.kc-cerca-testa { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--kam-linea); }
.kc-cerca-testa i { color: var(--kam-testo-2); }
.kc-cerca-testa input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.05rem; color: var(--kam-ink); }
.kc-cerca-risultati { max-height: 56vh; overflow-y: auto; padding: .4rem .5rem .6rem; }
.kc-cr-gruppo { font-size: .72rem; font-weight: 600; color: var(--kam-testo-2); padding: .7rem .7rem .3rem; }
.kc-cr { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px; cursor: pointer; font-size: .9rem; }
.kc-cr i { color: var(--kam-oro-dk); width: 1.1rem; text-align: center; }
.kc-cr span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-cr small { display: block; font-size: .76rem; color: var(--kam-testo-2); }
.kc-cr em { font-style: normal; font-size: .8rem; color: var(--kam-testo-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kc-cr.sel { background: rgba(0,170,240,.16); }
.kc-cerca-risultati .kc-vuoto { padding: 1rem .7rem; }

@media (max-width: 820px) {
  .kc-cerca-campo kbd { display: none; }
  .kc-azioni { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -.9rem; margin-right: -.9rem; padding: 0 .9rem; }
  .kc-azione { white-space: nowrap; }
  .kc-cerca-dialog { margin: .6rem; margin-top: .6rem; }
  .kc-cerca-risultati { max-height: 70vh; }
  .kc-altro-corto.show { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}


/* ── Estratti conto: riquadro della liquidità (strumenti/cruscotto, liquiditaEC) ── */
.kc-ec { display: grid; grid-template-columns: minmax(230px, 1.25fr) repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1rem;
  background: var(--kam-carta); border: 1px solid var(--kam-linea); border-radius: 16px; overflow: hidden; color: var(--kam-ink); }
.kc-ec > div { padding: 1rem 1.25rem 1.05rem; min-width: 0; display: flex; flex-direction: column; }
.kc-ec > div + div { border-left: 1px solid var(--kam-linea); }
.kc-ec-tot { background: var(--kam-ink); color: var(--kam-crema); }
.kc-ec-et { display: flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 600; color: var(--kam-testo-2); }
.kc-ec-et i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kc-ec-tot .kc-ec-et { color: var(--kam-oro); }
.kc-ec-saldo { font-size: 1.45rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: .35rem; white-space: nowrap; }
.kc-ec-saldo-tot { font-size: 1.75rem; }
.kc-ec-data { font-size: .76rem; color: var(--kam-testo-2); margin-top: .1rem; }
.kc-ec-tot .kc-ec-data { color: rgba(238,243,248,.62); }
.kc-ec-mese { display: flex; flex-wrap: wrap; gap: .15rem .8rem; align-items: baseline; margin-top: auto; padding-top: .75rem; font-size: .82rem; font-variant-numeric: tabular-nums; }
.kc-ec-mese small { flex-basis: 100%; font-size: .72rem; color: var(--kam-testo-2); }
.kc-ec-tot .kc-ec-mese small { color: rgba(238,243,248,.62); }
.kc-ec-tot .kc-su { color: #7CC08F; } .kc-ec-tot .kc-giu { color: #E68A78; }
@media (max-width: 820px) {
  .kc-ec { grid-template-columns: 1fr 1fr; }
  .kc-ec-tot { grid-column: 1 / -1; }
  .kc-ec > div + div { border-left: 0; border-top: 1px solid var(--kam-linea); }
  .kc-ec > div:nth-child(2n+1):not(.kc-ec-tot) { border-left: 1px solid var(--kam-linea); }
}

/* ── Dipendenti: dashboard (strumenti/cruscotto/personale.js) ─────────────── */
.kp-barra { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .2rem; }
.kp-mese { width: auto !important; min-width: 220px; font-weight: 600; }
.kp-nota-alto { font-size: .78rem; color: var(--kam-testo-2); }
.kp-griglia { margin-top: 1rem; }
.kc-p.kp-w12 { grid-column: span 12; }
.kp-griglia > .kc-p { min-width: 0; }
.kp-w12 .table-responsive { overflow-x: auto; }
.d-flex:has(> #dipTabBtnPanor) { flex-wrap: wrap; }
.kp-unita { font-size: .45em; font-weight: 500; color: var(--kam-testo-2); }
.kp-c5 { background: #6B8CAE; } .kp-c6 { background: #8E6BAE; }
.kp-comp { margin-top: .8rem; display: flex; flex-direction: column; gap: .1rem; }
.kp-comp > div { display: grid; grid-template-columns: 10px 1fr auto 2.6rem; gap: .55rem; align-items: center; padding: .42rem 0; border-bottom: 1px solid var(--kam-linea); font-size: .84rem; }
.kp-comp > div:last-child { border-bottom: 0; }
.kp-comp b { width: 10px; height: 10px; border-radius: 3px; }
.kp-comp span { color: var(--kam-testo-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-comp em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.kp-comp small { text-align: right; color: var(--kam-testo-2); font-variant-numeric: tabular-nums; }
.kp-leg { display: flex; gap: 1rem; font-size: .76rem; color: var(--kam-testo-2); margin: -.2rem 0 .3rem; }
.kp-leg b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.kp-gr { width: 100%; height: auto; display: block; }
.kp-gr-linea { stroke: var(--kam-linea); stroke-width: 1; }
.kp-gr-asse { font-size: 10px; fill: var(--kam-testo-2); font-family: inherit; }
.kp-gr-asse-sel { fill: var(--kam-ink); font-weight: 700; }
.kp-gr-ap, b.kp-gr-ap { fill: rgba(0,42,98,.18); background: rgba(0,42,98,.18); }
.kp-gr-ora, b.kp-gr-ora { fill: var(--kam-oro); background: var(--kam-oro); }
.kp-gr-sel { fill: var(--kam-oro-dk); }
.kp-suggerimento { font-size: .74rem; color: var(--kam-testo-2); }
.kp-tab tbody tr { cursor: pointer; }
.kp-tab tbody tr:hover td { background: rgba(0,170,240,.08); }
.kp-tab td small { display: block; font-size: .72rem; color: var(--kam-testo-2); }
.kp-tab tfoot td { font-weight: 650; border-bottom: 0; border-top: 1px solid var(--kam-linea-forte); }
.kp-nome { font-weight: 600; }
.kp-ferie { display: inline-flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.kp-ferie b { min-width: 2.2rem; text-align: right; }
.kp-ferie-bar { width: 64px; height: 6px; border-radius: 99px; background: rgba(0,42,98,.1); overflow: hidden; display: inline-block; }
.kp-ferie-bar i { display: block; height: 100%; background: #5E9C70; }
.kp-ferie.kp-alto b, .kp-alto-t { color: #B4412F; }
.kp-ferie.kp-neg b, .kp-neg-t { color: #6237A6; }
.kp-ass { font-size: .8rem; color: var(--kam-testo-2); }
.kp-legenda-ferie { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .74rem; color: var(--kam-testo-2); margin-top: .5rem; }
.kp-l-god { display: inline-block; width: 16px; height: 6px; border-radius: 99px; background: #5E9C70; margin-right: .35rem; vertical-align: 1px; }
.kp-piede { font-size: .74rem; color: var(--kam-testo-2); margin: 1rem .2rem 0; line-height: 1.5; }
.kp-m-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin-bottom: .6rem; }
.kp-m-kpi > div { background: rgba(0,42,98,.035); border-radius: 12px; padding: .7rem .8rem; }
.kp-m-kpi small { display: block; font-size: .72rem; color: var(--kam-testo-2); }
.kp-m-kpi b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.kp-storia { display: flex; align-items: flex-end; gap: .4rem; height: 120px; padding-top: 1rem; }
.kp-storia > div { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; align-items: center; gap: .25rem; font-size: .68rem; color: var(--kam-testo-2); }
.kp-storia i { width: 70%; max-width: 26px; background: var(--kam-oro); border-radius: 3px 3px 0 0; min-height: 2px; }
.kp-storia em { font-style: normal; font-variant-numeric: tabular-nums; }
.kp-storia-sel i { background: var(--kam-oro-dk); } .kp-storia-sel span { color: var(--kam-ink); font-weight: 700; }
#dipStatsRow { display: none !important; }
@media (max-width: 820px) {
  .kp-m-kpi { grid-template-columns: 1fr 1fr; }
  .kp-nota-alto { display: none; }
  .kp-mese { min-width: 0; width: 100% !important; }
}

/* ═══ Italchimica (strumenti/personalizza.py) ═════════════════════════════ */
.app-nav { border-bottom: 3px solid #00AAF0 !important; }
.app-nav-brand img.ital-logo-nav { height: 26px !important; width: auto !important; }
@media (max-width: 600px) { .app-nav-brand img.ital-logo-nav { height: 20px !important; } }
/* Barra in basso e foglio "Altro" da telefono: dal foglio della Panoramica di AlfonzoApp, ricolorati (strumenti/marchio) */
.kc-tabbar, .kc-foglio { display: none; }
@media (max-width: 820px) {
  /* barra in alto: resta solo logo + menu utente; le sezioni passano in basso */
  body.kc-mobile .app-nav > .nav-pill-btn, body.kc-mobile .app-nav > .kc-altro,
  body.kc-mobile .app-nav > .kc-nav-cerca { display: none !important; }
  body.kc-mobile > div[style*="linear-gradient(to right, transparent"] { display: none !important; }
  body.kc-mobile { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.kc-mobile .position-fixed.bottom-0.end-0 { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }

  .kc-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    background: #002A62; border-top: 3px solid #00AAF0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .kc-tabbar button { border: 0; background: none; color: rgba(255,255,255,.62); display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 6px 0 4px; font-size: .68rem; font-weight: 500; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
  .kc-tabbar button i { font-size: 1.2rem; line-height: 1; }
  .kc-tabbar button.attiva { color: #00AAF0; }
  .kc-tabbar button.attiva i { transform: translateY(-1px); }

  /* foglio "Altro" che sale dal basso, sopra la barra */
  .kc-foglio { display: block; position: fixed; inset: 0; z-index: 1034; pointer-events: none; }
  .kc-foglio-sfondo { position: absolute; inset: 0; background: rgba(0,42,98,.45); opacity: 0; transition: opacity .2s; }
  .kc-foglio-pannello { position: absolute; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); max-height: 72vh; overflow-y: auto;
    background: #fff; border-radius: 18px 18px 0 0; padding: .5rem 1rem 1rem; transform: translateY(110%); transition: transform .22s ease;
    display: block; }
  .kc-foglio.aperto { pointer-events: auto; }
  .kc-foglio.aperto .kc-foglio-sfondo { opacity: 1; }
  .kc-foglio.aperto .kc-foglio-pannello { transform: none; }
  .kc-foglio-maniglia { width: 40px; height: 4px; border-radius: 2px; background: #D1D5DB; margin: .2rem auto .7rem; }
  .kc-foglio-voci { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem 1rem; }
  .kc-foglio-voci .kc-altro-gruppo h6 { font-size: .74rem; font-weight: 600; color: #4A5B73; margin: .5rem 0 .25rem .2rem; }
  .kc-foglio-voci .dropdown-item { display: flex; align-items: center; gap: .55rem; padding: .55rem .4rem; border-radius: 10px; font-size: .9rem;
    color: #fff; white-space: normal; line-height: 1.2; cursor: pointer; }
  .kc-foglio-voci .dropdown-item i { color: #fff; background: #00AAF0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
    font-size: .85rem; flex: none; }
  .kc-foglio-voci .dropdown-item:active { background: rgba(0,170,240,.25); }

  /* Panoramica più compatta */
  .kc { padding: .9rem .75rem 1rem; }
  .kc-titolo { font-size: 1.3rem !important; }
  .kc-data-oggi { font-size: .78rem; }
  .kc-cerca-campo { padding: .5rem .75rem; font-size: .85rem; }
  .kc-aggiorna { width: 36px; height: 36px; }
  .kc-azioni { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin: .8rem 0 0 !important; padding: 0 !important; overflow: visible !important; }
  .kc-azione { justify-content: center; padding: .55rem .4rem; font-size: .78rem; white-space: nowrap; background: #fff; }
  .kc-griglia { gap: .6rem !important; margin-top: .8rem !important; }
  .kc-p { padding: .85rem .9rem .9rem !important; border-radius: 14px !important; }
  .kc-p-testa { margin-bottom: .55rem; gap: .5rem; }
  .kc-p-testa h3 { font-size: .82rem !important; }
  .kc-ico { width: 26px; height: 26px; font-size: .8rem; }
  .kc-num { font-size: 1.45rem; }

  /* schede dei totali: due per riga, solo numero (il dettaglio si apre al tocco) */
  .kc-p.kc-kpi, .kc-p[data-k="inc"], .kc-p[data-k="pag"] { grid-column: span 6 !important; padding: .75rem .75rem .8rem !important; }
  :is(.kc-p.kc-kpi, .kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-p-testa h3 { font-size: .74rem !important; line-height: 1.15; }
  :is(.kc-p.kc-kpi, .kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-p-apri { display: none; }
  :is(.kc-p.kc-kpi, .kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-num { font-size: 1.2rem; letter-spacing: -.03em; }
  :is(.kc-p.kc-kpi, .kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-sub { font-size: .7rem; line-height: 1.3; }
  :is(.kc-p.kc-kpi, .kc-p[data-k="inc"], .kc-p[data-k="pag"]) :is(.kc-elenco, .kc-confronto, .kc-cap, .kc-leg, .kc-mini) { display: none !important; }
  :is(.kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-seg { height: 6px; margin-top: .55rem; }
  .kc-p:not(.kc-kpi):not([data-k="inc"]):not([data-k="pag"]) { grid-column: span 12 !important; }

  /* finestre di dettaglio */
  .kc-modal-testa { padding: 1rem 1rem .75rem !important; }
  .kc-modal-titolo { font-size: 1.02rem; }
  .kc-modal-tot { font-size: .8rem; }
  .kc-modal-piede { flex-wrap: wrap; gap: .5rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)) !important; }
  #kcModalNota { flex: 1 1 100%; font-size: .7rem; line-height: 1.35; }
  #kcModalNota:empty { display: none; }
  .kc-vai { width: 100%; text-align: center; padding: .6rem 1rem; }
  .kc-fasce { gap: .5rem !important; margin: .6rem 0 .8rem !important; }
  .kc-fascia { padding: .6rem .65rem !important; }
  .kc-fascia-v { font-size: 1.05rem !important; }
  .kc-fascia-s { font-size: .68rem !important; }

  /* tabelle delle finestre: una scheda per riga, etichetta della colonna a sinistra */
  .kc-tab-scorri { overflow: visible !important; }
  .kc-tab thead { display: none; }
  .kc-tab, .kc-tab tbody, .kc-tab tfoot { display: block; width: 100%; }
  .kc-tab tr { display: block; padding: .55rem 0; border-bottom: 1px solid #E4E6EA; }
  .kc-tab tfoot tr { border-bottom: 0; border-top: 1px solid #CBD5E1; }
  .kc-tab td { display: block; border: 0 !important; padding: .1rem 0 !important; text-align: right !important; white-space: normal !important; font-size: .84rem; }
  .kc-tab td::before { content: attr(data-label); float: left; color: #4A5B73; font-size: .74rem; font-weight: 500; padding-right: .8rem; }
  .kc-tab td::after { content: ""; display: table; clear: both; }
  .kc-tab td:first-child { text-align: left !important; padding-bottom: .3rem !important; font-size: .88rem; }
  .kc-tab td:first-child::before { content: none; }
  .kc-tab td.kc-tenue { display: none; }
  .kc-tab td small { font-size: .7rem; }
  .kc-tab tbody tr[role="button"]:hover td { background: none; }
}
@media (max-width: 820px) {
  body.kc-mobile .app-nav > .nav-divider { display: none !important; }
  .kc-azione { white-space: normal !important; line-height: 1.15; text-align: left; justify-content: flex-start; padding: .5rem .7rem !important; min-height: 2.6rem; }
  .kc-azione i { flex: none; }
}

/* ═══ Italchimica — sistema grafico (strumenti/design/design.css), in coda al tema ═══ */
@font-face { font-family: 'Inter Var'; src: url('/static/fonts/inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Manrope Var'; src: url('/static/fonts/manrope-var.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  --ds-navy: #002A62; --ds-navy-2: #0A3A7A; --ds-azz: #00AAF0; --ds-azz-dk: #0077B6; --ds-bg: #F3F6FA; --ds-carta: #fff;
  --ds-testo: #0F2442; --ds-testo-2: #5E6E85; --ds-linea: #E3E9F1; --ds-ok: #1F7A3E; --ds-ok-bg: #E4F4E9; --ds-ko: #B4392B; --ds-ko-bg: #FBE9E6;
  --ds-warn: #8F6200; --ds-warn-bg: #FFF3D6; --ds-r: 16px; --ds-ombra: 0 1px 2px rgba(0,42,98,.05), 0 8px 24px -14px rgba(0,42,98,.14);
  --ui-radius: 12px; --dash-radius: 16px;
}
body { background: var(--ds-bg) !important; color: var(--ds-testo); font-feature-settings: 'cv11', 'ss03'; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .kc-titolo, .sec-header-text h5 { font-family: 'Manrope Var', 'Inter Var', sans-serif !important; letter-spacing: -.02em; }
td, th, .kc-valore { font-variant-numeric: tabular-nums; }

/* ── Barra laterale ── */
.ds-side { display: none; }
@media (min-width: 1024px) {
  body.ds-shell { padding-left: 248px; }
  body.ds-shell .app-nav, body.ds-shell > div[style*="linear-gradient(to right, transparent"] { display: none !important; }
  .ds-side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 1030; padding: 18px 12px 10px;
    background: linear-gradient(185deg, #002A62 0%, #00214E 100%); color: #fff; }
}
.ds-logo { display: block; padding: 4px 10px 14px; }
.ds-logo img { height: 34px; width: auto; display: block; }
.ds-cerca { display: flex; align-items: center; gap: 9px; width: 100%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #C6D6EA;
  border-radius: 10px; padding: 8px 10px; font-size: 13.5px; margin-bottom: 8px; cursor: pointer; }
.ds-cerca:hover { background: rgba(255,255,255,.12); }
.ds-cerca kbd { margin-left: auto; font-size: 10.5px; background: rgba(255,255,255,.1); color: #C6D6EA; border-radius: 5px; padding: 2px 5px; font-family: inherit; box-shadow: none; }
.ds-voci { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.ds-gruppo { padding: 3px 0 1px; }
.ds-voce span { overflow: hidden; text-overflow: ellipsis; }
.ds-gruppo h6 { font-size: 11px; font-weight: 600; color: #8FA8C8; margin: 7px 10px 3px; letter-spacing: .02em; font-family: 'Inter Var', sans-serif !important; }
.ds-voce { display: flex; align-items: center; gap: 11px; padding: 6px 10px; white-space: nowrap; border-radius: 9px; color: #D5E1F0 !important; text-decoration: none !important;
  font-size: 13.8px; font-weight: 500; transition: background .12s; }
.ds-voce i { font-size: 15px; width: 18px; text-align: center; opacity: .85; }
.ds-voce:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.ds-voce.on { background: var(--ds-azz); color: #00214E !important; font-weight: 650; }
.ds-voce.on i { opacity: 1; }
.ds-voce:focus-visible, .ds-cerca:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.ds-piede { border-top: 1px solid rgba(255,255,255,.12); margin-top: 8px; padding-top: 8px; }
.ds-piede .dropdown { margin: 0 !important; position: relative !important; padding: 0 !important; background: none !important; }
.ds-piede .dropdown > button, .ds-piede .dropdown > a { width: 100%; text-align: left; background: rgba(255,255,255,.07) !important; border: 0 !important; color: #fff !important; border-radius: 10px !important; }

/* ── Superfici e intestazioni di sezione ── */
.sec-wrap { max-width: 1500px; margin-inline: auto; }
.sec-header { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 6px 0 14px !important; margin-bottom: 8px !important; }
.sec-header-icon { display: none !important; }
.sec-header-text h5 { font-size: 1.65rem !important; font-weight: 750 !important; color: var(--ds-navy) !important; margin: 0 !important; }
.sec-header-text small { font-size: .9rem !important; color: var(--ds-testo-2) !important; }
.app-card, .card, .filter-bar, .filters-bar { border: 1px solid var(--ds-linea) !important; border-radius: var(--ds-r) !important; box-shadow: var(--ds-ombra) !important; background: var(--ds-carta); }

/* ── Tabelle: più aria, meno inchiostro ── */
.app-table thead th { background: #F8FAFC !important; color: var(--ds-testo-2) !important; font-size: 11.5px !important; font-weight: 600 !important; text-transform: none !important;
  letter-spacing: 0 !important; border-bottom: 1px solid var(--ds-linea) !important; padding-block: 10px !important; }
.app-table tbody td { border-bottom: 1px solid #EEF2F7 !important; border-left: 0 !important; padding-block: 11px !important; font-size: 13.6px; }
.app-table tbody tr { box-shadow: none !important; border-left: 0 !important; }
.app-table tbody tr td:first-child { border-left: 0 !important; box-shadow: none !important; }
.app-table tbody tr:hover td { background: #F3F9FE !important; }
/* azioni di riga: barra sospesa al passaggio del mouse o col fuoco da tastiera, sempre visibili su schermi touch */
@media (hover: hover) and (min-width: 1024px) {
  .app-table tbody tr { position: relative; }
  .app-table tbody td.ui-actions { position: absolute !important; right: 10px; top: 50%; transform: translateY(-50%); z-index: 3; width: auto !important; padding: 3px 6px !important;
    background: #fff !important; border: 1px solid var(--ds-linea) !important; border-radius: 10px; box-shadow: 0 8px 18px -10px rgba(0,42,98,.35); opacity: 0; pointer-events: none; transition: opacity .12s; }
  .app-table tbody tr:hover td.ui-actions, .app-table tbody tr:focus-within td.ui-actions { opacity: 1; pointer-events: auto; }
  .app-table thead th.ui-actions, .app-table thead th:empty { padding: 0 !important; width: 0; }
}
.btn-action { border-radius: 8px !important; }
td[data-label="Commessa"], td[data-label="Commessa"] span { white-space: nowrap; }
.badge { border-radius: 999px !important; font-weight: 600 !important; border: 0 !important; }

/* ── Controlli ── */
.btn { border-radius: 10px !important; font-weight: 600 !important; box-shadow: none !important; }
.btn-primary { background: var(--ds-navy) !important; border-color: var(--ds-navy) !important; color: #fff !important; }
.btn-primary:hover { background: var(--ds-navy-2) !important; }
.form-control, .form-select { border-radius: 10px !important; border-color: var(--ds-linea) !important; }
.form-control:focus, .form-select:focus { border-color: var(--ds-azz) !important; box-shadow: 0 0 0 3px rgba(0,170,240,.16) !important; }
.modal-content { border: 0 !important; border-radius: 18px !important; box-shadow: 0 24px 60px -18px rgba(0,42,98,.4) !important; }
input[type=date].form-control-sm { width: 134px !important; }
.filter-label { font-size: 11.5px !important; color: var(--ds-testo-2) !important; text-transform: none !important; letter-spacing: 0 !important; }
#tabBtnCorrispettivi, #tabBtnRevisioni { display: none !important; }   /* di Italchimica: autolavaggio e centro revisioni */
.ft-tab-bar { border: 0 !important; background: #E9EEF5 !important; border-radius: 12px !important; padding: 4px !important; display: inline-flex !important; gap: 2px; width: auto !important; }
.ft-tab-btn { border: 0 !important; border-radius: 9px !important; background: transparent !important; color: var(--ds-testo-2) !important; padding: 6px 14px !important; font-weight: 600 !important; }
.ft-tab-btn.active { background: #fff !important; color: var(--ds-navy) !important; box-shadow: 0 1px 2px rgba(0,42,98,.12) !important; }

/* intestazioni delle pagine di analisi: stesse delle altre sezioni */
.dash-hero { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 6px 0 14px !important; margin-bottom: 10px !important; }
.dash-hero .dash-hero-title-icon, .dash-hero .dash-hero-title > .dash-hero-btn-ghost { display: none !important; }
.dash-hero-title h2 { color: var(--ds-navy) !important; font-size: 1.65rem !important; font-weight: 750 !important; margin: 0; }
.dash-hero-title small { color: var(--ds-testo-2) !important; font-size: .9rem !important; }
.dash-hero-filter-group label { color: var(--ds-testo-2) !important; }
.dash-hero-filters .form-control { background: #fff !important; color: var(--ds-testo) !important; border: 1px solid var(--ds-linea) !important; color-scheme: light; }
.dash-hero-filters .form-control::-webkit-calendar-picker-indicator { filter: none !important; }
.dash-hero-filters .btn { background: #fff !important; color: var(--ds-testo-2) !important; border: 1px solid var(--ds-linea) !important; }
.dash-hero-filters .btn.dash-hero-btn-primary, .dash-hero-filters .btn.active { background: var(--ds-navy) !important; color: #fff !important; border-color: var(--ds-navy) !important; }

.dash-hero .ce-anno-btn { background: #fff !important; color: var(--ds-testo-2) !important; border: 1px solid var(--ds-linea) !important; }
.dash-hero .ce-anno-btn.active { background: var(--ds-navy) !important; color: #fff !important; border-color: var(--ds-navy) !important; }

/* ── Panoramica ── */
.kc { max-width: 1480px !important; margin-inline: auto; }
.ds-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px 62px; color: #fff; margin-bottom: 0;
  background: radial-gradient(900px 340px at 92% -30%, rgba(0,170,240,.55), transparent 62%), linear-gradient(120deg, #002A62 0%, #003A82 62%, #0060A8 100%); }
.ds-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 74px; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 74' preserveAspectRatio='none'%3E%3Cpath fill='%2300AAF0' fill-opacity='.22' d='M0 42c120-26 240-26 360 0s240 26 360 0 240-26 360 0 240 26 360 0v32H0z'/%3E%3Cpath fill='%23fff' fill-opacity='.07' d='M0 54c120 18 240 18 360 0s240-18 360 0 240 18 360 0 240-18 360 0v20H0z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat; }
.ds-hero .kc-testa { position: relative; z-index: 1; margin-bottom: 14px; gap: 16px; flex-wrap: wrap; align-items: center; }
.ds-hero .kc-aggiorna { margin-left: auto; }
.ds-hero .kc-titolo { color: #fff !important; font-size: 2rem !important; font-weight: 750 !important; }
.ds-hero .kc-data-oggi { color: #BFD6EE !important; }
.ds-hero .kc-cerca-campo { background: rgba(255,255,255,.12) !important; border: 1px solid rgba(255,255,255,.2) !important; color: #E3EEF9 !important; border-radius: 12px !important; }
.ds-hero .kc-cerca-campo span { color: inherit !important; }
.ds-hero .kc-cerca-campo kbd { background: rgba(255,255,255,.14) !important; color: #E3EEF9 !important; border: 0 !important; box-shadow: none !important; }
.ds-hero .kc-aggiorna { background: rgba(255,255,255,.12) !important; border: 1px solid rgba(255,255,255,.2) !important; color: #fff !important; border-radius: 12px !important; }
.ds-hero .kc-azioni { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ds-hero .kc-azione { background: rgba(255,255,255,.1) !important; border: 1px solid rgba(255,255,255,.2) !important; color: #fff !important; border-radius: 999px !important; font-weight: 550; }
.ds-hero .kc-azione i { color: #7FD4F7 !important; }
.ds-hero .kc-azione:hover { background: rgba(255,255,255,.2) !important; }
@media (min-width: 1024px) { body.ds-shell .ds-hero .kc-cerca-campo { display: none; } }

#dsDirezione { position: relative; z-index: 2; margin-top: -44px; margin-bottom: 16px; }
.ds-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; padding-inline: 16px; }
.ds-tile { position: relative; display: flex; flex-direction: column; gap: 3px; text-align: left; background: #fff; border: 1px solid var(--ds-linea); border-radius: var(--ds-r); padding: 15px 16px 14px;
  box-shadow: var(--ds-ombra); cursor: pointer; font: inherit; color: var(--ds-testo); min-width: 0; transition: transform .14s, box-shadow .14s; }
.ds-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(0,42,98,.3); }
.ds-tile:focus-visible { outline: 2px solid var(--ds-azz); outline-offset: 2px; }
.ds-tile-t { font-size: 13px; color: var(--ds-testo-2); font-weight: 550; display: flex; gap: 7px; align-items: center; }
.ds-tile-t i { color: var(--ds-azz-dk); }
.ds-tile-v { font-family: 'Manrope Var', sans-serif; font-size: 1.85rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; color: var(--ds-navy); }
.ds-tile-p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 22px; font-size: 12.5px; }
.ds-sub { color: var(--ds-testo-2); font-size: 12.5px; margin: 0; }
.ds-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 12px; padding: 1px 7px; border-radius: 999px; }
.ds-delta.su { background: var(--ds-ok-bg); color: var(--ds-ok); }
.ds-delta.giu { background: var(--ds-ko-bg); color: var(--ds-ko); }
.ds-spark { position: absolute; right: 14px; top: 11px; }
.ds-tile.ds-hl { background: linear-gradient(135deg, #00B2F5, #0077B6); border-color: transparent; color: #fff; }
.ds-hl .ds-tile-t, .ds-hl .ds-tile-t i, .ds-hl .ds-sub { color: #E6F6FF; }
.ds-hl .ds-tile-v { color: #fff; }
.ds-hl .ds-delta.su, .ds-hl .ds-delta.giu { background: rgba(255,255,255,.2); color: #fff; }
.ds-hl .ds-spark polyline { stroke: #fff; } .ds-hl .ds-spark circle { fill: #fff; }

.ds-tiles.ds-t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-griglia { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.ds-card { background: #fff; border: 1px solid var(--ds-linea); border-radius: var(--ds-r); padding: 18px 20px; box-shadow: var(--ds-ombra); min-width: 0; }
.ds-w8 { grid-column: span 8; } .ds-w4 { grid-column: span 4; } .ds-w12 { grid-column: span 12; }
.ds-ct { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; }
.ds-ct h3 { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--ds-navy); }
.ds-ct p { margin: 2px 0 0; font-size: 12.8px; color: var(--ds-testo-2); }
.ds-leg { display: flex; gap: 14px; font-size: 12.5px; color: var(--ds-testo-2); }
.ds-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.ds-grafico { width: 100%; overflow: hidden; }
.ds-grafico svg { display: block; max-width: 100%; outline: none; }
.ds-ax { font-size: 11px; fill: #5E6E85; font-family: 'Inter Var', sans-serif; }
.ds-ax-on { fill: #002A62; font-weight: 700; }
.ds-banda { outline: none; cursor: default; } .ds-alone { fill: transparent; }
.ds-banda:hover .ds-alone, .ds-banda:focus .ds-alone { fill: #F0F6FC; }
.ds-tip { position: fixed; display: none; z-index: 4000; pointer-events: none; background: #fff; border: 1px solid var(--ds-linea); border-radius: 10px; padding: 8px 11px;
  box-shadow: 0 12px 28px -10px rgba(0,42,98,.32); font-size: 12.5px; color: var(--ds-testo); min-width: 130px; }
.ds-tip-t { color: var(--ds-testo-2); margin-bottom: 3px; font-size: 12px; }
.ds-tip-r { display: flex; align-items: center; gap: 7px; }
.ds-tip-r i { width: 12px; height: 2px; border-radius: 1px; } .ds-tip-r b { font-variant-numeric: tabular-nums; } .ds-tip-r span { color: var(--ds-testo-2); }
.ds-dati { margin-top: 8px; font-size: 12.5px; } .ds-dati summary { cursor: pointer; color: var(--ds-azz-dk); font-weight: 550; width: fit-content; }
.ds-dati-s { max-height: 220px; overflow: auto; margin-top: 6px; } .ds-dati table { width: 100%; border-collapse: collapse; }
.ds-dati th { text-align: left; color: var(--ds-testo-2); font-weight: 600; padding: 3px 6px; } .ds-dati td { padding: 3px 6px; border-top: 1px solid #EEF2F7; font-variant-numeric: tabular-nums; }

.ds-rep { padding: 7px 0; } .ds-rep-t { display: flex; justify-content: space-between; gap: 8px; font-size: 13.4px; } .ds-rep-t b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-rep-b { height: 8px; background: #EDF2F8; border-radius: 4px; margin: 5px 0 3px; overflow: hidden; } .ds-rep-b i { display: block; height: 100%; background: #0091D6; border-radius: 0 4px 4px 0; }
.ds-rep-m { font-size: 12px; color: var(--ds-testo-2); }

.ds-atts { display: flex; flex-direction: column; gap: 6px; }
.ds-att { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; font: inherit; background: #F8FAFC; border: 1px solid transparent; border-radius: 12px; padding: 10px 11px; color: var(--ds-testo); cursor: pointer; }
.ds-att:hover { border-color: var(--ds-azz); background: #fff; } .ds-att > .bi-chevron-right { margin-left: auto; color: #9DB0C7; }
.ds-att-i { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.ds-att-i.ko { background: var(--ds-ko-bg); color: var(--ds-ko); } .ds-att-i.info { background: #E1F4FD; color: var(--ds-azz-dk); }
.ds-att-t { min-width: 0; } .ds-att-t b { display: block; font-size: 13.4px; font-weight: 650; line-height: 1.25; } .ds-att-t small { color: var(--ds-testo-2); font-size: 12px; }
.ds-ok { display: flex; gap: 8px; align-items: center; color: var(--ds-ok); background: var(--ds-ok-bg); padding: 12px; border-radius: 12px; font-size: 13.4px; }
.ds-link { border: 0; background: none; color: var(--ds-azz-dk); font-weight: 600; font-size: 13px; cursor: pointer; padding: 2px 0; }

.ds-lavs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.ds-lavs.ds-lavs-1 { grid-template-columns: 1fr; }
.ds-lav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 96px; gap: 14px; align-items: center; padding: 11px 6px; border-bottom: 1px solid #EEF2F7; color: inherit !important; text-decoration: none !important; border-radius: 8px; }
.ds-lav:hover { background: #F3F9FE; }
.ds-lav-a { min-width: 0; } .ds-lav-a b { display: block; font-size: 13.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-lav-a span { display: block; font-size: 12px; color: var(--ds-testo-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-lav-pt { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ds-testo-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-lav-pt b { color: var(--ds-testo); }
.ds-lav-b { height: 6px; background: #EDF2F8; border-radius: 3px; margin-top: 4px; overflow: hidden; } .ds-lav-b i { display: block; height: 100%; background: #0091D6; }
.ds-lav-s { font-size: 12px; font-weight: 600; color: var(--ds-ok); } .ds-lav-s small { display: block; color: var(--ds-testo-2); font-weight: 400; font-size: 11px; }
.ds-lav-s.att { color: var(--ds-warn); }
.ds-carica { height: 140px; border-radius: var(--ds-r); background: linear-gradient(100deg, #fff 30%, #F0F5FA 50%, #fff 70%); background-size: 200% 100%; animation: ds-sh 1.3s linear infinite; border: 1px solid var(--ds-linea); }
@keyframes ds-sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ds-carica { animation: none; } .ds-tile { transition: none; } }

/* pannelli sotto i grafici */
.kc-griglia { gap: 16px !important; }
.kc-p { border: 1px solid var(--ds-linea) !important; border-radius: var(--ds-r) !important; box-shadow: var(--ds-ombra) !important; background: #fff !important; }
.kc-p-testa h3 { font-family: 'Manrope Var', sans-serif !important; font-weight: 700 !important; color: var(--ds-navy) !important; }
.kc-ico { display: none !important; }
:is(.kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-c0 { background: #A9DDF7; }   /* età: stessa tinta che scurisce, rosso solo sull'arretrato */
:is(.kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-c1 { background: #4DB8EC; }
:is(.kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-c2 { background: #0077B6; }
:is(.kc-p[data-k="inc"], .kc-p[data-k="pag"]) .kc-c3 { background: #B4392B; }
.dash-panel:has(#pushNotifBtn) { display: none !important; }   /* chiavi push non ancora generate */

@media (max-width: 1180px) { .ds-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-w8, .ds-w4 { grid-column: span 12; } .ds-lavs { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .ds-hero { border-radius: 18px; padding: 18px 16px 58px; } .ds-hero .kc-titolo { font-size: 1.55rem !important; }
  .ds-tiles { padding-inline: 6px; } .ds-tile-v { font-size: 1.22rem; white-space: nowrap; } .ds-spark { display: none; }
  .ds-tiles.ds-t3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kc-griglia > .kc-p[data-k="dip"], .kc-griglia > .kc-p[data-k="rate"] { grid-column: 1 / -1; }
  .ds-tiles { gap: 8px; } .ds-tile { padding: 12px; } .ds-card { padding: 14px; }
  .ds-lav { grid-template-columns: 1fr; gap: 6px; }
  .ds-lav-s small { display: inline; margin-left: 6px; }
}
