/* ==========================================================================
   Dash Synectis - tema grafico (CSS a mano, nessuna compilazione)
   Caricato dal provider del pannello con un <link> in panels::head.end.
   Le due copie (laravel_dash/public/css e document root dash.synectis.it/css) devono restare identiche.
   Per tornare indietro: togliere il renderHook dal provider (o ripristinare il backup .pre-grafica).
   Fase 2: colori di base.
   ========================================================================== */

:root {
    --tt-bg: #f2f5fa;
    --tt-card: #ffffff;
    --tt-line: #e6eaf2;
    --tt-text-soft: #5b667a;
    --tt-radius: 0;
    --tt-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.05);
    --tt-side-from: #222d3c;
    --tt-side-mid: #2a3d52;
    --tt-side-to: #2f5266;
}

/* ---------- colore primario: blu navy ---------- */
:root {
    --primary-50: #eff3f9;
    --primary-100: #dce5f1;
    --primary-200: #bccde3;
    --primary-300: #92aacb;
    --primary-400: #6482ac;
    --primary-500: #3d5a85;
    --primary-600: #2a4469;
    --primary-700: #223756;
    --primary-800: #1b2c45;
    --primary-900: #162338;
    --primary-950: #0e1624;
}

/* ---------- sfondo pagina (solo tema chiaro) ---------- */
html:not(.dark) body.fi-body,
html:not(.dark) .fi-body {
    background: var(--tt-bg);
}

/* ---------- barra superiore ---------- */
html:not(.dark) .fi-topbar,
html:not(.dark) .fi-topbar-ctn {
    background: #ffffff;
}
.fi-topbar {
    box-shadow: 0 1px 0 var(--tt-line), 0 2px 10px rgba(16, 24, 40, 0.04);
}

/* ==========================================================================
   Fase 3: sidebar
   ========================================================================== */
.fi-sidebar,
.fi-sidebar-nav {
    background: transparent;
}
.fi-sidebar {
    background: linear-gradient(180deg, var(--tt-side-from) 0%, var(--tt-side-mid) 55%, var(--tt-side-to) 100%);
    box-shadow: none;
    border: 0;
}
.fi-sidebar-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}
.fi-sidebar-nav {
    padding-inline: 0.5rem;
}
.fi-sidebar .fi-sidebar-group-label,
.fi-sidebar .fi-sidebar-group-collapse-btn,
.fi-sidebar .fi-sidebar-group-dropdown-trigger-btn {
    color: rgba(255, 255, 255, 0.5);
}
.fi-sidebar-group-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.fi-sidebar-item-btn {
    border-radius: 0.45rem;
    padding-block: 0.4rem;
}
.fi-sidebar .fi-sidebar-item-label {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.82rem;
    font-weight: 500;
}
.fi-sidebar .fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.7);
}
.fi-sidebar .fi-sidebar-item-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar .fi-sidebar-item-btn.fi-active {
    background: rgba(255, 255, 255, 0.15);
}
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: #ffffff;
}
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
    font-weight: 600;
}

/* ==========================================================================
   Fase 4: larghezza contenuto e tipografia
   ========================================================================== */
:root {
    --text-xs: 0.6875rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.125rem;
    --text-2xl: 1.375rem;
    --text-3xl: 1.625rem;
}
.fi-main {
    max-width: none;
    padding-inline: 1.25rem;
}
@media (min-width: 1024px) {
    .fi-main {
        padding-inline: 1.5rem;
    }
}
.fi-page-header-main-ctn {
    row-gap: 1rem;
    padding-block: 1.25rem;
}
.fi-page-content {
    row-gap: 1.25rem;
}
.fi-header-heading {
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
}
.fi-breadcrumbs {
    font-size: 0.8rem;
}
.fi-section-header {
    padding: 0.7rem 1.1rem;
}
.fi-section-header-heading {
    font-size: 0.9rem;
    font-weight: 600;
}
.fi-section-content {
    padding: 0.9rem 1.1rem;
}

