/* =====================================================
   CONSENTIO - Design System
   Modern, Minimal & Clean UI
   ===================================================== */

/* =====================================================
   1. CSS VARIABLES - Design Tokens
   ===================================================== */
:root {
    /* Primary Colors - Arancio Consentio */
    --primary: #E35118;
    --primary-light: #F06A35;
    --primary-dark: #C44615;
    --primary-bg: rgba(227, 81, 24, 0.08);

    /* Secondary Colors */
    --secondary: #64748b;
    --secondary-light: #94a3b8;
    --secondary-dark: #475569;
--bs-light-rgb:245, 245, 246;
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;

    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Background & Surface */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;

    /* Text Colors */
    --text-primary: #000000;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Border */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
}

/* CRITICAL: Force submenu dark background immediately to prevent color flash */
.deznav .metismenu ul {
    background: rgba(0, 0, 0, 0.15) !important;
    background-color: rgba(0, 0, 0, 0.15) !important;
}

/* =====================================================
   2. BASE STYLES
   ===================================================== */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-color: var(--bg-body);
}
code{background-color: transparent!important;}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#main-wrapper, body {
    background-color: transparent;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

p, li {
    line-height: 1.6;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

/* =====================================================
   3. TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.h4, h4 {
    font-size: 1.25rem;
}

/* .text-muted {
    color: var(--text-muted) !important;
} */

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

/* =====================================================
   4. LAYOUT - Header & Navigation
   ===================================================== */
.nav-header {
    background-color: var(--gray-800) !important;
    border-right: 1px solid var(--gray-700);
}

.nav-header .brand-logo {
    background-color: #0a0a0a;
}

.logo_header {
    width: 100%;
    transition: width var(--transition-base);
    max-width: 300px!important;
}

/* Logo sidebar: mostra logo completo di default, icona quando compresso */
.logo_header.logo-full {
    display: block;
    max-width: 180px;
    height: auto;
}

.logo_header.logo-icon {
    display: none;
    width: 40px;
    height: auto;
}

/* Quando sidebar è compressa (menu-toggle) */
.menu-toggle .logo_header.logo-full {
    display: none !important;
}

.menu-toggle .logo_header.logo-icon {
    display: block !important;
    width: 40px !important;
}

/* Supporto per data-sidebar-style="mini" */
[data-sidebar-style="mini"] .logo_header.logo-full {
    display: none !important;
}

[data-sidebar-style="mini"] .logo_header.logo-icon {
    display: block !important;
    width: 40px !important;
}

.header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

[data-header-position="fixed"] .header {
    height: 70px;
}

[data-header-position="fixed"] .content-body {
    padding-top: 4.5rem;
}

.header-info2 svg {
    width: 28px;
    height: 28px;
    margin-left: 8px;
}

.header-info2 h4 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* =====================================================
   5. SIDEBAR
   ===================================================== */
/* Force dark sidebar background */
.deznav,
.nav-header {
    background-color: #0a0a0a !important;
}

/* Submenu background */
.deznav .metismenu ul,
.deznav .metismenu li ul,
.deznav .metismenu li > ul {
    background: rgba(0, 0, 0, 0.15) !important;
    background-color: rgba(0, 0, 0, 0.15) !important;
}
[data-sidebar-style="full"][data-layout="vertical"] .deznav .metismenu > li > a{margin-bottom: 0!important;}
/* Remove all background colors from menu items (no more "arlecchino" effect) */
.deznav .metismenu > li > a[style],
.deznav .metismenu > li > a {
    background: transparent !important;
    background-color: transparent !important;
    color: #ffffff !important;
    display: flex;
    align-items: center !important;
    gap: 5px;
}
.deznav .metismenu a{
        color: #ffffff !important;

}

.deznav .metismenu > li{
    margin: 0px 0;
    padding: 0 1rem !important;
}
.deznav .metismenu > li > a {
    padding: 0.875rem 1.25rem;
    margin: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    background: transparent !important;
}

.deznav .metismenu > li > a:hover {
    background-color: rgba(227, 81, 24, 0.15) !important;
}

.deznav .metismenu > li.mm-active > a,
[data-sidebarbg="color_2"] .deznav .metismenu > li.mm-active > a,
[data-sidebarbg="color_2"][data-sidebar-style="full"][data-layout="vertical"] .deznav .metismenu > li.mm-active > a,
[data-sidebarbg="color_2"][data-sidebar-style="mini"] .deznav .metismenu > li.mm-active > a,
[data-sidebarbg="color_2"][data-sidebar-style="modern"] .deznav .metismenu > li.mm-active > a {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(227, 81, 24, 0.3);
}

/* Override framework hover styles */
[data-sidebarbg="color_2"] .deznav .metismenu > li:hover > a,
[data-sidebarbg="color_2"][data-sidebar-style="mini"] .deznav .metismenu > li:hover > a,
[data-sidebarbg="color_2"][data-sidebar-style="modern"] .deznav .metismenu > li:hover > a,
[data-sidebarbg="color_2"][data-sidebar-style="full"] .deznav .metismenu > li:hover > a {
    background: rgba(227, 81, 24, 0.15) !important;
}

/* Remove the white :after line from menu items */
[data-sidebarbg="color_2"] .deznav .metismenu > li:after,
[data-sidebarbg="color_2"][data-theme-version="dark"] .deznav .metismenu > li:after {
    background: transparent !important;
    display: none !important;
}

.deznav .metismenu > li.mm-active > a .menu-icon,
.deznav .metismenu > li.mm-active > a svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.deznav .metismenu > li.mm-active > a .nav-text {
    color: #ffffff !important;
}

.deznav .metismenu > li > a .menu-icon {
    width: 24px;
    height: 24px;
    line-height: 24px;
}

.deznav .metismenu > li > a .nav-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Submenu background - force dark with no transition to avoid flash */
.deznav .metismenu ul,
.deznav .metismenu ul.mm-collapse,
.deznav .metismenu ul.mm-collapse.mm-show,
.deznav .metismenu ul.mm-collapsing,
.deznav .metismenu li ul,
.deznav .metismenu li > ul,
[data-sidebarbg] .deznav .metismenu ul,
[data-sidebarbg] .deznav .metismenu li ul,
[data-sidebarbg] .deznav .metismenu li > ul,
[data-sidebarbg] .menu-toggle .deznav .metismenu li > ul,
[data-sidebarbg][data-sidebar-style] .deznav .metismenu li ul,
[data-primary] .deznav .metismenu ul,
[data-primary] .deznav .metismenu li ul {
    background-color: rgba(0, 0, 0, 0.15) !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin: 0 0.75rem;
    padding: 0.5rem 0;
    transition: none !important;
}

/* Override any inline styles on submenu containers */
.deznav .metismenu ul[style],
.deznav .metismenu ul.mm-collapse[style],
.deznav .metismenu ul.mm-show[style],
[data-sidebarbg] .deznav .metismenu ul[style],
[data-sidebarbg] .deznav .metismenu li ul[style],
[data-primary] .deznav .metismenu ul[style] {
    background-color: rgba(0, 0, 0, 0.15) !important;
    background: rgba(0, 0, 0, 0.15) !important;
    transition: none !important;
}

.deznav .metismenu ul li a {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    font-size: 0.8125rem;
    background: transparent !important;
}

.deznav .metismenu ul li a:hover {
    color: var(--primary) !important;
}

.deznav .metismenu ul li.mm-active > a {
    color: var(--primary) !important;
    font-weight: 600;
}

/* Hamburger */
.hamburger .line {
    height: 2px;
    background-color: var(--gray-400);
    opacity: 1 !important;
}

.hamburger svg {
    display: none;
}

@media only screen and (min-width: 48rem) {
    [data-sidebar-style="mini"] .deznav .metismenu > li > a {
        padding: 0.825rem 0.2rem;
        text-align: center;
        line-height: 1;
        transition: all 0.5s;
        -moz-transition: all 0.5s;
        -webkit-transition: all 0.5s;
        -ms-transition: all 0.5s;
        -o-transition: all 0.5s;
    }
}


/* =====================================================
   6. CONTENT AREA
   ===================================================== */
.content-body .container {
  margin-top: 2.5rem; }

.content-body .container-fluid, .content-body .container-sm, .content-body .container-md, .content-body .container-lg, .content-body .container-xl, .content-body .container-xxl {
  padding-top: 1.875rem;
  padding-right: 1.875rem;
  padding-left: 1.875rem; }
  @media only screen and (max-width: 75rem) {
    .content-body .container-fluid, .content-body .container-sm, .content-body .container-md, .content-body .container-lg, .content-body .container-xl, .content-body .container-xxl {
      padding-top: 1.875rem;
      padding-right: 1.875rem;
      padding-left: 1.875rem; } }
  @media only screen and (max-width: 47.9375rem) {
    .content-body .container-fluid, .content-body .container-sm, .content-body .container-md, .content-body .container-lg, .content-body .container-xl, .content-body .container-xxl {
      padding-top: 1.25rem;
      padding-right: 1.25rem;
      padding-left: 1.25rem; } }
  @media only screen and (max-width: 35.9375rem) {
    .content-body .container-fluid, .content-body .container-sm, .content-body .container-md, .content-body .container-lg, .content-body .container-xl, .content-body .container-xxl {
      padding-top: 0.9375rem;
      padding-right: 0.9375rem;
      padding-left: 0.9375rem; } }

/* =====================================================
   7. CARDS
   ===================================================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: auto;
    transition: box-shadow var(--transition-base);
        height: auto;
    min-height: auto;
    overflow: auto;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header h4,
.card-header h5,
.card-header .card-title {
    /* color: var(--text-primary); */
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0;
}

