/* ==========================================================================
   SpedizioniPallet App Styles
   Glassmorphism Design System

   Contains page-specific and component styles.
   NOTE: variables.css and base.css are included directly in _Layout.cshtml
   ========================================================================== */

/* ==========================================================================
   PAGE BACKGROUNDS
   ========================================================================== */

/* Full page gradient background */
.bg-gradient-page {
    min-height: 100vh;
    background: linear-gradient(to bottom right, var(--color-bg-start), var(--color-bg-mid), var(--color-bg-end));
}

/* Auth pages background with 3D Italy map */
.bg-auth {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-mid) 50%, var(--color-bg-end) 100%);
    position: relative;
    overflow: hidden;
}

/* Three.js canvas container - full screen background */
#auth-background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: all;
}

#auth-background-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Soft gradient overlay for depth */
.bg-auth::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 30%, rgba(74, 93, 74, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 70%, rgba(139, 64, 32, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   AUTH PAGE LAYOUTS
   ========================================================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Aligned to LEFT */
    padding: 50px; /* 50px padding as requested */
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--glass-panel-bg);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-glass-raised);
    padding: 2.5rem;
    animation: slideUp var(--transition-slow) ease-out;
}

/* Responsive: full width on smaller screens */
@media (max-width: 1024px) {
    .auth-container {
        padding: 2rem;
    }
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 80px;
    width: auto;
}

.auth-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-terracotta) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(26, 46, 59, 0.3);
}

.auth-logo-icon .material-symbols-outlined {
    font-size: 2.5rem;
    color: white;
}

.auth-title {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--color-text);
}

.auth-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ==========================================================================
   RECAPTCHA STYLING
   ========================================================================== */
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.recaptcha-container .g-recaptcha {
    transform-origin: center;
}

/* ==========================================================================
   PASSWORD VISIBILITY TOGGLE
   ========================================================================== */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-text);
}

.password-toggle .material-symbols-outlined {
    font-size: 1.25rem;
}

/* ==========================================================================
   ENVIRONMENT BADGE (Development indicator)
   ========================================================================== */
.env-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-warning);
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   MODAL OVERLAY & GLASS MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--glass-overlay-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: var(--z-modal);
    animation: fadeIn var(--transition-fast) ease-out;
}

.modal-glass {
    background: var(--glass-panel-bg);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass-raised);
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp var(--transition-normal) ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* ==========================================================================
   SPINNER
   ========================================================================== */
.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border-input);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: var(--radius-xl);
    }

    .auth-logo img {
        height: 64px;
    }

    .auth-logo-icon {
        width: 56px;
        height: 56px;
    }

    .auth-logo-icon .material-symbols-outlined {
        font-size: 2rem;
    }

    .auth-title {
        font-size: var(--font-size-xl);
    }
}

/* ==========================================================================
   BLOCKED CONTENT STATE
   ========================================================================== */
.app-content.blocked {
    pointer-events: none;
    opacity: 0.5;
}

/* ==========================================================================
   BOOTSTRAP DISPLAY UTILITIES (compatibility)
   ========================================================================== */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-inline { display: inline !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-flex { display: flex !important; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-inline { display: inline !important; }
    .d-xl-flex { display: flex !important; }
}

/* ==========================================================================
   DATATABLE GLASSMORPHISM OVERRIDES - TEMPLATE STYLE
   ========================================================================== */
.dataTables_wrapper {
    font-family: var(--font-sans);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    padding: 0.625rem 1rem;
    background: var(--glass-card-bg);
    border: 1px solid var(--border-glass-subtle);
    border-radius: var(--radius-xl);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--color-terracotta);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-terracotta-light);
}

.dataTables_wrapper .dataTables_info {
    padding-top: 1rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.5rem 0.875rem;
    margin: 0 0.125rem;
    background: var(--glass-card-bg);
    border: 1px solid var(--border-glass-subtle);
    border-radius: var(--radius-xl);
    color: var(--color-text) !important;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--glass-hover-bg) !important;
    border-color: var(--border-input);
    color: var(--color-text) !important;
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-terracotta) !important;
    border-color: var(--color-terracotta);
    color: white !important;
    box-shadow: 0 4px 12px rgba(139, 64, 32, 0.25);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Table header sorting icons */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    opacity: 0.4;
}

