@import url('./modules/ui-utilities.css');
@import url('./modules/viewer.css');
@import url('./modules/modal-shipment.css');

/* ─── FONT: Inter (self-hosted, GDPR compliant) ──────── */
/* latin-ext – caratteri estesi usati in alcune lingue europee */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                   U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                   U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin – caratteri ASCII + italiano + euro */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                   U+FEFF, U+FFFD;
}

/* ─── TOKENS ─────────────────────────────────────────── */
:root {
    --glass-tint: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-inner: rgba(255, 255, 255, 0.08);

    /* Primary Accents */
    --accent: #ffb84d;
    --accent2: #7fc8ff;
    --accent3: #ff6f91;
    --accent4: #6effc8;
    --accent5: #ff8c42;

    /* Semantic Colors */
    --accent-error: #ff6f91;
    --accent-success: #6effc8;
    --accent-warning: #ffb84d;
    --accent-info: #7fc8ff;

    /* Extended Palette */
    --color-error-light: rgba(255, 111, 145, 0.12);
    --color-error-border: rgba(255, 111, 145, 0.25);
    --color-success-light: rgba(110, 255, 200, 0.12);
    --color-success-border: rgba(110, 255, 200, 0.25);
    --color-warning-light: rgba(255, 184, 77, 0.12);
    --color-warning-border: rgba(255, 184, 77, 0.25);

    /* Text */
    --text: #f0f4ff;
    --text-muted: rgba(240, 244, 255, 0.65);
    --text-disabled: rgba(240, 244, 255, 0.35);

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

    /* Spacing & Radius */
    --radius-card: 28px;
    --radius-input: 14px;
    --radius-btn: 14px;

    /* Layout */
    --sidebar-w: 260px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.5);
}

/* ─── RESET ────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.02em;
    font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2rem); }
h3 { font-size: clamp(1.5rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h5 { font-size: clamp(1.1rem, 1.5vw, 1.25rem); }
h6 { font-size: clamp(1rem, 1vw, 1.1rem); }
p { font-size: clamp(0.95rem, 1.5vw, 1.05rem); line-height: 1.6; }

html {
    background-color: #020617;
    /* Sfondo scuro di base per evitare back-layer bianchi */
}

