/* ============================================================
   ECO CUSTOM UI - BOOTSTRAP 5 / FLAT / MATERIAL / A11Y
   File standard. Non contiene regole DevExpress.
   ============================================================ */ /* ============================================================
   01. VARIABILI, TOKENS E TEMI
   ============================================================ */

:root {
    --ui-primary: #2563eb;
    --ui-primary-hover: #1d4ed8;
    --ui-primary-soft: #e8f0ff;
    --ui-bg: #f5f7fb;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8fafc;
    --ui-text: #1f2937;
    --ui-text-muted: #64748b;
    --ui-border: #e2e8f0;
    --ui-border-strong: #cbd5e1;
    --ui-focus-ring: rgba(37, 99, 235, .25);
    --ui-radius-sm: .35rem;
    --ui-radius: .6rem;
    --ui-radius-lg: .85rem;
    --ui-shadow-1: 0 2px 10px rgba(15, 23, 42, .06);
    --header-h: 64px;
    --footer-h: 48px;
    --sidebar-w: 268px;
    --sidebar-w-collapsed: 76px;
    --ui-teal: #0d9488;
    --ui-magenta: #d946ef;
    --ui-indigo: #6366f1;
    --ui-amber: #f59e0b;
    --ui-slate: #475569;
}

:root {
    --eco-grid-font: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    --eco-grid-font-size: .875rem;
    --eco-grid-font-size-h: .75rem;
    --eco-grid-pad-v: 13px;
    --eco-grid-pad-h: 16px;
    --eco-grid-line-h: 1.6;
    --eco-grid-radius: var(--ui-radius, .6rem);
    --eco-grid-shadow: var(--ui-shadow-1, 0 2px 10px rgba(15,23,42,.06));
    --eco-grid-border: var(--ui-border, #e2e8f0);
    --eco-grid-border-h: var(--ui-border-strong, #cbd5e1);
    --eco-grid-bg: var(--ui-surface, #ffffff);
    --eco-grid-bg-head: #e9eef6;
    --eco-grid-bg-stripe: #f1f5f9;
    --eco-grid-bg-hover: var(--ui-primary-soft, #e8f0ff);
    --eco-grid-text: var(--ui-text, #1f2937);
    --eco-grid-text-h: var(--ui-text-muted, #64748b);
    --eco-grid-dark-bg: #111827;
    --eco-grid-dark-stripe: #0d1526;
    --eco-grid-dark-bg-head: #0b1220;
    --eco-grid-dark-hover: #1e293b;
    --eco-grid-dark-border: #334155;
    --eco-grid-dark-text: #e5e7eb;
    --eco-grid-dark-text-h: #94a3b8;
}
/* ============================================================
   02. BASE, LAYOUT, HEADER, SIDEBAR, FOOTER E RESPONSIVE
   ============================================================ */

.app-header {
    height: var(--header-h);
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    box-shadow: var(--ui-shadow-1);
    z-index: 1100;
}

.navbar-brand {
    font-size: .95rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
}

.app-launcher {
    width: 300px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.app-tile {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    border: 1px solid var(--ui-border);
    border-radius: .65rem;
    text-decoration: none;
    color: var(--ui-text);
    font-size: .78rem;
}

    .app-tile:hover {
        background: var(--ui-primary-soft);
        border-color: #bfd2ff;
        color: var(--ui-primary-hover);
    }

    .app-tile i {
        font-size: 1.15rem;
    }

.profile-trigger {
    border: 1px solid transparent;
    background: transparent;
    color: var(--ui-text);
    padding: .3rem .55rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

    .profile-trigger:hover {
        background: var(--ui-surface-soft);
        color: var(--ui-text);
    }

.avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, .22);
    color: #bfdbfe;
}

.profile-name {
    font-size: .82rem;
    font-weight: 500;
}

.app-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: var(--footer-h);
    width: var(--sidebar-w);
    background: var(--ui-surface);
    border-right: 1px solid var(--ui-border);
    overflow-y: auto;
    transition: width .2s ease, transform .2s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    min-height: 72px;
    display: flex;
    align-items: center;
    padding: .85rem .95rem;
    border-bottom: 1px solid var(--ui-border);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    color: var(--ui-text);
    width: 100%;
}

.brand-image {
    width: 36px;
    height: 36px;
    border-radius: .5rem;
    object-fit: cover;
}

.brand-text {
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
}

.sidebar-nav {
    padding: .7rem;
    flex: 1 1 auto;
    overflow-y: auto;
}

    .sidebar-nav .nav-link {
        color: var(--ui-text);
        border-radius: .55rem;
        font-size: .85rem;
        min-height: 40px;
        display: flex;
        align-items: center;
        border: 1px solid transparent;
    }

        .sidebar-nav .nav-link:hover {
            background: #1e293b;
            color: #f8fafc;
        }

        .sidebar-nav .nav-link.active {
            background: var(--ui-primary-soft);
            border-color: #bfd2ff;
            color: var(--ui-primary-hover);
        }

body.sidebar-collapsed .submenu-nested {
    padding-left: 0;
    border-left: 0;
    margin-left: 0;
}

.app-content-shell {
    margin-top: var(--header-h);
    margin-left: var(--sidebar-w);
    padding: 1rem 1rem calc(var(--footer-h) + 1rem);
}

.app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--footer-h);
    background: var(--ui-surface);
    border-top: 1px solid var(--ui-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: .78rem;
    color: var(--ui-text-muted);
    transition: left .2s ease;
    z-index: 1040;
}

.footer-content {
    display: flex;
    align-items: center;
}

body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-w-collapsed);
}

body.sidebar-collapsed .app-content-shell {
    margin-left: var(--sidebar-w-collapsed);
}

body.sidebar-collapsed .app-footer {
    left: 0;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-nav .nav-link span,
body.sidebar-collapsed .nav-collapse-toggle .bi-chevron-down {
    display: none;
}

body.sidebar-collapsed .nav-collapse-toggle {
    display: flex;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: min(86vw, 300px);
        box-shadow: var(--ui-shadow-1);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-content-shell {
        margin-left: 0;
    }

    .app-footer {
        left: 0;
    }

    .profile-name {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .app-content-shell {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .app-footer {
        left: 0 !important;
    }
}

html[data-theme="dark"] .app-tile:hover {
    border-color: #60a5fa;
}

html[data-theme="dark"] body.eco-body,
html[data-theme="dark"] .app-content-shell {
    color: var(--ui-text);
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .card,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas {
    background: var(--ui-surface);
    color: var(--ui-text);
    border-color: var(--ui-border);
}

.app-sidebar {
    background: #0f172a;
    border-right: 1px solid #1e293b;
}

.sidebar-logo {
    border-bottom: 1px solid #1e293b;
}

.logo-link,
.brand-text,
.sidebar-nav .nav-link,
.nav-collapse-toggle {
    color: #e2e8f0;
}

    .sidebar-nav .nav-link:hover,
    .profile-trigger:hover {
        background: #1e293b;
        color: #f8fafc;
    }

    .sidebar-nav .nav-link.active {
        background: rgba(59, 130, 246, .22);
        border-color: #3b82f6;
        color: #bfdbfe;
    }

.sidebar-nav .submenu .nav-link {
    color: #cbd5e1;
}

body.sidebar-collapsed .app-sidebar {
    overflow-y: hidden;
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-nav {
    padding: .55rem .35rem;
}

body.sidebar-collapsed .app-sidebar .collapse:not(.show) {
    display: none !important;
}

body.sidebar-collapsed .app-sidebar .collapse.show {
    display: block !important;
}

body.sidebar-collapsed .submenu {
    margin-top: .15rem;
    padding-left: 0;
}

body.sidebar-collapsed .sidebar-nav .nav-link,
body.sidebar-collapsed .sidebar-nav .nav-collapse-toggle {
    justify-content: center;
    min-height: 34px;
    padding: .35rem;
    font-size: 0;
}

body.sidebar-collapsed .submenu .nav-link {
    min-height: 30px;
}

body.sidebar-collapsed .sidebar-nav .nav-link i,
body.sidebar-collapsed .sidebar-nav .nav-collapse-toggle i {
    margin-right: 0 !important;
    font-size: 1rem;
}

body.sidebar-collapsed .nav-collapse-toggle .bi-chevron-down {
    display: none;
}

.app-header .container-fluid {
    flex-wrap: nowrap;
    gap: .5rem;
}

.app-header .navbar-nav {
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: .25rem;
}

.app-header .nav-item {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .navbar-brand {
        max-width: 34vw;
    }

    .app-header .navbar-nav {
        gap: .15rem;
    }
}

.app-header .navbar-brand,
.app-header .btn-icon,
.app-header .profile-trigger,
.app-header .profile-name {
    color: #e2e8f0;
}

    .app-header .btn-icon:hover,
    .app-header .profile-trigger:hover {
        background: #1e293b;
        color: #f8fafc;
    }

html[data-theme="dark"] .app-header .profile-trigger,
html[data-theme="dark"] .app-header .profile-name {
    color: #e5e7eb !important;
}

.app-content-shell {
    min-height: calc(100vh - var(--header-h));
    margin-top: var(--header-h);
    margin-left: var(--sidebar-w);
    padding: 1rem 1rem calc(var(--footer-h) + 1rem);
    transition: margin-left .2s ease;
    box-sizing: border-box;
}

.app-header {
    z-index: 1030;
}

.app-sidebar {
    z-index: 1025;
}

.app-footer {
    z-index: 1020;
}

.app-sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
}

.sidebar-bottom {
    flex: 0 0 auto;
    border-top: 1px solid #1e293b;
    padding: .75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0f172a;
}

.company-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    border: 0 !important;
    border-radius: .55rem;
    background: transparent !important;
    box-shadow: none !important;
}

.company-logo {
    max-width: 140px;
    max-height: 34px;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.sidebar-collapsed .sidebar-bottom {
    padding: .45rem .35rem;
}

body.sidebar-collapsed .company-logo {
    display: none;
}

.company-logo-lg {
    display: inline-block;
}

.company-logo-sm {
    display: none;
}

@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar-bottom {
        padding: .35rem .3rem;
    }

    body.sidebar-collapsed .company-logo-wrap {
        min-height: 40px;
        border-color: #334155;
        background: rgba(255, 255, 255, .02);
    }

    body.sidebar-collapsed .company-logo-lg {
        display: none;
    }

    body.sidebar-collapsed .company-logo-sm {
        display: inline-block;
        max-width: 28px;
        max-height: 28px;
    }
}

@media (max-width: 991.98px) {
    .company-logo-lg {
        display: inline-block !important;
    }

    .company-logo-sm {
        display: none !important;
    }

    body:not(.sidebar-open) .sidebar-bottom {
        padding: 0 !important;
        border-top: 0 !important;
        min-height: 0 !important;
    }

    body:not(.sidebar-open) .company-logo-wrap {
        width: 0 !important;
        min-height: 0 !important;
        border: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
    }
}

.mobile-nav {
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 72px;
        display: flex;
        align-items: stretch;
        background: #0f172a;
        border-top: 1px solid #1e293b;
        z-index: 1100;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .20rem;
        text-decoration: none;
        color: #cbd5e1;
        border: 0;
        background: transparent;
        transition: background-color .18s ease, color .18s ease;
        position: relative;
    }

        .mobile-nav-item i {
            font-size: 1.15rem;
            line-height: 1;
        }

        .mobile-nav-item span {
            font-size: .68rem;
            font-weight: 500;
            line-height: 1;
        }

        .mobile-nav-item:hover {
            background: #1e293b;
            color: #f8fafc;
            text-decoration: none;
        }

        .mobile-nav-item.active {
            background: rgba(59,130,246,.22);
            color: #bfdbfe;
        }

            .mobile-nav-item.active::before {
                content: "";
                position: absolute;
                top: 4px;
                width: 24px;
                height: 4px;
                border-radius: 999px;
                background: #60a5fa;
            }

    .mobile-nav-button {
        cursor: pointer;
    }

    .app-content-shell {
        padding-bottom: 88px !important;
    }

    .app-header .nav-item.dropdown {
        position: relative;
    }

    .app-header .dropdown-menu-end {
        position: absolute;
        right: 0;
        left: auto;
        min-width: 180px;
    }
}

.nav-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    flex-shrink: 0;
}

body.sidebar-collapsed .nav-badges {
    display: none;
}

.footer-content {
    display: flex;
    align-items: center;
    width: 100%;
}
/* ============================================================
   03. TIPOGRAFIA, PULSANTI, CARD, KPI E UTILITA
   ============================================================ */

html,
body {
    height: 100%;
}

    body.eco-body {
        height: calc(100% - var(--footer-h) - var(--header-h));
        margin: 0;
        color: var(--ui-text);
        background: var(--ui-bg);
        font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    }

.skip-link {
    position: absolute;
    z-index: 2000;
    left: .5rem;
    top: .5rem;
    padding: .5rem .75rem;
    background: #111827;
    color: #fff;
    border-radius: .5rem;
}

.btn {
    border: 1px solid transparent;
    border-radius: .55rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
    }

    .btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
    }

    .btn:focus-visible {
        box-shadow: 0 0 0 3px var(--ui-focus-ring), 0 6px 16px rgba(15, 23, 42, .14);
    }

.btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: #fff;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
        border-color: #1e40af;
        color: #fff;
    }

.btn-outline-secondary {
    background: transparent;
    border-color: var(--ui-border-strong);
    color: var(--ui-text-muted);
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus {
        background: var(--ui-surface-soft);
        border-color: var(--ui-border-strong);
        color: var(--ui-text);
    }

.btn-info {
    background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
    border-color: #0284c7;
    color: #fff;
}

    .btn-info:hover,
    .btn-info:focus {
        background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
        border-color: #0369a1;
        color: #fff;
    }

.apps-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ui-text-muted);
}

