:root {
        --ink: #0f172a;
        --ink-soft: #64748b;
        --paper: #f8fafc;
        --paper-deep: #f1f5f9;
        --surface: #ffffff;
        --line: #e2e8f0;
        --green: #059669;
        --green-deep: #065f46;
        --green-soft: #ecfdf5;
        --gold: #f59e0b;
        --gold-soft: #fef3c7;
        --brick: #dc2626;
        --brick-soft: #fee2e2;
        --ok: #059669;
        --warn: #d97706;
        --r-lg: 12px;
        --r-md: 8px;
        --r-sm: 6px;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
        --font-display: 'Inter', system-ui, -apple-system, sans-serif;
        --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
        --primary: var(--green);
    }
    * { box-sizing: border-box; font-family: var(--font-body); }
    * { -webkit-tap-highlight-color: transparent; }
    :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
    body { margin: 0; background-color: var(--paper); color: var(--ink); overflow-x: hidden; }

    /* Topbar & Header */
    .app-title-bar {
        width: 100%; text-align: center; padding: 0.9rem 1.2rem;
        background: var(--green-deep); position: relative;
        display: flex; align-items: center; justify-content: center;
        min-height: 60px;
    }
    .app-brand-left {
        position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%);
        display: flex; align-items: center; gap: 0.65rem;
        cursor: pointer; user-select: none;
    }
    .app-brand-left .app-logo {
        width: 42px; height: 42px; object-fit: contain;
        border-radius: 50%; background: #ffffff; padding: 2px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.25);
        flex-shrink: 0;
    }
    .app-brand-left .app-name {
        font-family: var(--font-display);
        font-weight: 800; font-size: 1.65rem; letter-spacing: .06em;
        color: var(--gold-soft); line-height: 1;
    }
    .app-title-bar h1 {
        color: var(--gold-soft); margin: 0; font-family: var(--font-display);
        font-weight: 700; font-size: 1.85rem; letter-spacing: .08em;
    }
    .cloud-status {
        position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
        font-size: 0.8rem; font-weight: 600; padding: 0.35rem 0.75rem; border-radius: 999px;
        display: flex; align-items: center; gap: 0.4rem; background: rgba(0,0,0,0.25);
        color: #fff; transition: background .3s ease;
    }
    .cloud-status.synced { color: #86efac; border: 1px solid rgba(134,239,172,0.3); }
    .cloud-status.saving { color: #fde047; border: 1px solid rgba(253,224,71,0.3); }
    .cloud-status.offline { color: #fca5a5; border: 1px solid rgba(252,165,165,0.3); }

    #dashboard {
        display: flex; flex-direction: column; align-items: center;
        min-height: 100vh; padding: 0 0 2.5rem;
    }
    #dashboard > .buttons-grid, #dashboard > #bk-warn, #dashboard > .dtabs {
        padding-left: 1.5rem; padding-right: 1.5rem;
    }

    /* Dashboard 3-Column Layout with Integrated Bacheca (left) & Calendario (right) */
    .dash-layout-container {
        display: flex;
        gap: 20px;
        align-items: flex-start;
        width: 100%;
        max-width: 1600px;
        padding: 0 1.5rem;
        margin-top: 1rem;
        box-sizing: border-box;
    }
    .dash-side-col {
        width: 290px;
        min-width: 260px;
        flex-shrink: 0;
    }
    .dash-center-col {
        flex: 1 1 0;
        min-width: 0;
    }
    .dash-widget-card {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        padding: 14px 16px;
        box-shadow: var(--shadow-sm);
    }
    .dash-widget-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 10px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--line);
    }
    .dash-widget-content {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 580px;
        overflow-y: auto;
    }
    @media (max-width: 1100px) {
        .dash-layout-container {
            flex-direction: column;
            align-items: stretch;
            padding: 0 1rem;
        }
        .dash-side-col {
            width: 100%;
            min-width: 0;
        }
        .dash-left-col {
            order: 1; /* In alto se manca spazio */
            margin-bottom: 0.5rem;
        }
        .dash-center-col {
            order: 2; /* In mezzo */
        }
        .dash-right-col {
            order: 3; /* In basso se manca spazio */
            margin-top: 1rem;
        }
    }

    .buttons-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 1.3rem; width: 100%; max-width: 1060px; margin: 1.8rem auto 0;
    }

    .tool-btn {
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
        padding: 1.8rem 1.2rem; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; color: var(--ink);
        cursor: grab; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
        box-shadow: var(--shadow-sm);
        display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
        user-select: none; touch-action: manipulation;
    }
    .tool-btn:hover { transform: translateY(-3px); border-color: var(--green); box-shadow: var(--shadow); }
    .tool-btn:active { cursor: grabbing; }
    .tool-btn .icon {
        font-size: 2.1rem; width: 3.6rem; height: 3.6rem; border-radius: 50%;
        background: var(--green-soft); display: flex; align-items: center; justify-content: center;
    }
    .tool-btn[hidden] { display: none !important; }
    .tool-btn.dragging { opacity: .35; cursor: grabbing; }

    /* Digital Pay Modal */
    .digital-pay-modal-overlay {
        display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7);
        backdrop-filter: blur(4px); z-index: 999; align-items: center; justify-content: center; padding: 1rem;
    }
    .digital-pay-modal-overlay.active { display: flex !important; }
    .digital-pay-modal-card {
        background: var(--paper); color: var(--ink); border: 1px solid var(--border);
        border-radius: var(--r); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
        width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; padding: 1.4rem;
    }

    /* App Views / Iframes */
    .app-view {
        display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: #fff; z-index: 100; flex-direction: column;
    }
    .app-view.active { display: flex; }
    .app-header {
        background: var(--green-deep); color: var(--gold-soft); padding: 0.75rem 1rem;
        display: flex; align-items: center; z-index: 101;
    }
    .back-btn {
        background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,.18);
        color: var(--gold-soft); padding: 0.5rem 1rem; border-radius: var(--r-sm);
        font-size: 0.95rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
    }
    .app-title { margin: 0 auto; font-weight: 700; font-size: 1.15rem; transform: translateX(-40px); color: #fff; }
    iframe { flex: 1; width: 100%; height: 100%; border: none; background: #fff; }

    /* Screens & Cards */
    .screen { display: none; min-height: 100vh; padding: 1.5rem; background: var(--paper); }
    .screen.on { display: block; }
    #scr-auth.screen {
        background: radial-gradient(circle at 50% -10%, #3a5a3f 0%, var(--green-deep) 55%, #1a2e18 100%);
        padding-top: 3.5rem;
    }
    #scr-auth .card { margin-top: 1rem; }
    .card {
        max-width: 660px; margin: 1.5rem auto; background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.8rem;
        box-shadow: var(--shadow-sm);
    }
    .card.wide { max-width: 980px; }
    .card h2 {
        margin: 0 0 1.1rem; font-size: 1.55rem; font-family: var(--font-display);
        font-weight: 700; color: var(--green-deep);
    }
    .card h3 {
        margin: 1.6rem 0 .7rem; font-size: 1.05rem; color: var(--green-deep);
        padding-bottom: .4rem; border-bottom: 2px solid var(--line);
    }
    .card input, .card select {
        width: 100%; padding: .65rem .8rem; margin: .25rem 0 .75rem;
        border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 1rem;
        background: #fff; color: var(--ink);
    }
    .card textarea {
        width: 100%; padding: .65rem .8rem; margin: .25rem 0 .75rem;
        border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit;
        min-height: 4.2rem; background: #fff; color: var(--ink); resize: vertical;
    }
    .card input:focus, .card select:focus, .card textarea:focus {
        outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft);
    }
    .card label { display: block; font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
    .card .chk label {
        display: inline-flex; gap: .4rem; align-items: center; margin-right: 1.2rem;
        font-weight: 500; color: var(--ink); cursor: pointer;
    }
    .card .chk input { width: auto; margin: 0; }
    .card button, .ubar button {
        background: var(--green); color: #fff; border: 0; border-radius: var(--r-sm);
        padding: .65rem 1.15rem; font-weight: 700; cursor: pointer; font-size: .95rem;
        transition: background .15s ease, opacity .15s ease;
    }
    .card button:hover, .ubar button:hover { background: var(--green-deep); }
    .card button:disabled { opacity: 0.5; cursor: not-allowed; }
    .card button.ghost, .ubar button.ghost { background: var(--paper-deep); color: var(--ink); }
    .card button.ghost:hover, .ubar button.ghost:hover { background: var(--line); }

    /* Tabs & Filters */
    .ptabs, .dtabs { display: flex; gap: .5rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
    .dtabs { justify-content: center; margin-top: 2.2rem; margin-bottom: 1.6rem; }
    .ptabs button, .dtabs button {
        border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
        border-radius: 999px; padding: .6rem 1.2rem; font-weight: 700; font-size: .95rem; cursor: pointer;
        transition: all .15s ease;
    }
    .ptabs button.on, .dtabs button.on { background: var(--green); border-color: var(--green); color: #fff; }
    .dtabs button.tab-drag-hover { background: #059669 !important; border-color: #059669 !important; color: #fff !important; transform: scale(1.08); box-shadow: 0 4px 12px rgba(5,150,105,0.4); outline: 2px dashed #fff; }

    /* Notifications & Tables */
    .msg { margin: .6rem 0; font-weight: 600; color: var(--brick); font-size: .95rem; }
    .msg.ok { color: var(--ok); }
    .row { padding: .75rem 0; border-top: 1px solid var(--line); }
    .row small { color: var(--ink-soft); }
    .row select { width: auto; min-width: 200px; margin: .4rem .4rem 0 0; }
    .row button { margin-top: .4rem; }
    .chip {
        display: inline-block; background: var(--gold-soft); color: var(--green-deep);
        border-radius: 999px; padding: .2rem .7rem; margin: .2rem .3rem .2rem 0;
        font-size: .9rem; font-weight: 600;
    }
    .chip a { cursor: pointer; margin-left: .35rem; }

    /* Top User Bar */
    .ubar {
        display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
        width: 100%; background: var(--green); color: #fff; padding: .75rem 1.5rem;
        font-weight: 600; border-top: 1px solid rgba(255,255,255,.15);
    }
    .ubar-left { display: flex; flex-direction: column; justify-self: start; line-height: 1.3; }
    .ubar-left span:first-child { font-size: 1.05rem; font-weight: 700; }
    .ubar-left #ub-role { font-size: .85rem; color: var(--gold-soft); font-weight: 500; }
    .ubar-center { justify-self: center; font-size: 1.15rem; font-weight: 700; text-align: center; font-family: var(--font-display); }
    .ubar-right { display: flex; align-items: center; gap: 1rem; justify-self: end; }

    .gcols, .pcols { display: grid; gap: 1.5rem; }
    .gcols { grid-template-columns: 280px minmax(0, 1fr); }
    .gcols > *, .pcols > * { min-width: 0; max-width: 100%; }
    .pcols { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
    .two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
    @media (max-width: 680px) {
        .two-col-grid { grid-template-columns: 1fr; gap: 1rem; }
    }
    @media (max-width: 768px) {
        .app-title-bar {
            flex-direction: column;
            gap: 0.5rem;
            padding: 0.8rem 1rem;
        }
        .app-brand-left {
            position: static;
            transform: none;
        }
        .cloud-status {
            position: static;
            transform: none;
        }
        .gcols, .pcols { grid-template-columns: 1fr; }
        .ubar { grid-template-columns: 1fr; text-align: center; }
        .ubar-left, .ubar-center, .ubar-right { justify-self: center; align-items: center; }
        .app-title { transform: none; font-size: 1rem; }
    }

    .pick { cursor: pointer; padding: .5rem; border-radius: var(--r-sm); transition: background .15s; }
    .pick:hover { background: var(--paper); }
    .pick.sel { background: var(--green-soft); }
    .kv { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--line); }
    .kv span { color: var(--ink-soft); }
    .kv b { text-align: right; }
    .rel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
    .rel button { grid-column: 1/-1; justify-self: start; }

    #badge {
        display: none; flex-direction: column; justify-content: center; gap: .15rem;
        background: transparent; color: #fff; border: 0; padding: 0; font-size: .85rem;
        font-weight: 600; line-height: 1.3;
    }
    #badge span { white-space: nowrap; color: var(--gold-soft); }
    #badge b { font-size: 1.05rem; margin-left: .4rem; color: var(--gold-soft); }

    .badge-credito { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
    .badge-debito { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
    .badge-pareggio { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 600; background: #f5f5f5; color: #616161; }
    .comp-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
    .comp-step { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
    .comp-step-arrow { font-size: 1.2rem; font-weight: 900; color: var(--gold); }
    .sede-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; background: var(--green-soft); color: var(--green-deep); }

    #backtop {
        display: none; position: fixed; top: 8px; left: 10px; z-index: 300;
        background: var(--green-deep); color: var(--gold-soft); border: 1px solid rgba(255,255,255,.2);
        border-radius: var(--r-sm); padding: .5rem 1rem; font-size: .95rem; font-weight: 700; cursor: pointer;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    }
    body.hasback { padding-top: 50px; }

    .tscroll { overflow-x: auto; margin: .4rem 0 1.2rem; }
    .tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
    .tbl th, .tbl td { padding: .55rem .7rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
    .tbl th { border-top: 0; border-bottom: 2px solid var(--gold); color: var(--green-deep); font-size: .84rem; font-weight: 700; white-space: nowrap; }
    .tbl .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
    .tbl tfoot td { border-top: 2px solid var(--paper-deep); font-weight: 700; }
    .tbl tr.trpick { cursor: pointer; }
    .tbl tr.trpick:hover td { background: var(--paper); }
    .tbl tr.sel td { background: var(--green-soft); }
    .tbl tr.trpick:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
    .tbl button { padding: .35rem .7rem; font-size: .85rem; }
    .up { color: var(--ok); font-weight: 700; }
    .dn { color: var(--brick); font-weight: 700; }
    .sub { margin: .25rem 0 1rem; color: var(--ink-soft); }
    .formcol { max-width: 540px; }

    /* Toast Notification */
    .toast-popup {
        position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
        background: var(--green-deep); color: #fff; padding: 0.85rem 1.6rem; border-radius: var(--r-md);
        font-size: 0.95rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        border: 1px solid var(--gold); z-index: 500; opacity: 0; pointer-events: none;
        transition: opacity .25s ease, transform .25s ease;
    }
    /* Delegati e Uscite Anticipate */
    .delegato-card {
        background: var(--panel2);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        padding: 12px;
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .badge-delegato-ok {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
        font-weight: 700;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }
    .badge-delegato-genitore {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
        font-weight: 700;
        border: 1px solid rgba(59, 130, 246, 0.3);
    }
    .badge-delegato-warn {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
        font-weight: 700;
        border: 1px solid rgba(245, 158, 11, 0.3);
    }
    .usc-quick-btn {
        padding: 6px 12px;
        font-size: 0.82rem;
        border-radius: 6px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    /* =========================================================
    /* =========================================================
       PROFILO UTENTE - DESIGN ESATTO DA MOCKUP PDF / IMMAGINI
       ========================================================= */
    #scr-profilo {
        display: none !important;
    }
    #scr-profilo.on {
        display: flex !important;
        background: #eae4d5 !important;
        min-height: 100vh !important;
        padding: 2rem 1.2rem !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }
    .prof-mockup-card {
        background: #fffdfa !important;
        border: none !important;
        border-radius: 26px !important;
        max-width: 780px !important;
        margin: 0 auto !important;
        padding: 28px 34px 34px 34px !important;
        box-shadow: 0 10px 36px rgba(45, 35, 20, 0.07) !important;
        box-sizing: border-box !important;
        width: 100% !important;
        font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    }
    .prof-mockup-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }
    .prof-avatar-icon {
        width: 52px !important;
        height: 52px !important;
        border-radius: 50% !important;
        background: #284835 !important;
        color: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    .prof-header-title {
        font-size: 1.35rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        letter-spacing: -0.01em !important;
    }
    .prof-header-sub {
        font-size: 0.9rem !important;
        color: #5a655c !important;
        margin-top: 3px !important;
        font-weight: 400 !important;
    }
    .prof-home-btn {
        background: #d1cdc4 !important;
        color: #1f2621 !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        padding: 7px 22px !important;
        border-radius: 12px !important;
        border: none !important;
        cursor: pointer !important;
        transition: background 0.15s ease !important;
    }
    .prof-home-btn:hover {
        background: #c3beaf !important;
    }
    .prof-pill-tabs {
        display: flex !important;
        gap: 12px !important;
        padding-bottom: 16px !important;
        margin-bottom: 20px !important;
        border-bottom: 1.5px solid #ded7c9 !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    .prof-pill-tabs button {
        border: 1.5px solid #284835 !important;
        background: transparent !important;
        color: #284835 !important;
        border-radius: 9999px !important;
        padding: 6px 22px !important;
        font-size: 0.92rem !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
    }
    .prof-pill-tabs button.on {
        background: #284835 !important;
        color: #ffffff !important;
        border-color: #284835 !important;
    }
    .prof-tab-pill-sub {
        background: transparent !important;
        border: 1.5px solid #284835 !important;
        color: #284835 !important;
        border-radius: 9999px !important;
        padding: 4px 14px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
    }
    .prof-tab-pill-sub.active {
        background: #284835 !important;
        color: #ffffff !important;
    }
    .prof-beige-box {
        background: #eae5d8 !important;
        border-radius: 16px !important;
        padding: 20px 24px !important;
        margin-bottom: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border: none !important;
    }
    .prof-beige-box:last-child {
        margin-bottom: 0 !important;
    }
    .prof-two-cols {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
        width: 100% !important;
    }
    @media (max-width: 680px) {
        .prof-two-cols {
            grid-template-columns: 1fr !important;
        }
    }
    .prof-col-left {
        padding-right: 24px !important;
    }
    .prof-col-right {
        padding-left: 24px !important;
        border-left: 1px solid #ded6c7 !important;
    }
    @media (max-width: 680px) {
        .prof-col-left { padding-right: 0 !important; padding-bottom: 14px !important; }
        .prof-col-right { padding-left: 0 !important; border-left: none !important; border-top: 1px solid #ded6c7 !important; padding-top: 14px !important; }
    }
    .prof-box-title,
    .prof-section-title {
        font-size: 1.12rem !important;
        font-weight: 700 !important;
        color: #1e2821 !important;
        margin: 0 0 14px 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    .prof-field-line {
        display: flex !important;
        align-items: baseline !important;
        font-size: 0.95rem !important;
        color: #2f3832 !important;
        margin-bottom: 8px !important;
        line-height: 1.35 !important;
    }
    .prof-field-line:last-child {
        margin-bottom: 0 !important;
    }
    .prof-field-label {
        color: #2f3832 !important;
        font-weight: 400 !important;
        flex-shrink: 0 !important;
        font-size: 0.95rem !important;
        margin-right: 8px !important;
        white-space: nowrap !important;
    }
    .prof-field-val {
        color: #141a16 !important;
        font-weight: 600 !important;
        font-size: 0.95rem !important;
        word-break: break-word !important;
        padding: 1px 2px !important;
    }
    .prof-field-input {
        flex: 1 !important;
        min-width: 0 !important;
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid transparent !important;
        color: #141a16 !important;
        font-weight: 600 !important;
        font-size: 0.95rem !important;
        padding: 1px 4px !important;
        outline: none !important;
        font-family: inherit !important;
        border-radius: 4px !important;
        transition: background 0.15s ease, border-bottom 0.15s ease !important;
    }
    .prof-field-input:focus {
        background: rgba(255, 255, 255, 0.65) !important;
        border-bottom: 1.5px solid #284835 !important;
    }
    .prof-field-select {
        cursor: pointer !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23284835' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 6px center !important;
        padding-right: 22px !important;
        width: auto !important;
        max-width: 100% !important;
        flex: initial !important;
    }
    input[type="date"].prof-field-input {
        font-family: inherit !important;
        font-size: 0.93rem !important;
        font-weight: 600 !important;
        color: #141a16 !important;
        padding: 1px 2px !important;
        cursor: pointer !important;
        display: inline-flex !important;
        align-items: center !important;
        max-width: 170px !important;
    }
    input[type="date"].prof-field-input::-webkit-calendar-picker-indicator {
        cursor: pointer !important;
        opacity: 0.65 !important;
        padding: 0 !important;
        margin-left: 6px !important;
        filter: invert(20%) sepia(20%) saturate(1200%) hue-rotate(95deg) brightness(80%);
    }
    input[type="date"].prof-field-input::-webkit-calendar-picker-indicator:hover {
        opacity: 1 !important;
    }
    .prof-btn-green, .prof-btn-aggiungi {
        background: #284835 !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 9999px !important;
        padding: 6px 26px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: opacity 0.15s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .prof-btn-green:hover, .prof-btn-aggiungi:hover {
        opacity: 0.9 !important;
    }
    .prof-filter-select {
        background: #fffdfa !important;
        border: 1px solid #c9c2b4 !important;
        border-radius: 9999px !important;
        padding: 5px 28px 5px 12px !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        color: #284835 !important;
        height: 32px !important;
        cursor: pointer !important;
        outline: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23284835' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 10px center !important;
    }
    .prof-filter-pill {
        background: transparent !important;
        border: 1px solid #c9c2b4 !important;
        border-radius: 9999px !important;
        padding: 0 14px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        color: #284835 !important;
        cursor: pointer !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.15s ease !important;
    }
    .prof-filter-pill:hover {
        border-color: #284835 !important;
    }
    .prof-filter-pill.active {
        background: #284835 !important;
        border-color: #284835 !important;
        color: #ffffff !important;
    }
    .prof-table-30gg {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 0.88rem !important;
        margin-top: 8px !important;
    }
    .prof-table-30gg th {
        text-align: left !important;
        padding: 8px 10px !important;
        font-weight: 700 !important;
        color: #111813 !important;
        border-top: 1.5px solid #111813 !important;
        border-bottom: 1.5px solid #111813 !important;
    }
    .prof-table-30gg td {
        padding: 8px 10px !important;
        color: #222222 !important;
        border-bottom: 1px solid #ded6c7 !important;
        vertical-align: middle !important;
    }

    /* =====================================================================
       MOCKUP CARICA CREDITO
       ===================================================================== */
    .carica-mockup-card {
        background: #fffdfa !important;
        border: none !important;
        border-radius: 26px !important;
        max-width: 780px !important;
        margin: 0 auto !important;
        padding: 28px 34px 34px 34px !important;
        box-shadow: 0 10px 36px rgba(45, 35, 20, 0.07) !important;
        box-sizing: border-box !important;
        width: 100% !important;
        font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    }
    .carica-mockup-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-bottom: 14px !important;
        margin-bottom: 18px !important;
        border-bottom: 1.5px solid #ded6c7 !important;
        width: 100% !important;
    }
    .carica-header-title {
        font-size: 1.65rem !important;
        font-weight: 700 !important;
        color: #284835 !important;
        margin: 0 !important;
        letter-spacing: -0.01em !important;
    }
    .carica-home-btn {
        background: #cecac0 !important;
        color: #222222 !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        padding: 7px 22px !important;
        border-radius: 9999px !important;
        border: none !important;
        cursor: pointer !important;
        transition: background 0.15s ease !important;
    }
    .carica-home-btn:hover {
        background: #bfbaa9 !important;
    }
    .carica-top-grid {
        display: grid !important;
        grid-template-columns: 1.15fr 1fr !important;
        gap: 20px !important;
        align-items: stretch !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }
    @media (max-width: 680px) {
        .carica-top-grid {
            grid-template-columns: 1fr !important;
            gap: 12px !important;
        }
    }
    .carica-label {
        font-size: 0.88rem !important;
        color: #3f4742 !important;
        margin-bottom: 6px !important;
        font-weight: 500 !important;
        display: block !important;
    }
    .carica-select-field, .carica-input-field {
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #b5afa4 !important;
        border-radius: 8px !important;
        padding: 10px 14px !important;
        font-size: 0.95rem !important;
        font-family: inherit !important;
        color: #111813 !important;
        box-sizing: border-box !important;
        outline: none !important;
        transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    }
    .carica-select-field {
        cursor: pointer !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23284835' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 14px center !important;
        padding-right: 36px !important;
    }
    .carica-select-field:focus, .carica-input-field:focus {
        border-color: #284835 !important;
        box-shadow: 0 0 0 2px rgba(40, 72, 53, 0.12) !important;
    }
    .carica-bal-box {
        background: #eee8dc !important;
        border-radius: 12px !important;
        padding: 12px 18px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .carica-bal-title {
        font-size: 0.94rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        margin-bottom: 2px !important;
    }
    .carica-bal-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.9rem !important;
        color: #222222 !important;
    }
    .carica-bal-row span {
        color: #333333 !important;
    }
    .carica-bal-row b {
        font-weight: 700 !important;
        color: #111813 !important;
    }
    .carica-load-box {
        background: #eee8dc !important;
        border-radius: 16px !important;
        padding: 20px 24px 22px 24px !important;
        margin: 16px 0 24px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .carica-load-title {
        font-size: 1.18rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        margin-bottom: 14px !important;
    }
    .carica-form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px 24px !important;
        width: 100% !important;
    }
    @media (max-width: 680px) {
        .carica-form-grid {
            grid-template-columns: 1fr !important;
            gap: 14px !important;
        }
    }
    .carica-btn-submit {
        background: #284835 !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 9999px !important;
        padding: 11px 48px !important;
        font-size: 0.98rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        transition: opacity 0.15s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-top: 18px !important;
    }
    .carica-btn-submit:hover {
        opacity: 0.92 !important;
    }
    .carica-sec-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 10px !important;
        width: 100% !important;
    }
    .carica-sec-title {
        font-size: 1.25rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
    }
    .carica-btn-csv {
        background: #284835 !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 9999px !important;
        padding: 7px 22px !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        transition: opacity 0.15s ease !important;
    }
    .carica-btn-csv:hover {
        opacity: 0.92 !important;
    }
    .carica-tbl-mov {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 0.88rem !important;
        margin-top: 8px !important;
    }
    .carica-tbl-mov th {
        text-align: left !important;
        padding: 8px 10px !important;
        font-weight: 700 !important;
        color: #111813 !important;
        border-top: 1.5px solid #111813 !important;
        border-bottom: 1.5px solid #111813 !important;
    }
    .carica-tbl-mov td {
        padding: 8px 10px !important;
        color: #222222 !important;
    }

    /* =====================================================================
       MOCKUP ATTIVITÀ
       ===================================================================== */
    .att-mockup-card {
        background: #fffdfa !important;
        border: none !important;
        border-radius: 26px !important;
        max-width: 780px !important;
        margin: 0 auto !important;
        padding: 28px 34px 34px 34px !important;
        box-shadow: 0 10px 36px rgba(45, 35, 20, 0.07) !important;
        box-sizing: border-box !important;
        width: 100% !important;
        font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    }
    .att-mockup-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-bottom: 14px !important;
        margin-bottom: 18px !important;
        border-bottom: 1.5px solid #ded6c7 !important;
        width: 100% !important;
    }
    .att-header-title {
        font-size: 1.65rem !important;
        font-weight: 700 !important;
        color: #284835 !important;
        margin: 0 !important;
        letter-spacing: -0.01em !important;
    }
    .att-home-btn {
        background: #cecac0 !important;
        color: #222222 !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        padding: 7px 22px !important;
        border-radius: 9999px !important;
        border: none !important;
        cursor: pointer !important;
        transition: background 0.15s ease !important;
    }
    .att-home-btn:hover {
        background: #bfbaa9 !important;
    }
    .att-top-grid {
        display: grid !important;
        grid-template-columns: 1.15fr 1fr !important;
        gap: 20px !important;
        align-items: stretch !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }
    @media (max-width: 680px) {
        .att-top-grid {
            grid-template-columns: 1fr !important;
            gap: 12px !important;
        }
    }
    .att-label {
        font-size: 0.88rem !important;
        color: #3f4742 !important;
        margin-bottom: 6px !important;
        font-weight: 500 !important;
        display: block !important;
    }
    .att-select-field {
        width: 100% !important;
        padding: 10px 14px !important;
        border-radius: 10px !important;
        border: 1px solid #c4beaf !important;
        background: #ffffff !important;
        font-size: 0.95rem !important;
        color: #111813 !important;
        box-sizing: border-box !important;
        font-family: inherit !important;
        cursor: pointer !important;
    }
    .att-bal-box {
        background: #ebe5d8 !important;
        border-radius: 14px !important;
        padding: 12px 18px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    .att-bal-title {
        font-size: 0.86rem !important;
        color: #222222 !important;
        font-weight: 700 !important;
        margin-bottom: 6px !important;
    }
    .att-bal-row {
        display: flex !important;
        justify-content: space-between !important;
        font-size: 0.88rem !important;
        color: #3f4742 !important;
        line-height: 1.5 !important;
    }
    .att-bal-row b {
        color: #111813 !important;
        font-weight: 700 !important;
    }

    /* Griglia attività */
    .att-cards-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
        margin-bottom: 24px !important;
        width: 100% !important;
    }
    @media (max-width: 680px) {
        .att-cards-grid {
            grid-template-columns: 1fr !important;
            gap: 16px !important;
        }
    }
    .att-card-box {
        background: #ebe5d8 !important;
        border-radius: 16px !important;
        padding: 18px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    .att-card-box.full-width {
        grid-column: 1 / -1 !important;
    }
    .att-card-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: baseline !important;
        margin-bottom: 4px !important;
    }
    .att-card-title {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        margin: 0 !important;
    }
    .att-card-price {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        white-space: nowrap !important;
    }
    .att-card-desc {
        font-size: 0.85rem !important;
        color: #5c6760 !important;
        margin-bottom: 14px !important;
        line-height: 1.35 !important;
    }

    /* Griglia sottoattività (Settimane) a 2 colonne come nel mockup */
    .att-sub-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
        margin: 12px 0 16px 0 !important;
    }
    @media (max-width: 600px) {
        .att-sub-grid {
            grid-template-columns: 1fr !important;
            gap: 14px !important;
        }
    }
    .att-sub-item {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        background: #ffffff !important;
        border: 1.5px solid #ded6c7 !important;
        border-radius: 14px !important;
        padding: 12px 14px !important;
        transition: all 0.2s ease !important;
        box-sizing: border-box !important;
    }
    .att-sub-item.unselected {
        background: #ffffff !important;
        border: 1.5px solid #e2e8f0 !important;
        box-shadow: none !important;
    }
    .att-sub-item.selected {
        background: #f0fdf4 !important;
        border: 1.5px solid #16a34a !important;
        box-shadow: 0 4px 14px rgba(22, 163, 74, 0.12) !important;
    }
    .att-week-pill {
        border-radius: 9999px !important;
        padding: 7px 18px !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .att-week-pill.selected {
        background: #16a34a !important;
        color: #ffffff !important;
        border: 1.5px solid #15803d !important;
    }
    .att-week-pill.unselected {
        background: #ffffff !important;
        color: #334155 !important;
        border: 1.5px solid #cbd5e1 !important;
    }
    .att-week-pill:hover {
        opacity: 0.9 !important;
    }
    .att-sub-dates {
        font-size: 0.82rem !important;
        color: #5c6760 !important;
        text-align: left !important;
        margin: 0 0 2px 2px !important;
    }
    .att-mensa-box {
        margin-top: 4px !important;
        padding: 8px 10px !important;
        border-radius: 10px !important;
        border: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
        transition: all 0.2s ease !important;
    }
    .att-mensa-box.selected {
        background: rgba(22, 163, 74, 0.08) !important;
        border-color: #86efac !important;
        border-left: 3.5px solid #16a34a !important;
    }
    .att-mensa-box.unselected {
        background: #f8fafc !important;
        border-color: #e2e8f0 !important;
    }
    .att-mensa-title {
        font-size: 0.86rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        margin-bottom: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .att-days-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    .att-day-pill {
        border-radius: 9999px !important;
        padding: 5px 4px !important;
        font-size: 0.78rem !important;
        font-weight: 600 !important;
        text-align: center !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }
    .att-day-pill.selected {
        background: #16a34a !important;
        color: #ffffff !important;
        border: 1px solid #15803d !important;
        font-weight: 700 !important;
        box-shadow: 0 1px 4px rgba(22, 163, 74, 0.3) !important;
    }
    .att-day-pill.unselected {
        background: #ffffff !important;
        color: #475569 !important;
        border: 1px solid #cbd5e1 !important;
    }
    .att-day-pill:hover {
        opacity: 0.9 !important;
    }

    /* Pulsante submit (Carica credito / Iscriviti) */
    .att-btn-submit {
        background: #284835 !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 10px !important;
        padding: 10px 18px !important;
        font-size: 0.94rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        width: 100% !important;
        margin-top: 10px !important;
        transition: opacity 0.15s ease !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    .att-btn-submit:hover {
        opacity: 0.92 !important;
    }

    /* Sezione Attività a cui sei iscritto */
    .att-enrolled-section {
        margin-top: 24px !important;
        border-top: 1.5px solid #ded6c7 !important;
        padding-top: 16px !important;
    }
    .att-sec-title {
        font-size: 1.25rem !important;
        font-weight: 700 !important;
        color: #111813 !important;
        margin: 0 0 14px 0 !important;
    }
    .att-enrolled-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 0.88rem !important;
    }
    .att-enrolled-table th {
        text-align: left !important;
        padding: 8px 10px !important;
        font-weight: 700 !important;
        color: #111813 !important;
        border-top: 1.5px solid #111813 !important;
        border-bottom: 1.5px solid #111813 !important;
    }
    .att-enrolled-table td {
        padding: 8px 10px !important;
        color: #222222 !important;
        border-bottom: 1px solid #ded6c7 !important;
        vertical-align: middle !important;
    }

    /* =========================================================
       FOOD COST & MARGINALITÀ - STILE GESTIONALE
       ========================================================= */
    .fc-station-card {
        background: var(--paper-deep);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        padding: 14px 18px;
        margin-bottom: 1.2rem;
    }
    .fc-station-btn {
        padding: 0.55rem 1.25rem;
        border-radius: 999px;
        border: 1.5px solid var(--line);
        background: var(--surface);
        color: var(--ink);
        font-weight: 700;
        font-size: 0.95rem;
        cursor: pointer;
        transition: all .15s ease;
    }
    .fc-station-btn:hover {
        border-color: var(--green);
        background: var(--paper);
    }
    .fc-station-btn.active {
        background: var(--green) !important;
        border-color: var(--green-deep) !important;
        color: #ffffff !important;
        box-shadow: 0 3px 8px rgba(34,57,31,0.25);
    }
    .fc-kpi-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
        gap: 10px;
        margin: 14px 0;
    }
    .fc-kpi-card {
        background: var(--surface);
        border: 1px solid var(--line);
        border-left: 4px solid var(--gold);
        border-radius: var(--r-sm);
        padding: 10px 14px;
        box-shadow: var(--shadow-sm);
    }
    .fc-kpi-card small {
        display: block;
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--ink-soft);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .fc-kpi-card strong {
        display: block;
        font-size: 1.3rem;
        font-weight: 800;
        color: var(--green-deep);
        margin-top: 3px;
        font-variant-numeric: tabular-nums;
    }
    .fc-recipe-row {
        display: grid;
        grid-template-columns: 3fr 1.6fr 1.2fr auto;
        gap: 8px;
        align-items: end;
        margin: 8px 0;
        background: var(--paper);
        border: 1px solid var(--line);
        padding: 10px 12px;
        border-radius: var(--r-sm);
    }
    .fc-recipe-row label {
        display: block;
        font-size: 0.76rem;
        font-weight: 700;
        margin-bottom: 4px;
        color: var(--ink-soft);
    }
    .fc-recipe-row input, .fc-recipe-row select {
        width: 100%;
        padding: 0.55rem 0.65rem;
        margin: 0;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: #ffffff;
        font-size: 0.92rem;
    }
    .fc-dot {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 6px;
        vertical-align: middle;
        flex-shrink: 0;
    }
    .fc-dot.green { background: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2); }
    .fc-dot.yellow { background: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2); }
    .fc-dot.red { background: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }
    .fc-pill {
        display: inline-flex;
        align-items: center;
        padding: 3px 10px;
        border-radius: 999px;
        font-size: 0.84rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }
    .fc-pill.green { background: #e8f5e9; color: #166534; border: 1px solid #bbf7d0; }
    .fc-pill.yellow { background: #fef8ee; color: #92400e; border: 1px solid #fde68a; }
    .fc-pill.red { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
    .fc-inline-qty {
        width: 78px;
        max-width: 100%;
        padding: 6px 4px;
        text-align: center;
        border: 1.5px solid var(--line);
        border-radius: 6px;
        font-weight: 700;
        font-size: 0.95rem;
        background: #ffffff;
        color: var(--ink);
    }
    .fc-inline-qty:focus {
        border-color: var(--gold);
        outline: none;
        box-shadow: 0 0 0 2px var(--gold-soft);
    }
    .fc-sales-summary {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-top: 16px;
        background: var(--paper-deep);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        padding: 14px 18px;
    }
    .fc-sales-summary .fc-kpi-card {
        background: var(--surface);
    }
    .fc-modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(34, 43, 20, 0.65);
        backdrop-filter: blur(4px);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 1.2rem;
        z-index: 1000;
    }
    .fc-modal-overlay.show {
        display: flex !important;
    }
    .fc-modal-card {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r-lg);
        max-width: 800px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1.6rem;
        box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    }
    .fc-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.2rem;
        border-bottom: 1px solid var(--line);
        padding-bottom: 0.8rem;
    }
    @media (max-width: 768px) {
        .fc-recipe-row { grid-template-columns: 1fr 1fr; }
        .fc-sales-summary { grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 480px) {
        .fc-sales-summary { grid-template-columns: 1fr; }
        .fc-recipe-row { grid-template-columns: 1fr; }
    }

    @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ==========================================================
   LEFT SIDEBAR COLLAPSED & FULL-WIDTH CONTROLS
   ========================================================== */
#sidebar {
    width: 18.5rem; /* 296px: larghezza ampia senza scroll orizzontale */
    min-width: 18.5rem;
    max-width: 18.5rem;
    overflow-x: hidden !important;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease-in-out;
}

@media (min-width: 1280px) {
    #sidebar {
        width: 20rem; /* 320px su schermi ampi */
        min-width: 20rem;
        max-width: 20rem;
    }
}

/* Top Bar visibile quando la barra laterale è ridotta: stile coordinato con la barra laterale */
#top-bar-collapsed {
    display: none;
    background: linear-gradient(90deg, #064e3b 0%, #065f46 50%, #047857 100%) !important;
    color: #ffffff !important;
    min-height: 4.25rem;
}
#top-bar-collapsed.hidden {
    display: none !important;
}
@media (min-width: 768px) {
    body.sidebar-is-collapsed #top-bar-collapsed:not(.hidden) {
        display: flex !important;
    }
}

/* Card di selezione organizzazione con grandi icone */
.org-select-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.org-select-card:hover {
    border-color: #059669;
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(6, 78, 59, 0.18);
}
.org-select-card:active {
    transform: translateY(-1px);
}
.org-select-card .org-icon-large {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, #064e3b 0%, #047857 55%, #10b981 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 20px rgba(6, 78, 59, 0.28);
    transition: transform 0.2s ease;
}
.org-select-card:hover .org-icon-large {
    transform: scale(1.08);
}

#sidebar.sidebar-collapsed {
    width: 3.5rem !important; /* ~56px: barra stretta, poco più larga dell'icona del profilo (40px) */
    min-width: 3.5rem !important;
    max-width: 3.5rem !important;
}

#sidebar.sidebar-collapsed .sidebar-text,
#sidebar.sidebar-collapsed .sidebar-full-only {
    display: none !important;
}

