/*
 * Override e componenti Gestok (§13.2). Non toccare main.css/plugins.css del template:
 * qui si usano le classi di Equation e i suoi token (#4361ee primary, #805dca secondary, ...).
 */

/* logo testuale finché non c'è il logo Gestok */
.gestok-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: #4361ee; color: #fff; font-weight: 700; font-size: 1.1rem;
}
.gestok-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 50%;
    background: #eceffe; color: #4361ee; font-weight: 700; font-size: 1.2rem;
}
.gestok-avatar-sm { width: 34px; height: 34px; font-size: 0.95rem; }
body.dark .gestok-avatar { background: #1b2e4b; color: #bfc9d4; }

/* voci di menu non ancora disponibili */
.sidebar-wrapper .menu a.gestok-disabled { opacity: .55; cursor: default; }
.sidebar-wrapper .menu a.gestok-disabled .badge { font-size: 10px; }

/* selettore sede in topbar */
.header .gestok-sede-dropdown .nav-link { display: flex; align-items: center; gap: .4rem; color: #506690; }
.header .gestok-sede-dropdown .gestok-sede-nome { font-weight: 600; font-size: 13px; }
.header .gestok-sede-dropdown .dropdown-menu { min-width: 240px; }
.header .gestok-sede-dropdown .dropdown-item.active { background: #eceffe; color: #4361ee; }
.header .gestok-topbar-title { font-size: 12px; }
body.dark .header .gestok-sede-dropdown .nav-link { color: #bfc9d4; }

/* KPI dashboard */
.gestok-kpi { border-radius: 10px; }
.gestok-kpi .value { font-size: 1.8rem; font-weight: 700; }
.gestok-roadmap li { padding: .35rem 0; border-bottom: 1px dashed #e0e6ed; }
.gestok-roadmap li:last-child { border-bottom: 0; }
body.dark .gestok-roadmap li { border-color: #191e3a; }

/* toast */
.gestok-toast {
    position: fixed; top: 80px; right: 20px; z-index: 2000; min-width: 260px;
    opacity: 0; transform: translateY(-8px); transition: all .25s ease;
}
.gestok-toast.show { opacity: 1; transform: none; }

/* form */
.form-label { font-weight: 600; color: #506690; }
body.dark .form-label { color: #888ea8; }
fieldset:disabled .btn { display: none; }
.invalid-feedback.d-block { font-size: 12px; }

/* tabelle: azioni compatte */
table.dataTable td .btn-sm { padding: .25rem .45rem; }
table.dataTable td form.d-inline { margin: 0; }

/* responsive: editor e form su tablet */
@media (max-width: 991px) {
    .gestok-topbar-title { display: none !important; }
}

/* editor documento */
#tab-righe td { vertical-align: middle; padding: .35rem .4rem; }
#tab-righe textarea { min-height: 31px; resize: vertical; }
#tab-righe tr.descrittiva td { background: #fafafa; }
body.dark #tab-righe tr.descrittiva td { background: #191e3a; }
#tab-righe .riga-importo { font-weight: 600; }
.invoice-detail-total .invoice-totals-row { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed #e0e6ed; }
.invoice-detail-total .invoice-summary-total { font-size: 1.15rem; border-bottom: 0; border-top: 2px solid #4361ee; margin-top: .3rem; padding-top: .6rem; }
body.dark .invoice-detail-total .invoice-totals-row { border-color: #191e3a; }
.ts-wrapper.single .ts-control { min-height: 38px; }
#f-articolo + .ts-wrapper { min-width: 320px; }

/* timeline SdI */
.gestok-timeline li { padding: .3rem 0; border-bottom: 1px dashed #e0e6ed; }
.gestok-timeline li:last-child { border-bottom: 0; }

/* wizard (form-wizard §13.3): stepper orizzontale */
.gestok-stepper { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: step; }
.gestok-stepper li { flex: 1; display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-radius: 8px; background: #f1f2f3; color: #506690; font-weight: 600; font-size: 13px; }
.gestok-stepper li .n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #e0e6ed; color: #506690; font-size: 12px; }
.gestok-stepper li.active { background: #eceffe; color: #4361ee; }
.gestok-stepper li.active .n { background: #4361ee; color: #fff; }
.gestok-stepper li.done { background: #e6ffee; color: #1abc9c; }
.gestok-stepper li.done .n { background: #1abc9c; color: #fff; }
body.dark .gestok-stepper li { background: #191e3a; color: #888ea8; }
body.dark .gestok-stepper li .n { background: #0e1726; color: #888ea8; }
body.dark .gestok-stepper li.active { background: #1b2e4b; color: #bfc9d4; }
#w-tab-ddt tbody tr { cursor: pointer; }
#w-tab-righe tr.descrittiva td { background: #fafafa; }
body.dark #w-tab-righe tr.descrittiva td { background: #191e3a; }
@media (max-width: 767px) {
    .gestok-stepper { flex-wrap: wrap; }
    .gestok-stepper li { flex: 1 1 45%; }
}

/* finanza (§15.8) */
.gestok-aging td, .gestok-aging th { white-space: nowrap; }
#tab-scadenze td, #tab-pn td { vertical-align: middle; }
#modal-incasso .inc-importo { min-width: 110px; }
#cashflow-chart { min-height: 120px; }

/* autenticazione a due fattori: QR sempre su fondo bianco (leggibile anche col tema scuro), campo codice spaziato */
.gestok-qr { display: inline-block; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid #e0e6ed; line-height: 0; }
.gestok-qr svg { width: 220px; height: 220px; }
.gestok-otp { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
@media print {
    .sidebar-wrapper, .header-container, .footer-wrapper, .breadcrumb-style-one, #copia-codici, .btn { display: none !important; }
}

/* pagine pubbliche per i clienti (/p/*) */
body.gestok-pubblico { margin: 0; padding: 0 !important; background: #f1f2f3; font-family: 'Nunito', sans-serif; color: #3b3f5c; }
.gestok-pubblico-header { background: #4361ee; color: #fff; font-size: 1.2rem; }
.gestok-informativa { max-height: 60vh; overflow-y: auto; font-size: 0.92rem; }
.gestok-informativa h3 { font-size: 1rem; font-weight: 700; margin-top: 1rem; }