.nav-collapse-toggle {
    background: transparent;
}

    .nav-collapse-toggle .bi-chevron-down {
        transition: transform .2s ease;
    }

    .nav-collapse-toggle[aria-expanded="true"] .bi-chevron-down {
        transform: rotate(-180deg);
    }

.submenu {
    margin-top: .25rem;
    padding-left: 1rem;
}

.submenu-nested {
    padding-left: .75rem;
    border-left: 1px solid #334155;
    margin-left: .75rem;
    margin-top: .15rem;
}

    .submenu-nested .nav-link {
        font-size: .8rem;
        min-height: 32px;
        color: #94a3b8;
    }

        .submenu-nested .nav-link:hover {
            color: #f8fafc;
            background: #1e293b;
        }

.app-main,
.app-content,
.app-content-header {
    color: var(--ui-text);
    background: transparent;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    letter-spacing: .01em;
}

.fw-bold {
    font-weight: 500 !important;
}

.section-title {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ui-text-muted);
}

.card {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-1);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--ui-border);
}

.btn > i,
.btn > .bi,
.btn-xs > i,
.btn-xs > .bi {
    line-height: 1;
    vertical-align: middle;
}

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

html[data-theme="dark"] {
    color-scheme: dark;
    --ui-primary: #3b82f6;
    --ui-primary-hover: #60a5fa;
    --ui-primary-soft: rgba(59, 130, 246, .16);
    --ui-bg: #0b1220;
    --ui-surface: #111827;
    --ui-surface-soft: #1f2937;
    --ui-text: #e5e7eb;
    --ui-text-muted: #94a3b8;
    --ui-border: #334155;
    --ui-border-strong: #475569;
    --ui-focus-ring: rgba(96, 165, 250, .3);
    --ui-shadow-1: 0 6px 18px rgba(0, 0, 0, .35);
}

    html[data-theme="dark"] .skip-link {
        background: #e5e7eb;
        color: #111827;
    }

    html[data-theme="dark"] .card-header {
        background: var(--ui-surface);
    }

    html[data-theme="dark"] .btn-outline-secondary {
        border-color: var(--ui-border-strong);
        color: var(--ui-text-muted);
    }

        html[data-theme="dark"] .btn-outline-secondary:hover {
            background: var(--ui-surface-soft);
            color: var(--ui-text);
        }