/* User card in collapsed mode: tasto nascondi/espandi e icona utente allineati in colonna al centro */
#sidebar.sidebar-collapsed .sidebar-user-card {
    padding: 0.75rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

#sidebar.sidebar-collapsed .sidebar-header-row {
    display: flex !important;
    flex-direction: column-reverse !important; /* tasto toggle in cima, poi icona profilo */
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 0.5rem !important;
}

#sidebar.sidebar-collapsed #btn-sidebar-collapse {
    margin: 0 auto !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 0 !important;
}

#sidebar.sidebar-collapsed .sidebar-user-avatar {
    margin: 0 auto !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 0.75rem !important;
}

/* Nav list in collapsed mode: icone allineate e perfettamente centrate */
#sidebar.sidebar-collapsed nav {
    padding: 0.5rem 0 !important;
}

#sidebar.sidebar-collapsed #sidebar-schede-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

#sidebar.sidebar-collapsed #sidebar-schede-nav li {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

#sidebar.sidebar-collapsed .sidebar-item-btn {
    justify-content: center !important;
    padding: 0 !important;
    margin: 0.35rem auto !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 0.75rem !important;
    border-left: none !important;
    display: flex !important;
    align-items: center !important;
}

#sidebar.sidebar-collapsed .sidebar-item-btn i {
    margin: 0 !important;
    font-size: 1.15rem !important;
    width: auto !important;
    text-align: center !important;
}