.card-body {
    padding: var(--space-5);
    color: var(--text-primary) !important;
}

/* Stat Cards - Dashboard */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger,
.card.bg-info,
.card.bg-secondary {
    border: none;
    box-shadow: var(--shadow-md);
}

.card.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%) !important;
}

.card.bg-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%) !important;
}

.card.bg-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%) !important;
}

/* Card Footer */
.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: var(--space-3) var(--space-5);
}

/* =====================================================
   8. BUTTONS
   ===================================================== */
.btn {
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    border-width: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-xs {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
    font-weight: 600;
    border-radius: 0.3rem;
}
.btn:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white !important;
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: white !important;
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white !important;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white !important;
}

/* Fix per btn-check checked + hover */
.btn-check:checked + .btn.btn-outline-primary,
.btn-check:checked + .btn.btn-outline-primary:hover,
.btn-check:checked + .btn.btn-outline-primary:focus {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.btn-check:checked + .btn.btn-outline-secondary,
.btn-check:checked + .btn.btn-outline-secondary:hover,
.btn-check:checked + .btn.btn-outline-secondary:focus {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: white !important;
}

.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
    border-width: 1px;
}

.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover {
    color: white !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem;
    border-radius: var(--radius-lg) !important;
}

.btn .material-symbols-outlined {
    font-size: 18px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 18;
}