.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1055 !important;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(1200px 500px at 10% -10%, rgba(59, 130, 246, .12), transparent 60%), radial-gradient(1000px 500px at 100% 0, rgba(37, 99, 235, .10), transparent 60%), var(--ui-bg);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-card {
    width: 100%;
    max-width: 430px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-1);
    overflow: hidden;
    background: var(--ui-surface);
}

.login-logo {
    max-width: 180px;
    height: auto;
}

.login-theme-toggle {
    position: fixed;
    top: .75rem;
    right: .75rem;
    z-index: 20;
}

.count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
}

.count-pill-info {
    background: rgba(14, 165, 233, .22);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, .45);
}

.count-pill-success {
    background: rgba(34, 197, 94, .2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, .42);
}

.count-pill-warning {
    background: rgba(245, 158, 11, .2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, .42);
}

.count-pill-danger {
    background: rgba(239, 68, 68, .2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, .45);
}

.btn-small {
    min-height: 30px;
    padding: .22rem .55rem;
    font-size: .78rem;
    line-height: 1.1;
    border-radius: .45rem;
    gap: .25rem;
}

.btn-xsmall {
    min-height: 20px;
    padding: .14rem .40rem;
    font-size: .58rem;
    line-height: 1.1;
    border-radius: .45rem;
    gap: .15rem;
}