table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:after {
    opacity: 1;
    color: var(--color-terracotta);
}

/* ==========================================================================
   SWEET ALERT GLASSMORPHISM - GLASS PANEL STYLE
   Structure: .swal2-popup > .swal2-icon, .swal2-title, .swal2-html-container, .swal2-actions
   ========================================================================== */

/* Backdrop */
.swal2-container {
    background: rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Main popup - GLASS PANEL using theme variables */
.swal2-popup {
    background: var(--glass-panel-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 1.5rem !important;
    box-shadow: var(--shadow-glass-raised) !important;
    padding: 2rem 1.5rem 1.5rem !important;
    overflow: visible !important;
    min-width: 380px !important;
    max-width: 420px !important;
}

/* Icon - centered with glass badge */
.swal2-icon {
    margin: 0 auto 1rem auto !important;
    width: 64px !important;
    height: 64px !important;
    background: var(--glass-card-bg) !important;
    box-shadow: var(--shadow-card) !important;
}

/* Question icon */
.swal2-icon.swal2-question {
    color: var(--color-terracotta) !important;
    border: 2px solid var(--color-terracotta) !important;
}

/* Info icon */
.swal2-icon.swal2-info {
    color: #3b82f6 !important;
    border: 2px solid #3b82f6 !important;
}

/* Success icon */
.swal2-icon.swal2-success {
    border: 3px solid var(--color-success) !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%) !important;
    box-shadow:
        0 0 20px rgba(34, 197, 94, 0.2),
        inset 0 0 15px rgba(34, 197, 94, 0.1) !important;
}
.swal2-icon.swal2-success .swal2-success-line-tip,
.swal2-icon.swal2-success .swal2-success-line-long {
    background: var(--color-success) !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(34, 197, 94, 0.4) !important;
}
.swal2-icon.swal2-success .swal2-success-circular-line-left,
.swal2-icon.swal2-success .swal2-success-circular-line-right {
    background: transparent !important;
}
.swal2-icon.swal2-success .swal2-success-fix {
    background: transparent !important;
}

/* Warning icon */
.swal2-icon.swal2-warning {
    color: #f59e0b !important;
    border: 2px solid #f59e0b !important;
}

/* Error icon */
.swal2-icon.swal2-error {
    border: 2px solid var(--color-error) !important;
}
.swal2-icon.swal2-error .swal2-x-mark-line-left,
.swal2-icon.swal2-error .swal2-x-mark-line-right {
    background: var(--color-error) !important;
}

/* Title - centered */
.swal2-title {
    color: var(--color-text) !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

/* Body/message */
.swal2-html-container {
    padding: 0 !important;
    margin: 0 0 1.5rem 0 !important;
    color: var(--color-text-secondary) !important;
    font-size: 0.925rem !important;
    line-height: 1.6 !important;
    text-align: center !important;
}

/* Actions/Footer - buttons */
.swal2-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 1rem 0 0 0 !important;
    margin: 0 !important;
    border-top: 1px solid var(--border-divider) !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

/* When cancel button is visible, spread buttons apart */
.swal2-actions:has(.swal2-cancel:not([style*="display: none"])) {
    justify-content: space-between !important;
}

/* Hide deny and cancel buttons completely when they have display:none style */
.swal2-deny[style*="display: none"],
.swal2-cancel[style*="display: none"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    visibility: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Cancel button - GLASS BUTTON (left side) */
.swal2-cancel {
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(240,235,225,0.8)) !important;
    border: 1px solid rgba(200, 190, 170, 0.8) !important;
    border-bottom: 2px solid rgba(170, 160, 140, 0.8) !important;
    box-shadow: 0 4px 6px -1px rgba(60, 50, 40, 0.1) !important;
    color: #4a4a3a !important;
    border-radius: 0.75rem !important;
    font-weight: 700 !important;
    font-size: var(--font-size-sm) !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.1s !important;
    order: 1 !important;
    margin-right: auto !important;
}

.swal2-cancel:hover {
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(250,245,235,0.9)) !important;
    color: #1a2e3b !important;
}

.swal2-cancel:active {
    transform: translateY(1px) !important;
    border-bottom-width: 1px !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08) !important;
}

