﻿@charset "utf-8";
/* ==========================================================================
   GestaFinWeb 4.0 - Foglio di stile unico del progetto
   --------------------------------------------------------------------------
   Base: Bootstrap 5.3 (CDN) + Bootstrap Icons. Font: Inter.
   Design system allineato alla pagina Opportunita (indigo/soft, card 16px).
   Classi di progetto con prefisso .gfw-. Il layout dashboard (sidebar/topbar)
   vive qui ed e' condiviso dalla Site.master.
   ========================================================================== */

/* ==========================================================================
   1. TOKEN DI TEMA
   ========================================================================== */
:root {
    --gfw-bg:         #f4f5fb;
    --gfw-card:       #ffffff;
    --gfw-ink:        #1f2440;
    --gfw-muted:      #7a809c;
    --gfw-primary:    #6366f1;
    --gfw-primary-d:  #4f46e5;
    --gfw-primary-rgb: 99, 102, 241;
    --gfw-success:    #10b981;
    --gfw-warning:    #f59e0b;
    --gfw-danger:     #ef4444;
    --gfw-info:       #0ea5e9;
    --gfw-border:     #eef0f5;
    --gfw-radius:     16px;
    --gfw-radius-sm:  10px;
    --gfw-shadow:     0 10px 30px -12px rgba(31, 36, 64, .18);
    --gfw-shadow-sm:  0 0 18px rgba(31, 36, 64, .04);
    --gfw-font:       'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--gfw-font);
    background: var(--gfw-bg);
    color: var(--gfw-ink);
    font-size: 14px;
}

/* ==========================================================================
   3. RIBRANDING BOOTSTRAP 5 (senza ricompilare il Sass)
   ========================================================================== */