.btn-flat {
    border-radius: .0rem;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

    .btn-flat:hover,
    .btn-flat:active {
        box-shadow: none !important;
        transform: none !important;
    }

    .btn-flat.btn-primary {
        background: var(--ui-primary);
        border-color: var(--ui-primary);
        color: #fff;
    }

        .btn-flat.btn-primary:hover,
        .btn-flat.btn-primary:focus {
            background: var(--ui-primary-hover);
            border-color: var(--ui-primary-hover);
            color: #fff;
        }

    .btn-flat.btn-outline-secondary {
        background: transparent;
        border-color: var(--ui-border-strong);
        color: var(--ui-text-muted);
    }

        .btn-flat.btn-outline-secondary:hover,
        .btn-flat.btn-outline-secondary:focus {
            background: var(--ui-surface-soft);
            border-color: var(--ui-border-strong);
            color: var(--ui-text);
        }

.kpi-line {
    min-height: 56px;
}

    .kpi-line > :not(.kpi-bg-icon) {
        position: relative;
        z-index: 1;
    }

.kpi-card-body {
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.kpi-bg-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    transform: translate(-50%, -50%);
    font-size: clamp(5.5rem, 9vw, 8rem);
    color: var(--ui-text-muted);
    opacity: .12;
    pointer-events: none;
}

.text-teal {
    color: var(--ui-teal) !important;
}

.text-magenta {
    color: var(--ui-magenta) !important;
}

.text-indigo {
    color: var(--ui-indigo) !important;
}

.text-amber {
    color: var(--ui-amber) !important;
}

.text-slate {
    color: var(--ui-slate) !important;
}

.bg-teal {
    background-color: var(--ui-teal) !important;
}

.bg-magenta {
    background-color: var(--ui-magenta) !important;
}

.bg-indigo {
    background-color: var(--ui-indigo) !important;
}

.bg-amber {
    background-color: var(--ui-amber) !important;
}

.bg-slate {
    background-color: var(--ui-slate) !important;
}

.btn-teal {
    background-color: var(--ui-teal);
    border-color: var(--ui-teal);
    color: #fff;
}

    .btn-teal:hover {
        background-color: #0f766e;
        border-color: #0f766e;
        color: #fff;
    }

.btn-magenta {
    background-color: var(--ui-magenta);
    border-color: var(--ui-magenta);
    color: #fff;
}

    .btn-magenta:hover {
        background-color: #c026d3;
        border-color: #c026d3;
        color: #fff;
    }

.btn-indigo {
    background-color: var(--ui-indigo);
    border-color: var(--ui-indigo);
    color: #fff;
}

    .btn-indigo:hover {
        background-color: #4f46e5;
        border-color: #4f46e5;
        color: #fff;
    }

.btn-amber {
    background-color: var(--ui-amber);
    border-color: var(--ui-amber);
    color: #fff;
}

    .btn-amber:hover {
        background-color: #d97706;
        border-color: #d97706;
        color: #fff;
    }

.btn-slate {
    background-color: var(--ui-slate);
    border-color: var(--ui-slate);
    color: #fff;
}

    .btn-slate:hover {
        background-color: #334155;
        border-color: #334155;
        color: #fff;
    }

.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark {
    background-color: transparent !important;
    box-shadow: none;
}

.btn-outline-primary {
    color: var(--ui-primary);
    border-color: var(--ui-primary);
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-primary:active {
        color: var(--ui-primary-hover);
        border-color: var(--ui-primary-hover);
        background-color: transparent !important;
    }

.btn-outline-secondary {
    color: var(--ui-text-muted);
    border-color: var(--ui-border-strong);
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus,
    .btn-outline-secondary:active {
        color: var(--ui-text);
        border-color: var(--ui-border-strong);
        background-color: transparent !important;
    }

.btn-outline-success {
    color: #16a34a;
    border-color: #16a34a;
}

    .btn-outline-success:hover,
    .btn-outline-success:focus,
    .btn-outline-success:active {
        color: #15803d;
        border-color: #15803d;
        background-color: transparent !important;
    }

.btn-outline-danger {
    color: #dc2626;
    border-color: #dc2626;
}

    .btn-outline-danger:hover,
    .btn-outline-danger:focus,
    .btn-outline-danger:active {
        color: #b91c1c;
        border-color: #b91c1c;
        background-color: transparent !important;
    }

.btn-outline-warning {
    color: #d97706;
    border-color: #d97706;
}

    .btn-outline-warning:hover,
    .btn-outline-warning:focus,
    .btn-outline-warning:active {
        color: #b45309;
        border-color: #b45309;
        background-color: transparent !important;
    }

.btn-outline-info {
    color: #0891b2;
    border-color: #0891b2;
}

    .btn-outline-info:hover,
    .btn-outline-info:focus,
    .btn-outline-info:active {
        color: #0e7490;
        border-color: #0e7490;
        background-color: transparent !important;
    }

.btn-outline-light {
    color: #e2e8f0;
    border-color: #e2e8f0;
}

    .btn-outline-light:hover,
    .btn-outline-light:focus,
    .btn-outline-light:active {
        color: #f8fafc;
        border-color: #f8fafc;
        background-color: transparent !important;
    }

.btn-outline-dark {
    color: #0f172a;
    border-color: #0f172a;
}

    .btn-outline-dark:hover,
    .btn-outline-dark:focus,
    .btn-outline-dark:active {
        color: #020617;
        border-color: #020617;
        background-color: transparent !important;
    }

.btn-outline-teal,
.btn-outline-magenta,
.btn-outline-indigo,
.btn-outline-amber,
.btn-outline-slate {
    background-color: transparent !important;
    box-shadow: none;
}

.btn-outline-teal {
    color: var(--ui-teal);
    border-color: var(--ui-teal);
}

    .btn-outline-teal:hover,
    .btn-outline-teal:focus,
    .btn-outline-teal:active {
        color: #0f766e;
        border-color: #0f766e;
        background-color: transparent !important;
    }

.btn-outline-magenta {
    color: var(--ui-magenta);
    border-color: var(--ui-magenta);
}

    .btn-outline-magenta:hover,
    .btn-outline-magenta:focus,
    .btn-outline-magenta:active {
        color: #c026d3;
        border-color: #c026d3;
        background-color: transparent !important;
    }

.btn-outline-indigo {
    color: var(--ui-indigo);
    border-color: var(--ui-indigo);
}

    .btn-outline-indigo:hover,
    .btn-outline-indigo:focus,
    .btn-outline-indigo:active {
        color: #4f46e5;
        border-color: #4f46e5;
        background-color: transparent !important;
    }

.btn-outline-amber {
    color: var(--ui-amber);
    border-color: var(--ui-amber);
}

    .btn-outline-amber:hover,
    .btn-outline-amber:focus,
    .btn-outline-amber:active {
        color: #d97706;
        border-color: #d97706;
        background-color: transparent !important;
    }

.btn-outline-slate {
    color: var(--ui-slate);
    border-color: var(--ui-slate);
}

    .btn-outline-slate:hover,
    .btn-outline-slate:focus,
    .btn-outline-slate:active {
        color: #334155;
        border-color: #334155;
        background-color: transparent !important;
    }

.card-border-left {
    --card-accent: var(--ui-primary);
    position: relative;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    overflow: hidden;
    background: var(--ui-surface);
    background-clip: padding-box;
}

.card-border-top {
    position: relative;
    border: 1px solid var(--ui-border);
    border-top: 4px solid var(--card-accent, var(--ui-primary)) !important;
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-1);
}

.card-border-full {
    border: 2px solid var(--card-accent, var(--ui-primary)) !important;
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-1);
}

.card-border-left::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 6px;
    background: var(--card-accent);
    pointer-events: none;
}

