body.dark-theme {
    --text: #e6e9ef;
    --text-muted: #9aa3b2;
    --text-disabled: rgba(230, 233, 239, 0.35);

    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-inner: rgba(255, 255, 255, 0.05);

    --radius-card: var(--radius-md);

    --aurora-layers:
        radial-gradient(circle at 18% 22%, rgba(90, 130, 200, 0.16), transparent 55%),
        radial-gradient(circle at 82% 70%, rgba(70, 90, 120, 0.18), transparent 55%);
    background: linear-gradient(160deg, #0e131b, #141b26 60%, #0e131b);
    background-color: #0e131b;
    color: var(--text);
}

body.dark-theme::before {
    animation: none;
}

body.dark-theme .glass-card,
body.dark-theme .login-card,
body.dark-theme .card,
body.dark-theme .stats-card {
    background: rgba(22, 29, 40, 0.55);
    backdrop-filter: blur(16px) saturate(110%);
    -webkit-backdrop-filter: blur(16px) saturate(110%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme .glass-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme .glass-card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 30%);
}

body.dark-theme .modal-overlay {
    background: rgba(8, 11, 16, 0.62);
}

body.dark-theme .modal-content,
body.dark-theme .modal-eurotrasporti {
    background:
        radial-gradient(120% 70% at 0% 0%, rgba(var(--accent2-rgb), 0.07), transparent 55%),
        rgba(22, 29, 40, 0.82);
    border: 1px solid var(--glass-border);
    border-top-color: rgba(255, 255, 255, 0.16);
    --modale-ombra:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 12px 32px rgba(0, 0, 0, 0.45),
        0 30px 80px -10px rgba(0, 0, 0, 0.7);
    box-shadow: var(--modale-ombra);
}

body.dark-theme .modal-content:hover,
body.dark-theme .modal-eurotrasporti:hover {
    box-shadow: var(--modale-ombra);
}

body.dark-theme .btn-close {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
    box-shadow: none;
}

body.dark-theme .stats-card {
    border-radius: var(--radius-md);
    corner-shape: squircle;
}

body.dark-theme .stats-card:hover,
body.dark-theme .mittente-card:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme .stats-card--warning::after {
    animation: none;
    opacity: 0.6;
}

body.dark-theme .sidebar {
    background: rgba(12, 17, 25, 0.62);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.dark-theme .page-title,
body.dark-theme .topbar-title {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: #eef1f6;
}

body.dark-theme .section-label {
    color: #b7bfcc;
    letter-spacing: 0.06em;
}

body.dark-theme .logo-ring {
    box-shadow: none;
}

body.dark-theme .btn-primary,
body.dark-theme .btn-login,
body.dark-theme .btn-cta {
    background: var(--accent2-forte);
    color: var(--on-accent);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    filter: none;
}

body.dark-theme .btn-primary:hover:not(:disabled),
body.dark-theme .btn-login:hover:not(:disabled),
body.dark-theme .btn-cta:hover {
    background: var(--accent2-forte);
    box-shadow: none;
    filter: brightness(1.12);
}

body.dark-theme .btn-primary:active:not(:disabled),
body.dark-theme .btn-login:active:not(:disabled) {
    box-shadow: none;
}

body.dark-theme button[type="submit"]:not(.btn-secondary):not(.modal-btn-danger):hover:not(:disabled) {
    filter: none;
}

body.dark-theme .nav-item.active,
body.dark-theme .nav-sub-item.active {
    background: rgba(var(--accent2-rgb), 0.10);
    box-shadow: none;
    color: #dfe7f5;
}

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

body.dark-theme :is(.sidebar-user__avatar, .profile-photo__avatar).avatar-default {
    background: var(--accent2-forte);
    box-shadow: none;
    text-shadow: none;
}

body.dark-theme .avatar-default::before,
body.dark-theme .avatar-default::after {
    display: none;
}

body.dark-theme .sidebar-user:hover .avatar-default,
body.dark-theme .avatar-default:hover {
    transform: none;
}

body.dark-theme .status-badge.stato--consegna::after {
    animation: none;
    opacity: 0;
}

body.dark-theme .fogli-tab.is-active {
    box-shadow: none;
}

body.dark-theme .toast {
    background: rgba(18, 24, 34, 0.92);
    border-left-width: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body.dark-theme.viewer-page {
    --viewer-panel: rgba(14, 19, 27, 0.92);
    --viewer-line: var(--glass-border);
    --viewer-text: var(--text);
    --viewer-muted: var(--text-muted);
    --viewer-accent: var(--accent4);
    --viewer-accent-alt: var(--accent2);
}