:root {
    --bs-primary:          #6366f1;
    --bs-primary-rgb:      99, 102, 241;
    --bs-link-color:       #4f46e5;
    --bs-link-color-rgb:   79, 70, 229;
    --bs-link-hover-color: #4338ca;
    --bs-font-sans-serif:  'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.btn-primary {
    --bs-btn-bg:                  #6366f1;
    --bs-btn-border-color:        #6366f1;
    --bs-btn-hover-bg:            #4f46e5;
    --bs-btn-hover-border-color:  #4f46e5;
    --bs-btn-active-bg:           #4f46e5;
    --bs-btn-active-border-color: #4338ca;
    --bs-btn-disabled-bg:         #6366f1;
    --bs-btn-disabled-border-color:#6366f1;
    --bs-btn-color:               #fff;
    --bs-btn-hover-color:         #fff;
    --bs-btn-active-color:        #fff;
    --bs-btn-focus-shadow-rgb:    99, 102, 241;
}
.btn-link { --bs-btn-color: #4f46e5; --bs-btn-hover-color: #4338ca; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.form-control:focus, .form-select:focus {
    border-color: #a5a8f5;
    box-shadow: 0 0 0 .25rem rgba(var(--gfw-primary-rgb), .25);
}
.form-check-input:checked { background-color: #6366f1; border-color: #6366f1; }
.form-check-input:focus {
    border-color: #a5a8f5;
    box-shadow: 0 0 0 .25rem rgba(var(--gfw-primary-rgb), .25);
}

/* ==========================================================================
   4. LAYOUT DASHBOARD (condiviso dalla Site.master)
   ========================================================================== */
.gfw-shell { display: flex; min-height: 100vh; }

.gfw-sidebar {
    width: 260px; flex: 0 0 260px;
    background: #fff; color: #66667a;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    border-right: 1px solid var(--gfw-border);
    box-shadow: var(--gfw-shadow-sm);
    z-index: 1040;
}
.gfw-logo { padding: 18px 16px 16px; border-bottom: 1px solid var(--gfw-border); text-align: center; }
.gfw-logo .brand { display: block; text-decoration: none; font-weight: 700; font-size: 16px; color: #2b2f44; letter-spacing: .2px; }
.gfw-logo img { max-width: 135px; height: auto; margin-top: 10px; }

.gfw-nav { list-style: none; padding: 12px; margin: 0; }
.gfw-nav li { margin: 2px 0; }
.gfw-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: #66667a; text-decoration: none; font-weight: 500; font-size: 13.5px;
    transition: background .15s ease, color .15s ease;
}
.gfw-nav a i { font-size: 18px; width: 22px; text-align: center; }
.gfw-nav a:hover { background: #f5f6fa; color: #2b2f44; }
.gfw-nav a.active { background: rgba(239, 68, 68, .10); color: var(--gfw-danger); font-weight: 600; }
.gfw-nav a.active i { color: var(--gfw-danger); }

.gfw-main { flex: 1 1 auto; min-width: 0; }
.gfw-topbar {
    position: sticky; top: 0; z-index: 5;
    background: rgba(244,245,251,.85);
    backdrop-filter: saturate(160%) blur(8px);
    padding: 18px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.gfw-topbar h1 { font-size: 22px; margin: 0; font-weight: 700; }
.gfw-topbar .sub { color: var(--gfw-muted); font-size: 13px; }
.gfw-content { padding: 6px 28px 40px; }

/* utente + logout nella topbar */
.gfw-user { display: flex; align-items: center; gap: 14px; }
.gfw-user-name { font-size: 13px; font-weight: 600; color: var(--gfw-ink); }
.gfw-user-name i { color: var(--gfw-muted); }
a.gfw-logout { color: var(--gfw-danger); text-decoration: none; font-size: 13px; font-weight: 500; }
a.gfw-logout:hover { text-decoration: underline; }

/* Sidebar a scomparsa su schermi piccoli */
.gfw-backdrop { display: none; }
@media (max-width: 991.98px) {
    .gfw-sidebar {
        position: fixed; left: 0; top: 0;
        transform: translateX(-100%); transition: transform .2s ease;
    }
    .gfw-sidebar.open { transform: translateX(0); }
    .gfw-backdrop.show {
        display: block; position: fixed; inset: 0;
        background: rgba(31,36,64,.35); z-index: 1039;
    }
}

/* ==========================================================================
   5. CARD E KPI
   ========================================================================== */
.gfw-card {
    background: var(--gfw-card); border-radius: var(--gfw-radius);
    box-shadow: var(--gfw-shadow); border: 1px solid rgba(31,36,64,.05);
}
.gfw-card .gfw-card-head { padding: 18px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.gfw-card .gfw-card-title { font-weight: 600; font-size: 15px; margin: 0; }
.gfw-card .gfw-card-body { padding: 16px 20px 20px; }

.gfw-kpi { display: flex; align-items: center; gap: 16px; }
.gfw-kpi .ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex: 0 0 56px; }
.gfw-kpi .ic.warn { background: rgba(245,158,11,.14); color: var(--gfw-warning); }
.gfw-kpi .ic.succ { background: rgba(16,185,129,.14); color: var(--gfw-success); }
.gfw-kpi .ic.dang { background: rgba(239,68,68,.14); color: var(--gfw-danger); }
.gfw-kpi .ic.info { background: rgba(99,102,241,.14); color: var(--gfw-primary); }
.gfw-kpi .lbl { color: var(--gfw-muted); font-size: 12.5px; font-weight: 500; }
.gfw-kpi .val { font-size: 22px; font-weight: 700; line-height: 1.15; }

/* ==========================================================================
   6. UTILITY / VALIDAZIONE
   ========================================================================== */
.gfw-error, .failureNotification {
    display: block; color: var(--gfw-danger);
    font-size: .8rem; line-height: 1.3; margin-top: 4px;
}
.failureNotification ul { padding-left: 18px; margin-bottom: 0; }

/* ==========================================================================
   7. PAGINE ACCOUNT (Login / Registrazione / Recupero password)
   ========================================================================== */
.gfw-auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 40px 15px;
    background: linear-gradient(135deg, var(--gfw-primary) 0%, var(--gfw-primary-d) 100%);
}
.gfw-auth-wrapper { width: 100%; max-width: 420px; }
.gfw-auth-card {
    background: #fff; border-radius: var(--gfw-radius);
    box-shadow: 0 24px 60px -20px rgba(31,36,64,.45); overflow: hidden;
}
.gfw-auth-logo { text-align: center; padding: 34px 32px 6px; }
.gfw-auth-logo img { max-width: 160px; height: auto; }
.gfw-auth-body { padding: 10px 34px 34px; }
.gfw-auth-title { font-size: 20px; font-weight: 700; text-align: center; color: var(--gfw-ink); margin: 6px 0 22px; }
.gfw-auth-body label { display: block; font-weight: 600; font-size: .82rem; color: var(--gfw-ink); margin-bottom: 6px; }
.gfw-auth-body .form-text { font-size: .75rem; color: var(--gfw-muted); }
.gfw-auth-body .form-control { border-radius: var(--gfw-radius-sm); padding: 10px 13px; }
.gfw-auth-remember { display: flex; align-items: center; gap: 8px; margin: 4px 0 20px; font-size: .85rem; color: var(--gfw-ink); }
.gfw-auth-remember input { margin: 0; }
.gfw-auth-remember label { margin: 0; font-weight: 500; }
.gfw-auth-submit { display: block; width: 100%; font-weight: 600; letter-spacing: .3px; padding: 11px 12px; border-radius: var(--gfw-radius-sm); }
.gfw-auth-divider { border: 0; border-top: 1px solid var(--gfw-border); margin: 20px 0 12px; opacity: 1; }
.gfw-auth-links { text-align: center; }
.gfw-auth-links .btn-link { font-size: .88rem; padding: 4px 10px; }
.gfw-auth-links .gfw-link-danger { --bs-btn-color: #ef4444; --bs-btn-hover-color: #dc2626; }
@media (max-width: 480px) {
    .gfw-auth-logo { padding: 26px 22px 4px; }
    .gfw-auth-body { padding: 10px 22px 26px; }
}

/* ==========================================================================
   8. DASHBOARD - tab, grafici (Chart.js), calendario (FullCalendar)
   ========================================================================== */
.nav-tabs { border: 0; gap: 6px; }
.nav-tabs .nav-link { border: 0; border-radius: 10px; color: var(--gfw-muted); font-weight: 600; padding: 8px 16px; }
.nav-tabs .nav-link.active { background: rgba(99,102,241,.12); color: var(--gfw-primary-d); }
.nav-tabs .nav-link i { margin-right: 6px; }

.chart-box { position: relative; width: 100%; height: 320px; }
.chart-box.tall { height: 420px; }
.chart-box.pie { height: 260px; }
.mini-title { font-weight: 600; font-size: 13.5px; margin: 4px 0 10px; color: var(--gfw-ink); text-align: center; }

.gfw-hint { color: var(--gfw-muted); font-size: 12px; }
footer.gfw-foot { color: var(--gfw-muted); font-size: 12.5px; text-align: center; padding: 24px; }

#calendar {
    --fc-border-color: #eceefb;
    --fc-button-bg-color: var(--gfw-primary);
    --fc-button-border-color: var(--gfw-primary);
    --fc-button-hover-bg-color: var(--gfw-primary-d);
    --fc-button-active-bg-color: var(--gfw-primary-d);
    --fc-today-bg-color: rgba(99,102,241,.07);
    font-size: 13px;
}
.fc .fc-toolbar-title { font-size: 1.05rem; }

/* ==========================================================================
   9. SEZIONI FUTURE (conversione pagina per pagina)
   --------------------------------------------------------------------------
   9.1 Tabelle/griglie (GridView, ListView) in stile card
   9.2 Modulo Pratiche
   9.3 Form di dettaglio (GestioneContatto, ModificaNota) - standalone iframe
   ========================================================================== */

/* =========================================================================
   10. MODULO OPPORTUNITA' (Leads) - stili circoscritti a .gfw-opp
   (spostati qui da Opportunita.aspx; valgono solo dentro la pagina
    Opportunita grazie al contenitore .gfw-opp, non toccano la Dashboard)
   ========================================================================= */

    .gfw-opp .gfw-card .table { margin-bottom: 0; font-size: 13.5px; }
    .gfw-opp .gfw-card .table thead th { background: #f7f8fc; color: #66667a; font-weight: 600;
            border-bottom: 1px solid #eef0f5; white-space: nowrap; }
    .gfw-opp .gfw-card .table td { vertical-align: middle; }
    .gfw-opp .gfw-row-hover { background: #eef1ff !important; }
    .gfw-opp .gfw-card .gfw-card-head { display: flex; align-items: center; gap: 12px;
            padding: 14px 18px; border-bottom: 1px solid #eef0f5; }
    .gfw-opp .gfw-card .gfw-card-head .ic { width: 38px; height: 38px; border-radius: 10px;
            display: grid; place-items: center; color: #fff; font-size: 18px; }
    .gfw-opp .gfw-card .gfw-card-head h2 { font-size: 15px; margin: 0; font-weight: 700; color: #2b2f44; }
    .gfw-opp .gfw-grid-wrap { overflow-x: auto; }
    .gfw-opp .gfw-grid-wrap table { font-size: 13px; margin-bottom: 0; }
    .gfw-opp .gfw-grid-wrap thead th { background: #f7f8fc; color: #66667a; font-weight: 600; white-space: nowrap; border-bottom: 1px solid #eef0f5; }
    .gfw-opp .gfw-grid-wrap td { padding: .55rem .6rem; vertical-align: top; }
    .gfw-opp .gfw-grid-wrap tbody tr { border-bottom: 1px solid #f2f3f8; }
    .gfw-opp .gfw-grid-wrap tbody tr:hover, .gfw-opp .gfw-row-hover { background: #fafbff; }
    .gfw-opp .gfw-nota { max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .gfw-opp .gfw-count { margin-left: auto; background: #eef0fb; color: #5b5fd6; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
    .gfw-opp .gfw-pager { padding: 10px 4px 2px; }
    .gfw-opp .gfw-pager table { margin: 0; }
    .gfw-opp .gfw-pager td { padding: 0; }
    .gfw-opp .gfw-pager a, .gfw-opp .gfw-pager span { display: inline-block; min-width: 30px; text-align: center; padding: 4px 8px; margin: 0 2px; border-radius: 8px; font-size: 13px; text-decoration: none; color: #5b5fd6; }
    .gfw-opp .gfw-pager a:hover { background: #eef0fb; }
    .gfw-opp .gfw-pager span { background: #6366f1; color: #fff; font-weight: 700; }
    .gfw-opp .slide-panel { position: fixed; top: 0; right: -80%; width: 80%; height: 100%;
            background: #fff; transition: right .3s ease;
            box-shadow: -5px 0 15px rgba(0,0,0,.2); z-index: 1050; overflow: hidden; }
    .gfw-opp .slide-panel.active { right: 0; }
    .gfw-opp .slide-panel-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,.5); z-index: 1040; display: none; }
    .gfw-opp .slide-panel-iframe { width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
    @media (max-width: 991px) {
    .gfw-opp .slide-panel { width: 100%; right: -100%; }
    }
    .gfw-opp .gfw-switch { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
    .gfw-opp .gfw-switch .lab { font-size:12px; color:#9aa0bd; text-transform:uppercase; letter-spacing:.04em; }
    .gfw-opp .gfw-seg-wrap { display:inline-flex; border:0.5px solid #dfe1ec; border-radius:999px; overflow:hidden; }
    .gfw-opp .gfw-seg { padding:6px 16px; font-size:13px; color:#6b7088; text-decoration:none; background:#fff; }
    .gfw-opp .gfw-seg:hover { background:#f6f7fb; color:#1f2440; }
    .gfw-opp .gfw-seg.is-active, .gfw-opp .gfw-seg.is-active:hover { background:#1f2440; color:#fff; }
    .gfw-opp .gfw-tabs { display:none; gap:2px; border-bottom:0.5px solid #e6e8f0; margin-bottom:18px; }
    .gfw-opp .gfw-tab { padding:10px 16px; font-size:14px; color:#6b7088; cursor:pointer; display:flex; align-items:center; gap:8px; border-bottom:2px solid transparent; user-select:none; }
    .gfw-opp .gfw-tab:hover { color:#1f2440; }
    .gfw-opp .gfw-tab.is-active { color:#1f2440; font-weight:500; border-bottom-color:#6366f1; }
    .gfw-opp .gfw-tab .dot { width:8px; height:8px; border-radius:50%; }
    .gfw-opp .gfw-tab .cnt { font-size:12px; color:#9aa0bd; }
    .gfw-opp .mode-focus .gfw-tabs { display:flex; }
    .gfw-opp .mode-focus .queue-section { display:none; }
    .gfw-opp .mode-focus .queue-section.is-active { display:block; }
    .gfw-opp .mode-focus .queue-section .gfw-card-head h2 { display:none; }
    .gfw-opp .mode-compatta .gfw-tabs { display:none; }
    .gfw-opp .gfw-list-col { min-width:0; }
    .gfw-opp .gfw-detail-col { display:none; }
    .gfw-opp .gfw-kpi { display:none; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; margin-bottom:18px; }
    .gfw-opp .mode-cruscotto .gfw-kpi { display:grid; }
    .gfw-opp .mode-cruscotto .gfw-tabs { display:none; }
    .gfw-opp .mode-cruscotto .queue-section { display:none; }
    .gfw-opp .mode-cruscotto .queue-section.is-active { display:block; }
    .gfw-opp .mode-cruscotto .queue-section .gfw-card-head h2 { display:none; }
    .gfw-opp .gfw-kpi-card { background:#f7f8fc; border:2px solid transparent; border-radius:12px; padding:12px 14px; cursor:pointer; }
    .gfw-opp .gfw-kpi-card:hover { background:#eef0f8; }
    .gfw-opp .gfw-kpi-card.is-active { border-color:#6366f1; background:#fff; }
    .gfw-opp .gfw-kpi-card .k-lab { font-size:12px; display:flex; align-items:center; gap:6px; }
    .gfw-opp .gfw-kpi-card .k-num { font-size:24px; font-weight:700; color:#2b2f44; margin-top:2px; }
    .gfw-opp .mode-affiancata { display:grid; grid-template-columns:340px minmax(0,1fr); gap:16px; align-items:start; }
    .gfw-opp .mode-affiancata .gfw-tabs { display:flex; }
    .gfw-opp .mode-affiancata .queue-section { display:none; }
    .gfw-opp .mode-affiancata .queue-section.is-active { display:block; }
    .gfw-opp .mode-affiancata .queue-section .gfw-card-head h2 { display:none; }
    .gfw-opp .mode-affiancata .queue-section table th:nth-child(n/**/+3), .gfw-opp .mode-affiancata .queue-section table td:nth-child(n/**/+3) { display:none; }
    .gfw-opp .mode-affiancata .gfw-detail-col { display:block; position:sticky; top:16px; height:calc(100vh - 140px);
            background:#fff; border:0.5px solid #e6e8f0; border-radius:14px; overflow:hidden; }
    .gfw-opp .gfw-detail-frame { width:100%; height:100%; border:0; display:none; }
    .gfw-opp .gfw-detail-empty { padding:48px 20px; text-align:center; color:#9aa0bd; font-size:13px; }
    .gfw-opp .gfw-ac-wrap { position:relative; }
    .gfw-opp .gfw-ac { position:absolute; z-index:40; left:0; right:0; top:calc(100% + 4px); background:#fff;
            border:1px solid #e6e8f0; border-radius:10px; box-shadow:0 8px 24px rgba(20,20,50,.12);
            max-height:320px; overflow:auto; display:none; }
    .gfw-opp .gfw-ac.show { display:block; }
    .gfw-opp .gfw-ac-item { padding:8px 12px; cursor:pointer; border-bottom:1px solid #f2f3f8; }
    .gfw-opp .gfw-ac-item:last-child { border-bottom:0; }
    .gfw-opp .gfw-ac-item:hover, .gfw-opp .gfw-ac-item.active { background:#f4f6fc; }
    .gfw-opp .gfw-ac-item .r { font-size:13px; font-weight:500; color:#2b2f44; }
    .gfw-opp .gfw-ac-item .m { font-size:12px; color:#8a90ad; margin-top:1px; }
    .gfw-opp .gfw-ac-empty { padding:10px 12px; font-size:13px; color:#9aa0bd; }
    @media (max-width: 991px) {
    .gfw-opp .mode-affiancata { grid-template-columns:1fr; }
    .gfw-opp .mode-affiancata .gfw-detail-col { position:static; height:60vh; }
    }


/* --- Collasso manuale della sidebar su desktop --- */
@media (min-width: 992px) {
    .gfw-sidebar { transition: flex-basis .2s ease, width .2s ease; }
    .gfw-shell.gfw-collapsed .gfw-sidebar {
        flex-basis: 0;
        width: 0;
        min-width: 0;
        overflow: hidden;
        border-right: none;
    }
}