.card-border-left .card-header {
    background: transparent;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.card-border-primary {
    --card-accent: var(--ui-primary);
}

.card-border-info {
    --card-accent: #0ea5e9;
}

.card-border-success {
    --card-accent: #16a34a;
}

.card-border-warning {
    --card-accent: var(--ui-amber);
}

.card-border-danger {
    --card-accent: #dc2626;
}

.card-border-teal {
    --card-accent: var(--ui-teal);
}

.card-border-magenta {
    --card-accent: var(--ui-magenta);
}

.card-border-indigo {
    --card-accent: var(--ui-indigo);
}

.card-border-slate {
    --card-accent: var(--ui-slate);
}

.card {
    overflow: hidden;
}

    .card > .card-header:first-child {
        border-top-left-radius: inherit;
        border-top-right-radius: inherit;
    }

html[data-theme="dark"] .card {
    border-color: var(--ui-border) !important;
}

.card {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-1);
    overflow: visible;
}

.card-clip {
    overflow: hidden;
}

blockquote.custom-blockquote {
    position: relative;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    background: #f8f9fa;
    border-left: 4px solid #1f3e74;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-style: italic;
    color: #495057;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

    blockquote.custom-blockquote::before {
        content: "“";
        position: absolute;
        top: -10px;
        left: 12px;
        font-size: 3rem;
        color: rgba(98, 89, 202, 0.15);
        font-family: Georgia, serif;
        line-height: 1;
    }

    blockquote.custom-blockquote footer,
    blockquote.custom-blockquote .blockquote-footer {
        margin-top: .75rem;
        color: #6c757d;
        font-size: .875rem;
        font-style: normal;
    }

[data-theme="dark"] blockquote.custom-blockquote,
.dark-theme blockquote.custom-blockquote {
    position: relative;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    background: #242f48;
    border-left: 4px solid #1f3e74;
    border-radius: 0.5rem;
    color: #cfd8e3;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

    [data-theme="dark"] blockquote.custom-blockquote::before,
    .dark-theme blockquote.custom-blockquote::before {
        content: "“";
        position: absolute;
        top: -10px;
        left: 12px;
        font-size: 3rem;
        color: rgba(98, 89, 202, 0.25);
        font-family: Georgia, serif;
        line-height: 1;
    }

    [data-theme="dark"] blockquote.custom-blockquote .blockquote-footer,
    .dark-theme blockquote.custom-blockquote .blockquote-footer {
        color: #8f9bb3;
    }

.hidden {
    display: none !important;
}

.card-link {
    text-decoration: none;
    color: inherit;
}

body.eco-body {
    background-image: url("../assets/img/bg03.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
}

html[data-theme="dark"] body.eco-body {
    background-image: url("../assets/img/bg07.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
}
/* ============================================================
   04. FORM, CHECKBOX, SWITCH E STATI CONTROLLI
   ============================================================ */

label,
.form-label,
.text-muted {
    color: var(--ui-text-muted) !important;
    font-weight: 600;
    margin-bottom: 0;
}

.form-control,
.form-select {
    border-radius: var(--ui-radius-sm);
    min-height: 36px;
    border: 1px solid var(--ui-border);
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .form-control:hover,
    .form-select:hover {
        border-color: var(--ui-border-strong);
    }

    .form-control:focus,
    .form-select:focus {
        border-color: var(--ui-primary) !important;
        box-shadow: 0 0 0 3px var(--ui-focus-ring) !important;
    }

.btn,
.btn-xs,
.input-group > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

    a:focus-visible,
    button:focus-visible,
    .btn:focus-visible,
    .form-control:focus-visible,
    .form-select:focus-visible,
    .nav-link:focus-visible {
        outline: 2px solid var(--ui-primary);
        outline-offset: 2px;
    }

.login-card .input-group-text {
    min-width: 2.5rem;
    justify-content: center;
    color: var(--ui-text-muted);
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
}

input[type="date"].form-control,
input[type="date"].form-control::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
}

    input[type="date"].form-control::-webkit-calendar-picker-indicator {
        filter: invert(40%) sepia(0%) brightness(90%);
    }

html[data-theme="dark"] input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(80%) sepia(10%) brightness(120%);
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 36px;
    padding-left: 0;
    margin-bottom: 0;
}

    .form-check .form-check-input {
        margin-top: 0;
        flex-shrink: 0;
        width: 1rem;
        height: 1rem;
        cursor: pointer;
    }

    .form-check label {
        cursor: pointer;
        font-size: .85rem;
        color: var(--ui-text);
        user-select: none;
        margin-bottom: 0;
    }

.label-spacer {
    display: block;
    visibility: hidden;
    font-size: .85rem;
    min-height: 21px;
    margin-bottom: .25rem;
}

.form-switch-yesno {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 36px;
    padding-left: 0;
}

    .form-switch-yesno .form-check-input {
        width: 2.5rem;
        height: 1.35rem;
        margin-top: 0;
        flex-shrink: 0;
        cursor: pointer;
        background-color: var(--ui-border-strong);
        border-color: var(--ui-border-strong);
        transition: background-color .2s ease, border-color .2s ease;
    }

        .form-switch-yesno .form-check-input:checked {
            background-color: var(--ui-primary);
            border-color: var(--ui-primary);
        }

    .form-switch-yesno .switch-label-off,
    .form-switch-yesno .switch-label-on {
        font-size: .82rem;
        font-weight: 600;
        transition: opacity .2s ease;
    }

    .form-switch-yesno .switch-label-off {
        color: var(--ui-text-muted);
    }

    .form-switch-yesno .switch-label-on {
        color: var(--ui-primary);
    }

html[data-theme="dark"] .form-switch-yesno .form-check-input {
    background-color: #334155;
    border-color: #475569;
}

    html[data-theme="dark"] .form-switch-yesno .form-check-input:checked {
        background-color: var(--ui-primary);
        border-color: var(--ui-primary);
    }

.form-check span,
.form-switch-yesno span > span {
    display: contents;
}

.form-check input[type="checkbox"],
.form-switch-yesno input[type="checkbox"] {
    margin-top: 0;
    flex-shrink: 0;
}

.form-check label,
.form-switch-yesno label {
    cursor: pointer;
    font-size: .85rem;
    color: var(--ui-text);
    user-select: none;
    margin-bottom: 0;
}

.ui-switch-wrap {
    display: flex;
    align-items: center;
    min-height: 36px;
    gap: .6rem;
}

.ui-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ui-switch-wrap > span {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ui-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 3.2rem;
    height: 1.65rem;
    background: var(--ui-border-strong);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
    flex-shrink: 0;
    border: 1px solid transparent;
}

    .ui-switch:hover {
        box-shadow: 0 0 0 3px var(--ui-focus-ring);
    }

.ui-switch-thumb {
    position: absolute;
    left: .18rem;
    width: 1.2rem;
    height: 1.2rem;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .2);
}

.ui-switch-label-off,
.ui-switch-label-on {
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
    position: absolute;
    transition: opacity .2s ease;
    user-select: none;
}

.ui-switch-label-off {
    right: .35rem;
    color: #fff;
    opacity: 1;
}

.ui-switch-label-on {
    left: .35rem;
    color: #fff;
    opacity: 0;
}

.ui-switch-input:checked + .ui-switch {
    background: var(--ui-primary);
    border-color: var(--ui-primary-hover);
}

    .ui-switch-input:checked + .ui-switch .ui-switch-thumb {
        transform: translateX(1.55rem);
    }

    .ui-switch-input:checked + .ui-switch .ui-switch-label-off {
        opacity: 0;
    }

    .ui-switch-input:checked + .ui-switch .ui-switch-label-on {
        opacity: 1;
    }

.ui-switch-input:focus-visible + .ui-switch {
    box-shadow: 0 0 0 3px var(--ui-focus-ring);
}

html[data-theme="dark"] .ui-switch {
    background: #334155;
    border-color: #475569;
}

html[data-theme="dark"] .ui-switch-input:checked + .ui-switch {
    background: var(--ui-primary);
    border-color: var(--ui-primary-hover);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
    background-color: var(--ui-bg) !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

    html[data-theme="dark"] .form-control::placeholder,
    html[data-theme="dark"] textarea.form-control::placeholder {
        color: #94a3b8 !important;
        opacity: 1;
    }

.form-control:not([readonly]):not(:disabled),
.form-select:not(:disabled),
textarea.form-control:not([readonly]):not(:disabled) {
    background-color: transparent !important;
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled,
textarea.form-control[readonly],
textarea.form-control:disabled {
    background-color: #e5e7eb !important;
    color: #475569 !important;
    border-color: var(--ui-border-strong) !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled {
    background-color: #2A2E37 !important;
    color: #9CA3AF !important;
    border-color: var(--ui-border-strong) !important;
    opacity: 1 !important;
    cursor: not-allowed;
}
/* ============================================================
   05. TABELLE, ASP GRIDVIEW ED ECO GRID
   ============================================================ */

.table {
    color: var(--ui-text);
}

    .table thead th {
        background: var(--ui-surface-soft);
        color: var(--ui-text-muted);
        border-bottom: 1px solid var(--ui-border);
        font-size: .7rem;
        letter-spacing: .03em;
        font-weight: 600;
    }

.table-hover tbody tr:hover > * {
    background: #f1f5f9;
}

html[data-theme="dark"] .table-hover tbody tr:hover > * {
    background: #1e293b;
}

html[data-theme="dark"] .table {
    color: var(--ui-text);
}

    html[data-theme="dark"] .table > :not(caption) > * > * {
        background-color: transparent;
        border-color: var(--ui-border);
    }

.asp-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--ui-text);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    overflow: hidden;
    box-shadow: var(--ui-shadow-1);
}

    .asp-grid th {
        background: var(--ui-surface-soft);
        color: var(--ui-text-muted);
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .03em;
        text-transform: uppercase;
        border-bottom: 1px solid var(--ui-border);
        padding: .55rem .7rem;
        white-space: nowrap;
    }

    .asp-grid td {
        border-bottom: 1px solid var(--ui-border);
        padding: .5rem .7rem;
        vertical-align: middle;
        font-size: .82rem;
    }

    .asp-grid tr:last-child td {
        border-bottom: 0;
    }

    .asp-grid tr:hover td {
        background: #f1f5f9;
    }

    .asp-grid td a.bi,
    .asp-grid td .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .asp-grid .pager,
    .asp-grid tr[class*="Pager"] td {
        background: var(--ui-surface-soft);
        color: var(--ui-text-muted);
        border-top: 1px solid var(--ui-border);
    }

        .asp-grid .pager a,
        .asp-grid tr[class*="Pager"] a {
            text-decoration: none;
            padding: .2rem .45rem;
            border-radius: .35rem;
            color: var(--ui-primary);
        }

        .asp-grid .pager span,
        .asp-grid tr[class*="Pager"] span {
            padding: .2rem .45rem;
            border-radius: .35rem;
            background: var(--ui-primary-soft);
            color: var(--ui-primary-hover);
        }

html[data-theme="dark"] .asp-grid tr:hover td {
    background: #1e293b;
}

.eco-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--eco-grid-font);
    font-size: var(--eco-grid-font-size);
    color: var(--eco-grid-text);
    background: var(--eco-grid-bg);
    border: 1px solid var(--eco-grid-border);
    border-radius: var(--eco-grid-radius);
    box-shadow: var(--eco-grid-shadow);
    overflow: hidden;
}

    .eco-grid th,
    .eco-grid td {
        padding: var(--eco-grid-pad-v) var(--eco-grid-pad-h);
        vertical-align: middle;
        text-align: left;
        font-size: var(--eco-grid-font-size);
        font-weight: normal;
        line-height: var(--eco-grid-line-h);
        border-bottom: 1px solid var(--eco-grid-border);
    }

    .eco-grid th {
        background: var(--eco-grid-bg-head);
        color: var(--eco-grid-text-h);
        font-weight: 700;
        border-bottom-width: 2px;
        border-bottom-color: var(--eco-grid-border-h);
        white-space: nowrap;
    }

        .eco-grid th a {
            text-decoration: none;
            color: inherit;
        }

    .eco-grid td {
        background: var(--eco-grid-bg);
        color: var(--eco-grid-text);
    }

    .eco-grid.eco-grid--dividers th + th,
    .eco-grid.eco-grid--dividers td + td {
        border-left: 1px solid var(--eco-grid-border);
    }

    .eco-grid.eco-grid--striped tr:nth-child(even) td {
        background: var(--eco-grid-bg-stripe);
    }

    .eco-grid.eco-grid--hover tbody tr:hover td {
        background: var(--eco-grid-bg-hover);
        transition: background .15s ease;
    }

    .eco-grid.eco-grid--compact th,
    .eco-grid.eco-grid--compact td {
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .eco-grid tr:last-child td {
        border-bottom: none;
    }

html[data-theme="dark"] .eco-grid th,
[data-bs-theme="dark"] .eco-grid th {
    background: var(--eco-grid-dark-bg-head);
    color: var(--eco-grid-dark-text-h);
    border-color: var(--eco-grid-dark-border);
}

html[data-theme="dark"] .eco-grid td,
[data-bs-theme="dark"] .eco-grid td {
    background: var(--eco-grid-dark-bg);
    color: var(--eco-grid-dark-text);
    border-color: var(--eco-grid-dark-border);
}

html[data-theme="dark"] .eco-grid.eco-grid--dividers th + th,
html[data-theme="dark"] .eco-grid.eco-grid--dividers td + td,
[data-bs-theme="dark"] .eco-grid.eco-grid--dividers th + th,
[data-bs-theme="dark"] .eco-grid.eco-grid--dividers td + td {
    border-left-color: var(--eco-grid-dark-border);
}

html[data-theme="dark"] .eco-grid.eco-grid--striped tr:nth-child(even) td,
[data-bs-theme="dark"] .eco-grid.eco-grid--striped tr:nth-child(even) td {
    background: var(--eco-grid-dark-stripe);
}

html[data-theme="dark"] .eco-grid.eco-grid--hover tbody tr:hover td,
[data-bs-theme="dark"] .eco-grid.eco-grid--hover tbody tr:hover td {
    background: var(--eco-grid-dark-hover);
    color: #f8fafc;
}

.pointer-grid td {
    cursor: pointer;
}

/* ============================================================
   06. OVERRIDE CANONICI CONFERMATI
   ============================================================ */

.card {
    overflow: visible;
}

.card-clip {
    overflow: hidden;
}

.footer-content {
    display: flex;
    align-items: center;
    width: 100%;
}
select,
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.2rem; /* spazio per la freccia custom */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231f2937' stroke-width='2'><path d='M2 5l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    background-size: .9rem;
}

    /* Nasconde la freccia nativa in Edge/IE */
    select::-ms-expand {
        display: none;
    }

/* CODICE AGGIUNTIVO A PARTIRE DAL 10/09*/
/* Stili per <select> in tema scuro (chiuso + freccia custom) */
html[data-theme="dark"] select,
html[data-bs-theme="dark"] select,
html[data-theme="dark"] .form-select,
html[data-bs-theme="dark"] .form-select {
    background-color: #0f172a;
    color: #e5e7eb;
    border: 1px solid #334155;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.2rem; /* spazio per la freccia custom */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23e5e7eb' stroke-width='2'><path d='M2 5l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    background-size: .9rem;
}

    /* Nasconde la freccia nativa in Edge/IE */
    html[data-theme="dark"] select::-ms-expand {
        display: none;
    }

    /* Opzioni (quando possibile) */
    html[data-theme="dark"] select option {
        background-color: #0f172a;
        color: #e5e7eb;
    }

    /* Focus */
    html[data-theme="dark"] select:focus,
    html[data-bs-theme="dark"] select:focus,
    html[data-theme="dark"] .form-select:focus,
    html[data-bs-theme="dark"] .form-select:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    }
