/* ==========================================================================
   MIACASSAWEB - CSS PERSONALIZZATO PER BOOTSTRAP 5
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABILI CSS
   -------------------------------------------------------------------------- */
:root {
    /* Colori principali */
    --bs-primary: #009EF7;
    --bs-secondary: #E4E6EF;
    --bs-success: #50CD89;
    --bs-info: #7239EA;
    --bs-warning: #FFC700;
    --bs-danger: #F1416C;
    --bs-dark: #181C32;
    --bs-light: #F5F8FA;

    /* Colori grigi */
    --bs-gray-100: #F5F8FA;
    --bs-gray-200: #EFF2F5;
    --bs-gray-300: #E4E6EF;
    --bs-gray-400: #B5B5C3;
    --bs-gray-500: #A1A5B7;
    --bs-gray-600: #7E8299;
    --bs-gray-700: #5E6278;
    --bs-gray-800: #3F4254;
    --bs-gray-900: #181C32;

    /* Colori light */
    --bs-light-primary: #F1FAFF;
    --bs-light-success: #E8FFF3;
    --bs-light-info: #F8F5FF;
    --bs-light-warning: #FFF8DD;
    --bs-light-danger: #FFF5F8;

    /* Colori inverse (per badge solidi) */
    --bs-primary-inverse: #ffffff;
    --bs-success-inverse: #ffffff;
    --bs-info-inverse: #ffffff;
    --bs-warning-inverse: #ffffff;
    --bs-danger-inverse: #ffffff;
    --bs-secondary-inverse: var(--bs-gray-700);
    --bs-dark-inverse: #ffffff;
    --bs-light-inverse: var(--bs-gray-800);

    /* Background app */
    --app-bg: #F5F8FA;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY - Font Size Classes
   -------------------------------------------------------------------------- */
.fs-1 { font-size: 1.75rem !important; }
.fs-2 { font-size: 1.5rem !important; }
.fs-3 { font-size: 1.35rem !important; }
.fs-4 { font-size: 1.25rem !important; }
.fs-5 { font-size: 1.15rem !important; }
.fs-6 { font-size: 1rem !important; }
.fs-7 { font-size: 0.95rem !important; }
.fs-8 { font-size: 0.85rem !important; }
.fs-9 { font-size: 0.75rem !important; }
.fs-2x { font-size: 2rem !important; }
.fs-3x { font-size: 3rem !important; }

/* --------------------------------------------------------------------------
   3. TEXT COLORS
   -------------------------------------------------------------------------- */
.text-gray-100 { color: var(--bs-gray-100) !important; }
.text-gray-200 { color: var(--bs-gray-200) !important; }
.text-gray-300 { color: var(--bs-gray-300) !important; }
.text-gray-400 { color: var(--bs-gray-400) !important; }
.text-gray-500 { color: var(--bs-gray-500) !important; }
.text-gray-600 { color: var(--bs-gray-600) !important; }
.text-gray-700 { color: var(--bs-gray-700) !important; }
.text-gray-800 { color: var(--bs-gray-800) !important; }
.text-gray-900 { color: var(--bs-gray-900) !important; }

/* --------------------------------------------------------------------------
   4. BACKGROUNDS
   -------------------------------------------------------------------------- */
.bg-light-primary { background-color: var(--bs-light-primary) !important; }
.bg-light-success { background-color: var(--bs-light-success) !important; }
.bg-light-info { background-color: var(--bs-light-info) !important; }
.bg-light-warning { background-color: var(--bs-light-warning) !important; }
.bg-light-danger { background-color: var(--bs-light-danger) !important; }

/* Testo bianco su sfondi scuri */
.bg-success { color: #fff !important; }
.bg-success * { color: inherit; }
.bg-primary { color: #fff !important; }
.bg-primary * { color: inherit; }
.bg-danger { color: #fff !important; }
.bg-danger * { color: inherit; }
.bg-info { color: #fff !important; }
.bg-info * { color: inherit; }
.bg-dark { color: #fff !important; }
.bg-dark * { color: inherit; }

/* --------------------------------------------------------------------------
   5. APP LAYOUT
   -------------------------------------------------------------------------- */
html {
    font-size: 13px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--app-bg);
}

.app-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--bs-gray-200);
}

.app-main {
    background-color: #FFFFFF;
}

.app-footer {
    border-top: 1px solid var(--bs-gray-200);
}

/* --------------------------------------------------------------------------
   6. SIDEBAR MENU - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 6.1 Sidebar Container */
.app-sidebar {
    background-color: #FFFFFF;
    border-right: 1px solid var(--bs-gray-200);
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
}

/* 6.2 Sidebar Menu Container */
.sidebar-menu {
    display: flex;
    flex-direction: column;
}

/* 6.3 Menu Item - Wrapper del singolo link */
.menu-item {
    margin-bottom: 0.25rem;
}

/* 6.4 Menu Link - Link singolo navigazione */
.menu-link {
    display: flex;
    align-items: center;
    color: var(--bs-gray-700);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* 6.5 Menu Link - Stato Hover */
.menu-link:hover {
    background-color: var(--bs-light-primary);
    color: var(--bs-primary);
}

.menu-link:hover .menu-icon i,
.menu-link:hover .menu-icon .bi {
    color: var(--bs-primary);
}

.menu-link:hover .menu-title {
    color: var(--bs-primary);
}

/* 6.6 Menu Link - Stato Active */
.menu-link.active {
    background-color: var(--bs-light-primary);
}

.menu-link.active .menu-icon i,
.menu-link.active .menu-icon .bi {
    color: var(--bs-primary) !important;
}

.menu-link.active .menu-title {
    color: var(--bs-primary) !important;
    font-weight: 600;
}

/* 6.7 Menu Link - Stato Disabled */
.menu-link.disabled {
    color: var(--bs-gray-400);
    pointer-events: none;
    cursor: not-allowed;
}

.menu-link.disabled .menu-icon i,
.menu-link.disabled .menu-icon .bi {
    color: var(--bs-gray-400);
}

/* 6.8 Menu Icon - Contenitore icona */
.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    margin-right: 0.75rem;
}

.menu-icon i,
.menu-icon .bi {
    color: var(--bs-gray-500);
    font-size: 1.35rem;
    line-height: 1;
    transition: color 0.2s ease;
}

/* 6.9 Menu Title - Testo del link */
.menu-title {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
}

/* 6.10 Menu Section - Titolo sezione/gruppo */
.menu-section {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.menu-section .menu-section-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* 6.11 Menu Badge - Badge notifiche */
.menu-badge {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.menu-badge .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
}

/* 6.12 Menu Arrow - Freccia per submenu */
.menu-arrow {
    display: flex;
    align-items: center;
    margin-left: auto;
    color: var(--bs-gray-500);
    transition: transform 0.2s ease;
}

.menu-arrow i,
.menu-arrow .bi {
    font-size: 0.75rem;
}

/* 6.13 Menu Submenu - Sottomenu */
.menu-sub {
    display: none;
    flex-direction: column;
    padding-left: 1.5rem;
}

.menu-sub.show {
    display: flex;
}

.menu-sub .menu-link {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

/* 6.14 Menu Separator - Linea separatrice */
.menu-separator {
    margin: 0.5rem 0;
    border-bottom: 1px dashed var(--bs-gray-300);
}

/* --------------------------------------------------------------------------
   7. CARDS - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 7.1 Card base */
.card {
    border: 0;
    border-radius: 0.65rem;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.08);
    background-color: #fff;
}

/* 7.2 Card Header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
    background-color: transparent;
    border-bottom: 1px solid var(--bs-gray-200);
    min-height: 70px;
}

.card-header.border-0 {
    border-bottom: 0;
}

/* 7.3 Card Title */
.card-title {
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--bs-gray-900);
    margin-bottom: 0;
}

/* Card title con layout colonna (per sottotitoli) */
.card-title.align-items-start {
    align-items: flex-start;
}

.card-title.flex-column {
    flex-direction: column;
}

/* 7.4 Card Label - Etichetta titolo */
.card-label {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--bs-gray-900);
    margin-bottom: 0;
}

/* 7.5 Card Toolbar - Azioni nell'header */
.card-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

/* 7.6 Card Body */
.card-body {
    padding: 1.5rem;
}

/* 7.7 Card Footer */
.card-footer {
    padding: 1rem 1.5rem;
    background-color: transparent;
    border-top: 1px solid var(--bs-gray-200);
}

/* 7.8 Card Flush - Card senza bordi interni */
.card-flush > .card-header {
    border-bottom: 0;
}

.card-flush > .card-footer {
    border-top: 0;
}

/* 7.9 Card Bordered - Card con bordo visibile */
.card-bordered {
    border: 1px solid var(--bs-gray-200);
    box-shadow: none;
}

/* 7.10 Card Stretch - Allunga card in flex */
.card-stretch {
    height: 100%;
}

.card-stretch > .card-body {
    flex: 1 1 auto;
}

/* 7.11 Card Hover Effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.12);
}

/* Hoverable - effetto elevazione al hover */
.hoverable {
    transition: box-shadow 0.2s ease;
}

.hoverable:hover {
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

/* Hover card - stile specifico per card cliccabili */
.hover-card {
    transition: all 0.2s ease;
}

.hover-card:hover {
    background-color: var(--bs-gray-100) !important;
}

/* 7.12 Card con background colorati */
.card.bg-light-primary {
    background-color: var(--bs-light-primary) !important;
}

.card.bg-light-success {
    background-color: var(--bs-light-success) !important;
}

.card.bg-light-info {
    background-color: var(--bs-light-info) !important;
}

.card.bg-light-warning {
    background-color: var(--bs-light-warning) !important;
}

.card.bg-light-danger {
    background-color: var(--bs-light-danger) !important;
}

.card.bg-light {
    background-color: var(--bs-light) !important;
}

/* --------------------------------------------------------------------------
   8. BUTTONS - Stile base allineato a MiaDelega
   -------------------------------------------------------------------------- */

/* 8.1 Base button styles */
.btn {
    font-weight: 500;
    border-radius: 0.65rem;
    transition: color 0.15s ease-in-out,
                background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out,
                box-shadow 0.15s ease-in-out;
}

.btn:focus {
    box-shadow: none;
}

.btn:active {
    transform: translateY(1px);
}

/* 8.2 Button sizes */
.btn-sm {
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    border-radius: 0.55rem;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1.15rem;
    border-radius: 1rem;
}

/* 8.3 Button icon - Solo icona quadrato */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: calc(1.5em + 1.55rem + 2px);
    height: calc(1.5em + 1.55rem + 2px);
}

.btn-icon.btn-sm {
    width: calc(1.5em + 1.1rem + 2px);
    height: calc(1.5em + 1.1rem + 2px);
}

.btn-icon.btn-lg {
    width: calc(1.5em + 2rem + 2px);
    height: calc(1.5em + 2rem + 2px);
}

.btn-icon i {
    font-size: 1.2em;
    line-height: 1;
}

/* 8.4 Primary button enhancements */
.btn-primary {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-color: #0095e8;
    border-color: #0095e8;
}

/* 8.5 Secondary button enhancements */
.btn-secondary {
    color: var(--bs-gray-700);
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    color: var(--bs-gray-800);
    background-color: var(--bs-gray-300);
    border-color: var(--bs-gray-300);
}

/* 8.5b Warning button - Testo bianco */
.btn-warning {
    color: #fff;
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
}

.btn-warning:hover,
.btn-warning:focus {
    color: #fff;
    background-color: #e6b300;
    border-color: #e6b300;
}

.btn-warning:active {
    color: #fff !important;
}

/* 8.5c Info button - Testo bianco */
.btn-info {
    color: #fff;
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}
.btn-info:hover,
.btn-info:focus {
    color: #fff;
    background-color: #6222d4;
    border-color: #6222d4;
}
.btn-info:active {
    color: #fff !important;
}

/* 8.6 Light button variants */
.btn-light-primary {
    color: var(--bs-primary);
    background-color: var(--bs-light-primary);
    border-color: transparent;
}
.btn-light-primary:hover,
.btn-light-primary:focus {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-light-success {
    color: var(--bs-success);
    background-color: var(--bs-light-success);
    border-color: transparent;
}
.btn-light-success:hover,
.btn-light-success:focus {
    color: #fff;
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.btn-light-danger {
    color: var(--bs-danger);
    background-color: var(--bs-light-danger);
    border-color: transparent;
}
.btn-light-danger:hover,
.btn-light-danger:focus {
    color: #fff;
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

.btn-light-warning {
    color: var(--bs-warning);
    background-color: var(--bs-light-warning);
    border-color: transparent;
}
.btn-light-warning:hover,
.btn-light-warning:focus {
    color: #fff;
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
}

.btn-light-info {
    color: var(--bs-info);
    background-color: var(--bs-light-info);
    border-color: transparent;
}
.btn-light-info:hover,
.btn-light-info:focus {
    color: #fff;
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}

.btn-light-secondary {
    color: var(--bs-gray-700);
    background-color: var(--bs-gray-200);
    border-color: transparent;
}
.btn-light-secondary:hover,
.btn-light-secondary:focus {
    color: #fff;
    background-color: var(--bs-gray-600);
    border-color: var(--bs-gray-600);
}

/* 8.7 Outline button variants */
.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-outline-secondary {
    color: var(--bs-gray-700);
    border-color: var(--bs-gray-400);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--bs-gray-800);
    background-color: var(--bs-gray-200);
    border-color: var(--bs-gray-400);
}

.btn-outline-success {
    color: var(--bs-success);
    border-color: var(--bs-success);
}
.btn-outline-success:hover,
.btn-outline-success:focus {
    color: #fff;
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.btn-outline-danger {
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}
.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #fff;
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

.btn-outline-warning {
    color: var(--bs-warning);
    border-color: var(--bs-warning);
}
.btn-outline-warning:hover,
.btn-outline-warning:focus {
    color: #fff;
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
}

.btn-outline-info {
    color: var(--bs-info);
    border-color: var(--bs-info);
}
.btn-outline-info:hover,
.btn-outline-info:focus {
    color: #fff;
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}

/* 8.8 Button active/color states */
.btn-active-light-primary:active,
.btn-active-light-primary.active {
    color: var(--bs-primary);
    background-color: var(--bs-light-primary);
}

.btn-active-primary:active,
.btn-active-primary.active {
    color: #fff;
    background-color: var(--bs-primary);
}

/* 8.9 Button color utilities */
.btn-color-primary {
    color: var(--bs-primary);
}
.btn-color-primary:hover,
.btn-color-primary:focus {
    color: #0095e8;
}

.btn-color-gray-500 {
    color: var(--bs-gray-500);
}
.btn-color-gray-500:hover,
.btn-color-gray-500:focus {
    color: var(--bs-gray-700);
}

.btn-active-color-primary:active,
.btn-active-color-primary.active,
.btn-active-color-primary:hover {
    color: var(--bs-primary);
}

/* --------------------------------------------------------------------------
   9. BADGES - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 9.1 Badge Base - CSS Variables per Bootstrap 5 */
.badge {
    --bs-badge-padding-x: 0.5rem;
    --bs-badge-padding-y: 0.325rem;
    --bs-badge-font-size: 0.85rem;
    --bs-badge-font-weight: 600;
    --bs-badge-color: var(--bs-body-color);
    --bs-badge-border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
    font-size: var(--bs-badge-font-size);
    font-weight: var(--bs-badge-font-weight);
    line-height: 1;
    color: var(--bs-badge-color);
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--bs-badge-border-radius);
    position: relative;
    top: -1px;
}

/* 9.2 Badge Empty - Nasconde badge vuoti */
.badge:empty {
    display: none;
}

/* 9.3 Badge Circle e Square */
.badge.badge-circle,
.badge.badge-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    min-width: 1.75rem;
    padding: 0 0.1rem;
    line-height: 0;
}

.badge.badge-circle {
    border-radius: 50%;
    padding: 0;
    min-width: unset;
    width: 1.75rem;
}

/* 9.4 Badge Sizes - Dimensioni */
.badge.badge-sm {
    min-width: 1.5rem;
    font-size: 0.8rem;
}

.badge.badge-sm.badge-square {
    height: 1.5rem;
}

.badge.badge-sm.badge-circle {
    width: 1.5rem;
    height: 1.5rem;
}

.badge.badge-lg {
    min-width: 2rem;
    font-size: 1rem;
}

.badge.badge-lg.badge-square {
    height: 2rem;
}

.badge.badge-lg.badge-circle {
    width: 2rem;
    height: 2rem;
}

/* 9.5 Badge Solid Variants - Varianti con sfondo pieno */
.badge-primary {
    color: var(--bs-primary-inverse);
    background-color: var(--bs-primary);
}

.badge-success {
    color: var(--bs-success-inverse);
    background-color: var(--bs-success);
}

.badge-danger {
    color: var(--bs-danger-inverse);
    background-color: var(--bs-danger);
}

.badge-warning {
    color: var(--bs-warning-inverse);
    background-color: var(--bs-warning);
}

.badge-info {
    color: var(--bs-info-inverse);
    background-color: var(--bs-info);
}

.badge-secondary {
    color: var(--bs-secondary-inverse);
    background-color: var(--bs-secondary);
}

.badge-dark {
    color: var(--bs-dark-inverse);
    background-color: var(--bs-dark);
}

.badge-light {
    color: var(--bs-light-inverse);
    background-color: var(--bs-light);
}

/* 9.6 Badge Light Variants - Varianti con sfondo chiaro */
.badge-light-primary {
    color: var(--bs-primary);
    background-color: var(--bs-light-primary);
}

.badge-light-success {
    color: var(--bs-success);
    background-color: var(--bs-light-success);
}

.badge-light-danger {
    color: var(--bs-danger);
    background-color: var(--bs-light-danger);
}

.badge-light-warning {
    color: #B87A00;
    background-color: var(--bs-light-warning);
}

.badge-light-info {
    color: var(--bs-info);
    background-color: var(--bs-light-info);
}

.badge-light-secondary {
    color: var(--bs-secondary-inverse);
    background-color: var(--bs-gray-200);
}

.badge-light-dark {
    color: var(--bs-dark);
    background-color: var(--bs-gray-200);
}

/* 9.7 Badge Outline Variants - Varianti con bordo */
.badge-outline-primary {
    border: 1px solid var(--bs-primary);
    background-color: transparent;
    color: var(--bs-primary);
}

.badge-outline-success {
    border: 1px solid var(--bs-success);
    background-color: transparent;
    color: var(--bs-success);
}

.badge-outline-danger {
    border: 1px solid var(--bs-danger);
    background-color: transparent;
    color: var(--bs-danger);
}

.badge-outline-warning {
    border: 1px solid var(--bs-warning);
    background-color: transparent;
    color: var(--bs-warning);
}

.badge-outline-info {
    border: 1px solid var(--bs-info);
    background-color: transparent;
    color: var(--bs-info);
}

.badge-outline-secondary {
    border: 1px solid var(--bs-gray-400);
    background-color: transparent;
    color: var(--bs-secondary-inverse);
}

.badge-outline-dark {
    border: 1px solid var(--bs-dark);
    background-color: transparent;
    color: var(--bs-dark);
}

/* 9.8 Badge con tooltip - Cursore freccia (non pointer) */
.badge[data-bs-toggle="tooltip"] {
    cursor: default;
}

/* --------------------------------------------------------------------------
   10. ALERTS - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 10.1 Alert Base - Override Bootstrap 5 */
.alert {
    --bs-alert-padding-x: 1rem;
    --bs-alert-padding-y: 1rem;
    --bs-alert-margin-bottom: 1rem;
    --bs-alert-border-radius: 0.65rem;
    position: relative;
    padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
    margin-bottom: var(--bs-alert-margin-bottom);
    border: 1px solid transparent;
    border-radius: var(--bs-alert-border-radius);
}

/* 10.2 Alert Dismissible - Pulsante chiusura */
.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

/* 10.3 Alert con Icone - Layout d-flex */
.alert.d-flex {
    align-items: center;
}

.alert.d-flex > i:first-child,
.alert.d-flex > span.ki-outline:first-child,
.alert.d-flex > [class*="ki-"]:first-child {
    flex-shrink: 0;
}

/* 10.4 Alert Standard Variants - Colori Bootstrap 5 */
.alert-primary {
    --bs-alert-color: var(--bs-primary);
    --bs-alert-bg: rgba(0, 158, 247, 0.1);
    --bs-alert-border-color: rgba(0, 158, 247, 0.2);
    color: var(--bs-primary);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-secondary {
    --bs-alert-color: var(--bs-gray-700);
    --bs-alert-bg: var(--bs-gray-100);
    --bs-alert-border-color: var(--bs-gray-200);
    color: var(--bs-gray-700);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-success {
    --bs-alert-color: var(--bs-success);
    --bs-alert-bg: rgba(80, 205, 137, 0.1);
    --bs-alert-border-color: rgba(80, 205, 137, 0.2);
    color: var(--bs-success);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-info {
    --bs-alert-color: var(--bs-info);
    --bs-alert-bg: rgba(114, 57, 234, 0.1);
    --bs-alert-border-color: rgba(114, 57, 234, 0.2);
    color: var(--bs-info);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-warning {
    --bs-alert-color: #b38600;
    --bs-alert-bg: rgba(255, 199, 0, 0.15);
    --bs-alert-border-color: rgba(255, 199, 0, 0.25);
    color: #b38600;
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-danger {
    --bs-alert-color: var(--bs-danger);
    --bs-alert-bg: rgba(241, 65, 108, 0.1);
    --bs-alert-border-color: rgba(241, 65, 108, 0.2);
    color: var(--bs-danger);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-dark {
    --bs-alert-color: var(--bs-dark);
    --bs-alert-bg: rgba(24, 28, 50, 0.1);
    --bs-alert-border-color: rgba(24, 28, 50, 0.2);
    color: var(--bs-dark);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

.alert-light {
    --bs-alert-color: var(--bs-gray-700);
    --bs-alert-bg: var(--bs-gray-100);
    --bs-alert-border-color: var(--bs-gray-200);
    color: var(--bs-gray-700);
    background-color: var(--bs-alert-bg);
    border-color: var(--bs-alert-border-color);
}

/* 10.5 Alert Light Variants - Sfondo chiaro senza bordo */
.alert-light-primary {
    color: var(--bs-primary);
    background-color: var(--bs-light-primary);
    border-color: transparent;
}

.alert-light-success {
    color: var(--bs-success);
    background-color: var(--bs-light-success);
    border-color: transparent;
}

.alert-light-info {
    color: var(--bs-info);
    background-color: var(--bs-light-info);
    border-color: transparent;
}

.alert-light-warning {
    color: #b38600;
    background-color: var(--bs-light-warning);
    border-color: transparent;
}

.alert-light-danger {
    color: var(--bs-danger);
    background-color: var(--bs-light-danger);
    border-color: transparent;
}

.alert-light-secondary {
    color: var(--bs-gray-700);
    background-color: var(--bs-gray-200);
    border-color: transparent;
}

.alert-light-dark {
    color: var(--bs-dark);
    background-color: var(--bs-gray-200);
    border-color: transparent;
}

/* 10.6 Alert Links - Link all'interno degli alert */
.alert-primary .alert-link { color: #0095e8; }
.alert-success .alert-link { color: #47b97a; }
.alert-info .alert-link { color: #6633cc; }
.alert-warning .alert-link { color: #997300; }
.alert-danger .alert-link { color: #d93a62; }
.alert-dark .alert-link { color: #131825; }
.alert-secondary .alert-link { color: var(--bs-gray-800); }
.alert-light .alert-link { color: var(--bs-gray-800); }

/* Alert light variants links */
.alert-light-primary .alert-link { color: #0095e8; }
.alert-light-success .alert-link { color: #47b97a; }
.alert-light-info .alert-link { color: #6633cc; }
.alert-light-warning .alert-link { color: #997300; }
.alert-light-danger .alert-link { color: #d93a62; }
.alert-light-secondary .alert-link { color: var(--bs-gray-800); }
.alert-light-dark .alert-link { color: var(--bs-gray-800); }

/* 10.7 Alert Heading - Titoli negli alert */
.alert h4,
.alert .h4,
.alert h5,
.alert .h5,
.alert h6,
.alert .h6 {
    color: inherit;
}

/* 10.8 Alert con Bordo Dashed - Stile particolare per informazioni */
.alert.border-dashed {
    border-style: dashed !important;
}

/* 10.9 Alert Padding Variants - Padding personalizzati */
.alert.p-4 {
    padding: 1rem !important;
}

.alert.p-5 {
    padding: 1.25rem !important;
}

.alert.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.alert.px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* --------------------------------------------------------------------------
   11. TABLES - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 11.1 Table Base Enhancements */
.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: var(--bs-gray-100);
    --bs-table-hover-bg: var(--bs-gray-100);
    width: 100%;
    margin-bottom: 1rem;
    color: var(--bs-gray-700);
    vertical-align: top;
    border-color: var(--bs-gray-200);
}

.table > :not(caption) > * > * {
    padding: 0.75rem 0.75rem;
    background-color: var(--bs-table-bg);
    border-bottom-width: 1px;
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

.table > tbody {
    vertical-align: inherit;
}

.table > thead {
    vertical-align: bottom;
}

.table > thead > tr > th {
    font-weight: 600;
    color: var(--bs-gray-800);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
}

/* 11.2 Table Row Bordered - Bordi solid tra righe */
.table-row-bordered tr {
    border-bottom: 1px solid var(--bs-gray-200);
}

.table-row-bordered tr:last-child {
    border-bottom: 0;
}

.table-row-bordered tfoot tr:first-child,
.table-row-bordered tfoot tr:last-child {
    border-top: 1px solid var(--bs-gray-200);
    border-bottom: 0;
}

/* 11.3 Table Row Dashed - Bordi tratteggiati tra righe */
.table-row-dashed tr {
    border-bottom: 1px dashed var(--bs-gray-300);
}

.table-row-dashed tr:last-child {
    border-bottom: 0;
}

.table-row-dashed tfoot tr:first-child,
.table-row-dashed tfoot tr:last-child {
    border-top: 1px dashed var(--bs-gray-300);
    border-bottom: 0;
}

/* 11.4 Table Row Gray Colors - Colore bordo grigio */
.table-row-gray-100 tr {
    border-bottom-color: var(--bs-gray-100);
}

.table-row-gray-200 tr {
    border-bottom-color: var(--bs-gray-200);
}

.table-row-gray-300 tr {
    border-bottom-color: var(--bs-gray-300);
}

.table-row-gray-400 tr {
    border-bottom-color: var(--bs-gray-400);
}

.table-row-gray-500 tr {
    border-bottom-color: var(--bs-gray-500);
}

/* 11.5 Table Rounded - Angoli arrotondati */
.table-rounded {
    border-radius: 0.65rem;
    border-spacing: 0;
    border-collapse: separate;
    overflow: hidden;
}

.table-rounded th:first-child {
    border-top-left-radius: 0.65rem;
}

.table-rounded th:last-child {
    border-top-right-radius: 0.65rem;
}

.table-rounded tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.65rem;
}

.table-rounded tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.65rem;
}

/* 11.6 Table Flush - Senza padding laterale */
.table-flush tr th:first-child,
.table-flush tr td:first-child {
    padding-left: 0;
}

.table-flush tr th:last-child,
.table-flush tr td:last-child {
    padding-right: 0;
}

/* 11.7 Table Striped Enhanced */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: var(--bs-gray-100);
    color: var(--bs-gray-800);
}

/* 11.8 Table Hover Enhanced */
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--bs-gray-100);
    color: var(--bs-gray-900);
}

/* 11.9 GY Classes - Vertical Spacing (padding top/bottom) */
.gy-1 tr th,
.gy-1 tr td {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.gy-2 tr th,
.gy-2 tr td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.gy-3 tr th,
.gy-3 tr td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.gy-4 tr th,
.gy-4 tr td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.gy-5 tr th,
.gy-5 tr td {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.gy-6 tr th,
.gy-6 tr td {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.gy-7 tr th,
.gy-7 tr td {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}

/* 11.10 GS Classes - Horizontal Spacing (padding left/right per celle) */
.gs-0 tr th,
.gs-0 tr td {
    padding-left: 0;
    padding-right: 0;
}

.gs-0 tr th:first-child,
.gs-0 tr td:first-child {
    padding-left: 0;
}

.gs-0 tr th:last-child,
.gs-0 tr td:last-child {
    padding-right: 0;
}

.gs-1 tr th,
.gs-1 tr td {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.gs-2 tr th,
.gs-2 tr td {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.gs-3 tr th,
.gs-3 tr td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.gs-4 tr th,
.gs-4 tr td {
    padding-left: 1rem;
    padding-right: 1rem;
}

.gs-5 tr th,
.gs-5 tr td {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.gs-6 tr th,
.gs-6 tr td {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.gs-7 tr th,
.gs-7 tr td {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

/* 11.11 Min Width Utilities */
.min-w-0 { min-width: 0 !important; }
.min-w-50px { min-width: 50px; }
.min-w-75px { min-width: 75px; }
.min-w-100px { min-width: 100px; }
.min-w-125px { min-width: 125px; }
.min-w-150px { min-width: 150px; }
.min-w-175px { min-width: 175px; }
.min-w-200px { min-width: 200px; }
.min-w-225px { min-width: 225px; }
.min-w-250px { min-width: 250px; }
.min-w-275px { min-width: 275px; }
.min-w-300px { min-width: 300px; }
.min-w-325px { min-width: 325px; }
.min-w-350px { min-width: 350px; }
.min-w-400px { min-width: 400px; }
.min-w-450px { min-width: 450px; }
.min-w-500px { min-width: 500px; }

/* 11.12 Max Width Utilities */
.max-w-50px { max-width: 50px; }
.max-w-100px { max-width: 100px; }
.max-w-150px { max-width: 150px; }
.max-w-200px { max-width: 200px; }
.max-w-250px { max-width: 250px; }
.max-w-300px { max-width: 300px; }
.max-w-350px { max-width: 350px; }
.max-w-400px { max-width: 400px; }
.max-w-500px { max-width: 500px; }

/* 11.13 Width Utilities per celle tabella */
.w-50px { width: 50px; }
.w-75px { width: 75px; }
.w-100px { width: 100px; }
.w-125px { width: 125px; }
.w-150px { width: 150px; }
.w-175px { width: 175px; }
.w-200px { width: 200px; }
.w-250px { width: 250px; }
.w-300px { width: 300px; }

/* 11.14 Table Loading Overlay */
.table-loading {
    position: relative;
}

.table-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

/* 11.15 Empty Table Message */
.table-empty-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-gray-500);
    font-size: 1rem;
}

.table-empty-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--bs-gray-400);
}

/* --------------------------------------------------------------------------
   12. FORMS - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 12.1 Form Control - Base */
.form-control {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--bs-gray-700);
    background-color: #fff;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.65rem;
    padding: 0.775rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: var(--bs-gray-700);
    background-color: #fff;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.15rem rgba(0, 158, 247, 0.15);
    outline: 0;
}

.form-control::placeholder {
    color: var(--bs-gray-400);
    font-weight: 400;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bs-gray-100);
    color: var(--bs-gray-500);
    opacity: 1;
}

/* 12.2 Form Control - Sizing */
.form-control-sm {
    padding: 0.55rem 0.75rem;
    font-size: 0.925rem;
    border-radius: 0.55rem;
    min-height: calc(1.5em + 1.1rem + 2px);
}

.form-control-lg {
    padding: 1rem 1.5rem;
    font-size: 1.15rem;
    border-radius: 0.65rem;
    min-height: calc(1.5em + 2rem + 2px);
}

/* 12.3 Form Control Solid - Background grigio */
.form-control-solid {
    background-color: var(--bs-gray-100);
    border-color: var(--bs-gray-100);
    color: var(--bs-gray-700);
}

.form-control-solid:focus {
    background-color: var(--bs-gray-200);
    border-color: var(--bs-gray-200);
    box-shadow: none;
}

.form-control-solid::placeholder {
    color: var(--bs-gray-500);
}

.form-control-solid:disabled,
.form-control-solid[readonly] {
    background-color: var(--bs-gray-200);
    color: var(--bs-gray-500);
}

/* 12.4 Form Control Transparent */
.form-control.bg-transparent {
    background-color: transparent !important;
    border-color: var(--bs-gray-300);
}

.form-control.bg-transparent:focus {
    background-color: transparent !important;
    border-color: var(--bs-primary);
}

/* 12.5 Form Select */
.form-select {
    font-size: 1rem;
    font-weight: 500;
    color: var(--bs-gray-700);
    background-color: #fff;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.65rem;
    padding: 0.775rem 3rem 0.775rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.15rem rgba(0, 158, 247, 0.15);
    outline: 0;
}

.form-select:disabled {
    background-color: var(--bs-gray-100);
    color: var(--bs-gray-500);
}

.form-select-sm {
    padding: 0.55rem 2.5rem 0.55rem 0.75rem;
    font-size: 0.925rem;
    border-radius: 0.55rem;
}

.form-select-lg {
    padding: 1rem 3.5rem 1rem 1.5rem;
    font-size: 1.15rem;
    border-radius: 0.65rem;
}

/* 12.6 Form Select Solid */
.form-select-solid {
    background-color: var(--bs-gray-100);
    border-color: var(--bs-gray-100);
}

.form-select-solid:focus {
    background-color: var(--bs-gray-200);
    border-color: var(--bs-gray-200);
    box-shadow: none;
}

/* 12.7 Form Label */
.form-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--bs-gray-800);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: "*";
    color: var(--bs-danger);
    margin-left: 0.25rem;
    font-weight: 600;
}

/* 12.8 Input Group */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:focus,
.input-group > .form-select:focus {
    z-index: 5;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.775rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--bs-gray-700);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.65rem;
}

.input-group-text.solid {
    background-color: var(--bs-gray-200);
    border-color: var(--bs-gray-200);
}

/* Input group bordi arrotondati corretti */
.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),
.input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3),
.input-group:not(.has-validation) > .form-floating:not(:last-child) > .form-control,
.input-group:not(.has-validation) > .form-floating:not(:last-child) > .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 12.9 Form Floating */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
    padding: 1rem 1rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 1rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--bs-gray-500);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* 12.10 Form Check - Stile allineato a MiaDelega (Metronic Theme) */

/* Form Check base - Stile solid di default per TUTTE le checkbox */
.form-check-input {
    border: 0 !important;
    background-color: var(--bs-gray-200);
    cursor: pointer;
}

.form-check-input:not(:checked) {
    background-color: var(--bs-gray-200);
}

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

.form-check-input:focus {
    box-shadow: none;
}

/* Form Check base - Checkmark piu' grande */
.form-check:not(.form-switch) .form-check-input[type=checkbox] {
    background-size: 60% 60%;
}

/* Form Check - Layout flex di default */
.form-check {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin: 0;
    min-height: auto;
}

.form-check .form-check-input {
    margin: 0;
    float: none;
    flex-shrink: 0;
}

.form-check .form-check-label {
    margin-left: 0.55rem;
}

/* Form Check Custom - Layout flex personalizzato (retrocompatibilita') */
.form-check-custom {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin: 0;
    min-height: auto;
}

.form-check-custom .form-check-input {
    margin: 0;
    float: none;
    flex-shrink: 0;
}

.form-check-custom .form-check-label {
    margin-left: 0.55rem;
}

/* Form Check Solid - Background pieno (retrocompatibilita') */
.form-check.form-check-solid .form-check-input {
    border: 0;
}

.form-check.form-check-solid .form-check-input:not(:checked) {
    background-color: var(--bs-gray-200);
}

.form-check.form-check-solid .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-check.form-check-solid .form-check-input:focus {
    box-shadow: none;
}

/* Form Check dimensioni */
.form-check.form-check-sm .form-check-input {
    height: 1.55rem;
    width: 1.55rem;
}

.form-check.form-check-lg .form-check-input {
    height: 2rem;
    width: 2rem;
}

/* Form Switch - Base con pallino bianco di default */
.form-switch {
    padding-left: 3.75rem;
}

.form-switch .form-check-input {
    width: 3.25rem;
    height: 2.25rem;
    margin-left: -3.75rem;
    border-radius: 3.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    background-position: left center;
    transition: background-position 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
}

/* Form Switch Custom - Altezza maggiore (retrocompatibilita') */
.form-switch.form-check-custom .form-check-input {
    height: 2.25rem;
}

/* Form Switch varianti dimensioni */
.form-switch.form-check-custom.form-switch-sm .form-check-input {
    height: 1.5rem;
    width: 2.5rem;
}

.form-switch.form-check-custom.form-switch-lg .form-check-input {
    height: 2.75rem;
    width: 3.75rem;
}

/* Form Switch Solid - Pallino bianco sempre visibile */
.form-switch.form-check-solid .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
}

.form-switch.form-check-solid .form-check-input:not(:checked) {
    background-color: var(--bs-gray-200);
}

/* Form Check varianti colore */
.form-check.form-check-success .form-check-input:checked {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.form-check.form-check-danger .form-check-input:checked {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

.form-check.form-check-warning .form-check-input:checked {
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
}

.form-check.form-check-info .form-check-input:checked {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}

/* Utility classes per dimensioni switch (compatibilita' MiaDelega) */
.w-35px { width: 35px !important; }
.w-45px { width: 45px !important; }
.h-20px { height: 20px !important; }
.h-30px { height: 30px !important; }

/* 12.11 Validation States */
.form-control.is-valid,
.was-validated .form-control:valid {
    border-color: var(--bs-success);
    background-image: none;
}

.form-control.is-valid:focus,
.was-validated .form-control:valid:focus {
    border-color: var(--bs-success);
    box-shadow: 0 0 0 0.15rem rgba(80, 205, 137, 0.15);
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: var(--bs-danger);
    background-image: none;
}

.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 0.15rem rgba(241, 65, 108, 0.15);
}

.form-select.is-valid,
.was-validated .form-select:valid {
    border-color: var(--bs-success);
}

.form-select.is-valid:focus,
.was-validated .form-select:valid:focus {
    border-color: var(--bs-success);
    box-shadow: 0 0 0 0.15rem rgba(80, 205, 137, 0.15);
}

.form-select.is-invalid,
.was-validated .form-select:invalid {
    border-color: var(--bs-danger);
}

.form-select.is-invalid:focus,
.was-validated .form-select:invalid:focus {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 0.15rem rgba(241, 65, 108, 0.15);
}

/* Feedback messages */
.valid-feedback {
    color: var(--bs-success);
    font-size: 0.925rem;
}

.invalid-feedback {
    color: var(--bs-danger);
    font-size: 0.925rem;
}

/* 12.12 Form Text Helper */
.form-text {
    font-size: 0.925rem;
    color: var(--bs-gray-500);
}

/* 12.13 Form Plaintext */
.form-control-plaintext {
    padding: 0.775rem 0;
    color: var(--bs-gray-800);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   13. LOADER OVERLAY
   -------------------------------------------------------------------------- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.25);
    z-index: 9999;
}

/* --------------------------------------------------------------------------
   14. UTILITIES
   -------------------------------------------------------------------------- */
.cursor-pointer { cursor: pointer; }
.h-35px { height: 35px; }
.h-50px { height: 50px; }

/* Padding responsivi */
.pt-7 { padding-top: 1.75rem !important; }

@media (min-width: 992px) {
    .pt-lg-10 { padding-top: 2.5rem !important; }
}

/* --------------------------------------------------------------------------
   15. SCROLL TO TOP BUTTON
   -------------------------------------------------------------------------- */
#scrollToTop {
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   16. DROPDOWN MENU - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 16.1 Dropdown Menu - Contenitore principale */
.dropdown-menu {
    --bs-dropdown-zindex: 1000;
    --bs-dropdown-min-width: 10rem;
    --bs-dropdown-padding-x: 0;
    --bs-dropdown-padding-y: 0.5rem;
    --bs-dropdown-spacer: 0.125rem;
    --bs-dropdown-font-size: 1rem;
    --bs-dropdown-color: var(--bs-gray-700);
    --bs-dropdown-bg: #fff;
    --bs-dropdown-border-color: transparent;
    --bs-dropdown-border-radius: 0.65rem;
    --bs-dropdown-border-width: 0;
    --bs-dropdown-inner-border-radius: 0.65rem;
    --bs-dropdown-divider-bg: var(--bs-gray-200);
    --bs-dropdown-divider-margin-y: 0.5rem;
    --bs-dropdown-box-shadow: 0 0 50px 0 rgba(82, 63, 105, 0.15);
    --bs-dropdown-link-color: var(--bs-gray-700);
    --bs-dropdown-link-hover-color: var(--bs-gray-900);
    --bs-dropdown-link-hover-bg: var(--bs-gray-100);
    --bs-dropdown-link-active-color: var(--bs-primary);
    --bs-dropdown-link-active-bg: var(--bs-light-primary);
    --bs-dropdown-link-disabled-color: var(--bs-gray-400);
    --bs-dropdown-item-padding-x: 1rem;
    --bs-dropdown-item-padding-y: 0.65rem;
    --bs-dropdown-header-color: var(--bs-gray-500);
    --bs-dropdown-header-padding-x: 1rem;
    --bs-dropdown-header-padding-y: 0.5rem;
    position: absolute;
    z-index: var(--bs-dropdown-zindex);
    display: none;
    min-width: var(--bs-dropdown-min-width);
    padding: var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);
    margin: 0;
    font-size: var(--bs-dropdown-font-size);
    color: var(--bs-dropdown-color);
    text-align: left;
    list-style: none;
    background-color: var(--bs-dropdown-bg);
    background-clip: padding-box;
    border: var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);
    border-radius: var(--bs-dropdown-border-radius);
    box-shadow: var(--bs-dropdown-box-shadow);
}

/* 16.2 Dropdown Menu - Animazione apertura (CSS-only) */
.dropdown-menu[data-bs-popper] {
    top: 100%;
    left: 0;
    margin-top: var(--bs-dropdown-spacer);
}

.dropdown-menu.show {
    display: block;
    animation: dropdown-fade-in 0.2s ease;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 16.3 Dropdown Item - Voce singola */
.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
    clear: both;
    font-weight: 500;
    color: var(--bs-dropdown-link-color);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* 16.4 Dropdown Item - Hover e Focus */
.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--bs-dropdown-link-hover-color);
    background-color: var(--bs-dropdown-link-hover-bg);
    text-decoration: none;
}

/* 16.5 Dropdown Item - Active */
.dropdown-item.active,
.dropdown-item:active {
    color: var(--bs-dropdown-link-active-color);
    background-color: var(--bs-dropdown-link-active-bg);
    text-decoration: none;
}

/* 16.6 Dropdown Item - Disabled */
.dropdown-item.disabled,
.dropdown-item:disabled {
    color: var(--bs-dropdown-link-disabled-color);
    pointer-events: none;
    background-color: transparent;
}

/* 16.7 Dropdown Divider - Separatore */
.dropdown-divider {
    height: 0;
    margin: var(--bs-dropdown-divider-margin-y) 0;
    overflow: hidden;
    border-top: 1px solid var(--bs-dropdown-divider-bg);
    opacity: 1;
}

/* 16.8 Dropdown Header - Intestazione sezione */
.dropdown-header {
    display: block;
    padding: var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);
    margin-bottom: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-dropdown-header-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* 16.9 Dropdown Menu - Posizionamento */
.dropdown-menu-start {
    --bs-position: start;
}

.dropdown-menu-start[data-bs-popper] {
    right: auto;
    left: 0;
}

.dropdown-menu-end {
    --bs-position: end;
}

.dropdown-menu-end[data-bs-popper] {
    right: 0;
    left: auto;
}

/* 16.10 Dropdown Menu - Larghezze personalizzate */
.dropdown-menu-lg {
    min-width: 250px;
}

.dropdown-menu-xl {
    min-width: 320px;
}

/* 16.11 Dropdown Item Text */
.dropdown-item-text {
    display: block;
    padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
    color: var(--bs-dropdown-link-color);
}

/* 16.12 Dropdown Hover - Apertura al passaggio mouse */
.dropdown-hover {
    position: relative;
}

.dropdown-hover:hover > .dropdown-menu {
    display: block;
}

/* 16.13 Dropdown Menu User - Menu utente largo */
.dropdown-menu-user {
    min-width: 300px;
    right: 0;
    left: auto;
}

/* 16.14 Dropdown Menu Dark - Variante scura */
.dropdown-menu-dark {
    --bs-dropdown-color: #dee2e6;
    --bs-dropdown-bg: #343a40;
    --bs-dropdown-border-color: var(--bs-gray-700);
    --bs-dropdown-box-shadow: none;
    --bs-dropdown-link-color: #dee2e6;
    --bs-dropdown-link-hover-color: #fff;
    --bs-dropdown-divider-bg: var(--bs-gray-600);
    --bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.15);
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg: var(--bs-primary);
    --bs-dropdown-link-disabled-color: #adb5bd;
    --bs-dropdown-header-color: #adb5bd;
}

/* 16.15 Dropup, Dropend, Dropstart - Direzioni alternative */
.dropup .dropdown-menu[data-bs-popper] {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: var(--bs-dropdown-spacer);
}

.dropend .dropdown-menu[data-bs-popper] {
    top: 0;
    right: auto;
    left: 100%;
    margin-top: 0;
    margin-left: var(--bs-dropdown-spacer);
}

.dropstart .dropdown-menu[data-bs-popper] {
    top: 0;
    right: 100%;
    left: auto;
    margin-top: 0;
    margin-right: var(--bs-dropdown-spacer);
}

/* 16.16 Dropdown con icone - Spaziatura icona */
.dropdown-item i,
.dropdown-item .ki-outline,
.dropdown-item [class*="ki-"] {
    font-size: 1.15rem;
    margin-right: 0.5rem;
    color: var(--bs-gray-500);
    transition: color 0.2s ease;
}

.dropdown-item:hover i,
.dropdown-item:hover .ki-outline,
.dropdown-item:hover [class*="ki-"] {
    color: var(--bs-primary);
}

.dropdown-item.active i,
.dropdown-item.active .ki-outline,
.dropdown-item.active [class*="ki-"] {
    color: var(--bs-primary);
}

/* --------------------------------------------------------------------------
   17. NAV TABS - Stile allineato a MiaDelega (Metronic Theme)
   -------------------------------------------------------------------------- */

/* 17.1 Nav Line Tabs - Tab con linea sottile sotto */
.nav-line-tabs {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: var(--bs-gray-200);
}

.nav-line-tabs .nav-item {
    margin-bottom: -1px;
}

.nav-line-tabs .nav-item .nav-link {
    color: var(--bs-gray-700);
    border: 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    margin: 0 1rem;
}

.nav-line-tabs .nav-item:first-child .nav-link {
    margin-left: 0;
}

.nav-line-tabs .nav-item:last-child .nav-link {
    margin-right: 0;
}

.nav-line-tabs .nav-item .nav-link.active,
.nav-line-tabs .nav-item .nav-link:hover:not(.disabled),
.nav-line-tabs .nav-item.show .nav-link {
    background-color: transparent;
    border: 0;
    border-bottom: 1px solid var(--bs-primary);
    color: var(--bs-primary);
    transition: color 0.2s ease;
}

/* 17.2 Nav Line Tabs 2x - Variante con bordo piu' spesso */
.nav-line-tabs.nav-line-tabs-2x {
    border-bottom-width: 2px;
}

.nav-line-tabs.nav-line-tabs-2x .nav-item {
    margin-bottom: -2px;
}

.nav-line-tabs.nav-line-tabs-2x .nav-item .nav-link {
    border-bottom-width: 2px;
}

.nav-line-tabs.nav-line-tabs-2x .nav-item .nav-link.active,
.nav-line-tabs.nav-line-tabs-2x .nav-item .nav-link:hover:not(.disabled),
.nav-line-tabs.nav-line-tabs-2x .nav-item.show .nav-link {
    color: var(--bs-primary);
    border-bottom-width: 2px;
}

/* 17.3 Tab Content */
.tab-content > .tab-pane {
    display: none;
}

.tab-content > .tab-pane.active {
    display: block;
}

/* --------------------------------------------------------------------------
   18. SYMBOL/AVATAR - Stile allineato a MiaDelega (Metronic Theme)
   Componente per cerchi con iniziali utente o immagini avatar
   -------------------------------------------------------------------------- */

/* 18.1 Symbol Base - Contenitore principale (tondo di default) */
.symbol {
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
    vertical-align: middle;
}

.symbol .symbol-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--bs-gray-800);
    background-color: var(--bs-gray-100);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    border-radius: 50%;
}

.symbol.symbol-circle,
.symbol.symbol-circle .symbol-label {
    border-radius: 50%;
}

/* Per overflow hidden (utile per immagini) */
.symbol.overflow-hidden,
.symbol.overflow-hidden .symbol-label {
    overflow: hidden;
}

/* 18.2 Symbol Sizes - Dimensioni fisse */
.symbol.symbol-20px,
.symbol.symbol-20px .symbol-label {
    width: 20px;
    height: 20px;
}
.symbol.symbol-20px .symbol-label {
    font-size: 0.65rem;
}

.symbol.symbol-25px,
.symbol.symbol-25px .symbol-label {
    width: 25px;
    height: 25px;
}
.symbol.symbol-25px .symbol-label {
    font-size: 0.75rem;
}

.symbol.symbol-30px,
.symbol.symbol-30px .symbol-label {
    width: 30px;
    height: 30px;
}
.symbol.symbol-30px .symbol-label {
    font-size: 0.85rem;
}

.symbol.symbol-35px,
.symbol.symbol-35px .symbol-label {
    width: 35px;
    height: 35px;
}
.symbol.symbol-35px .symbol-label {
    font-size: 0.95rem;
}

.symbol.symbol-40px,
.symbol.symbol-40px .symbol-label {
    width: 40px;
    height: 40px;
}
.symbol.symbol-40px .symbol-label {
    font-size: 1rem;
}

.symbol.symbol-45px,
.symbol.symbol-45px .symbol-label {
    width: 45px;
    height: 45px;
}
.symbol.symbol-45px .symbol-label {
    font-size: 1.1rem;
}

.symbol.symbol-50px,
.symbol.symbol-50px .symbol-label {
    width: 50px;
    height: 50px;
}
.symbol.symbol-50px .symbol-label {
    font-size: 1.25rem;
}

.symbol.symbol-60px,
.symbol.symbol-60px .symbol-label {
    width: 60px;
    height: 60px;
}
.symbol.symbol-60px .symbol-label {
    font-size: 1.5rem;
}

.symbol.symbol-70px,
.symbol.symbol-70px .symbol-label {
    width: 70px;
    height: 70px;
}
.symbol.symbol-70px .symbol-label {
    font-size: 1.75rem;
}

.symbol.symbol-80px,
.symbol.symbol-80px .symbol-label {
    width: 80px;
    height: 80px;
}
.symbol.symbol-80px .symbol-label {
    font-size: 2rem;
}

.symbol.symbol-100px,
.symbol.symbol-100px .symbol-label {
    width: 100px;
    height: 100px;
}
.symbol.symbol-100px .symbol-label {
    font-size: 2.5rem;
}

/* 18.3 Symbol Responsive Sizes - Breakpoint md (>= 768px) */
@media (min-width: 768px) {
    .symbol.symbol-md-30px,
    .symbol.symbol-md-30px .symbol-label {
        width: 30px;
        height: 30px;
    }
    .symbol.symbol-md-30px .symbol-label {
        font-size: 0.85rem;
    }

    .symbol.symbol-md-35px,
    .symbol.symbol-md-35px .symbol-label {
        width: 35px;
        height: 35px;
    }
    .symbol.symbol-md-35px .symbol-label {
        font-size: 0.95rem;
    }

    .symbol.symbol-md-40px,
    .symbol.symbol-md-40px .symbol-label {
        width: 40px;
        height: 40px;
    }
    .symbol.symbol-md-40px .symbol-label {
        font-size: 1rem;
    }

    .symbol.symbol-md-45px,
    .symbol.symbol-md-45px .symbol-label {
        width: 45px;
        height: 45px;
    }
    .symbol.symbol-md-45px .symbol-label {
        font-size: 1.1rem;
    }

    .symbol.symbol-md-50px,
    .symbol.symbol-md-50px .symbol-label {
        width: 50px;
        height: 50px;
    }
    .symbol.symbol-md-50px .symbol-label {
        font-size: 1.25rem;
    }
}

/* 18.4 Symbol Responsive Sizes - Breakpoint lg (>= 992px) */
@media (min-width: 992px) {
    .symbol.symbol-lg-40px,
    .symbol.symbol-lg-40px .symbol-label {
        width: 40px;
        height: 40px;
    }
    .symbol.symbol-lg-40px .symbol-label {
        font-size: 1rem;
    }

    .symbol.symbol-lg-50px,
    .symbol.symbol-lg-50px .symbol-label {
        width: 50px;
        height: 50px;
    }
    .symbol.symbol-lg-50px .symbol-label {
        font-size: 1.25rem;
    }

    .symbol.symbol-lg-60px,
    .symbol.symbol-lg-60px .symbol-label {
        width: 60px;
        height: 60px;
    }
    .symbol.symbol-lg-60px .symbol-label {
        font-size: 1.5rem;
    }
}

/* 18.5 Symbol Label Color Variants - Testo colorato */
.symbol .symbol-label.text-primary { color: var(--bs-primary) !important; }
.symbol .symbol-label.text-success { color: var(--bs-success) !important; }
.symbol .symbol-label.text-info { color: var(--bs-info) !important; }
.symbol .symbol-label.text-warning { color: var(--bs-warning) !important; }
.symbol .symbol-label.text-danger { color: var(--bs-danger) !important; }
.symbol .symbol-label.text-dark { color: var(--bs-dark) !important; }
.symbol .symbol-label.text-light-primary { color: #E8EFFF !important; }

/* 18.6 Symbol Badge - Notifica su avatar */
.symbol .symbol-badge {
    position: absolute;
    border-radius: 50%;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
}

/* 18.7 Symbol Group - Gruppo di avatar sovrapposti */
.symbol-group {
    display: flex;
    align-items: center;
}

.symbol-group .symbol {
    margin-left: -10px;
    border: 2px solid #fff;
}

.symbol-group .symbol:first-child {
    margin-left: 0;
}

.symbol-group .symbol:hover {
    z-index: 1;
}

.symbol-group.symbol-hover .symbol:hover {
    transform: translateY(-3px);
    transition: transform 0.2s ease;
}

/* --------------------------------------------------------------------------
   19. METRONIC COMPATIBILITY - Classi per allineamento layout
   -------------------------------------------------------------------------- */

/* 19.1 Flex utilities aggiuntive */
.flex-root {
    flex: 1;
}

.flex-column-fluid {
    flex: 1 0 auto;
}

.flex-row-fluid {
    flex: 1 auto;
    min-width: 0;
}

/* 19.2 App Layout Structure */
.app-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-page {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.app-container {
    width: 100%;
    padding-right: var(--bs-gutter-x, 0.75rem);
    padding-left: var(--bs-gutter-x, 0.75rem);
    margin-right: auto;
    margin-left: auto;
}

/* 19.3 App Content Area */
.app-content {
    display: flex;
    flex-direction: column;
    flex: 1 auto;
    padding: 0;
}

/* 19.4 Scrolltop Button */
.scrolltop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-primary);
    color: #fff;
    border-radius: 0.65rem;
    box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.075);
    opacity: 0;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    z-index: 105;
    cursor: pointer;
}

.scrolltop:hover {
    background-color: #0095e8;
}

.scrolltop.show {
    display: flex;
    opacity: 1;
}

/* 19.5 Container Fluid senza padding */
.container-fluid.px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 19.6 Gap utilities */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }

@media (min-width: 992px) {
    .gap-lg-2 { gap: 0.5rem !important; }
    .gap-lg-5 { gap: 1.25rem !important; }
}

/* 19.7 Row g-5 */
.row.g-5 {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

/* 19.8 Header height fix e centratura verticale */
.app-header {
    min-height: 70px;
    display: flex;
    align-items: center;
}

/* 19.9 Sidebar width standardizzata */
@media (min-width: 992px) {
    .app-sidebar {
        width: 280px;
        min-width: 280px;
    }
}

/* 19.10 Content padding */
.app-content.flex-column-fluid {
    padding-top: 1.75rem;
}

@media (min-width: 992px) {
    .app-content.flex-column-fluid {
        padding-top: 2.5rem;
    }
}

/* 19.11 App Navbar */
.app-navbar {
    display: flex;
    align-items: center;
}

.app-navbar-item {
    display: flex;
    align-items: center;
}

/* 19.12 Text hover utilities */
.text-hover-primary:hover {
    color: var(--bs-primary) !important;
    transition: color 0.2s ease;
}

/* 19.13 Sidebar padding top - spazio sotto la topbar */
.app-sidebar-menu {
    padding-top: 1.5rem;
}

/* 19.14 User Menu Hover - Dropdown CSS puro */
.user-menu-hover {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    background-color: #fff;
    border: 1px solid var(--bs-gray-200);
    border-radius: 0.65rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1050;
}

.user-menu-hover:hover .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--bs-gray-700);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.user-menu-item:hover {
    background-color: var(--bs-gray-100);
    color: var(--bs-gray-900);
}

.user-menu-item.text-danger:hover {
    background-color: var(--bs-light-danger);
}

/* 19.15 Utility - Word break per hash e testi lunghi */
.text-break-all {
    word-break: break-all;
}

/* 19.16 Utility - Icona large per empty state */
.empty-state-icon {
    font-size: 4rem;
}

/* 19.17 Fix container wrapper - rimuovi padding sinistro per sidebar */
.app-wrapper > .app-container {
    padding-left: 0 !important;
}

/* 19.18 Fix sidebar - rimuovi spazio grigio a sinistra */
#kt_app_wrapper .app-sidebar {
    margin-left: 0 !important;
    border-left: none !important;
}

/* 19.19 Fix header container - allinea al bordo */
#kt_app_header .app-container {
    padding-left: 1rem;
}

/* --------------------------------------------------------------------------
   20. CHAT ASSISTENZA
   -------------------------------------------------------------------------- */

/* 20.1 Container chat con scroll */
.chat-container {
    max-height: 60vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 1rem;
}

@media (max-width: 768px) {
    .chat-container {
        max-height: 50vh;
    }
}

/* 20.2 Bolle chat - max-width responsive */
.chat-bubble {
    max-width: 75%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .chat-bubble {
        max-width: 85%;
    }
}

/* 20.3 Input area sticky */
.chat-input-area {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--bs-gray-200);
}