/* ==========================================================================
   Fase 4b: Dashboard piu' stretta e centrata (solo la home, classe dash-home da Dashboard.php)
   ========================================================================== */
.fi-page.dash-home {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
}

/* ==========================================================================
   Fase 5: riquadri, tabelle, badge, pulsanti, campi, modali
   ========================================================================== */
html:not(.dark) .fi-section:not(.fi-section-not-contained) {
    background: var(--tt-card);
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow);
    border: 0;
}
html:not(.dark) .fi-ta-ctn {
    background: var(--tt-card);
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow);
    border: 0;
    overflow: hidden;
}
html:not(.dark) .fi-ta-header-cell {
    background: #f6f8fc;
}
.fi-ta-header-cell {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tt-text-soft);
}
.fi-ta-cell .fi-ta-cell-content {
    padding-block: 0.4rem;
}
html:not(.dark) .fi-ta-row:hover {
    background: #f8faff;
}
.fi-badge {
    border-radius: 999px;
    font-weight: 600;
}
.fi-btn {
    border-radius: 0.3rem;
}
.fi-input-wrp {
    border-radius: 0.5rem;
}
.fi-modal-window {
    border-radius: var(--tt-radius);
}

/* ==========================================================================
   Fase 5b: angoli squadrati anche su widget e riquadri della Dashboard
   ========================================================================== */
.fi-wi-stats-overview-stat,
.fi-wi-widget .fi-section,
.fi-wi-widget .fi-wi-stats-overview-stat {
    border-radius: var(--tt-radius);
}
.dash-home .fi-section {
    border-radius: var(--tt-radius);
}
/* raggi scritti a mano nelle viste dei widget (solo Dashboard): tessere Task aperti, pillola backup */
.dash-home [style*="border-radius:0.5rem"],
.dash-home [style*="border-radius: 0.5rem"],
.dash-home [style*="border-radius:0.375rem"],
.dash-home [style*="border-radius: 0.375rem"] {
    border-radius: 0 !important;
}

/* ==========================================================================
   Fase 5c: angoli stondati (un po' meno del default di Filament, 0.75rem).
   Sovrascrive i blocchi 5 e 5b: --tt-radius governa sezioni, tabelle, modali e riquadri statistici.
   ========================================================================== */
:root {
    --tt-radius: 0.5rem;
}
.dash-home [style*="border-radius:0.5rem"],
.dash-home [style*="border-radius: 0.5rem"] {
    border-radius: 0.35rem !important;
}
.dash-home [style*="border-radius:0.375rem"],
.dash-home [style*="border-radius: 0.375rem"] {
    border-radius: 0.3rem !important;
}

/* ==========================================================================
   Fase 6: widget statistici e dashboard
   ========================================================================== */