/* =====================================================
   9. FORMS
   ===================================================== */
.form-control {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    height: auto;
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-bg);
    color: var(--text-primary) !important;
}

.form-control:hover:not(:focus) {
    border-color: var(--gray-400) !important;
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-check {
    font-size: 0.875rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    min-height: auto;
}

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

.form-control.is-invalid {
    border-color: var(--danger) !important;
}

/* Select2 */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 42px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0.5rem 1rem !important;
    line-height: 1.5;
    color: var(--text-primary);
    font-size: 0.9375rem;
}
h5{
    /* display: flex;
    align-items: center !important; */
}
/* =====================================================
   10. TABLES
   ===================================================== */
.table {
    color: var(--text-primary);
    font-size: 0.875rem;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
}
.card-body>.table-responsive>.table {
    border-radius: 0!important;
}

.table thead {
    background-color: var(--primary);
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem !important;
    font-size: 0.875rem !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

table.dataTable {
    width: 100% !important;
}

table.dataTable tbody td,
table.dataTable thead th {
    font-size: 0.875rem !important;
}

/* DataTables Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-md);
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate span .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

/* DataTables Previous/Next Arrows */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-size: 0;
    padding: 0.5rem 0.75rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous::before {
    content: '\2039';
    font-size: 1.25rem;
    line-height: 1;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.next::before {
    content: '\203A';
    font-size: 1.25rem;
    line-height: 1;
}

/* =====================================================
   11. BADGES
   ===================================================== */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-full);
}