/* Confirm button - PRIMARY (terracotta) - GLASS STYLE */
.swal2-confirm {
    background: linear-gradient(to bottom, var(--color-terracotta), #7a3a1a) !important;
    border: 1px solid rgba(139, 64, 32, 0.8) !important;
    border-bottom: 2px solid rgba(100, 45, 20, 0.9) !important;
    box-shadow: 0 4px 6px -1px rgba(139, 64, 32, 0.3) !important;
    color: white !important;
    border-radius: 0.75rem !important;
    font-weight: 700 !important;
    font-size: var(--font-size-sm) !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.1s !important;
    order: 2 !important;
}

.swal2-confirm:hover {
    background: linear-gradient(to bottom, var(--color-terracotta-hover), #8a4520) !important;
}

.swal2-confirm:active {
    transform: translateY(1px) !important;
    border-bottom-width: 1px !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15) !important;
}

/* Success confirm button - usa customClass: { confirmButton: 'swal2-success-btn' } */
.swal2-confirm.swal2-success-btn {
    background: linear-gradient(to bottom, var(--color-success), #15803d) !important;
    border: 1px solid rgba(34, 197, 94, 0.8) !important;
    border-bottom: 2px solid rgba(21, 128, 61, 0.9) !important;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.3) !important;
}

.swal2-confirm.swal2-success-btn:hover {
    background: linear-gradient(to bottom, #22c55e, #16a34a) !important;
}

/* Danger confirm button - usa customClass: { confirmButton: 'swal2-danger' } */
.swal2-confirm.swal2-danger {
    background: linear-gradient(to bottom, #dc2626, #b91c1c) !important;
    border: 1px solid rgba(185, 28, 28, 0.8) !important;
    border-bottom: 2px solid rgba(153, 27, 27, 0.9) !important;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3) !important;
}

.swal2-confirm.swal2-danger:hover {
    background: linear-gradient(to bottom, #ef4444, #dc2626) !important;
}

/* Deny button */
.swal2-deny {
    background: #dc2626 !important;
    color: white !important;
    border: none !important;
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    padding: 0.625rem 1.25rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3) !important;
}

.swal2-deny:hover {
    background: #b91c1c !important;
    transform: translateY(-1px) !important;
}

/* Input fields - glass input */
.swal2-input,
.swal2-textarea,
.swal2-select {
    background: var(--glass-input-bg) !important;
    border: 1px solid var(--border-input) !important;
    border-radius: 0.75rem !important;
    color: var(--color-text) !important;
    font-size: 0.925rem !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.2s ease !important;
    margin: 0.75rem 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: var(--color-terracotta) !important;
    box-shadow: 0 0 0 3px rgba(139, 64, 32, 0.1) !important;
    outline: none !important;
}

.swal2-input::placeholder {
    color: var(--color-text-muted) !important;
}

/* Validation message */
.swal2-validation-message {
    background: var(--color-error-light) !important;
    color: var(--color-error) !important;
    border-radius: 0.5rem !important;
    padding: 0.625rem 1rem !important;
    margin: 0.5rem 0 !important;
    font-size: 0.85rem !important;
}

/* Close button - hidden */
.swal2-close {
    display: none !important;
}

/* Animation */
.swal2-popup.swal2-show {
    animation: swalGlassShow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes swalGlassShow {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Timer progress bar */
.swal2-timer-progress-bar {
    background: var(--color-terracotta) !important;
}

/* ==========================================================================
   TOASTR GLASSMORPHISM OVERRIDES - TEMPLATE STYLE
   ========================================================================== */
/* Toast - Glass style - override toastr defaults */
.toast,
.toast-success,
.toast-error,
.toast-warning,
.toast-info,
#toast-container > div,
#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-warning,
#toast-container > .toast-info {
    background: rgba(255, 255, 255, 0.98) !important;
    background-image: none !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    padding: 1rem 2.5rem 1rem 1rem !important;
    opacity: 1 !important;
    color: var(--color-text) !important;
}

/* Toast types - border color */
#toast-container > .toast-success {
    border-left: 4px solid var(--color-success) !important;
}

#toast-container > .toast-error {
    border-left: 4px solid var(--color-error) !important;
}

#toast-container > .toast-warning {
    border-left: 4px solid #f59e0b !important;
}