.fi-wi-stats-overview-stat {
    border-radius: var(--tt-radius);
}
.fi-wi-stats-overview-stat:not([style*="border-left"]) {
    border-top: 3px solid var(--primary-500);
}
.fi-wi-stats-overview-stat-value {
    font-weight: 700;
}
/* riquadri scadenze: stessa decorazione, colori della palette (ambra = in scadenza, rosso = scadute) */
html:not(.dark) .fi-wi-stats-overview-stat[style*="border-left: 4px solid #d97706"] {
    border-left-color: #a86a0a !important;
    background-color: rgba(168, 106, 10, 0.07) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat[style*="border-left: 4px solid #dc2626"] {
    border-left-color: #c62833 !important;
    background-color: rgba(198, 40, 51, 0.08) !important;
}
/* etichette delle sezioni della dashboard personalizzata */
.dash-home p[style*="font-size: 13px"] {
    font-size: 0.8rem !important;
    letter-spacing: 0.02em;
}
html:not(.dark) .dash-home p[style*="font-size: 13px"] {
    color: var(--tt-text-soft) !important;
}

/* ==========================================================================
   Fase 7: viste scritte a mano (font-size inline, palette semantica, tabelle compatte).
   Esclusa la Registrazione Rapida (Fase 8).
   ========================================================================== */
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) {
    font-size: 0.875rem;
    line-height: 1.45;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:0.875rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 0.875rem"] {
    font-size: 0.8125rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:0.8125rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 0.8125rem"] {
    font-size: 0.75rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:0.75rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 0.75rem"] {
    font-size: 0.6875rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:1rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 1rem"] {
    font-size: 0.9375rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:1.125rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 1.125rem"] {
    font-size: 1.0625rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:1.25rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 1.25rem"] {
    font-size: 1.125rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:1.375rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 1.375rem"] {
    font-size: 1.25rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:1.5rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 1.5rem"] {
    font-size: 1.375rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:1.875rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 1.875rem"] {
    font-size: 1.625rem !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:11px"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 11px"] {
    font-size: 10px !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:13px"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 13px"] {
    font-size: 12px !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:14px"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 14px"] {
    font-size: 13px !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:15px"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 15px"] {
    font-size: 14px !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:16px"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 16px"] {
    font-size: 15px !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size:24px"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="font-size: 24px"] {
    font-size: 22px !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color:#dc2626" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color: #dc2626" i]:not([style*="background-color"]) {
    color: #c62833 !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color:#16a34a" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color: #16a34a" i]:not([style*="background-color"]) {
    color: #17803f !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color:#2563eb" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color: #2563eb" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color:#3b82f6" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color: #3b82f6" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color:#1d4ed8" i]:not([style*="background-color"]),
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color: #1d4ed8" i]:not([style*="background-color"]) {
    color: var(--primary-600) !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color: #d97706" i]:not([style*="background-color"]) {
    color: #a86a0a !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="color:#d97706" i]:not([style*="background-color"]) {
    color: var(--primary-600) !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="solid #d97706"]:not(.fi-wi-stats-overview-stat) {
    border-color: var(--primary-600) !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="background:#d97706"] {
    background: var(--primary-600) !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="background:rgba(217,119,6,0.2)"] {
    background: rgba(42, 68, 105, 0.16) !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="background: #16a34a"] {
    background: #17803f !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="background: #dc2626"] {
    background: #c62833 !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="background: #dbeafe"] {
    background: #dce5f1 !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) [style*="background: #eff6ff"] {
    background: #eff3f9 !important;
}
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) table[style] th[style*="padding: 0.75rem 1rem"],
.fi-page-content:where(:not(:has([x-data*="recognizing"]))) table[style] td[style*="padding: 0.75rem 1rem"] {
    padding: 0.5rem 0.75rem !important;
}
html:not(.dark) .fi-page-content:where(:not(:has([x-data*="recognizing"]))) tr[style*="background-color: #f9fafb"] {
    background-color: #f6f8fc !important;
}

/* ==========================================================================
   Fase 8: Registrazione Rapida, pulsante Scarica (Backup) e schermo stretto
   La pagina Registrazione Rapida e' riconosciuta dal suo x-data ("recognizing").
   ========================================================================== */
html:not(.dark) .fi-page-content:has([x-data*="recognizing"]) button[style*="border: 2px solid #f59e0b"],
html:not(.dark) .fi-page-content:has([x-data*="recognizing"]) button[style*="border: 2px solid #3b82f6"] {
    border-color: var(--primary-600) !important;
    background: #dce5f1 !important;
}
html:not(.dark) .fi-page-content:has([x-data*="recognizing"]) button:not([style*="border: 2px"])[style*="rgb(245, 158, 11)"],
html:not(.dark) .fi-page-content:has([x-data*="recognizing"]) button:not([style*="border: 2px"])[style*="#f59e0b"] {
    background-color: var(--primary-600) !important;
}
html:not(.dark) .fi-page-content a[style*="background-color: #f59e0b"] {
    background-color: var(--primary-600) !important;
}
@media (max-width: 639px) {
    .fi-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
    .fi-body select,
    .fi-body textarea {
        font-size: 16px !important;
    }
    .fi-main {
        padding-inline: 0.75rem;
    }
}