.badge.bg-primary {
    background-color: var(--primary) !important;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: white;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
}

.badge.bg-secondary {
    background-color: var(--secondary) !important;
}

/* Light Badges */
.light.badge-success {
    background-color: var(--success-light);
    color: #065f46;
}

.light.badge-warning,
.bg-warning-light {
    background-color: var(--warning-light);
    color: #92400e;
}

.light.badge-danger,
.bg-danger-light {
    background-color: var(--danger-light);
    color: #991b1b;
}

/* =====================================================
   12. ALERTS
   ===================================================== */
.alert {
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    padding: 0.875rem 1rem;
    border: none;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
}

.alert-info {
    background-color: var(--info-light);
    color: #0e7490;
}

.alert-primary {
    background-color: var(--primary-bg);
    color: var(--primary-dark);
}

/* Subscription Alert */
.subscription-info .alert {
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    border-radius: var(--radius-full);
}

.subscription-info .alert-success {
    background-color: var(--success);
    color: white;
}
.subscription-info .alert-success a{color: #ffffff!important;}

/* =====================================================
   13. MODALS
   ===================================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background-color: #0a0a0a !important;
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1rem 1.5rem;
}

.modal-header h2,
.modal-header .modal-title {
    color: white;
    font-size: 1.125rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.modal.fade.show::before {
    content: "";
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    opacity: 0 !important;
}

/* Fix modal scrollbar shift */
body.modal-open {
    padding-right: 0 !important;
    overflow: hidden;
}

.modal-open .header,
.modal-open .deznav,
.modal-open .nav-header {
    padding-right: 0 !important;
}

/* =====================================================
   14. NAVIGATION TABS
   ===================================================== */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem !important;
    border: none;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background-color: transparent;
    border-color: transparent;
    border-bottom: 2px solid var(--primary);
}

.tab-content > .tab-pane {
    margin-top: 1.25rem;
}

/* =====================================================
   15. ICONS
   ===================================================== */
.material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.deznav .metismenu > li > a .material-symbols-outlined {
    font-size: 22px;
}

button .material-symbols-outlined,
.btn .material-symbols-outlined {
    font-size: 18px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 18;
    vertical-align: middle;
}

/* =====================================================
   16. TOOLTIP & POPOVER
   ===================================================== */