#sidebar.sidebar-collapsed .sidebar-item-btn.bg-white\/20,
#sidebar.sidebar-collapsed .sidebar-item-btn.border-l-3 {
    border-left: none !important;
    box-shadow: 0 0 0 2px #34d399 !important;
    background: rgba(255, 255, 255, 0.25) !important;
}

/* Footer (Logout) in collapsed mode */
#sidebar.sidebar-collapsed .sidebar-footer {
    padding: 0.75rem 0 !important;
    display: flex !important;
    justify-content: center !important;
}

#sidebar.sidebar-collapsed .sidebar-footer .sidebar-item-btn {
    width: 2.5rem !important;
    height: 2.5rem !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0.75rem !important;
}

/* Dashboard Tools Grid: Pulsanti più larghi (+50% o più) con grandi cerchi emoji */
.dash-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .dash-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}
@media (min-width: 1024px) {
    .dash-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.75rem;
    }
}

#dash-scheda-content {
    margin-bottom: 2.5rem;
}

.dash-tool-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    user-select: none;
    min-height: 180px;
    width: 100%;
}
.dash-tool-tile:hover {
    border-color: #10b981;
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -6px rgba(16, 185, 129, 0.2), 0 10px 14px -6px rgba(16, 185, 129, 0.12);
}
.dash-tool-circle {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    margin-bottom: 1rem;
    transition: all 0.22s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    flex-shrink: 0;
}
.dash-tool-tile:hover .dash-tool-circle {
    background: #ecfdf5;
    border-color: #6ee7b7;
    transform: scale(1.06);
}
.dash-tool-emoji {
    font-size: 2.75rem;
    line-height: 1;
}
.dash-tool-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    margin-top: 0.35rem;
    padding: 0 0.5rem;
    transition: color 0.15s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dash-tool-tile:hover .dash-tool-title {
    color: #047857;
}