/* 20.4 Bottoni chat touch-friendly */
.chat-btn-attach,
.chat-btn-send {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 20.5 Badge non letti cerchio */
.badge-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0;
}

/* --------------------------------------------------------------------------
   21. UTILITIES AGGIUNTIVE
   -------------------------------------------------------------------------- */

/* 21.1 Symbol link - No underline on hover */
a.symbol:hover {
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   22. CARD PAGINAZIONE
   -------------------------------------------------------------------------- */

/* 22.1 Card item */
.card-pag-item {
    transition: opacity 0.3s ease;
}
.card-pag-item .card {
    border: 0;
    border-radius: 0.65rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
}
.card-pag-item .card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.10);
}

/* 22.2 Label e valori */
.card-pag-item .card-pag-label {
    font-size: 0.85rem;
    color: #6c757d;
}
.card-pag-item .card-pag-value {
    font-size: 1rem;
    font-weight: 600;
}
.card-pag-item .card-pag-importo {
    font-size: 1.15rem;
    font-weight: 700;
}

/* 22.3 Pulsante "Carica altri..." */
.btn-carica-altri {
    border: 1px dashed #0d6efd;
    background: transparent;
    color: #0d6efd;
    border-radius: 0.65rem;
    padding: 12px;
    width: 100%;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.btn-carica-altri:hover {
    background: rgba(13,110,253,0.05);
}

/* ========== Spiegazione AI markdown ========== */
.explanation-content h1,
.explanation-content h2,
.explanation-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}
.explanation-content h1:first-child,
.explanation-content h2:first-child,
.explanation-content h3:first-child {
    margin-top: 0;
}
.explanation-content ul,
.explanation-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.explanation-content p {
    margin-bottom: 0.5rem;
}
.explanation-content p:last-child {
    margin-bottom: 0;
}