.tooltip-inner {
    background-color: var(--gray-800);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

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

.popover-body {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

/* =====================================================
   17. LANGUAGE SELECTOR
   ===================================================== */
.language-selector a {
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.language-selector a:hover,
.language-selector a.active {
    opacity: 1;
}

/* =====================================================
   18. FOOTER
   ===================================================== */
.footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
}

.footer .copyright {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* =====================================================
   19. PRELOADER
   ===================================================== */
#preloader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: fixed;
    width: 100%;
    z-index: 999999;
    background-color: var(--bg-body);
}

#preloader .loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   20. DASHBOARD SPECIFIC
   ===================================================== */
.blocchi-dashboard .card {
    min-height: auto;
}

.blocchi-dashboard .material-symbols-outlined {
    font-size: 64px;
    opacity: 0.5;
}

/* Quick Action Buttons */
.btn-outline-primary.py-3,
.btn-outline-info.py-3,
.btn-outline-success.py-3,
.btn-outline-warning.py-3 {
    border-width: 1px;
    border-style: dashed;
    background-color: transparent;
    transition: all var(--transition-base);
}

.btn-outline-primary.py-3:hover {
    border-style: solid;
    transform: translateY(-2px);
    background-color: var(--primary) !important;
    color: white !important;
}

.btn-outline-info.py-3:hover {
    border-style: solid;
    transform: translateY(-2px);
    background-color: var(--info) !important;
    color: white !important;
}

.btn-outline-success.py-3:hover {
    border-style: solid;
    transform: translateY(-2px);
    background-color: var(--success) !important;
    color: white !important;
}

.btn-outline-warning.py-3:hover {
    border-style: solid;
    transform: translateY(-2px);
    background-color: var(--warning) !important;
    color: white !important;
}

.btn-outline-primary.py-3:hover .material-symbols-outlined,
.btn-outline-info.py-3:hover .material-symbols-outlined,
.btn-outline-success.py-3:hover .material-symbols-outlined,
.btn-outline-warning.py-3:hover .material-symbols-outlined {
    color: white !important;
}

/* =====================================================
   21. UTILITIES
   ===================================================== */
.text-white,
.text-white * {
    color: white !important;
}

.opacity-5 {
    opacity: 0.5;
}

.white-space-normal {
    white-space: normal !important;
}

.pos-rel {
    position: relative;
}

.small-text {
    font-size: 0.8125rem;
}

/* =====================================================
   22. RESPONSIVE
   ===================================================== */

/* Mobile: nasconde completamente la sidebar, mostra solo con menu-toggle */
@media only screen and (max-width: 991.98px) {
    .deznav {
        left: -100% !important;
        transition: left 0.3s ease;
    }

    /* Quando menu-toggle è presente, mostra la sidebar */
    .menu-toggle .deznav {
        left: 0 !important;
    }

    /* Content-body occupa tutto lo spazio su mobile */
    .content-body {
        margin-left: 0 !important;
    }

    /* Overlay quando sidebar è aperta su mobile */
    .menu-toggle::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .menu-toggle .deznav {
        z-index: 100;
    }
}

@media only screen and (max-width: 87.5rem) {


    .nav-control {
        right: -3.5rem;
        top: 28px;
    }
}

@media only screen and (max-width: 63.9375rem) {
    .nav-header {
        width: 70px;
    }
}

@media only screen and (max-width: 47.9375rem) {
    .header .header-content {
        padding-left: 70px;
    }

    .header-info2 .sidebar-info {
        display: none;
    }
}

@media (max-width: 768px) {
    h3, .h3 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: var(--space-4);
    }
}

/* =====================================================
   23. SELECT2 MODERN
   ===================================================== */
.select2-container .select2-selection--multiple {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 42px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
}

.select2-container--open {
    z-index: 9999;
}

.select2-dropdown {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* =====================================================
   24. DATEPICKER
   ===================================================== */
.picker__box {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.picker__select--month,
.picker__select--year {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* =====================================================
   25. TOASTR
   ===================================================== */
.toast-success {
    background-color: var(--success) !important;
}

.toast-error {
    background-color: var(--danger) !important;
}

.toast-warning {
    background-color: var(--warning) !important;
}

.toast-info {
    background-color: var(--info) !important;
}

#toast-container > div {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* =====================================================
   26. SWEETALERT2
   ===================================================== */
div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm {
    background-color: var(--primary);
    border-radius: var(--radius-md);
}

div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: var(--radius-xl);
}

/* =====================================================
   27. LOGIN PAGE
   ===================================================== */
body.login {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
}

body.login > .container-fluid::after {
    display: none;
}

.logo-login a {
    display: block;
    margin: 0 auto;
}

/* =====================================================
   28. CHART.JS CONTAINER FIX
   ===================================================== */
.chart-container {
    position: relative;
    height: 250px;
}

/* =====================================================
   29. SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* =====================================================
   30. ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* =====================================================
   31. CLICKABLE ROWS
   ===================================================== */
.clickable-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.clickable-row:hover {
    background-color: var(--gray-50);
}

.clickable-row:active {
    background-color: var(--gray-100);
}

/* =====================================================
   32. STATUS BADGES
   ===================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active {
    background-color: var(--success-light);
    color: #065f46;
}

.status-badge.active::before {
    background-color: var(--success);
}

.status-badge.pending {
    background-color: var(--warning-light);
    color: #92400e;
}

.status-badge.pending::before {
    background-color: var(--warning);
}

.status-badge.expired {
    background-color: var(--danger-light);
    color: #991b1b;
}

.status-badge.expired::before {
    background-color: var(--danger);
}

.btn-group {
    gap: 10px;
}

.input-group-text {
    margin-bottom: 0;
}


table.dataTable tbody td {
    border-bottom: 1px solid var(--border-color);
}

.input-group .btn{
    border-top-left-radius: 0!important;
    border-bottom-left-radius: 0!important;
}