/* ****** Mobile footer navigation ****** */

/* nasconde il footer normale e mostra la mobile-bar solo su schermi piccoli */
@media (max-width: 991.98px) {
    
    .mobile-footer {
        display: flex;
    }

    /* evita che il contenuto venga coperto: aggiusta padding bottom */
    .app-content-shell {
        padding-bottom: calc(var(--footer-h) + 0.5rem);
    }
}

/* default nascosto desktop */
.mobile-footer {
    /*display: none;*/
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--footer-h);
    background: var(--ui-surface);
    border-top: 1px solid var(--ui-border);
    z-index: 1060;
    align-items: center;
    padding: 0 .25rem;
}

/* container e bottoni */
.mobile-footer-inner {
    width: 100%;
    display: flex;
    gap: .15rem;
}

.mobile-nav-btn {
    flex: 1 1 0;
    color: var(--ui-text-muted);
    text-decoration: none;
    padding: .4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    border-radius: .45rem;
    transition: color .12s ease, background-color .12s ease;
}

    .mobile-nav-btn i {
        font-size: 1.15rem;
        line-height: 1;
        margin-bottom: .12rem;
        display: block;
    }

    /* stato active (gestito da JS che aggiunge .active) */
    .mobile-nav-btn.active,
    .mobile-nav-btn[aria-current="page"] {
        color: var(--ui-primary);
        background: rgba(37, 99, 235, 0.06);
    }

    /* hover / focus */
    .mobile-nav-btn:hover,
    .mobile-nav-btn:focus {
        color: var(--ui-primary-hover);
        background: rgba(37, 99, 235, 0.04);
        text-decoration: none;
        outline: none;
    }