#toast-container > .toast-info {
    border-left: 4px solid var(--color-terracotta) !important;
}

/* Toast text */
#toast-container .toast-title {
    color: var(--color-text) !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
}

#toast-container .toast-message {
    color: var(--color-text) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

/* Close button - compact, vertically centered */
#toast-container .toast-close-button {
    color: var(--color-text-muted) !important;
    font-size: 1rem !important;
    font-weight: 300 !important;
    opacity: 0.5 !important;
    text-shadow: none !important;
    position: absolute !important;
    right: 0.5rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    line-height: 18px !important;
    text-align: center !important;
}

#toast-container .toast-close-button:hover {
    opacity: 1 !important;
    color: var(--color-error) !important;
}

/* Slide in/out animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

#toast-container > div {
    animation: toastSlideIn 0.3s ease-out forwards !important;
}

#toast-container > div.toast-hidden,
#toast-container > div[style*="display: none"] {
    animation: toastSlideOut 0.3s ease-in forwards !important;
}

/* ==========================================================================
   SELECT2 GLASSMORPHISM OVERRIDES - TEMPLATE STYLE
   ========================================================================== */
.select2-container--default .select2-selection--single {
    background: rgb(255 255 255 / 54%);
  
    border: 1px solid rgba(160, 140, 110, 0.25);;
    border-radius: 1rem !important;
    height: 44px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px !important;
    color: var(--color-text) !important;
    padding-left: 1rem;
    font-size: var(--font-size-sm);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
    right: 0.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--color-terracotta) transparent transparent transparent !important;
}

/* .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--color-terracotta) !important;
    box-shadow: 0 0 0 3px var(--color-terracotta-light);
} */

.select2-dropdown {
    background: var(--glass-panel-bg) !important;
    border: 1px solid var(--border-glass-subtle) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-glass-raised) !important;
    margin-top: 4px;
}

.select2-container--default .select2-results__option {
    padding: 0.625rem 1rem;
    font-size: var(--font-size-sm);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--color-terracotta) !important;
    color:white !important;
}

.select2-container--default .select2-results__option--selected {
    background: var(--color-terracotta-light) !important;
   
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--glass-card-bg);
    border: 1px solid var(--border-glass-subtle);
    border-radius: var(--radius-lg);
    padding: 0.625rem 1rem;
    font-size: var(--font-size-sm);
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--color-terracotta);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-terracotta-light);
}

/* Multiple select */
.select2-container--default .select2-selection--multiple {
    background: var(--glass-card-bg) !important;
    border: 1px solid var(--border-glass-subtle) !important;
    border-radius: var(--radius-xl) !important;
    min-height: 44px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--color-terracotta-light) !important;
    border: 1px solid var(--color-terracotta) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--color-terracotta) !important;
    font-size: var(--font-size-xs);
    padding: 0.25rem 0.5rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--color-terracotta) !important;
}

/* ==========================================================================
   DASHBOARD COMPONENTS
   ========================================================================== */

/* Dashboard Grid - 4 columns responsive */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Stats Card */
.stats-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem !important;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: currentColor;
    opacity: 0.05;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stats-card:hover::before {
    transform: scale(1.2);
    opacity: 0.08;
}

.stats-card-icon-wrapper {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stats-card-icon-wrapper.bg-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
}

.stats-card-icon-wrapper.bg-success {
    background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
    color: white;
}

.stats-card-icon-wrapper.bg-warning {
    background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark));
    color: white;
}

.stats-card-icon-wrapper.bg-error {
    background: linear-gradient(135deg, var(--color-error), var(--color-error-dark));
    color: white;
}

.stats-card-icon-wrapper .material-symbols-outlined {
    font-size: 2rem;
}

.stats-card-content {
    flex: 1;
    min-width: 0;
}

.stats-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stats-card-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stats-card-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.stats-card-trend .material-symbols-outlined {
    font-size: 1rem;
}

.trend-up {
    color: var(--color-success);
}

.trend-down {
    color: var(--color-error);
}