/* ─── BODY / AURORA ───────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    background:
        radial-gradient(circle at 15% 25%, rgba(0, 255, 180, 0.30), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(0, 150, 255, 0.30), transparent 55%),
        radial-gradient(circle at 50% 85%, rgba(160, 0, 255, 0.28), transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(255, 100, 80, 0.18), transparent 45%),
        linear-gradient(135deg, #020617, #0b1226 40%, #0f1a33 70%, #020617);
    background-size: 220% 220%;
    animation: auroraMove 20s ease-in-out infinite;
    will-change: background-position;
    display: flex;
}

@keyframes auroraMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ─── TEMI AGGIUNTIVI (IMPOSTAZIONI) ──────────────── */
body.theme-gray-dark {
    background:
        radial-gradient(circle at 15% 25%, rgba(100, 100, 100, 0.15), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(140, 140, 140, 0.10), transparent 55%),
        radial-gradient(circle at 50% 85%, rgba(70, 70, 70, 0.20), transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(120, 120, 120, 0.12), transparent 45%),
        linear-gradient(135deg, #111216, #1a1c23 40%, #20222b 70%, #111216);
    background-size: 220% 220%;
    animation: auroraMove 20s ease-in-out infinite;
}

/* ─── CUSTOM CHOICES UPPERCASE ───────────────────── */
.text-uppercase-choices,
.text-uppercase-choices option,
.text-uppercase-choices + .choices .choices__inner,
.text-uppercase-choices + .choices .choices__list,
.text-uppercase-choices + .choices .choices__item,
.text-uppercase-choices + .choices .choices__item--choice,
.text-uppercase-choices + .choices .choices__placeholder,
.text-uppercase-choices + .choices .choices__input,
.text-uppercase-input {
    text-transform: uppercase !important;
}

body.theme-custom-img {
    background: url('../img/custom_bg.jpg') center center / cover no-repeat fixed;
    animation: none;
    background-color: #1a1c23;
}

/* ─── TEMA: GRIGIO ASTRATTO ──────────────────────── */
body.theme-grigio {
    background:
        radial-gradient(circle at 15% 25%, rgba(100, 100, 100, 0.15), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(140, 140, 140, 0.10), transparent 55%),
        radial-gradient(circle at 50% 85%, rgba(70, 70, 70, 0.20), transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(120, 120, 120, 0.12), transparent 45%),
        linear-gradient(135deg, #1a1d24, #242832 40%, #2d3139 70%, #1a1d24);
    background-size: 220% 220%;
    color: #e8e8e8;
    animation: auroraMove 20s ease-in-out infinite;
    --text: #e8e8e8;
    --text-muted: rgba(232, 232, 232, 0.65);
    --glass-tint: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-inner: rgba(255, 255, 255, 0.10);
}

body.theme-grigio .sidebar {
    background: rgba(30, 32, 42, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-grigio .login-card,
body.theme-grigio .card,
body.theme-grigio .filter-bar,
body.theme-grigio .main-header {
    background: rgba(40, 42, 54, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.theme-grigio .nav-item {
    color: #e8e8e8;
}

body.theme-grigio .nav-item:hover:not(.active),
body.theme-grigio .nav-sub-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-grigio .nav-item.active,
body.theme-grigio .nav-sub-item.active {
    background: linear-gradient(135deg, rgba(127, 200, 255, 0.22), rgba(127, 200, 255, 0.08));
    box-shadow: 0 4px 12px rgba(127, 200, 255, 0.16), inset 0 0 0 1px rgba(127, 200, 255, 0.22);
    color: var(--accent2);
}

body.theme-grigio .table-spedizioni th {
    color: #e8e8e8;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.theme-grigio .table-spedizioni td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.theme-grigio .status-badge {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-grigio .form-control {
    background: rgba(40, 42, 54, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8e8e8;
}

body.theme-gray-light {
    background:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.80), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(200, 200, 200, 0.50), transparent 55%),
        radial-gradient(circle at 50% 85%, rgba(240, 240, 240, 0.60), transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(180, 180, 180, 0.40), transparent 45%),
        linear-gradient(135deg, #e4e7eb, #f0f2f5 40%, #ffffff 70%, #e4e7eb);
    background-size: 220% 220%;
    color: #1a1c23;
    animation: auroraMove 20s ease-in-out infinite;
    --text: #1a1c23;
    --text-muted: rgba(26, 28, 35, 0.75);
    --glass-tint: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-inner: rgba(255, 255, 255, 0.8);
}

body.theme-gray-light .sidebar {
    background: rgba(240, 242, 245, 0.9);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

body.theme-gray-light .login-card,
body.theme-gray-light .card,
body.theme-gray-light .filter-bar,
body.theme-gray-light .main-header {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

body.theme-gray-light .nav-item {
    color: #1a1c23;
}

body.theme-gray-light .nav-item:hover:not(.active),
body.theme-gray-light .nav-sub-item:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-gray-light .nav-item.active,
body.theme-gray-light .nav-sub-item.active {
    background: linear-gradient(135deg, rgba(127, 200, 255, 0.24), rgba(127, 200, 255, 0.10));
    box-shadow: 0 4px 12px rgba(127, 200, 255, 0.14), inset 0 0 0 1px rgba(127, 200, 255, 0.24);
    color: #005fa3;
}

body.theme-gray-light .table-spedizioni th {
    color: #1a1c23;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.theme-gray-light .table-spedizioni td {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.theme-gray-light .status-badge {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-gray-light .form-control {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1c23;
}

body.theme-gray-light .form-group input,
body.theme-gray-light .form-group select {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1c23;
}

body.theme-gray-light .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body.theme-gray-light .form-group select:disabled {
    background-color: rgba(243, 244, 246, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(17, 24, 39, 0.48);
}

body.theme-gray-light .form-group input:focus,
body.theme-gray-light .form-group select:focus,
body.theme-gray-light .form-group input:focus-visible,
body.theme-gray-light .form-group select:focus-visible {
    border-color: rgba(0, 0, 0, 0.2);
    background: #ffffff;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(127, 200, 255, 0.15),
        0 0 12px rgba(127, 200, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════
   PERSONALIZZAZIONI INTERFACCIA
═══════════════════════════════════════════════════════ */

/* ─── DENSITÀ INTERFACCIA ──────────────────────────── */
/* Compatta: riduci spacing e padding */
body.densita-compatta {
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
}

body.densita-compatta .form-group {
    margin-bottom: 12px;
}

body.densita-compatta .glass-card,
body.densita-compatta .card {
    padding: 16px;
}

/* Spaziosa: aumenta spacing e padding */
body.densita-spaziosa {
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
}

body.densita-spaziosa .form-group {
    margin-bottom: 24px;
}

body.densita-spaziosa .glass-card,
body.densita-spaziosa .card {
    padding: 32px;
}

/* ─── DIMENSIONE FONT ───────────────────────────────── */
/* Piccolo */
body.font-piccolo {
    font-size: 13px;
}

body.font-piccolo h1,
body.font-piccolo .page-title {
    font-size: 24px;
}

body.font-piccolo h2 {
    font-size: 20px;
}

body.font-piccolo h3 {
    font-size: 16px;
}

/* Grande */
body.font-grande {
    font-size: 15px;
}

body.font-grande h1,
body.font-grande .page-title {
    font-size: 32px;
}

body.font-grande h2 {
    font-size: 26px;
}

body.font-grande h3 {
    font-size: 20px;
}

/* ─── VELOCITÀ TRANSIZIONI ──────────────────────────── */
/* Lenta */
body.velocita-lenta {
    --transition-fast: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 600ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 1000ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Veloce */
body.velocita-veloce {
    --transition-fast: 75ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── ANIMAZIONI DISABILITATE ──────────────────────── */
body.animazioni-disabilitate,
body.animazioni-disabilitate * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

body.animazioni-disabilitate {
    animation: none !important;
}

/* ─── GLASSMORPHISM INTENSITY ──────────────────────── */
/* Bassa intensità */
body.glassmorphism-bassa .glass-card,
body.glassmorphism-bassa .login-card,
body.glassmorphism-bassa .card {
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
}

body.glassmorphism-bassa .form-group input,
body.glassmorphism-bassa .form-group select {
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
}

/* Alta intensità */
body.glassmorphism-alta .glass-card,
body.glassmorphism-alta .login-card,
body.glassmorphism-alta .card {
    backdrop-filter: blur(45px) saturate(210%) brightness(105%);
    -webkit-backdrop-filter: blur(45px) saturate(210%) brightness(105%);
}

body.glassmorphism-alta .form-group input,
body.glassmorphism-alta .form-group select {
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 200;

    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-right: 1px solid rgba(255, 255, 255, 0.10);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Brand / Logo */
.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}


/* New Load CTA */
.sidebar-cta {
    margin: 16px 16px 8px;
    flex-shrink: 0;
}

.btn-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, var(--accent2), #3da8ff);
    color: #020a1a;
    box-shadow: 0 4px 20px rgba(127, 200, 255, 0.30);
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-cta:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 28px rgba(127, 200, 255, 0.45);
}

.btn-cta:active {
    transform: scale(0.97);
}

.btn-cta svg {
    flex-shrink: 0;
}

/* Nav */
.sidebar-nav {
    flex: 1 1 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-nav > * {
    flex-shrink: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.nav-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 14px 10px 6px;
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(240, 244, 255, 0.75);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.18s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.nav-item:active {
    transform: scale(0.97);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(127, 200, 255, 0.18), rgba(127, 200, 255, 0.05));
    box-shadow: 0 4px 12px rgba(127, 200, 255, 0.1), inset 0 0 0 1px rgba(127, 200, 255, 0.15);
    color: var(--accent2);
    font-weight: 600;
}

.nav-item.active svg {
    opacity: 1;
    color: var(--accent2);
}

.nav-item.active::before {
    display: none;
}

/* Sub-items */
.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-left: 18px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.nav-sub.open {
    max-height: 400px;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    color: rgba(240, 244, 255, 0.60);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.nav-sub-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    transform: translateX(4px);
}

.nav-sub-item.active {
    background: linear-gradient(135deg, rgba(127, 200, 255, 0.18), rgba(127, 200, 255, 0.05));
    box-shadow: 0 4px 12px rgba(127, 200, 255, 0.1), inset 0 0 0 1px rgba(127, 200, 255, 0.15);
    color: var(--accent2);
    font-weight: 600;
    transform: translateX(0);
}

/* Collapse chevron */
.nav-chevron {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.25s;
    opacity: 0.5;
}

.nav-item.open .nav-chevron {
    transform: rotate(180deg);
}

/* Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

/* ─── SIDEBAR OVERLAY (mobile) ──────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
    z-index: 190;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.open {
    opacity: 1;
}

/* ─── MAIN CONTENT ─────────────────────────────────── */
.main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Topbar (mobile/tablet) */
.topbar {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 6, 23, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (max-width: 1024px) {
    .topbar {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 199;
        height: 100vh;
        transition: transform var(--transition-base);
    }

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

    .sidebar-overlay {
        display: block;
    }

    .sidebar-overlay.open {
        display: block;
        opacity: 1;
    }

    .main-wrap {
        width: 100%;
    }
}

.hamburger {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    min-width: 40px;
    min-height: 40px;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.15);
}

.topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── LAYOUT ──────────────────────────────────────── */
.page {
    max-width: 1320px;
    width: 100%;
    padding: 32px 28px 60px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ─── HEADER ──────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-ring {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    position: relative;
    z-index: 5;
}

.page-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    background: linear-gradient(135deg, #fff 30%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@supports not ((-webkit-background-clip: text) and (-webkit-text-fill-color: transparent)) {
    .topbar-title,
    .page-title {
        background: none;
        color: var(--accent2);
    }
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── GLASS CARD ──────────────────────────────────── */
.glass-card {
    padding: 28px 32px;
    border-radius: var(--radius-card);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    backdrop-filter: blur(40px) saturate(160%) brightness(110%);
    -webkit-backdrop-filter: blur(40px) saturate(160%) brightness(110%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.08),
        0 16px 40px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    will-change: transform;
    animation: fadeIn 0.6s ease both;
    transition: box-shadow var(--transition-base), transform var(--transition-base), background var(--transition-base);
}

.glass-card:hover {
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        inset 0 0 24px rgba(255, 255, 255, 0.08),
        0 24px 50px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3);
}

.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.03) 25%,
            transparent 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* Staggered entrance micro-animations per i figli delle griglie */
.glass-card:nth-child(1) {
    animation-delay: 0.0s;
}

.glass-card:nth-child(2) {
    animation-delay: 0.07s;
}

.glass-card:nth-child(3) {
    animation-delay: 0.14s;
}

.glass-card:nth-child(4) {
    animation-delay: 0.21s;
}

.glass-card:nth-child(5) {
    animation-delay: 0.28s;
}

.glass-card:nth-child(6) {
    animation-delay: 0.35s;
}

.glass-card:nth-child(7) {
    animation-delay: 0.42s;
}

.glass-card:nth-child(8) {
    animation-delay: 0.49s;
}

.glass-card:nth-child(9) {
    animation-delay: 0.56s;
}

.glass-card:nth-child(10) {
    animation-delay: 0.63s;
}

.glass-card:nth-child(n+11) {
    animation-delay: 0.70s;
}

.glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMTAnIGhlaWdodD0nMTAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGZpbHRlciBpZD0nbic+PGZlVHVyYnVsZW5jZSB0eXBlPSdmcmFjdGFsTm9pc2UnIGJhc2VGcmVxdWVuY3k9JzAuNScgc3RpdGNoVGlsZXM9J3N0aXRjaCc+PC9mZVR1cmJ1bGVuY2U+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSJ1cmwoI24pIiBvcGFjaXR5PScwLjMnPjwvcmVjdD48L3N2Zz4=");
    opacity: 0.07;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.refraction {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    -webkit-mask-image: radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.35), transparent 65%);
    mask-image: radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.35), transparent 65%);
    opacity: 0.22;
    pointer-events: none;
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .glass-card,
    .stats-card,
    .sidebar,
    .topbar,
    .sidebar-footer,
    table tbody tr {
        background: rgba(15, 23, 42, 0.88);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    }

    .glass-card::after,
    .refraction {
        display: none;
    }
}

@supports not (mask-image: radial-gradient(circle at center, #fff, transparent)) {
    .refraction {
        display: none;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightMove {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(18%, 18%);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* ─── SECTION LABEL ──────────────────────────────── */
.section-label {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

/* ─── FILTER GRID ────────────────────────────────── */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px 18px;
    position: relative;
    z-index: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.span-1 {
    grid-column: span 1;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group.row-span-2 {
    grid-row: span 2;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border-radius: var(--radius-input);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.2),
        0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: none;
    border-color: rgba(127, 200, 255, 0.6);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        0 0 0 3px rgba(127, 200, 255, 0.25),
        0 0 12px rgba(127, 200, 255, 0.15);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--accent-error);
    background: rgba(255, 111, 145, 0.08);
}

.form-group input.error:focus-visible,
.form-group select.error:focus-visible {
    outline-color: var(--accent-error);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.form-error-text {
    font-size: 12px;
    color: var(--accent-error);
    margin-top: 4px;
    display: block;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Password requirements checklist */
.password-requirements {
    font-size: 11px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid var(--accent2);
    animation: slideIn 0.2s ease-out;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
    color: var(--text-muted);
}

.req-item.req-met {
    color: var(--accent-success);
}

.req-item.req-unmet {
    color: var(--accent-error);
}

.strength-indicator {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    display: block;
}

.strength-weak {
    color: var(--accent-error);
}

.strength-fair {
    color: #ffa500;
}

.strength-good {
    color: #ffd700;
}

.strength-strong {
    color: var(--accent-success);
}

.form-group input:hover,
.form-group select:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent2);
    background: rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.3),
        0 0 0 4px rgba(127, 200, 255, 0.2),
        0 8px 16px -4px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.form-group input[type="date"] {
    position: relative;
    min-height: 41px;
}

@media (max-width: 768px) {

    .form-group input,
    .form-group select,
    .form-group input[type="date"] {
        min-height: 44px;
    }

    /* Touch targets for buttons and links */
    button,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-login,
    a[href],
    input[type="submit"],
    input[type="button"],
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) sepia(1) saturate(5) hue-rotate(175deg);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="radio"]:checked {
    accent-color: var(--accent2);
    transform: scale(1.1);
}

input[type="radio"] {
    accent-color: var(--accent2);
    cursor: pointer;
    transition: transform 0.2s, accent-color 0.2s;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 14px;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group select:disabled {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-disabled);
    cursor: not-allowed;
    opacity: 0.75;
    box-shadow: none;
}

.form-group select:disabled:hover,
.form-group select:disabled:focus {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: none;
}

.form-group select option {
    background: #ffffff;
    color: #111827;
}

.form-group select optgroup {
    background: #ffffff;
    color: #111827;
}

/* ─── CHECKBOX BOX ────────────────────────────────── */
.checkbox-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-input);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    height: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.checkbox-label.disabled {
    opacity: 0.38;
    cursor: default;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox-label input:checked+.checkmark {
    background: linear-gradient(135deg, var(--accent2), var(--accent3));
    border-color: transparent;
}

.checkbox-label input:checked+.checkmark::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

/* ─── ADVANCED TOGGLE ─────────────────────────────── */
.advanced-toggle {
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.advanced-toggle a {
    font-size: 12.5px;
    color: var(--accent2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.advanced-toggle a:hover {
    opacity: 1;
}

.arrow {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    display: inline-block;
}

.arrow.down {
    transform: rotate(45deg) translateY(-2px);
}

/* ─── ACTIONS ─────────────────────────────────────── */
.actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.btn {
    padding: 11px 28px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: filter var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-base), background var(--transition-base);
    letter-spacing: 0.3px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent2), #3da8ff);
    color: #020a1a;
    box-shadow: 0 4px 20px rgba(127, 200, 255, 0.35);
    border: 2px solid transparent;
}

.btn-primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 8px 36px rgba(127, 200, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    transition: filter var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-base), background var(--transition-base), border-color var(--transition-base);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 4px 12px rgba(255, 255, 255, 0.15),
        inset 0 0 10px rgba(255, 255, 255, 0.15);
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ─── TABLE SECTION ───────────────────────────────── */
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.result-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(127, 200, 255, 0.15);
    border: 1px solid rgba(127, 200, 255, 0.25);
    font-size: 12px;
    color: var(--accent2);
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    position: relative;
    z-index: 1;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    font-variant-numeric: tabular-nums;
}

thead tr {
    background: rgba(255, 255, 255, 0.06);
}

th {
    padding: 12px 14px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    line-height: 1.25;
}

th.text-right {
    text-align: right;
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

/* Global hover applicato sempre a tbody tr per coerenza */
tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.06);
}

tbody tr.clickable-row:hover {
    background: rgba(127, 200, 255, 0.12);
    box-shadow: inset 0 0 16px rgba(127, 200, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

tbody tr.clickable-row:active {
    background: rgba(127, 200, 255, 0.18);
    transform: scale(0.995);
}

@media (max-width: 768px) {

    tbody tr.clickable-row:hover,
    tbody tr:hover {
        background: rgba(127, 200, 255, 0.08);
        /* Fallback per touch che bloccano hover state */
        box-shadow: none;
    }
}

/* Righe foglio cliccabili: feedback visivo esplicito */
tbody tr.foglio-row {
    cursor: pointer;
}

tbody tr.foglio-row:hover {
    box-shadow: inset 0 0 0 1px rgba(182, 127, 249, 0.28), inset 0 0 14px rgba(182, 127, 249, 0.10);
}

tbody tr.foglio-row:active {
    transform: translateY(0.5px);
}

td {
    padding: 13px 14px;
    font-size: 13px;
    color: var(--text);
    vertical-align: middle;
    line-height: 1.35;
}

td.text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.link {
    color: var(--accent2);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.link:hover {
    color: #fff;
    text-decoration: underline;
}

.text-sm {
    font-size: 12px;
}

.text-muted {
    color: var(--text-muted);
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent4), #00cc88);
    box-shadow: 0 0 8px rgba(110, 255, 200, 0.6);
    margin: auto;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 184, 77, 0.18);
    border: 1px solid rgba(255, 184, 77, 0.30);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

/* ─── MODAL ───────────────────────────────────────── */
/* ─── MODAL ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(2, 6, 23, 0.75), rgba(2, 6, 23, 0.92));
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    display: flex;
    /* Always flex but hidden by state */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content,
.modal-eurotrasporti {
    width: 100%;
    max-width: 600px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 32px;
    padding: 40px;
    position: relative;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.08);
    transform: scale(0.92) translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay:not(.hidden) .modal-content,
.modal-overlay:not(.hidden) .modal-eurotrasporti {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modale Warning (Eliminazione) */
.modal-warning {
    border: 1px solid rgba(255, 111, 145, 0.35);
    border-top: 1px solid rgba(255, 111, 145, 0.55);
    background: linear-gradient(135deg, rgba(255, 111, 145, 0.06), rgba(2, 6, 23, 0.4));
}

.modal-inner {
    position: relative;
    z-index: 2;
}

.modal-width-sm {
    max-width: 400px;
}

.modal-width-md {
    max-width: 480px;
}

.modal-width-lg {
    max-width: 550px;
}

.modal-centered {
    text-align: center;
}

.modal-subtext {
    font-size: 13px;
    margin-bottom: 24px;
    margin-top: -10px;
}

.modal-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-form-block {
    margin-bottom: 16px;
}

.modal-form-block-lg {
    margin-bottom: 24px;
}

.modal-form-label {
    display: block;
    font-size: 11px;
    margin-bottom: 6px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-form-label-accent {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--accent2);
    font-weight: 700;
    text-transform: uppercase;
}

.modal-form-label-doc {
    display: block;
    font-size: 10px;
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

.modal-form-label-doc--original {
    color: var(--accent2);
}

.modal-form-label-doc--signed {
    color: var(--accent4);
}

.modal-form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.modal-helper-text {
    margin-top: -8px;
    margin-bottom: 24px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.modal-field,
.modal-select,
.modal-textarea,
.modal-file-input,
.modal-readonly-field,
.modal-accent-field {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
}

.modal-field,
.modal-select,
.modal-textarea,
.modal-file-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.modal-select,
.modal-select--accent {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 14px;
    background-position: right 14px center;
    padding-right: 40px;
}

.modal-select:disabled,
.modal-select--accent:disabled {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-disabled);
    cursor: not-allowed;
    opacity: 0.72;
}

.modal-textarea {
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.modal-select option,
.modal-select optgroup,
.modal-select--accent option,
.modal-select--accent optgroup {
    background: #ffffff;
    color: #111827;
}

.modal-select--accent,
.modal-accent-field {
    background: rgba(46, 213, 115, 0.1);
    border: 2px solid rgba(46, 213, 115, 0.4);
    color: #2ed573;
    font-weight: 600;
}

.modal-field[type="date"],
.modal-field[type="datetime-local"] {
    color-scheme: dark;
}

.modal-readonly-field {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
}

.modal-readonly-field--strong {
    font-weight: 700;
}

.modal-accent-field {
    border: 1px solid rgba(255, 193, 7, 0.3);
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    font-weight: 700;
    cursor: not-allowed;
}

.modal-upload-box {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.modal-file-input-compact {
    width: 100%;
    font-size: 11px;
    color: #fff;
}

.modal-actions-end {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions-center {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn-md {
    font-size: 13px;
    padding: 12px 20px;
}

.modal-btn-lg {
    font-size: 13px;
    padding: 12px 24px;
}

.modal-btn-xl {
    font-size: 14px;
    padding: 12px 28px;
}

.modal-btn-danger {
    background: #ff6f91;
    color: #fff;
    border-color: rgba(255, 111, 145, 0.3);
}

.modal-warning-icon {
    font-size: 56px;
    margin-bottom: 24px;
    opacity: 1;
}

.modal-warning-copy {
    font-size: 14px;
    margin-bottom: 32px;
    padding: 0 10px;
}

@media (max-width: 680px) {
    .modal-form-grid-2,
    .modal-form-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {

    .modal-content,
    .modal-eurotrasporti {
        max-width: 100%;
        padding: 24px 16px;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.modal-header h3,
.modal-header .section-label {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    background: linear-gradient(to right, #fff, var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    position: relative;
    z-index: 1;
}

/* ─── TIMELINE ────────────────────────────────────── */
.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.30);
    flex-shrink: 0;
    margin-top: 3px;
    transition: background 0.3s;
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: rgba(255, 255, 255, 0.10);
    margin-top: 4px;
}

.timeline-item:last-child .timeline-line {
    display: none;
}

.timeline-item.completed .timeline-dot {
    background: linear-gradient(135deg, var(--accent2), var(--accent4));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(127, 200, 255, 0.5);
}

.timeline-item.completed .timeline-line {
    background: linear-gradient(180deg, rgba(127, 200, 255, 0.4), rgba(255, 255, 255, 0.08));
}

.timeline-item.latest .timeline-dot {
    background: linear-gradient(135deg, var(--accent4), #00cc88);
    box-shadow: 0 0 14px rgba(110, 255, 200, 0.6);
    width: 16px;
    height: 16px;
}

.timeline-content {
    flex: 1;
}

.timeline-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-item.latest .timeline-content h4::after {
    content: "ULTIMO";
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(110, 255, 200, 0.18);
    border: 1px solid rgba(110, 255, 200, 0.35);
    color: var(--accent4);
}

.timeline-content p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── STATUS BADGE ────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge.consegnata {
    background: rgba(110, 255, 200, 0.15);
    border: 1px solid rgba(110, 255, 200, 0.30);
    color: var(--accent4);
}

.status-badge.consegnata::before {
    background: var(--accent4);
    box-shadow: 0 0 5px rgba(110, 255, 200, 0.7);
}

.status-badge.transito {
    background: rgba(127, 200, 255, 0.15);
    border: 1px solid rgba(127, 200, 255, 0.30);
    color: var(--accent2);
}

.status-badge.transito::before {
    background: var(--accent2);
}

.status-badge.magazzino {
    background: rgba(255, 184, 77, 0.15);
    border: 1px solid rgba(255, 184, 77, 0.30);
    color: var(--accent);
}

.status-badge.magazzino::before {
    background: var(--accent);
}

.status-badge.annotazioni {
    background: rgba(255, 111, 145, 0.15);
    border: 1px solid rgba(255, 111, 145, 0.30);
    color: var(--accent3);
}

.status-badge.annotazioni::before {
    background: var(--accent3);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */

/* ── Tablet piccolo / Large mobile ───────────── */
@media (max-width: 650px) {
    .page {
        padding: 14px 12px 65px;
    }

    .glass-card {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 15px !important;
        padding: 10px 12px;
        min-height: 44px;
    }

    .modal-eurotrasporti {
        max-height: 92vh !important;
        max-width: 95vw !important;
    }

    table tbody tr {
        border-radius: 14px;
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    table tbody td {
        grid-template-columns: 80px 1fr;
        padding: 6px 0;
        font-size: 13px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .result-count {
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .fogli-state-tabs {
        flex-wrap: wrap !important;
    }

    .fogli-state-tab {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}

/* ── Tablet ────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    :root {
        --sidebar-w: 220px;
    }

    .page {
        padding: 24px 20px 60px;
    }
}

/* ── Filter grid ────────────────────────────── */
@media (max-width: 900px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-group.span-2 {
        grid-column: span 2;
    }

    .form-group.span-1 {
        grid-column: span 1;
    }

    .form-group.row-span-2 {
        grid-row: auto;
    }
}

/* ── Mobile ─────────────────────────────────── */
@media (max-width: 768px) {
    body {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }

    /* Sidebar off-canvas */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        width: 280px;
        transform: translateX(-100%);
        z-index: 200;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-nav {
        height: auto;
        min-height: auto;
        overflow-y: visible;
        padding-bottom: 8px;
    }

    .sidebar-footer {
        position: sticky;
        bottom: 0;
        background: rgba(2, 6, 23, 0.92);
        backdrop-filter: blur(16px) saturate(150%);
        -webkit-backdrop-filter: blur(16px) saturate(150%);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 2;
    }

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

    .sidebar-overlay {
        display: block;
    }

    /* Topbar visible */
    .topbar {
        display: flex;
    }

    .page {
        padding: 12px 12px 70px;
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    .glass-card {
        padding: 18px 14px;
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
        backdrop-filter: blur(18px) saturate(145%) brightness(108%);
        -webkit-backdrop-filter: blur(18px) saturate(145%) brightness(108%);
        border: 1px solid rgba(255, 255, 255, 0.16);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
        transform-style: flat;
    }

    .glass-card::before {
        opacity: 0.65;
    }

    .glass-card::after,
    .refraction {
        display: none;
    }

    .stats-card {
        backdrop-filter: blur(14px) saturate(140%);
        -webkit-backdrop-filter: blur(14px) saturate(140%);
        border-color: rgba(255, 255, 255, 0.14);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    /* ── TABLE → CARD VIEW ───────────────────── */
    .table-container {
        border: none;
        border-radius: 0;
        overflow: visible;
        background: transparent;
    }

    table {
        min-width: unset;
    }

    table thead {
        display: none;
    }

    /* each row = a card */
    table tbody tr {
        display: block;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 18px;
        padding: 14px 16px;
        margin-bottom: 12px;
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.06), 0 6px 24px rgba(0, 0, 0, 0.3);
        transition: background 0.2s;
    }

    table tbody tr:last-child {
        margin-bottom: 0;
    }

    table tbody tr.clickable-row:hover {
        background: rgba(127, 200, 255, 0.09);
        border-color: rgba(127, 200, 255, 0.25);
    }

    /* each cell = grid: label col | value col */
    table tbody td {
        display: grid;
        grid-template-columns: 100px 1fr;
        align-items: start;
        gap: 8px;
        padding: 7px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 13px;
        text-align: left;
        line-height: 1.4;
    }

    table tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    table tbody td:first-child {
        padding-top: 0;
    }

    /* pseudo-label from data-label */
    table tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.7px;
        text-transform: uppercase;
        color: var(--text-muted);
        padding-top: 2px;
        line-height: 1.4;
    }

    /* Chiave in evidenza */
    td[data-label="Chiave"] {
        font-size: 15px;
        font-weight: 700;
    }

    /* fix text-right cells: left-align on mobile */
    td.text-right {
        text-align: left;
    }

    /* status badge full width on mobile */
    td[data-label="Stato"] .status-badge {
        font-size: 11px;
    }

    /* ── FIX RESPONSIVI GLOBALI ───────────────── */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .search-input {
        font-size: 16px !important;
        /* Blocca l'auto-zoom di iOS Safari al tocco */
    }

    /* ── MODALI RESPONSIVE ────────────────────── */
    .modal-overlay {
        padding: 12px !important;
    }

    .modal-eurotrasporti {
        padding: 16px 12px !important;
        max-height: 95vh !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px;
    }

    .modal-eurotrasporti .modal-inner {
        max-height: none;
        margin: 0;
        padding: 0;
    }

    .modal-eurotrasporti .glass-card {
        max-width: 100% !important;
        border-radius: 18px;
        padding: 0;
    }

    .modal-header {
        padding: 12px 0 12px 0 !important;
        margin-bottom: 14px !important;
    }

    .section-label {
        font-size: 18px !important;
    }

    /* ── TABS SCROLLABILI ─────────────────────── */
    .tabs-scroll {
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        padding-bottom: 8px !important;
        margin-bottom: -8px !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Override locale width/height per i tab mantenendo il global design per il colore */
    .tabs-scroll::-webkit-scrollbar {
        height: 6px;
    }

    .tabs-scroll>a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    /* ── GRIGLIE 2-COL → 1-COL ────────────────── */
    .grid-responsive-2 {
        grid-template-columns: 1fr !important;
    }

    /* ── ACTION BUTTONS STACK ─────────────────── */
    .action-btns {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .action-btns .btn {
        min-height: 44px;
        width: 100% !important;
        justify-content: center;
        font-size: 13px !important;
        padding: 12px 16px !important;
    }

    /* Form inputs - better sizing */
    .filter-grid input,
    .filter-grid select {
        min-height: 44px;
        font-size: 16px !important;
    }

    /* Form groups spacing */
    .form-group {
        margin-bottom: 14px !important;
    }

    .form-group label {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 15px !important;
        padding: 10px 12px !important;
        min-height: 44px;
    }

    /* ── MODAL CONTENT GRID ────────────────────── */
    .modal-content {
        max-width: 100%;
        margin: 0 8px;
    }

    .dashboard-card-grid {
        gap: 10px;
        padding: 0;
    }

    .dashboard-card-item {
        padding: 12px 14px;
    }

    .dashboard-card-item__details {
        gap: 8px;
        font-size: 12px;
    }
}

/* ── Piccolo mobile ─────────────────────────── */
@media (max-width: 480px) {
    .page {
        padding: 10px 10px 70px !important;
    }

    .glass-card {
        padding: 14px 12px !important;
        border-radius: 14px !important;
    }

    .filter-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 0 !important;
    }

    .form-group {
        grid-column: span 1 !important;
        margin-bottom: 12px !important;
    }

    .form-group.span-2,
    .form-group.span-1 {
        grid-column: span 1 !important;
    }

    table tbody td {
        grid-template-columns: 70px 1fr !important;
        padding: 6px 0 !important;
        font-size: 13px !important;
        gap: 6px !important;
    }

    table tbody td::before {
        font-size: 9px !important;
        min-width: 70px !important;
    }

    /* Modal adjustments */
    .modal-eurotrasporti {
        max-width: 100% !important;
        padding: 12px 10px !important;
        border-radius: 16px !important;
    }

    .modal-header {
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    .btn-close {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Button sizing */
    .btn {
        padding: 10px 12px !important;
        font-size: 13px !important;
        min-height: 44px !important;
    }

    /* Stats cards */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Login card padding */
    .login-card {
        padding: 20px 14px !important;
        margin: 0 10px !important;
        max-width: 100% !important;
    }

    /* Topbar adjustments */
    .topbar-title {
        font-size: 14px !important;
    }

    /* Table row cards smaller padding */
    table tbody tr {
        padding: 10px 12px !important;
        margin-bottom: 10px !important;
    }

    .dashboard-card-item {
        padding: 10px 12px !important;
        border-radius: 12px !important;
    }

    /* FORCE modal responsive - override inline max-width */
    .modal-eurotrasporti[style*="max-width"] {
        max-width: 95vw !important;
        width: 95vw !important;
    }

    /* Override for modals with specific inline widths */
    .modal-overlay .modal-eurotrasporti {
        max-width: 95vw !important;
        width: calc(100% - 24px) !important;
        margin: 0 auto !important;
    }
}

/* ── Ultra small mobile (< 380px) ─────────── */
@media (max-width: 380px) {
    .page {
        padding: 8px 8px 65px !important;
    }

    .glass-card {
        padding: 12px 10px !important;
        border-radius: 12px !important;
    }

    .section-label {
        font-size: 16px !important;
    }

    .page-title {
        font-size: 18px !important;
    }

    table tbody tr {
        padding: 10px 12px !important;
        margin-bottom: 8px !important;
        border-radius: 12px !important;
    }

    .dashboard-card-item {
        padding: 10px !important;
        border-radius: 10px !important;
    }

    table tbody td {
        grid-template-columns: 60px 1fr !important;
        padding: 4px 0 !important;
        font-size: 12px !important;
    }

    .btn {
        padding: 8px 10px !important;
        font-size: 12px !important;
        min-height: 44px !important;
    }

    .modal-eurotrasporti {
        padding: 10px 8px !important;
    }

    .modal-header {
        margin-bottom: 12px !important;
    }

    .login-card {
        padding: 18px 12px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* Drop zone optimizations for mobile */
    #drop-zone {
        padding: 24px 16px !important;
    }

    #drop-zone span:first-of-type {
        font-size: 32px !important;
        margin-bottom: 8px !important;
    }

    #drop-zone span:nth-of-type(2) {
        font-size: 14px !important;
    }

    #drop-zone span:nth-of-type(3) {
        font-size: 12px !important;
    }

    /* Search form stack on small mobile */
    .search-form {
        flex-direction: column !important;
    }

    .search-form input,
    .search-form button {
        min-width: 100% !important;
        width: 100% !important;
        flex: 1 !important;
    }

    /* Tracking header responsive */
    .tracking-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .tracking-header > div:last-child {
        width: 100% !important;
        text-align: left !important;
        align-self: flex-start !important;
    }

    /* Tracking dates grid responsive */
    .tracking-dates {
        grid-template-columns: 1fr !important;
    }

    .tracking-dates > div {
        padding: 12px 14px !important;
        font-size: 13px !important;
    }

    .tracking-dates > div > div:first-child {
        font-size: 9px !important;
    }

    .tracking-dates > div > div:last-child {
        font-size: 14px !important;
    }
}

/* ── STATS CARDS ────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.stats-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.22);
}

.stats-card .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.stats-card .value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.stats-card .icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    opacity: 1;
    filter: saturate(1.1);
}

.stats-card--warning {
    border-color: rgba(255, 193, 7, 0.3);
}

.stats-card__value--warning {
    color: #ffc107;
}

.form-label-meta {
    font-weight: 400;
    opacity: 0.6;
    text-transform: none;
    letter-spacing: 0;
}

.btn-inline-reset {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.table-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label--tight {
    margin-bottom: 0;
}

.btn-toggle-mobile-view {
    padding: 6px 12px;
    font-size: 11px;
}

.dashboard-empty-cell {
    padding: 0;
    border: none;
}

.dashboard-empty-state,
.storico-empty-card,
.fogli-empty-state {
    padding: 60px 40px;
    text-align: center;
}

.dashboard-empty-state__icon,
.storico-empty-card__icon,
.fogli-empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 1;
}

.dashboard-empty-state__title,
.storico-empty-card__title,
.fogli-empty-state__title {
    color: var(--text);
    margin-bottom: 8px;
    font-size: 18px;
}

.dashboard-empty-state__text,
.fogli-empty-state__text {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.dashboard-empty-state__cta,
.storico-empty-card__cta,
.fogli-empty-state__cta {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-btn);
    text-decoration: none;
    font-size: 13px;
}

.dashboard-cell-main {
    font-weight: 600;
    line-height: 1.35;
}

.dashboard-cell-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

.dashboard-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-metric {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
    line-height: 1.2;
}

.tracking-key {
    font-weight: 500;
}

.doc-indicator {
    margin-left: 4px;
    opacity: 0.8;
    cursor: help;
}

.dashboard-card-grid {
    display: none;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 4px;
}

.dashboard-card-item {
    margin: 0;
    padding: 14px 16px;
    cursor: pointer;
    border-radius: 14px;
}

.dashboard-card-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.dashboard-card-item__title {
    font-weight: 700;
    font-size: 14px;
}

.dashboard-card-item__meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.dashboard-card-item__details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
}

.dashboard-card-item__label {
    color: var(--text-muted);
}

.dashboard-card-item__label--success {
    color: #2ed573;
}

.dashboard-card-item__value {
    color: #fff;
}

.dashboard-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid var(--glass-border);
    gap: 16px;
}

.dashboard-pagination__summary {
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard-pagination__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-pagination[disabled],
.btn-pagination.is-disabled {
    opacity: 0.5;
}

.dashboard-pagination__ellipsis {
    padding: 0 6px;
    color: var(--text-muted);
}

.btn-pagination--current {
    background: var(--accent2);
    color: #020a1a;
    font-weight: 600;
    cursor: default;
}

.fogli-state-banner {
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.35);
    border-radius: 14px;
    padding: 14px 20px;
    color: #2ed573;
    font-size: 13px;
    margin-bottom: 24px;
    text-transform: uppercase;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.fogli-state-tab {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s;
}

.fogli-state-tab.is-active {
    background: var(--accent2);
    color: #020a1a;
    box-shadow: 0 4px 12px rgba(127, 200, 255, 0.3);
}

.fogli-state-tab:not(.is-active) {
    color: var(--text-muted);
}

.fogli-state-tab:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.fogli-filters-title {
    padding-top: 20px;
    padding-left: 20px;
}

.fogli-filters-form {
    padding: 0 20px 20px;
}

.fogli-filter-actions {
    justify-content: flex-end;
    padding-top: 10px;
}

.fogli-filter-actions__group {
    display: flex;
    gap: 8px;
}

.fogli-btn-reset {
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.fogli-btn-apply {
    font-size: 13px;
}

.fogli-section-label--tight {
    margin-bottom: 0;
}

.section-label--center {
    justify-content: center;
}

/* ── Shared page-wrapper widths ── */

.logo-ring--lg {
    width: 64px;
    height: 64px;
    font-size: 32px;
    margin: 0 auto 20px auto;
}

.page-header--mb {
    margin-bottom: 24px;
}

.page-title--mb-sm {
    margin-bottom: 8px;
}

.text-muted-intro {
    color: var(--text-muted);
    margin-bottom: 28px;
}

.section-label--mb {
    margin-bottom: 28px;
}

.section-label--mb-lg {
    margin-bottom: 36px;
}

.toggle-icon {
    font-size: 20px;
}

.brand-logo-login {
    width: 220px;
    height: auto;
    margin-bottom: 24px;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 20px;
}

.auth-page--aurora {
    background:
        radial-gradient(circle at 15% 25%, rgba(0, 255, 180, 0.20), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(0, 150, 255, 0.20), transparent 55%),
        radial-gradient(circle at 50% 85%, rgba(160, 0, 255, 0.18), transparent 55%),
        linear-gradient(135deg, #020617, #0b1226 40%, #0f1a33 70%, #020617);
    background-size: 220% 220%;
    animation: auroraMove 20s ease-in-out infinite;
}

.auth-page--twilight {
    background: radial-gradient(circle at top right, #1a1e36, #0d0f1a);
}

.login-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(28px) saturate(180%) brightness(105%);
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(105%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    isolation: isolate;
    box-shadow:
        inset 0 0 16px var(--glass-inner),
        inset 0 0 4px rgba(255, 255, 255, 0.20),
        0 24px 48px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease both;
}

.login-card::before {
    content: "";
    position: absolute;
    top: -150%;
    left: -150%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 40%, transparent 70%);
    pointer-events: none;
}

.login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMTAnIGhlaWdodD0nMTAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGZpbHRlciBpZD0nbic+PGZlVHVyYnVsZW5jZSB0eXBlPSdmcmFjdGFsTm9pc2UnIGJhc2VGcmVxdWVuY3k9JzAuNScgc3RpdGNoVGlsZXM9J3N0aXRjaCc+PC9mZVR1cmJ1bGVuY2U+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSJ1cmwoI24pIiBvcGFjaXR5PScwLjMnPjwvcmVjdD48L3N2Zz4=");
    opacity: 0.07;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 24px rgba(127, 200, 255, 0.4);
}

.login-title {
    color: #fff;
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 22px;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.6px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-input);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.login-links {
    margin-top: 24px;
    font-size: 13px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.login-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.login-links a:hover {
    color: var(--accent2);
}

.error-msg,
.success-msg {
    padding: 12px;
    border-radius: var(--radius-input);
    font-size: 13px;
    margin-bottom: 20px;
}

.error-msg {
    background: rgba(255, 111, 145, 0.12);
    color: var(--accent3);
    border: 1px solid rgba(255, 111, 145, 0.25);
}

.success-msg {
    background: rgba(110, 255, 200, 0.12);
    color: var(--accent4);
    border: 1px solid rgba(110, 255, 200, 0.25);
}

@supports not ((-webkit-background-clip: text) and (-webkit-text-fill-color: transparent)) {
    .login-title {
        background: none;
        color: var(--accent2);
    }
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .login-card {
        background: rgba(11, 18, 38, 0.94);
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
    }

    .login-card::after {
        display: none;
    }
}

.error-msg--warning {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.25);
}

.link-muted {
    opacity: 0.5;
}

.btn-login-link {
    display: block;
    text-decoration: none;
    text-align: center;
    margin-top: 15px;
}

.login-link-spaced {
    margin-right: 15px;
}

.privacy-footnote {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.privacy-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 80px;
    background:
        radial-gradient(circle at 20% 20%, rgba(127, 200, 255, 0.12), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(110, 255, 200, 0.08), transparent 50%),
        #02060e;
}

.privacy-wrap {
    width: 100%;
    max-width: 820px;
}

.privacy-header {
    text-align: center;
    margin-bottom: 40px;
}

.privacy-header img {
    height: 52px;
    width: auto;
    margin-bottom: 20px;
}

.privacy-header h1 {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.privacy-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.privacy-card {
    padding: 36px 40px;
    border-radius: var(--radius-card);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

.privacy-card h2 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 16px;
    margin-top: 28px;
}

.privacy-card h2:first-child {
    margin-top: 0;
}

.privacy-card p,
.privacy-card li {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 10px;
}

.privacy-card ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.privacy-card ul li {
    margin-bottom: 6px;
}

.privacy-card strong {
    color: var(--text);
}

.privacy-card a {
    color: var(--accent2);
    text-decoration: none;
}

.privacy-card a:hover {
    text-decoration: underline;
}

hr.section-sep {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 28px 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
    margin-top: 12px;
}

.back-link:hover {
    opacity: 1;
}

@supports not ((-webkit-background-clip: text) and (-webkit-text-fill-color: transparent)) {
    .privacy-header h1 {
        background: none;
        color: var(--accent2);
    }
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .privacy-card {
        background: rgba(8, 14, 26, 0.92);
    }
}

@media (max-width: 600px) {
    .privacy-card {
        padding: 20px 16px;
        border-radius: 18px;
    }
}

.modal-shipment-id {
    opacity: 0.6;
    font-weight: 400;
    margin-left: 4px;
}

.sidebar-brand-link {
    display: block;
    width: 100%;
}

.sidebar-brand-logo {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(127, 200, 255, 0.2));
}

.nav-item--danger {
    color: rgba(255, 111, 145, 0.8);
}

.nav-item--muted-sm {
    color: rgba(240, 244, 255, 0.35);
    font-size: 11px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.profile-role-card {
    padding: 18px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 8px;
}

.profile-role-card__label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.profile-role-card__value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent2);
}

.btn--w200 {
    min-width: 200px;
}

.is-hidden {
    display: none !important;
}

.entity-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.entity-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.entity-empty__icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 1;
}

.entity-card {
    padding: 16px;
    margin: 0;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entity-card__title {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    margin-bottom: 4px;
}

.entity-card__meta {
    font-size: 12px;
    color: var(--text-muted);
}

.entity-card__meta strong {
    color: rgba(255, 255, 255, 0.7);
}

.entity-card__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn--compact {
    padding: 8px 16px;
    font-size: 12px;
}

.required-star {
    color: #ff6f91;
}

.modal-field--mt {
    margin-top: 8px;
}

.storico-empty-card__cta {
    margin-top: 24px;
}

.storico-kpi-grid {
    margin-bottom: 24px;
}

.mittenti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.mittente-card {
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mittente-card__title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    padding-right: 32px;
}

.mittente-card__address {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.mittente-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-bottom: 14px;
}

.mittente-metric {
    padding: 11px;
    border-radius: 10px;
    text-align: center;
}

.mittente-metric--spedizioni {
    background: rgba(127, 200, 255, 0.08);
    border: 1px solid rgba(127, 200, 255, 0.12);
}

.mittente-metric--consegnate {
    background: rgba(46, 213, 115, 0.08);
    border: 1px solid rgba(46, 213, 115, 0.12);
}

.mittente-metric--in-corso {
    background: rgba(255, 184, 77, 0.08);
    border: 1px solid rgba(255, 184, 77, 0.12);
}

.mittente-metric--peso {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mittente-metric__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.mittente-metric__label--spedizioni { color: var(--accent2); }
.mittente-metric__label--consegnate { color: #2ed573; }
.mittente-metric__label--in-corso { color: var(--accent); }
.mittente-metric__label--peso { color: var(--text-muted); }

.mittente-metric__value {
    font-weight: 700;
}

.mittente-metric__value--spedizioni {
    font-size: 22px;
    color: var(--accent2);
}

.mittente-metric__value--consegnate {
    font-size: 22px;
    color: #2ed573;
}

.mittente-metric__value--in-corso {
    font-size: 22px;
    color: var(--accent);
}

.mittente-metric__value--peso {
    font-size: 18px;
}

.mittente-progress {
    margin-bottom: 12px;
}

.mittente-progress__head {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.mittente-progress__pct {
    color: #2ed573;
    font-weight: 600;
}

.mittente-progress__track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    height: 5px;
    overflow: hidden;
}

.mittente-progress__fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2ed573, #6ee7b7);
    border-radius: 20px;
}

.mittente-card__last {
    font-size: 11px;
    color: var(--text-muted);
}

.mittente-card__last strong {
    color: rgba(255, 255, 255, 0.6);
}

.mittente-card__arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--accent2);
    font-size: 16px;
    opacity: 0.5;
}

.page-content-narrow {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 12px;
}

.page-content-medium {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 12px;
}

.page-content-wide {
    max-width: 1000px;
    margin: 0 auto;
}

.page-content-std {
    max-width: 900px;
    margin: 0 auto;
}

/* ── Nuovo Carico ── */

.filter-grid--single {
    grid-template-columns: 1fr;
}

.form-group--mt {
    margin-top: 16px;
}

.drop-zone {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: rgba(127, 200, 255, 0.5);
    background: rgba(127, 200, 255, 0.06);
}

.drop-zone__icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.7;
}

.drop-zone__label {
    display: block;
    font-weight: 500;
    font-size: 16px;
    color: #fff;
}

.drop-zone__filename {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.actions--end {
    margin-top: 32px;
    justify-content: flex-end;
}

.btn--wide {
    min-width: 180px;
}

/* ── Ricerca / Tracking ── */

.page-header-card {
    text-align: center;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    border-radius: var(--radius-input);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    font-size: 15px;
    color: #fff;
    outline: none;
    font-family: inherit;
    transition: all 0.3s;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.search-btn {
    padding: 14px 28px;
    flex: 1;
    min-width: 120px;
}

.tracking-result-card {
    margin-top: 24px;
}

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.tracking-id {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent2);
    letter-spacing: -0.5px;
}

.tracking-contract {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.tracking-contract strong {
    color: var(--text);
}

.tracking-header-right {
    text-align: right;
}

.tracking-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.info-tile {
    background: rgba(0, 0, 0, 0.15);
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-tile--arrival {
    background: rgba(110, 255, 200, 0.08);
    border: 1px solid rgba(110, 255, 200, 0.15);
}

.info-tile__label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.info-tile__label--arrival {
    color: var(--accent4);
}

.info-tile__value {
    font-size: 16px;
    font-weight: 600;
}

.info-tile__value--arrival {
    color: var(--accent4);
}

.grid-responsive-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.party-tile {
    background: rgba(0, 0, 0, 0.15);
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.party-tile__heading {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 10px;
}

.party-tile__heading--sender {
    color: var(--accent2);
}

.party-tile__heading--receiver {
    color: var(--accent3);
}

.party-tile__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.party-tile__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.metric-tile {
    padding: 14px;
    border-radius: 12px;
    text-align: center;
}

.metric-tile--weight {
    background: rgba(255, 184, 77, 0.08);
    border: 1px solid rgba(255, 184, 77, 0.15);
}

.metric-tile--colli {
    background: rgba(127, 200, 255, 0.08);
    border: 1px solid rgba(127, 200, 255, 0.15);
}

.metric-tile--plt {
    background: rgba(160, 0, 255, 0.08);
    border: 1px solid rgba(160, 0, 255, 0.15);
}

.metric-tile--anno {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-tile__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.metric-tile__label--weight { color: var(--accent); }
.metric-tile__label--colli  { color: var(--accent2); }
.metric-tile__label--plt    { color: #c084fc; }
.metric-tile__label--anno   { color: var(--text-muted); }

.metric-tile__value {
    font-size: 18px;
    font-weight: 700;
}

.metric-tile__value--weight { color: var(--accent); }
.metric-tile__value--colli  { color: var(--accent2); }
.metric-tile__value--plt    { color: #c084fc; }

.metric-tile__unit {
    font-size: 10px;
    color: var(--text-muted);
}

.refs-tile {
    background: rgba(0, 0, 0, 0.15);
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.refs-tile__heading {
    font-size: 10px;
    color: var(--accent4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 10px;
}

.refs-tile__row {
    margin-bottom: 6px;
}

.refs-tile__key {
    font-size: 12px;
    color: var(--text-muted);
}

.refs-tile__val {
    font-size: 14px;
    font-weight: 500;
    margin-left: 6px;
}

.refs-tile__val--note {
    font-weight: 400;
}

.docs-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.doc-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px;
    border-radius: 14px;
}

.doc-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.doc-box__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.doc-badge--present {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(110, 255, 200, 0.12);
    color: var(--accent4);
    border-radius: 6px;
    font-weight: 600;
}

.doc-badge--missing {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(255, 111, 145, 0.12);
    color: var(--accent3);
    border-radius: 6px;
    font-weight: 600;
}

.doc-btn--view {
    width: 100%;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    padding: 8px;
    margin-bottom: 8px;
    display: inline-flex;
}

.doc-btn--action {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px;
}

.doc-status-text {
    font-size: 11px;
    margin-top: 6px;
    min-height: 14px;
    text-align: center;
}

.empty-state-card {
    margin-top: 24px;
    text-align: center;
}

.empty-state-body {
    padding: 60px 40px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state-title {
    margin-bottom: 8px;
    font-size: 18px;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

@media (max-width: 600px) {
    .grid-responsive-2 {
        grid-template-columns: 1fr;
    }
}

/* ── Utenti ── */

.utenti-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.utente-card {
    padding: 16px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.utente-card--active {
    background: rgba(255, 255, 255, 0.02);
}

.utente-card--inactive {
    background: rgba(255, 111, 145, 0.06);
    border-color: rgba(255, 111, 145, 0.25);
}

.utente-name {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    margin-bottom: 4px;
}

.utente-role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
    text-transform: uppercase;
}

.utente-role-badge--admin {
    background: rgba(255, 111, 145, 0.2);
    color: #ff6f91;
}

.utente-role-badge--cliente {
    background: rgba(59, 201, 157, 0.2);
    color: #3bc99d;
}

.utente-disabled-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(255, 111, 145, 0.18);
    color: #ff6f91;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 700;
}

.utente-email {
    font-size: 12px;
    color: var(--text-muted);
}

.utente-email strong {
    color: rgba(255, 255, 255, 0.7);
}

.active-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 12px;
    transition: all 0.25s;
}

.active-toggle--on {
    border: 2px solid rgba(46, 213, 115, 0.4);
    background: rgba(46, 213, 115, 0.08);
}

.active-toggle--off {
    border: 2px solid rgba(255, 111, 145, 0.4);
    background: rgba(255, 111, 145, 0.08);
}

.active-toggle__left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-toggle__title {
    font-size: 14px;
    font-weight: 600;
}

.active-toggle__title--on  { color: #2ed573; }
.active-toggle__title--off { color: #ff6f91; }

.active-toggle__sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.active-toggle__pill {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}

.active-toggle__pill--on  { background: #2ed573; }
.active-toggle__pill--off { background: rgba(255, 111, 145, 0.6); }

.active-toggle__thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    transition: left 0.25s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.active-toggle__thumb--on  { left: 25px; }
.active-toggle__thumb--off { left: 3px; }

.fogli-empty-cell {
    padding: 0;
    border: none;
}

.foglio-link-cell {
    cursor: pointer;
}

.foglio-contract {
    font-weight: 700;
}

.foglio-cell-main {
    font-weight: 600;
    line-height: 1.35;
}

.foglio-cell-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

.foglio-status-chip {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.foglio-status-chip--pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.foglio-status-chip--working {
    background: rgba(0, 150, 255, 0.15);
    color: #3da8ff;
    border: 1px solid rgba(0, 150, 255, 0.3);
}

.foglio-status-chip--done {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.foglio-status-chip--danger {
    background: rgba(255, 111, 145, 0.15);
    color: #ff6f91;
    border: 1px solid rgba(255, 111, 145, 0.3);
}

.foglio-docs-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.foglio-doc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.foglio-doc-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 35px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.foglio-doc-missing {
    font-size: 10px;
    font-weight: 500;
}

.foglio-doc-missing--danger {
    color: rgba(255, 111, 145, 0.7);
}

.foglio-doc-missing--muted {
    color: var(--text-muted);
}

.foglio-doc-btn {
    padding: 4px 10px;
    font-size: 10px;
}

.foglio-doc-btn--original-view {
    text-decoration: none;
    background: rgba(0, 150, 255, 0.1);
    color: #3da8ff;
    border: 1px solid rgba(0, 150, 255, 0.25);
}

.foglio-doc-btn--original-download {
    text-decoration: none;
    background: rgba(0, 150, 255, 0.06);
    color: #3da8ff;
    border: 1px solid rgba(0, 150, 255, 0.2);
}

.foglio-doc-btn--replace {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.25);
}

.foglio-doc-btn--signed-view {
    text-decoration: none;
    background: rgba(182, 127, 249, 0.1);
    color: var(--accent4);
    border: 1px solid rgba(182, 127, 249, 0.25);
}

.foglio-doc-btn--signed-download {
    text-decoration: none;
    background: rgba(182, 127, 249, 0.06);
    color: var(--accent4);
    border: 1px solid rgba(182, 127, 249, 0.2);
}

.foglio-doc-btn--upload {
    padding: 4px 10px;
    font-size: 10px;
}

.foglio-action-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.foglio-action-btn {
    padding: 6px 14px;
    font-size: 12px;
}

.foglio-action-btn--shipments {
    text-decoration: none;
    background: rgba(182, 127, 249, 0.1);
    color: var(--accent4);
    border-color: rgba(182, 127, 249, 0.3);
}

.foglio-action-btn--edit {
    background: rgba(0, 150, 255, 0.15);
    color: #3da8ff;
    border-color: rgba(0, 150, 255, 0.3);
}

.foglio-action-btn--delete {
    background: rgba(255, 111, 145, 0.15);
    color: #ff6f91;
    border-color: rgba(255, 111, 145, 0.3);
}

@media (max-width: 768px) {
    .fogli-state-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 10px 10px !important;
        gap: 8px !important;
    }

    .fogli-state-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 9px 14px !important;
        font-size: 12px !important;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .foglio-row td {
        min-width: 0;
    }

    .foglio-doc-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .foglio-doc-row > span {
        min-width: 42px !important;
        padding-top: 4px;
    }

    .foglio-doc-row a,
    .foglio-doc-row button {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }
}

/* ── Foglio Spedizioni: page-level helpers ── */

.u-flex-1 {
    flex: 1;
    min-width: 0;
}

tbody tr.clickable-row {
    cursor: pointer;
}

.section-label--tight {
    margin-bottom: 0;
}

.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success {
    background: rgba(46, 213, 115, 0.12);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

.alert-danger {
    background: rgba(255, 111, 145, 0.12);
    border: 1px solid rgba(255, 111, 145, 0.3);
    color: #ff6f91;
}

.foglio-error-card {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.foglio-error-body {
    padding: 48px 32px;
}

.foglio-error-icon {
    font-size: 46px;
    margin-bottom: 12px;
    opacity: 1;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.foglio-info-card {
    margin-bottom: 24px;
}

.foglio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.foglio-meta-line {
    font-size: 13px;
}

.foglio-meta-line + .foglio-meta-line {
    margin-top: 4px;
}

.foglio-meta-line .foglio-meta-strong {
    color: #fff;
}

.foglio-docs-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

.foglio-docs-heading {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.foglio-docs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foglio-doc-inline-form {
    display: inline-flex;
}

.foglio-sped-doc-cell {
    min-width: 140px;
}

.foglio-sped-doc-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.foglio-tracking-id {
    font-weight: 500;
}

.foglio-tracking-note {
    margin-left: 4px;
    opacity: 0.8;
}

/* ── Modal read-only view fields ── */

.modal-view-field {
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
}

.modal-view-field--note {
    white-space: pre-wrap;
    min-height: 60px;
}

.modal-form-grid-2-sm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════════════
   UX ENHANCEMENTS - PASSWORD & VALIDATION
═══════════════════════════════════════════════════════ */

/* Password Wrapper for Toggle Button */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.password-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.password-toggle-btn:active {
    transform: scale(0.95);
}

/* Password Strength Indicator */
.password-strength-container {
    margin-top: 10px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.strength-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-fill.strength-weak {
    background: linear-gradient(90deg, #ff6f91, #ff8077);
}

.strength-fill.strength-fair {
    background: linear-gradient(90deg, #ffb84d, #ffa500);
}

.strength-fill.strength-good {
    background: linear-gradient(90deg, #6effc8, #5fffc1);
}

.strength-fill.strength-strong {
    background: linear-gradient(90deg, #6effc8, #50d4aa);
}

.strength-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.strength-label-weak {
    color: #ff6f91;
}

.strength-label-fair {
    color: #ffb84d;
}

.strength-label-good {
    color: #6effc8;
}

.strength-label-strong {
    color: #50d4aa;
}

/* Field Error Messages */
.field-error {
    display: none;
    font-size: 12px;
    color: #ff6f91;
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(255, 111, 145, 0.12);
    border-left: 2px solid #ff6f91;
    border-radius: 4px;
    animation: slideInDown 0.2s ease;
}

.form-input.error {
    border-color: #ff6f91 !important;
    box-shadow: 0 0 0 4px rgba(255, 111, 145, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}

/* Form Input Focus with better visibility */
.form-input:focus {
    border-color: var(--accent2);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 4px rgba(127, 200, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

/* Login button base appearance */
.btn-login {
    display: block;
    width: 100%;
    padding: 14px;
    color: #020a1a;
    border: none;
    border-radius: var(--radius-input);
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    text-align: center;
    margin-top: 8px;
}

/* Button Base Styles - Standardized */
.btn-login,
button[type="submit"],
.btn,
.btn-primary {
    position: relative;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Primary Button */
.btn-login,
button[type="submit"],
.btn-primary {
    background: linear-gradient(135deg, var(--accent2), #3da8ff);
    box-shadow: 0 4px 20px rgba(127, 200, 255, 0.35);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.btn-login:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 28px rgba(127, 200, 255, 0.5);
}

.btn-login:active:not(:disabled),
button[type="submit"]:active:not(:disabled),
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(127, 200, 255, 0.35);
}

.btn-login:focus,
button[type="submit"]:focus,
.btn-primary:focus {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

/* Button Disabled State */
.btn-login:disabled,
button[type="submit"]:disabled,
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    filter: none;
}

/* Loading State - spinner inside button */
.btn-login.loading,
button[type="submit"].loading,
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading::after,
button[type="submit"].loading::after,
.btn-primary.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(2, 10, 26, 0.2);
    border-top-color: #020a1a;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    vertical-align: middle;
}

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

/* Responsive for small devices */
@media (max-width: 320px) {
    .password-toggle-btn {
        right: 8px;
    }

    .field-error {
        font-size: 11px;
    }

    .strength-label {
        font-size: 11px;
    }
}

/* ─── EXTENDED MEDIA QUERIES ──────────────────────── */

/* Extra small devices */
@media (max-width: 280px) {
    :root {
        --radius-card: 20px;
        --radius-input: 12px;
    }

    .login-card,
    .login-card.recover-card {
        padding: 20px 12px !important;
        border-radius: 20px;
    }

    .form-input,
    .btn-login,
    button[type="submit"] {
        font-size: 13px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .login-title {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .form-label {
        font-size: 10px;
    }

    .btn-login.loading::after,
    button[type="submit"].loading::after {
        width: 12px;
        height: 12px;
        margin-left: 6px;
        border-width: 1.5px;
    }
}

/* Small phones (320px) */
@media (max-width: 360px) {

    .login-card,
    .login-card.recover-card {
        padding: 20px 14px;
        margin: 0 10px;
    }

    .password-wrapper {
        padding-right: 4px;
    }

    .password-toggle-btn {
        right: 4px;
        padding: 6px;
        font-size: 16px;
    }

    .strength-bar {
        height: 5px;
    }

    .login-links {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
    }

    .login-links a {
        display: block;
        text-align: center;
    }
}

/* Regular phones (480px) */
@media (max-width: 480px) {
    .password-toggle-btn {
        right: 8px;
        padding: 8px;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {

    .login-card,
    .login-card.recover-card {
        max-width: 90vw;
    }
}

@media (max-width: 420px) {
    .login-card {
        padding: 24px 16px;
        margin: 0 12px;
    }
}

/* ═══════════════════════════════════════════════════════
   PAGINATION BUTTONS
═══════════════════════════════════════════════════════ */

.btn-pagination {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--accent2);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-pagination:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(127, 200, 255, 0.2);
}

.btn-pagination:active:not(:disabled) {
    transform: translateY(0);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .btn-pagination {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   SETTINGS PAGE
═══════════════════════════════════════════════════════ */

.settings-page-header,
.settings-page-card {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.settings-page-header {
    margin: 0 auto 24px;
}

.settings-page-card {
    margin: 0 auto;
    padding: 28px 32px;
}

.settings-page-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.settings-page-section {
    margin-bottom: 0;
}

.settings-page-title {
    margin-bottom: 15px;
    font-size: 14px;
}

.settings-options-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-choice-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-choice-group--dual {
    flex-wrap: nowrap;
}

.settings-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.settings-option--theme {
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
}

.settings-option--fill {
    flex: 1;
}

.settings-option--center {
    justify-content: center;
    min-width: 100px;
}

.settings-option--selected {
    border-color: var(--accent2);
}

.settings-option input[type="radio"] {
    cursor: pointer;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    accent-color: var(--accent2);
}

.settings-option__text--xs {
    font-size: 11px;
}

.settings-option__text--sm {
    font-size: 12px;
}

.settings-option__text--md {
    font-size: 13px;
}

.settings-option__text--lg {
    font-size: 15px;
}

.settings-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent2), #3bc99d);
    color: #111;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .settings-page-header {
        margin-bottom: 16px;
        padding: 0;
        gap: 12px;
        align-items: flex-start;
    }

    .settings-page-header .logo-ring {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        font-size: 20px;
    }

    .settings-page-header .page-title {
        font-size: clamp(20px, 7vw, 26px);
    }

    .settings-page-header .page-subtitle {
        font-size: 12px;
        line-height: 1.4;
    }

    .settings-page-card {
        padding: 16px 12px;
    }

    .settings-page-form {
        gap: 20px;
    }

    .settings-option {
        padding: 9px 10px;
        gap: 6px;
        border-width: 1px;
        min-height: 0;
    }

    .settings-option input[type="radio"] {
        width: 16px;
        height: 16px;
        min-width: 16px;
        min-height: 16px;
        transform: none;
    }

    .settings-option span {
        font-size: 11px;
        line-height: 1.2;
    }

    .settings-submit {
        padding: 12px;
        font-size: 14px;
        margin-top: 0;
    }
}

@media (max-width: 560px) {
    .settings-choice-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .settings-choice-group > .settings-option {
        width: 100%;
        justify-content: flex-start;
    }

    .settings-options-stack .settings-option {
        min-width: 100%;
    }
}

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 500;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid;
    -moz-appearance: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    transform-origin: top right;
    transform: scaleX(0);
}

.toast.toast-show {
    opacity: 1;
    transform: scaleX(1);
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Toast Types */
.toast-success {
    background: rgba(110, 255, 200, 0.12);
    border-color: rgba(110, 255, 200, 0.3);
    color: #6effc8;
}

.toast-error {
    background: rgba(255, 111, 145, 0.12);
    border-color: rgba(255, 111, 145, 0.3);
    color: #ff6f91;
}

.toast-warning {
    background: rgba(255, 184, 77, 0.12);
    border-color: rgba(255, 184, 77, 0.3);
    color: #ffb84d;
}

.toast-info {
    background: rgba(127, 200, 255, 0.12);
    border-color: rgba(127, 200, 255, 0.3);
    color: #7fc8ff;
}

.toast-icon {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-message {
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px) scaleX(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scaleX(1);
    }
}

/* Light theme adjustments */
body.theme-grigio .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.theme-grigio .toast-success {
    background: rgba(110, 255, 200, 0.08);
    border-color: rgba(110, 255, 200, 0.2);
    color: #1c9b7a;
}

body.theme-grigio .toast-error {
    background: rgba(255, 111, 145, 0.08);
    border-color: rgba(255, 111, 145, 0.2);
    color: #cc3a5a;
}

body.theme-grigio .toast-warning {
    background: rgba(255, 184, 77, 0.08);
    border-color: rgba(255, 184, 77, 0.2);
    color: #d47e1f;
}

body.theme-grigio .toast-info {
    background: rgba(127, 200, 255, 0.08);
    border-color: rgba(127, 200, 255, 0.2);
    color: #0066cc;
}

body.theme-gray-light .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.theme-gray-light .toast-success {
    background: rgba(110, 255, 200, 0.08);
    border-color: rgba(110, 255, 200, 0.2);
    color: #1c9b7a;
}

body.theme-gray-light .toast-error {
    background: rgba(255, 111, 145, 0.08);
    border-color: rgba(255, 111, 145, 0.2);
    color: #cc3a5a;
}

body.theme-gray-light .toast-warning {
    background: rgba(255, 184, 77, 0.08);
    border-color: rgba(255, 184, 77, 0.2);
    color: #d47e1f;
}

body.theme-gray-light .toast-info {
    background: rgba(127, 200, 255, 0.08);
    border-color: rgba(127, 200, 255, 0.2);
    color: #0066cc;
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
    #toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .toast {
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* ─── LOADING SKELETON ─────────────────────────── */
@keyframes skeletonPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.08) 100%);
    background-size: 200% 100%;
    animation: skeletonPulse var(--transition-slow) infinite;
    border-radius: 8px;
    height: 16px;
}

.skeleton-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.08) 100%);
    background-size: 200% 100%;
    animation: skeletonPulse var(--transition-slow) infinite;
}

.skeleton-line:last-child {
    width: 75%;
}

.skeleton-card {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
/* ─── TABLE DENSE / RESPONSIVE ─────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-dense {
    font-size: 0.85rem;
}

.table-dense th,
.table-dense td {
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.table-dense thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.06);
}

body.theme-gray-light .table-dense thead th {
    background: rgba(0, 0, 0, 0.03);
}

/* Striped & Hover effects for custom tables */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.035);
}
body.theme-gray-light .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}
body.theme-gray-light .table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* ── ANIMATED COLLAPSE ── */
.collapse {
    display: grid !important;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    opacity: 0;
    padding: 0;
    margin: 0;
}
.collapse > * {
    min-height: 0;
    overflow: hidden;
}
.collapse.show {
    grid-template-rows: 1fr;
    opacity: 1;
}