/* ============================================================
   ERROR PAGES — 404 & 500
   ============================================================ */

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    font-family: var(--eco-grid-font);
}

.error-page.error-404 {
    background: linear-gradient(135deg, var(--ui-bg) 0%, var(--ui-primary-soft) 100%);
}

.error-page.error-500 {
    background: linear-gradient(135deg, var(--ui-bg) 0%, rgba(254, 226, 226, 1) 100%);
}

html[data-theme="dark"] .error-page.error-404 {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

html[data-theme="dark"] .error-page.error-500 {
    background: linear-gradient(135deg, #0f172a 0%, #7f1d1d 100%);
}

.error-container {
    text-align: center;
    max-width: 600px;
    position: relative;
    z-index: 10;
}

.error-decoration {
    position: fixed;
    opacity: 0.06;
    pointer-events: none;
    border-radius: 50%;
}

.error-decoration-top {
    top: -50px;
    right: -100px;
    width: 300px;
    height: 300px;
}

.error-decoration-bottom {
    bottom: -100px;
    left: -50px;
    width: 250px;
    height: 250px;
}

.error-page.error-404 .error-decoration {
    background: radial-gradient(circle, var(--ui-primary) 0%, transparent 70%);
}

.error-page.error-500 .error-decoration {
    background: radial-gradient(circle, #dc2626 0%, transparent 70%);
}

.error-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.error-page.error-404 .error-icon {
    color: var(--ui-primary);
}

.error-page.error-500 .error-icon {
    color: #dc2626;
}

html[data-theme="dark"] .error-page.error-404 .error-icon {
    color: #3b82f6;
}

html[data-theme="dark"] .error-page.error-500 .error-icon {
    color: #ef4444;
}

.error-code {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    color: inherit;
}

.error-page.error-404 .error-code {
    color: var(--ui-primary);
}

.error-page.error-500 .error-code {
    color: #dc2626;
}

html[data-theme="dark"] .error-page.error-404 .error-code {
    color: #3b82f6;
}

html[data-theme="dark"] .error-page.error-500 .error-code {
    color: #ef4444;
}

.error-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ui-text);
    margin-bottom: 1rem;
}

html[data-theme="dark"] .error-title {
    color: #e2e8f0;
}

.error-description {
    font-size: 1rem;
    color: var(--ui-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

html[data-theme="dark"] .error-description {
    color: #94a3b8;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.error-actions a {
    border-radius: var(--ui-radius);
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}

.error-page.error-404 .error-actions .btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, var(--ui-primary) 100%);
    border-color: var(--ui-primary-hover);
    color: #fff;
    border: 1px solid transparent;
}

.error-page.error-404 .error-actions .btn-primary:hover {
    background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-hover) 100%);
    border-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
}

.error-page.error-500 .error-actions .btn-danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    border-color: #b91c1c;
    color: #fff;
    border: 1px solid transparent;
}

.error-page.error-500 .error-actions .btn-danger:hover {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    border-color: #991b1b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, .2);
}

.error-actions .btn-outline {
    background: transparent;
    border: 1px solid var(--ui-border-strong);
    color: var(--ui-text-muted);
}

.error-actions .btn-outline:hover {
    background: var(--ui-surface-soft);
    border-color: var(--ui-border-strong);
    color: var(--ui-text);
    transform: translateY(-2px);
}

html[data-theme="dark"] .error-actions .btn-outline {
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .error-actions .btn-outline:hover {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

@media (max-width: 576px) {
    .error-container {
        padding: 1.5rem;
    }

    .error-icon {
        font-size: 3.5rem;
    }

    .error-code {
        font-size: 3rem;
    }

    .error-title {
        font-size: 1.4rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions a {
        width: 100%;
    }
}