.trend-neutral {
    color: var(--color-warning);
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--glass-card-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    text-align: center;
}

.quick-action-btn:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--color-text);
}

.quick-action-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.quick-action-icon.bg-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.quick-action-icon.bg-success {
    background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
}

.quick-action-icon.bg-warning {
    background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark));
}

.quick-action-icon.bg-info {
    background: linear-gradient(135deg, var(--color-info), var(--color-info-dark));
}

/* Notification List */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--glass-card-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.notification-item:hover {
    background: var(--glass-hover-bg);
    border-color: var(--border-input);
}

.notification-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.notification-icon.bg-success {
    background: var(--color-success);
}

.notification-icon.bg-warning {
    background: var(--color-warning);
}

.notification-icon.bg-error {
    background: var(--color-error);
}

.notification-icon.bg-info {
    background: var(--color-info);
}

.notification-icon .material-symbols-outlined {
    font-size: 1.25rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.notification-text {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Destination List */
.destination-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.destination-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.destination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.destination-city {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
}

.destination-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.destination-bar {
    height: 8px;
    background: var(--glass-card-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.destination-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Mini Tabs for Dashboard */
.glass-tabs-mini {
    display: flex;
    gap: 0.5rem;
    background: var(--glass-card-bg);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
}

.glass-tab-mini-btn {
    padding: 0.375rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.glass-tab-mini-btn:hover {
    background: var(--glass-hover-bg);
    color: var(--color-text);
}

.glass-tab-mini-btn.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   PROFESSIONAL DATATABLES - Template Style
   ========================================================================== */

/* Table responsive wrapper with professional glass effect */
.table-responsive-glass {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

/* Professional DataTable with border-separate and row spacing - EXACT from template */
.table-responsive-glass table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 0.75rem !important; /* border-spacing-y-3 = 0.75rem */
}

/* Table header styling - uppercase, tracking-wide, EXTRABOLD */
.table-responsive-glass table thead tr {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800; /* extrabold from template */
    letter-spacing: 0.05em;
    color: var(--color-sandy-beige-800);
}

.dark .table-responsive-glass table thead tr {
    color: var(--color-sandy-beige-300);
}

.table-responsive-glass table thead th {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 0.5rem;
    text-align: left;
    background: transparent;
    border: none;
}

/* Table body rows with glass effect and hover animation */
.table-responsive-glass table tbody tr {
    transition: all 0.3s ease;
}

.table-responsive-glass table tbody tr:hover {
    transform: translateY(-2px);
}

/* Table cells with professional glass effect - EXACT from template */
.table-responsive-glass table tbody td {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    padding: 1rem;
    transition: all 0.3s ease;
}

/* First cell - left rounded border with extra padding */
.table-responsive-glass table tbody td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    padding-left: 1.5rem;
}

/* Last cell - right rounded border with extra padding */
.table-responsive-glass table tbody td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    border-top-right-radius: 1rem;
    border-bottom-right-radius: 1rem;
    padding-right: 1.5rem;
}

/* Hover effect on cells - EXACT from template */
.table-responsive-glass table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.9);
}

/* Shadow on hover for first and last cells only */
.table-responsive-glass table tbody tr:hover td:first-child {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

.table-responsive-glass table tbody tr:hover td:last-child {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

/* Dark mode support - EXACT from template */
.dark .table-responsive-glass table tbody td {
    background: rgba(74, 93, 74, 0.6);
    border-top: 1px solid rgba(47, 76, 47, 0.5);
    border-bottom: 1px solid rgba(47, 76, 47, 0.5);
}

.dark .table-responsive-glass table tbody td:first-child {
    border-left: 1px solid rgba(47, 76, 47, 0.5);
}

.dark .table-responsive-glass table tbody td:last-child {
    border-right: 1px solid rgba(47, 76, 47, 0.5);
}

.dark .table-responsive-glass table tbody tr:hover td {
    background: rgba(74, 93, 74, 0.8);
}

/* Action buttons container */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

/* Individual action button - EXACT from template */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: var(--color-sandy-beige-600);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.action-btn:hover {
    background: rgba(26, 46, 59, 0.1);
    color: var(--color-deep-blue-accent);
}

.action-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Action button variants */
.action-btn-view:hover {
    background: rgba(26, 46, 59, 0.1);
    color: var(--color-deep-blue-accent);
}

.action-btn-edit:hover {
    background: rgba(74, 93, 74, 0.1);
    color: var(--color-muted-green-800);
}

.action-btn-delete:hover {
    background: rgba(139, 64, 32, 0.1);
    color: var(--color-terracotta);
}

.action-btn-info:hover {
    background: rgba(179, 98, 18, 0.1);
    color: var(--color-natural-ochre);
}

/* Avatar circle with gradient - EXACT from template (w-9 h-9) */
.avatar-circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(to bottom right, var(--color-terracotta-200), var(--color-terracotta-100));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-terracotta-800);
    font-size: 11px;
    font-weight: 800; /* extrabold */
    border: 1px solid var(--color-terracotta-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Route visualization dots - EXACT from template (w-2.5 h-2.5) */
.route-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    border: 2px solid;
    background: white;
}

.route-dot-start,
.route-dot-origin {
    border-color: var(--color-muted-green-600);
}

.route-dot-end,
.route-dot-destination {
    border-color: var(--color-terracotta-600);
}

.route-line {
    height: 1.5rem; /* h-6 */
    border-left: 2px dashed var(--color-sandy-beige-400);
}

/* Professional badges for DataTables - EXACT from template */
.glass-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.glass-badge-primary {
    background: rgba(26, 46, 59, 0.1);
    color: var(--color-deep-blue-accent);
    border-color: rgba(26, 46, 59, 0.2);
}

.glass-badge-success {
    background: var(--color-muted-green-100);
    color: var(--color-muted-green-800);
    border-color: var(--color-muted-green-300);
}

.glass-badge-warning {
    background: rgba(179, 98, 18, 0.15);
    color: var(--color-natural-ochre);
    border-color: rgba(179, 98, 18, 0.4);
}

.glass-badge-error {
    background: var(--color-terracotta-50);
    color: var(--color-terracotta-700);
    border-color: var(--color-terracotta-200);
}

.glass-badge-info {
    background: rgba(26, 46, 59, 0.1);
    color: var(--color-deep-blue-accent);
    border-color: rgba(26, 46, 59, 0.2);
}

.glass-badge-secondary {
    background: var(--color-sandy-beige-100);
    color: var(--color-sandy-beige-800);
    border-color: var(--color-sandy-beige-300);
}

/* Badge with dot indicator */
.glass-badge .badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

/* Pulsing dot for "in transit" status */
.glass-badge .badge-dot-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* DataTables pagination override - EXACT from template */
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(210, 180, 140, 0.5);
    display: flex;
    align-items: center;
    justify-content: center; /* Centrata invece che space-between */
}

.dark .dataTables_wrapper .dataTables_paginate {
    border-top-color: rgba(47, 76, 47, 0.5);
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.75rem;
    color: var(--color-sandy-beige-800);
    font-weight: 600;
}

.dark .dataTables_wrapper .dataTables_info {
    color: var(--color-sandy-beige-300);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-sandy-beige-800);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: white;
    color: var(--color-deep-blue-accent);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-deep-blue-accent);
    color: white;
    box-shadow: 0 4px 6px rgba(26, 46, 59, 0.2);
    font-weight: 800;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(74, 93, 74, 0.5);
    color: var(--color-sandy-beige-200);
    border-color: var(--color-muted-green-600);
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(74, 93, 74, 0.7);
    color: var(--color-natural-ochre);
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-natural-ochre);
    box-shadow: 0 4px 6px rgba(179, 98, 18, 0.2);
}

/* Remove DataTables default borders */
.dataTables_wrapper table.dataTable {
    border: none !important;
}

.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable thead td {
    border-bottom: none !important;
}

.dataTables_wrapper table.dataTable tbody th,
.dataTables_wrapper table.dataTable tbody td {
    border: none !important;
}

/* Empty state for tables */
.table-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2rem;
}

.table-empty-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: #f6ebd8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-empty-icon .material-symbols-outlined {
    font-size: 2.5rem;
    color: var(--color-text-secondary);
}

.table-empty-text {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: var(--font-size-sm);
}
