/* =========================
   Reset e stili base
   ========================= */

/* shadcn/ui Design System */
@import url('shadcn-tokens.css');
@import url('shadcn-components.css');
@import url('shadcn-select.css');
@import url('shadcn-toast.css');
@import url('shadcn-chart.css');


:root {
    /* ======== Legacy variables mapped to Kinetic tokens ======== */

    /* Bordi e divisori */
    --background-spacer-color: hsl(var(--border));

    /* Sfondi */
    --background-color: hsl(var(--background));
    --background-card-color: hsl(var(--card));

    /* Gruppi di input e aree secondarie */
    --background-field-group: hsl(var(--secondary));
    --background-color-light: hsl(var(--muted));

    /* Tipografia */
    --text-color: hsl(var(--foreground));
    --small-text-color: hsl(var(--muted-foreground));

    /* Bottoni */
    --background-button-color: hsl(var(--primary));
    --text-color-btn: hsl(var(--primary-foreground));

    --background-button-color-shadow: hsla(var(--primary) / 0.15);

    /* Input e Focus */
    --border-input-color: hsl(var(--border));
    --background-a-element-active-hover: hsl(var(--accent));

    /* Colori di stato */
    --danger-color: hsl(var(--destructive));
    --success-color: hsl(var(--success));

    /* Additional legacy mappings */
    --primary-color: hsl(var(--primary));
    --light-border-color: hsl(var(--border));

    /* Focus ring */
    --ring-color: hsl(var(--ring));
    --warning-darker: hsl(var(--warning-darker));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* width */
::-webkit-scrollbar {
    width: 5px;
    margin-right: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background-color: transparent;
    border: transparent;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: var(--radius-full);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground));
}

body {
    font-family: var(--font-sans);
    background: hsl(var(--background));
    min-height: 100vh;
    color: hsl(var(--foreground));
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
}

body::before,
body::after {
    display: none;
}

::-moz-selection {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

::selection {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    letter-spacing: var(--tracking-tight);
    color: hsl(var(--foreground));
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

/* Links */
a {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: color var(--k-spring-micro);
}

a:hover {
    color: hsl(var(--primary) / 0.8);
}

button {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-family: var(--font-sans);
    border: 1px solid hsl(var(--primary) / 0.18);
    background-image: none;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

button:hover {
    background-color: hsl(var(--primary) / 0.82);
}

button:active {
    background-color: hsl(var(--primary) / 0.74);
}

button:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.button {
    background-image: none !important;
    padding: var(--space-2) var(--space-5) !important;
    text-decoration: none !important;
    color: hsl(var(--primary-foreground)) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-sans);
    font-weight: 500;
    border: 1px solid hsl(var(--primary) / 0.18) !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

.button:hover {
    background-color: hsl(var(--primary) / 0.82) !important;
}

/* Cookie Banner Style */
.cookie-banner {
    background-color: hsl(var(--input) / 0.9) !important;
    bottom: var(--space-6);
    transition: border-color var(--k-spring-snappy), box-shadow var(--k-spring-snappy), transform var(--k-spring-snappy) !important;
    width: calc(100% - var(--space-12));
    border: 1px solid hsl(var(--border)) !important;
    border-radius: var(--radius-lg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: hsl(var(--primary) / 0.75) !important;
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.1) !important;
    outline: none !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);

    /* Animazione entrata */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    /* Non cliccabile finché nascosto */
}

/* Classe per mostrare il banner */
.cookie-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.cookie-content {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.cookie-icon {
    color: hsl(var(--primary));
    font-size: 1.2rem;
    margin-top: 2px;
}

.cookie-banner p {
    font-size: var(--text-sm);
    color: hsl(var(--foreground));
    margin: 0;
    line-height: 1.5;
}

.cookie-banner a {
    color: hsl(var(--primary));
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner a:hover {
    text-decoration: underline;
}

.cookie-btn {
    align-self: flex-end;
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.cookie-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .cookie-banner {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
    }
}

#dbStatus {
    font-weight: bold !important;
}

input,
select,
textarea {
    background-color: hsl(var(--input)) !important;
    font-family: var(--font-sans) !important;
    transition: border-color var(--transition-fast) !important;
    color: hsl(var(--foreground)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: var(--radius-md) !important;
    font-size: var(--text-sm) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: hsl(var(--foreground) / 0.5) !important;
    box-shadow: none !important;
    outline: none !important;
}

input::placeholder,
textarea::placeholder {
    color: hsl(var(--muted-foreground)) !important;
}

.login-body {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    backdrop-filter: blur(5px) !important;
}

/* =========================
         Navbar — Modern Floating Bar
         ========================= */
.navbar {
    position: fixed;
    font-family: var(--font-nav);
    top: 0;
    left: 0;
    width: 100%;
    height: 55px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    background: hsl(var(--card));
    z-index: 1000;
    transition: background-color var(--k-spring-snappy), border-color var(--k-spring-snappy);
}

.navbar:hover {
    border-bottom-color: hsl(var(--border) / 0.95);
}

.nav-brand-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    transition: opacity 0.15s ease;
}

.nav-brand-icon:hover {
    opacity: 0.8;
}

#navbar {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spazio per navbar floating */
body {
    padding-top: calc(48px + 0.75rem + 1.25rem);
    padding-bottom: calc(60px + var(--space-4) + var(--space-6));
}

/* Sezioni navbar */
.branding {
    flex-shrink: 0;
}

.pulsanti {
    display: flex;
    align-items: center;
    gap: 0;
}

.utente {
    display: flex;
    align-items: center;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
    transition: opacity 0.15s ease;
}

.nav-brand:hover {
    opacity: 0.88;
}

.nav-brand i {
    color: hsl(var(--primary));
    font-size: 1em;
}

/* ─── Hamburger ─── */
.nav-toggle {
    display: none;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-lg);
    z-index: 1002;
    transition: background 0.15s ease;
}

.nav-toggle:hover {
    background: hsl(var(--accent)) !important;
}

.nav-toggle i {
    font-size: 1.15rem;
    color: hsl(var(--foreground));
    transition: color 0.15s ease;
}

.nav-toggle:hover i {
    color: hsl(var(--accent-foreground));
}

/* ─── Nav links ─── */
.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    font-family: var(--font-title);
    padding: 0;
    background: transparent;
    align-items: center;
}

.nav-links>li {
    position: relative;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-weight: 450;
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-lg);
    transition: color var(--k-spring-snappy), background var(--k-spring-snappy), transform var(--k-spring-snappy);
    position: relative;
    white-space: nowrap;
}

.nav-links a i {
    display: none;
    font-size: 0.85em;
}

.nav-links a:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--accent) / 0.8);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: hsl(var(--foreground));
    background: hsl(var(--primary) / 0.12);
    font-weight: 500;
}

.nav-links a.active:hover {
    background: hsl(var(--primary) / 0.16);
}

/* =========================
      Dropdown System (Desktop)
      ========================= */

.nav-mobile {
    display: none !important;
}

.nav-desktop {
    display: flex !important;
}

/* Dropdown container */
.nav-dropdown {
    position: relative;
    margin: 4px;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: hsl(var(--muted-foreground)) !important;
    background: transparent !important;
    border: none !important;
    font-weight: 450;
    font-family: var(--font-title);
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem !important;
    border-radius: var(--radius-lg) !important;
    cursor: pointer;
    transition: color var(--k-spring-snappy), background var(--k-spring-snappy), transform var(--k-spring-snappy);
    white-space: nowrap;
}

.nav-dropdown-trigger:hover {
    color: hsl(var(--foreground)) !important;
    background: hsl(var(--accent) / 0.8) !important;
    transform: translateY(-1px);
}

.nav-dropdown.open .nav-dropdown-trigger {
    color: hsl(var(--foreground)) !important;
    background: hsl(var(--primary) / 0.12) !important;
}

.nav-dropdown-arrow {
    font-size: 0.55em;
    opacity: 0.6;
    transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-dropdown.open .nav-dropdown-arrow,
.nav-user-dropdown.open .nav-dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}


/* ─── Dropdown Panel ─── */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    font-family: var(--font-title);
    transform: translateX(-50%) translateY(-6px);
    min-width: 190px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border) / 0.9);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    border-radius: var(--radius-xl);
    padding: 0.35rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 1001;
    list-style: none;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-user-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu li {
    margin: 3px;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.82rem;
    font-weight: 450;
    border-radius: var(--radius-lg);
    transition: background 0.12s ease, color 0.12s ease;
    text-decoration: none;
}

.nav-dropdown-menu a i {
    display: block !important;
    width: 1rem;
    text-align: center;
    font-size: 0.82em;
    color: hsl(var(--muted-foreground));
    opacity: 0.7;
    transition: color 0.12s ease, opacity 0.12s ease;
    flex-shrink: 0;
}

.nav-dropdown-menu a:hover {
    background: hsl(var(--primary) / 0.12);
    color: hsl(var(--foreground));
}

.nav-dropdown-menu a:hover i {
    color: hsl(var(--foreground));
    opacity: 1;
}

.nav-dropdown-menu a.active {
    color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.06);
    font-weight: 500;
}

.nav-dropdown-menu a.active i {
    color: hsl(var(--primary));
    opacity: 1;
}

/* =========================
      User Dropdown
      ========================= */
.nav-user-dropdown {
    position: relative;
}

.nav-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent !important;
    border: none !important;
    padding: 0.3rem 0.4rem !important;
    border-radius: var(--radius-xl) !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nav-user-trigger:hover {
    background: hsl(var(--accent) / 0.8) !important;
    transform: translateY(-1px);
}

.nav-user-name {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
    font-weight: 800;
    display: none;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .nav-user-name {
        display: block;
    }
}

.nav-user-trigger .nav-avatar-container img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid hsl(var(--border));
    transition: border-color var(--k-spring-snappy), transform var(--k-spring-snappy);
}

.nav-user-trigger:hover .nav-avatar-container img {
    border-color: hsl(var(--primary) / 0.5);
    transform: translateY(-1px);
}

.nav-user-trigger .nav-dropdown-arrow {
    color: hsl(var(--muted-foreground));
    font-size: 0.5em;
    opacity: 0.5;
}

/* User menu position */
.nav-user-menu {
    right: 0;
    left: auto !important;
    transform: translateX(0) translateY(-6px) !important;
    min-width: 170px;
}

.nav-user-dropdown.open .nav-user-menu {
    transform: translateX(0) translateY(0) !important;
}

.nav-user-divider {
    height: 1px;
    background: hsl(var(--border) / 0.6);
    margin: 0.3rem 0.25rem;
}

.nav-logout {
    color: hsl(var(--destructive)) !important;
}

.nav-logout:hover {
    background: hsl(var(--destructive) / 0.08) !important;
    color: hsl(var(--destructive)) !important;
}

.nav-logout i {
    color: hsl(var(--destructive)) !important;
}

/* User greeting (legacy) */
.nav-user {
    display: none;
    font-size: 0.82rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}

@media (min-width: 1013px) {
    .nav-user {
        display: block;
    }
}

.nav-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid hsl(var(--border) / 0.6);
    transition: opacity var(--k-spring-snappy), transform var(--k-spring-snappy);
}

.nav-avatar img:hover {
    transform: translateY(-1px);
}

.nav-avatar img:hover {
    opacity: 0.8;
}

.nav-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    text-decoration: none;
}

/* =========================
      Mobile (≤ 1120px)
      ========================= */
@media (max-width: 1120px) {
    .navbar {
        width: calc(100% - 1rem);
        top: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
        padding: 0 0.65rem;
        height: 46px;
        border-radius: var(--radius);
        backdrop-filter: blur(24px) saturate(180%);
    }

    body {
        padding-top: calc(46px + 0.5rem + 1rem);
    }

    .branding {
        display: none !important;
    }

    .summary-item {
        justify-content: space-between !important;
    }

    .summary-label {
        text-align: right;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 3;
        width: 36px;
        height: 36px;
        padding: 0 !important;
    }

    .nav-toggle.open {
        background: hsl(var(--accent)) !important;
    }

    .nav-toggle.open i {
        color: hsl(var(--accent-foreground)) !important;
    }

    .nav-avatar {
        order: 2;
        flex-direction: row-reverse;
    }

    .nav-avatar img {
        width: 30px;
        height: 30px;
    }

    /* 🍔 Mobile menu panel – dropdown compatto a destra 🍔 */
    .nav-links {
        /* display: none; */
        position: fixed;
        top: 58px;
        right: 0.5rem;
        left: auto;
        width: auto;
        min-width: 210px;
        max-width: 270px;
        background: hsl(var(--card) / 1);
        font-family: var(--font-title);
        padding: 0.4rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        border: 1px solid hsl(var(--border) / 0.8);
        border-radius: var(--radius-lg);
        /* box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12), 0 2px 8px hsl(var(--foreground) / 0.06); */
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-links.open {
        display: flex;
        animation: navSlideDown 0.2s ease-out forwards;
    }

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

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

    .nav-links a {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        font-weight: 500;
        border-radius: var(--radius-xl);
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.6rem;
        background: transparent;
        color: hsl(var(--foreground));
        transition: background 0.15s, color 0.15s;
        min-height: 38px;
        white-space: nowrap;
    }

    .nav-links a i {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: hsl(var(--muted));
        border-radius: 7px;
        font-size: 0.82em;
        color: hsl(var(--muted-foreground));
        opacity: 1;
        flex-shrink: 0;
        transition: background 0.15s, color 0.15s;
    }

    .nav-mobile li {
        list-style: none;
    }

    .nav-mobile a {
        justify-content: flex-start !important;
        text-align: left;
    }

    .nav-links a:hover {
        background: hsl(var(--accent) / 0.8);
        color: hsl(var(--foreground));
    }

    .nav-links a:hover i {
        background: hsl(var(--border));
        color: hsl(var(--foreground));
        opacity: 1;
    }

    .nav-links a.active {
        background: hsl(var(--primary) / 0.08);
        color: hsl(var(--primary));
    }

    .nav-links a.active i {
        background: hsl(var(--primary) / 0.15);
        color: hsl(var(--primary));
        opacity: 1;
    }

    .nav-mobile-divider {
        height: 1px;
        background: hsl(var(--border) / 0.7);
        margin: 0.35rem 0.5rem;
    }

    /* Header sezione menu mobile */
    .nav-mobile-header {
        list-style: none;
        padding: 0.4rem 0.75rem 0.2rem;
        pointer-events: none;
    }

    .nav-mobile-title {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: hsl(var(--muted-foreground));
    }

    /* Divisore fine lista */
    .nav-mobile-divider-el {
        list-style: none;
        height: 1px;
        background: hsl(var(--border) / 0.6);
        margin: 0.35rem 0.5rem;
        pointer-events: none;
    }

    /* Mobile: swap menus */
    .nav-desktop {
        display: none !important;
    }

    .nav-mobile.open {
        display: flex !important;
    }

    /* Mobile user dropdown simplification */
    .nav-user-name {
        display: none !important;
    }

    .nav-user-trigger .nav-dropdown-arrow {
        display: none;
    }

    .nav-user-dropdown {
        order: 2;
    }

    .nav-user-menu {
        right: revert-layer;
        left: auto !important;
        transform: none !important;
        top: calc(100% + 6px);
    }

    .nav-user-dropdown.open .nav-user-menu {
        transform: none !important;
    }

    .list-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .pulsanti {
        order: 3;
    }

    .utente {
        order: 2;
    }
}

.header-actions-first {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* =========================
      Footer globale
      ========================= */
#footer-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: var(--space-4);
}

#app-footer {
    display: none !important;
    position: fixed;
    bottom: var(--space-3);
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100% - var(--space-8));
    margin: 0 auto;
    border-radius: var(--radius-xl);
    height: auto;
    padding: var(--space-3) var(--space-5);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    background: hsl(var(--card) / 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid hsl(var(--border) / 0.6);
    transition: all var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

#app-footer:hover {
    border-color: hsl(var(--border));
    box-shadow: var(--shadow-xl);
}

.footer-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    gap: calc(var(--space-4) / 2);
}

.footer-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
}

.footer-elements {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: hsl(var(--muted-foreground));
}

.footer-brand {
    font-weight: 700;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: hsl(var(--foreground));
}

.footer-link {
    color: #7784ff;
    font-size: 16px;
    text-decoration: none;
    font-weight: 700;
    text-decoration: none;
}

.db-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: hsl(var(--muted-foreground));
    display: inline-block;
    animation: pulse 2s infinite;
}

.db-dot.online {
    background: hsl(var(--success));
    box-shadow: 0 0 8px hsl(var(--success) / 0.5);
}

.db-dot.offline {
    background: hsl(var(--destructive));
    box-shadow: 0 0 8px hsl(var(--destructive) / 0.5);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    #app-footer {
        width: calc(100% - var(--space-4));
        max-width: none;
        bottom: var(--space-2);
        flex-direction: column;
        gap: var(--space-2);
        padding: var(--space-3);
        border-radius: var(--radius-lg);
    }

    body {
        padding-bottom: calc(100px + var(--space-2) + var(--space-4));
    }

    .footer-elements {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .footer-brand {
        font-size: var(--text-base);
    }
}

/* ================================
   1) Custom caret color & blink
   ================================ */
input,
textarea {
    /* cambia colore al cursore di testo */
    caret-color: hsl(var(--primary));
}

/* ================================
   2) Custom checkbox → modern square
   ================================ */
input[type="checkbox"] {
    /* rimuovi aspetto nativo */
    appearance: none;
    -webkit-appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 1px solid var(--light-border-color);
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    transition: all 150ms ease;
    margin-right: 0.5rem;
    background: hsl(var(--background));
}

input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

input[type="checkbox"]:checked::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* se preferisci il look “radio” */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--light-border-color);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 150ms ease;
    margin-right: 0.5rem;
    background: hsl(var(--background));
}

input[type="radio"]:hover {
    border-color: var(--primary-color);
}

input[type="radio"]:checked {
    border-color: var(--primary-color);
}

input[type="radio"]:checked::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ================================
   3) Label + controllo
   ================================ */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
}

.checkbox-group label,
.radio-group label {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: hsl(var(--foreground));
}

/* Spazio tra più checkbox/radio in un form */
.checkbox-group+.checkbox-group,
.radio-group+.radio-group {
    margin-top: 0.5rem;
}

/* =========================
         Main container
         ========================= */

#det-idfGen {
    font-weight: bold;
    width: 100%;
}

input {
    font-weight: 500 !important;
}

main {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: auto;
}

/* =========================
      Sezione "Prossima Prenotazione"
      ========================= */
#nextBooking {
    width: 100%;
    margin: 2rem 0;
}

#nextBooking h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#nextBookingCard {
    cursor: pointer;
    /* background: hsl(var(--card)); */
    color: hsl(var(--foreground));
    border-radius: var(--radius);
    /* border: 3px solid hsl(var(--border)); */
    padding: 1.5rem;
    min-width: 100%;
    margin: auto;
    transition: transform 0.2s, box-shadow 0.2s;
}

#nextBookingDetails {
    font-size: 1rem;
    color: hsl(var(--foreground));
    line-height: 1.6;
}

#nextBookingDetails div {
    margin-bottom: 0.5rem;
}

#nextBookingDetails strong {
    font-size: 1.5rem;
    text-transform: uppercase !important;
}

/* ===========================================
      Preview lettera di benvenuto
      =========================================== */
.letter-preview {
    width: 595px;
    height: 842px;
    margin: 2rem auto;
    position: relative;
    font-family: var(--font-display);
    background-image: url('../images/A4\ -\ 9.png');
    /* Cambia con il tuo sfondo */
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* contenuto testuale, posizionato in modo da non sovrapporsi alla grafica di sfondo */
.letter-preview .letter-content {
    position: absolute;
    top: 140px;
    /* regola questi valori in base al tuo sfondo */
    left: 70px;
    right: 70px;
    bottom: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
}

/* saluto (text1) */
.letter-greeting {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.8rem;
    color: #264653;
    letter-spacing: 0.3px;
}

/* nome & cognome grande */
.letter-name {
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 2.2rem;
    color: #264653;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* paragrafi (text2, text3) */
.letter-paragraph {
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 440px;
    /* per limitarne la larghezza */
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
    font-weight: 400;
}

/* se vuoi un footer testuale semplice dentro il preview */
.letter-preview footer {
    position: absolute;
    bottom: 40px;
    /* luci sopra il bordo inferiore */
    left: 100px;
    right: 100px;
    text-align: right;
    font-size: 1rem;
    color: #264653;
}

/* =========================
         Login Page
         ========================= */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    text-align: center;
}



.login-container h1 {
    font-size: 2rem;
}

.login-container p {
    color: #f8f8f8;
}

.login-box {
    max-width: 450px;
    margin: auto;
}

.login-box h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.login-box p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1.5rem;
}

.login-box label {
    display: none;
    text-align: left;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.login-box input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #fff;
    background-color: #262626;
    border: none !important;
    border-radius: 17px;
    font-size: 1rem;
    transition: all 200ms ease;
}

.login-box input:focus {
    border: 2px solid #007bff !important;
}


.login-box button {
    width: 100%;
    padding: 0.90rem;
    background-color: #f5f5f5;
    color: #0f0f0f;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.spacer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 20px;
}

.spacer p {
    margin-bottom: 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
}

.spacer hr {
    width: 100%;
    height: 1px;
    background-color: #404040;
    border: none;
}

.small-text {
    font-size: 0.85rem;
    color: #9fa39f !important;
    margin-top: 1rem;
    text-align: center;
}

.small-text a {
    color: #e7e7e7;
    text-decoration: none;
}

.small-text a:hover {
    text-decoration: underline;
}

/* === Split layout === */
.login-layout {
    display: flex;
    min-height: 100vh !important;
}

.left,
.right {
    flex: 1;
}

/* Colonna sinistra: form */
.left {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #101118;
    /* Fallback color */
    background-image:
        radial-gradient(at 100% 100%, hsla(261, 55%, 15%, 0.411) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(340, 46%, 18%, 0.438) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(221, 32%, 15%, 0.411) 0px, transparent 50%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #ffffff;
}

/* Titolo e paragrafo principali in bianco */
.login-container>h1,
.login-container>p {
    color: #ffffff;
}

/* Colonna destra: immagine di demo */
.right {
    background-image: url('../images/NOVAGLIE-drone-1-1200x1000.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.right.registrati {
    background-image: url('../images/registrati1.webp');
}

#login-with {
    font-family: var(--font-sans) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.login-with-others {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 1rem;
}

.login-with-others button {
    display: flex;
    color: #fcfcfc !important;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    margin-top: 1rem;
    background: #ffffff00 !important;
    border: 1px solid #4d4d4d !important;
}

.btn-google {
    background: #ffffff00 !important;
    border: 1px solid #4d4d4d !important;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    width: 100%;
    border-radius: 30px !important;
    margin-top: 10px;
    cursor: pointer;
    color: #fcfcfc !important;
    font-weight: 500;
    transition: all 200ms ease !important;
    justify-content: center;
    gap: 20px;
}

.btn-discord {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 10px;
    cursor: pointer;
    color: #ffffff !important;
    font-weight: 500;
    transition: all 200ms ease !important;
    justify-content: center;
}

.btn-discord img {
    filter: brightness(0) invert(1);
}

.btn-github {
    padding: 0.90rem;
    width: auto !important;
    border-radius: 50px !important;
    margin-top: 10px;
    cursor: pointer;
    color: #ffffff !important;
    font-weight: 500;
    transition: all 200ms ease !important;
    justify-content: center;
}

.btn-github img {
    filter: brightness(0) invert(1);
}

.btn-spotify {
    border-radius: var(--radius-full) !important;
    margin-top: 10px;
    cursor: pointer;
    color: #ffffff !important;
    font-weight: 500;
    transition: all 200ms ease !important;
    justify-content: center;
}

.btn-spotify img {
    filter: brightness(0) invert(1);
}

.btn-figma {
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border-radius: var(--radius-full) !important;
    margin-top: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 200ms ease !important;
    justify-content: center;
}

.btn-discord,
.btn-github:hover,
.btn-google,
.btn-spotify,
.btn-figma {
    border-radius: 30px !important;
}

.welcome-text {
    font-size: 1.5rem;
    color: #ffffff;
}

.vertical-hr {
    width: 2px;
    /* Larghezza della linea */
    background-color: #f1f1f1;
    /* Colore della linea */
    height: 50px;
    /* Altezza della linea (ad esempio) */
}

.inizialitation {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .right {
        display: none;
    }

    .left {
        padding: 1rem;
    }
}

@media (max-width:1200px) {
    .left {
        padding: 1rem;
    }
}

.forgot-container {
    text-align: right;
    margin-top: 0.5rem;
    text-decoration: none !important;
}

.forgot-password {
    width: 100%;
    border-radius: 30px !important;
    color: #161616 !important;
}

#forgotPasswordLink {
    text-decoration: none !important;
    margin-bottom: -10px;
    color: #161616 !important;
}

.forgot-link {
    cursor: pointer !important;
    text-decoration: none !important;
}

.forgot-link:hover {
    color: #003d80;
    text-decoration: none !important;
}

.password-requirements {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    margin-bottom: .5rem;
}

.password-requirements .status {
    font-weight: bold;
}

/* =========================
         Form Page (Inserisci)
         ========================= */
.form-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem;
}

.form-card {
    background: hsl(var(--card));
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
}

.form-card h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    text-align: center;
}

.field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.field-group label {
    margin-bottom: 0.5rem;
    font-weight: 200;
}

.field-group input,
.field-group select {
    padding: 0.75rem;
    background: var(--background-field-group);
    border: 1px solid var(--light-border-color);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 200ms ease;
}


.btn-group-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

/* =================================================
      INSERISCI PAGE - Wizard moderno
      ================================================= */
.inserisci-page {
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem 4rem;
    display: flex;
    justify-content: center;
}

.inserisci-container {
    width: 100%;
    max-width: 600px;
}

/* Header */
.inserisci-header {
    margin-bottom: 1.5rem;
}

.inserisci-title-row h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.inserisci-title-row h1 i {
    color: hsl(var(--primary));
    font-size: 1.5rem;
}

/* Progress Steps */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1rem 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: hsl(var(--secondary));
    border: 2px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.step-circle i {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
    box-shadow: 0 0 20px hsl(var(--primary) / 0.4);
}

.progress-step.active .step-circle i {
    color: hsl(var(--primary-foreground));
}

.progress-step.completed .step-circle {
    background: hsl(var(--success));
    border-color: hsl(var(--success));
}

.progress-step.completed .step-circle i {
    color: hsl(var(--success-foreground));
}

.step-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: hsl(var(--primary));
}

.progress-step.completed .step-label {
    color: hsl(var(--success));
}

.progress-line {
    width: 80px;
    height: 3px;
    background: hsl(var(--border));
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
    overflow: hidden;
}

.progress-line-fill {
    height: 100%;
    width: 0%;
    background: hsl(var(--primary));
    transition: width 0.4s ease;
}

/* Card principale */
.inserisci-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Step header */
.step-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.step-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0 0 0.25rem;
}

.step-description {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.field-modern {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-modern.full-width {
    grid-column: 1 / -1;
}

.field-modern label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-modern label i {
    color: hsl(var(--muted-foreground));
    font-size: 0.8rem;
    width: 1rem;
}

.field-modern input,
.field-modern select {
    width: 100%;
    height: 2.75rem;
    padding: 0 1rem;
    font-size: 0.95rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-md);
    color: hsl(var(--foreground));
    transition: all 0.15s ease;
    outline: none;
}

.field-modern input::placeholder {
    color: hsl(var(--muted-foreground));
}

.field-modern input:focus,
.field-modern select:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

.field-modern input:disabled {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    cursor: not-allowed;
}

.field-modern select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Wizard actions */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid hsl(var(--border));
}

.wizard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    outline: none;
}

.wizard-btn:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 600px) {
    .inserisci-page {
        padding: 1rem 0.75rem 3rem;
    }

    .inserisci-card {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .inserisci-title-row h1 {
        font-size: 1.4rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-modern.full-width {
        grid-column: 1;
    }

    .wizard-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .wizard-btn {
        width: 100%;
        justify-content: center;
    }

    .progress-line {
        width: 50px;
    }

    .step-circle {
        width: 2.5rem;
        height: 2.5rem;
    }

    .step-circle i {
        font-size: 0.875rem;
    }
}

/* =========================
         Dashboard Summary (Home)
         ========================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background: #FFFFFF;
    border: 1px solid #D0D0C8;
    color: #111111;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    flex: 1 1 200px; /* Consente ai blocchi di adattarsi e dividersi equamente */
}

.chart-summary-strip {
    gap: 1rem !important;
    padding: 1rem 0 !important;
    border-top: none !important;
}

.summary-divider {
    display: none !important;
}

.summary-value {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: bold;
}

.attuale-prep {
    display: flex;
    flex-direction: column;
}

#currentGuest {
    font-size: 1.5rem !important;
}

.summary-label {
    color: hsl(var(--muted-foreground));
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.apexcharts-canvas {
    color: hsl(var(--foreground));
}

/* =================================================
      HOME PAGE - Design moderno
      ================================================= */
/* ─── Modern Dashboard v2 ─── */
.home-page-body {
    background-color: #F4F4EE !important;
    color: #111111 !important;
    min-height: 100vh;
}

.home-page {
    min-height: calc(100vh - 64px);
    padding: 2rem 1.5rem 4rem;
}

.home-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #D0D0C8;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.home-greeting h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111111;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.home-date {
    color: #666666;
    font-size: 0.95rem;
    margin: 0;
}

/* Stats Grid */
.home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid #D0D0C8;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

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

.stat-card-highlight {
    background: #FAFAFA;
    border-color: #A3D8B4;
    /* Un leggero verde pastello per indicare chi è in casa */
}

.stat-icon-box {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: #F4F4EE;
    color: #111111;
    border: 1px solid #D0D0C8;
}

.stat-icon-box.accent {
    background: #E8F0FE;
    color: #1A73E8;
    border-color: #D2E3FC;
}

.stat-icon-box.success {
    background: #E6F4EA;
    color: #137333;
    border-color: #CEEAD6;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111111;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-label-top {
    font-size: 0.85rem;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.stat-value-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111111;
}

/* Dashboard Grid */
.home-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.dashboard-main-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-side-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Common Card Style */
.home-card {
    background: #FFFFFF;
    border: 1px solid #D0D0C8;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.home-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #F4F4EE;
}

.home-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-card-title i {
    color: #666666;
    font-size: 1.2rem;
}

.home-card-title h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111111;
    margin: 0;
}

/* Badge in Arrivo */
.badge-upcoming {
    background: #FEF3C7;
    color: #D97706;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid #FDE68A;
}

/* Next Booking Details */
.next-booking-content {
    min-height: 100px;
}

.next-booking-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666666;
    padding: 2rem 0;
    text-align: center;
}

.next-booking-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #D0D0C8;
}

.next-booking-item {
    background: #F9F9F8;
    border: 1px solid #E5E5E0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nb-left h3 {
    font-size: 1.1rem;
    color: #111111;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.nb-left p {
    color: #666666;
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nb-left p i {
    color: #111111;
    width: 16px;
}

/* Quick Actions */
.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #F9F9F8;
    border: 1px solid #E5E5E0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quick-action-item:hover {
    background: #FFFFFF;
    border-color: #D0D0C8;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.qa-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 6px;
    background: #FFFFFF;
    color: #111111;
    border: 1px solid #D0D0C8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.qa-info {
    flex: 1;
}

.qa-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111111;
    margin: 0 0 0.2rem 0;
}

.qa-info p {
    font-size: 0.8rem;
    color: #666666;
    margin: 0;
}

.qa-arrow {
    color: #D0D0C8;
    transition: all 0.2s ease;
}

.quick-action-item:hover .qa-arrow {
    color: #111111;
    transform: translateX(4px);
}

/* Chart Controls */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-tabs {
    display: flex;
    background: #F4F4EE;
    padding: 0.25rem;
    border-radius: 6px;
    border: 1px solid #D0D0C8;
}

.chart-tab {
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab.active {
    background: #FFFFFF;
    color: #111111;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chart-type-toggle,
.chart-refresh-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    border: 1px solid #D0D0C8;
    background: #FFFFFF;
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-type-toggle:hover,
.chart-refresh-btn:hover {
    background: #F4F4EE;
}

.chart-refresh-btn {
    width: auto;
    padding: 0 0.75rem;
    gap: 0.5rem;
}

.chart-refresh-btn span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .home-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .home-stats {
        grid-template-columns: 1fr;
    }

    .home-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .chart-controls {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }
}

/* ========================================
      BOOKING TOOLBAR - Nuova barra moderna
      ======================================== */
.booking-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: hsl(var(--card));
    /* border: 1px solid hsl(var(--border)); */
    border: none;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    /* box-shadow: var(--shadow-sm);*/
    box-shadow: none;
}

.toolbar-sort {
    min-width: auto;
    flex: 2;
}

/* Search box con icona */
.toolbar-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.toolbar-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    pointer-events: none;
}

.toolbar-search input {
    width: 100%;
    height: 2.5rem;
    padding: 0 1rem 0 2.5rem;
    font-size: 0.875rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-full);
    color: hsl(var(--foreground));
    transition: all 0.15s ease;
    outline: none;
}

.toolbar-search input::placeholder {
    color: hsl(var(--muted-foreground));
}

.toolbar-search input:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

/* Filter dropdown */
.toolbar-filter {
    flex: 2;
    width: fit-content;
}

.toolbar-filter select {
    height: 2.5rem;
    padding: 0 2.5rem 0 0.875rem;
    font-size: 0.95rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-md);
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    flex: 2;
}

/* Sort dropdown */
.toolbar-sort select {
    height: 2.5rem;
    padding: 0 2.5rem 0 0.875rem;
    font-size: 0.95rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-md);
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.toolbar-sort select:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 1px hsl(var(--ring));
}

/* Action buttons group */
.toolbar-actions {
    align-items: center;
    gap: 0.5rem;
    justify-content: right;
    flex: 1;
    max-width: 20%;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    outline: none;
    font-size: 0.95rem;
}

.toolbar-btn:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* Primary button (Add) */
/* Danger button (Delete) */
.toolbar-btn-danger:hover:not(:disabled) {}

.toolbar-btn-danger:active:not(:disabled) {}

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

/* Counter button */
.toolbar-btn-counter {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
    min-width: 2.5rem;
    width: auto;
    padding: 0 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.toolbar-btn-counter:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    border-color: hsl(var(--ring));
}

.toolbar-btn-counter .counter-value {
    font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 768px) {
    .booking-toolbar {
        flex-wrap: wrap;
    }

    .toolbar-search {
        order: 1;
        flex: 1 1 100%;
        max-width: none;
    }

    .toolbar-controls {
        order: 2;
        flex: 1 1 100%;
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
    }

    .toolbar-filter,
    .toolbar-sort {
        flex: 1 1 50%;
        min-width: 0;
    }

    .toolbar-filter .shad-select-trigger,
    .toolbar-sort .shad-select-trigger {
        padding: 0 0.5rem;
        font-size: 0.8rem;
    }

    .toolbar-sort select {
        width: 100%;
    }

    .toolbar-actions {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .booking-toolbar {
        padding: 0.625rem;
        gap: 0.5rem;
    }

    .toolbar-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }

    .toolbar-sort select,
    .toolbar-filter select {
        height: 2.25rem;
        font-size: 0.8rem;
    }

    .toolbar-search input {
        height: 2.25rem;
        font-size: 0.8rem;
    }
}


/* 8) responsive minor tweaks */
@media (max-width: 600px) {
    .list-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-sort-group {
        width: 100%;
        flex-direction: column;
        margin-top: 0.5rem;
    }

    #searchInput {
        width: 100%;
    }

    .search-actions {
        display: flex;
        gap: 20px;
        width: 100%;
        justify-content: space-between !important;
        flex-direction: row;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    #app-footer {
        width: 95%;
        display: flex;
        flex-direction: column !important;
    }
}

/* ========== Pagination styles ========== */
#pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: hsl(var(--card));
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    margin-top: 2rem;
}

/* pulsanti numerati e frecce */
#pagination button {
    background: none;
    border: none;
    color: hsl(var(--foreground));
    font-size: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* hover sui pulsanti abilitati */
#pagination button:not(:disabled):hover {
    background: var(--background-a-element-active-hover);
}

/* pagina attiva */
#pagination button[disabled].current {
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    font-weight: 600;
}

/* pallini di ellissi */
#pagination .ellipsis {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    user-select: none;
}



/* =========================
      Settings Page
      ========================= */
.settings-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Page header */
.settings-page-header {
    margin-bottom: 1.75rem;
}

.settings-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0 0 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.02em;
}

.settings-page-header h1 i {
    font-size: 1.15rem;
    color: hsl(var(--muted-foreground));
    opacity: 0.6;
}

.settings-page-header p {
    margin: 0;
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
}

/* Groups */
.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.6rem 0.1rem;
    opacity: 0.7;
}

/* Sections (cards) */
.settings-section {
    background: hsl(var(--card));
    padding: 1rem 1.1rem;
    border: 1px solid hsl(var(--border));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s ease;
}

.settings-section:hover {
    border-color: hsl(var(--border) / 0.8);
}

/* First card in group gets top radius, last gets bottom */
.settings-group .settings-section:first-of-type {
    border-radius: var(--radius-xl) 12px 0 0;
}

.settings-group .settings-section:last-of-type {
    border-radius: 0 0 12px 12px;
}

.settings-group .settings-section:only-of-type {
    border-radius: var(--radius-xl);
}

/* Remove double border between stacked cards */
.settings-group .settings-section+.settings-section {
    border-top: none;
}

/* Header (icon + text) */
.settings-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
}

.settings-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--primary) / 0.1);
    border-radius: var(--radius-xl);
    font-size: 1rem;
    color: hsl(var(--primary));
    flex-shrink: 0;
}

.settings-icon--success {
    background: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

.settings-icon--info {
    background: hsl(var(--info) / 0.1);
    color: hsl(var(--info));
}

.settings-info h2 {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 0.15rem 0;
    color: hsl(var(--foreground));
    line-height: 1.2;
}

.settings-info p {
    font-size: 0.78rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
    line-height: 1.3;
}

/* Control area */
.settings-control {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* Theme labels */
.theme-label {
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
    opacity: 0.4;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.theme-label.active {
    color: hsl(var(--primary));
    opacity: 1;
}

/* ─── Switch toggle ─── */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: hsl(var(--muted));
    transition: background-color 0.2s ease;
    border-radius: var(--radius-full);
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: hsl(var(--card));
    transition: transform 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked+.slider {
    background-color: hsl(var(--primary));
}

.switch input:checked+.slider:before {
    transform: translateX(20px);
}

/* ─── DB status badge ─── */
.db-status {
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
}

.db-status.connected {
    background: hsl(var(--success) / 0.12);
    color: hsl(var(--success));
}

.db-status.error {
    background: hsl(var(--destructive) / 0.12);
    color: hsl(var(--destructive));
}

/* ─── Build Info Card ─── */
.build-info-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    padding: 1rem 1.1rem;
    font-size: 0.82rem;
    color: hsl(var(--foreground));
}

.build-info-loading {
    text-align: center;
    padding: 1.5rem 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.82rem;
}

.build-info-loading i {
    margin-right: 0.4rem;
}

.build-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem 1rem;
    align-items: center;
}

.build-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}

.build-info-value {
    font-size: 0.82rem;
    color: hsl(var(--foreground));
    overflow-wrap: break-word;
    word-break: break-all;
    min-width: 0;
}

.build-info-value code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: hsl(var(--muted) / 0.5);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius);
    color: hsl(var(--primary));
}

.build-info-value a {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.build-info-value a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.build-info-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: hsl(var(--border));
    margin: 0.3rem 0;
}

.build-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.build-info-badge--ready {
    background: hsl(var(--success) / 0.12);
    color: hsl(var(--success));
}

.build-info-badge--error {
    background: hsl(var(--destructive) / 0.12);
    color: hsl(var(--destructive));
}

.build-info-badge--building {
    background: hsl(var(--warning) / 0.12);
    color: hsl(var(--warning));
}

.build-info-badge--unknown {
    background: hsl(var(--muted) / 0.3);
    color: hsl(var(--muted-foreground));
}

.build-info-commit-msg {
    font-style: italic;
    opacity: 0.85;
}

/* ─── Footer info ─── */
.settings-footer-info {
    text-align: center;
    font-size: 0.72rem;
    color: hsl(var(--muted-foreground));
    opacity: 0.4;
    margin-top: 2rem;
    letter-spacing: 0.02em;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .settings-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-control {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .settings-page-header h1 {
        font-size: 1.25rem;
    }
}

/* =========================
      Accent Color Picker
      ========================= */
.accent-picker {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.accent-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    border: 2px solid transparent;
    background-color: var(--swatch) !important;
    color: hsl(var(--primary-foreground)) !important;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    padding: 0 !important;
    outline: none;
}

.accent-swatch:hover {
    transform: scale(1.15);
    background-color: var(--swatch) !important;
    box-shadow: 0 0 0 3px hsl(var(--card)), 0 0 0 5px var(--swatch);
}

.accent-swatch.active {
    border-color: var(--swatch);
    box-shadow: 0 0 0 3px hsl(var(--card)), 0 0 0 5px var(--swatch);
    transform: scale(1.1);
}

.accent-swatch.active::after {
    content: '\2713';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--primary-foreground));
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.accent-swatch:focus-visible {
    outline: 2px solid hsl(var(--foreground));
    outline-offset: 3px;
}

/* =========================
      User Profile Page - Redesign
      ========================= */
.user-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-2xl);
    margin-bottom: 2rem;
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.avatar-xl {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid hsl(var(--border));
    background: hsl(var(--border));
}

.avatar-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background: hsl(var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--primary-foreground));
    font-size: 0.9rem;
    border: 3px solid hsl(var(--card));
}

.profile-main-info h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: hsl(var(--foreground));
}

.user-email {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    margin: 0 0 0.75rem 0;
}

.profile-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-meta span {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-meta i {
    color: hsl(var(--primary));
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Profile Cards */
.profile-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.profile-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: hsl(var(--muted));
}

.profile-card .card-header i {
    color: hsl(var(--primary));
    font-size: 1rem;
}

.profile-card .card-header h3 {
    font-size: 1rem;
    font-weight: 300;
    margin: 0;
    color: hsl(var(--foreground));
}

.profile-card .card-body {
    padding: 1.25rem;
}

/* Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.info-label {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
}

.info-value {
    font-size: 0.9rem;
    color: hsl(var(--foreground));
    font-weight: 500;
}

.info-value.mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: hsl(var(--border));
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}

/* Providers List */
.providers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.providers-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: hsl(var(--border));
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
}

.providers-list li:last-child {
    margin-bottom: 0;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.provider-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1rem;
}

.provider-icon.google {
    background: #ea4335;
    color: hsl(var(--primary-foreground));
}

.provider-icon.discord {
    background: #5865f2;
    color: hsl(var(--primary-foreground));
}

.provider-icon.github {
    background: #333;
    color: hsl(var(--primary-foreground));
}

.provider-icon.spotify {
    background: #1db954;
    color: hsl(var(--primary-foreground));
}

.unlink-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all 0.2s ease;
}

.unlink-btn:hover {
    background: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive));
    color: hsl(var(--destructive));
}

/* Sessions List */
.sessions-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: hsl(var(--border));
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
}

.session-item:last-child {
    margin-bottom: 0;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.session-item.current .session-info i {
    color: hsl(var(--success));
}

.session-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    background: hsl(var(--success) / 0.15);
    color: hsl(var(--success));
    font-weight: 500;
}

/* Action Buttons */
.actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: auto;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    cursor: pointer;
}

.action-btn i {
    width: 20px;
    text-align: center;
    color: hsl(var(--primary));
}

.action-btn.danger {
    color: hsl(var(--destructive));
}

.action-btn.danger i {
    color: hsl(var(--destructive));
}

.action-btn.danger:hover {
    background: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive) / 0.3);
}

.action-btn.full {
    justify-content: center;
}

/* Danger Zone */
.danger-zone .card-header {
    background: hsl(var(--destructive) / 0.1);
}

.danger-zone .card-header i {
    color: hsl(var(--destructive));
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: hsl(var(--muted-foreground));
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Responsive */
@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-meta {
        justify-content: center;
    }
}

@media (max-width: 500px) {
    .avatar-xl {
        width: 80px;
        height: 80px;
    }

    .avatar-badge {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .profile-main-info h1 {
        font-size: 1.5rem;
    }
}

/* ===== Custom Select ===== */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-container select {
    display: none;
    /* nasconde il select nativo */
}

.select-selected {
    background: var(--background-field-group);
    border: 1px solid hsl(var(--border));
    border-radius: 30px;
    padding: 0.75rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.select-selected:after {
    content: "";
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-color: #333 transparent transparent transparent;
    transform: translateY(-50%);
    pointer-events: none;
}

.select-selected.select-arrow-active:after {
    border-color: transparent transparent transparent transparent;
    top: 45%;
}

.select-items {
    position: absolute;
    background: var(--background-field-group);
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 99;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
}

.select-items div {
    padding: 0.75rem;
    cursor: pointer;
}

.select-items div:hover,
.select-items .same-as-selected {
    background-color: hsl(var(--border));
}

.select-hide {
    display: none;
}


#deleteBtn {
    text-align: center;
    border: none !important;
}

#deleteBtn:hover {}

#deleteBtn:active {}

.deleteBtn {
    text-align: center;
    border: none !important;
}

.buttonsdetails>button {
    padding-left: 50px;
    padding-right: 50px;
    text-align: center;
}

#searchInput {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    font-size: 1rem;
    height: 50px !important;
    transition: border-color 0.2s;
}

#sortSelect {
    width: 200px;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.wizard-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-content: center;
    justify-content: space-between;
    align-items: center;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--background-button-color);
    /* adatta alla tua palette */
    color: var(--text-color-btn);
    font-size: 0.875rem;
    font-weight: bold;
}


.ring-container {
    position: relative;
}

.circle {
    width: 15px;
    height: 15px;
    background-color: #62bd19;
    border-radius: 50%;
    position: absolute;
    top: 23px;
    left: 23px;
}

.ringring {
    border: 3px solid #62bd19;
    -webkit-border-radius: 30px;
    border-radius: 30px;
    height: 25px;
    width: 25px;
    position: absolute;
    left: 15px;
    top: 15px;
    -webkit-animation: pulsate 1s ease-out;
    animation: pulsate 1s ease-out;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
    opacity: 0.0
}

@-webkit-keyframes pulsate {
    0% {
        -webkit-transform: scale(0.1, 0.1);
        opacity: 0.0;
    }

    50% {
        opacity: 1.0;
    }

    100% {
        -webkit-transform: scale(1.2, 1.2);
        opacity: 0.0;
    }
}

@keyframes pulsate {
    0% {
        transform: scale(0.1, 0.1);
        opacity: 0.0;
    }

    50% {
        opacity: 1.0;
    }

    100% {
        transform: scale(1.2, 1.2);
        opacity: 0.0;
    }
}


.querytent h1 {
    font-size: 2rem;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
    text-align: center;
}

.querytent #bookingSelector {
    margin-bottom: 1rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

@media (max-width: 600px) {
    #syncBtn>#text {
        display: none;
    }
}

/* =========================
   Pagina Dettagli (Nuovo Stile)
   ========================= */

.details-container {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: auto;
    position: relative;
}

/* Gradient decorativo dietro il nome - SOTTO la navbar */
.details-container::before {
    content: '';
    position: fixed;
    top: -200px;
    left: 0;
    width: 110%;
    height: 350px;
    background-color: #0f268d;
    background-size: cover;
    background-position: center;
    filter: blur(150px);
    z-index: -10;
    /* Sotto la navbar (z-index: 1000) ma sopra al background */
}


.details-header {
    text-align: left;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

@media (min-width: 1024px) {
    .details-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }

    .header-actions {
        justify-content: flex-end;
        padding-bottom: 0.5rem;
        /* align buttons nicely with badges */
    }
}

.details-header p {
    font-size: 1.1rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0;
}

.details-header h1 {
    font-size: 3.5rem;
    font-family: var(--font-title);
    color: hsl(var(--foreground));
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.header-badges {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.back-btn {
    background: transparent;
    border: none;
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
    margin-bottom: 1rem;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: hsl(var(--foreground));
}

.soggiorno-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.mt-1 {
    margin-top: 1rem;
}

.info-label {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
    display: block;
    margin-bottom: 0.2rem;
}

.info-value {
    font-size: 1.1rem;
    margin: 0;
}

.info-value-small {
    font-size: 1.05rem;
    margin: 0;
}

.info-value-flex {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.contact-box {
    display: flex;
    flex-direction: column;
}

.notti-arrow {
    color: hsl(var(--muted-foreground));
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.2rem;
}

.notti-text {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.word-break {
    word-break: break-all;
}

.doc-modal-content {
    max-width: 800px;
    padding: 1rem;
}

.doc-modal-body {
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.doc-preview-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    display: none;
}

.doc-state-box {
    padding: 2rem;
}

.doc-error-box {
    padding: 2rem;
    color: var(--destructive);
    display: none;
}

.id-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: hsl(var(--card));
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
}

.btn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: hsl(var(--card));
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-chip:hover:not(:disabled) {
    background: hsl(var(--foreground) / 0.05);
    color: hsl(var(--foreground));
    border-color: hsl(var(--muted-foreground));
}

.btn-chip:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-chip.btn-danger {
    color: hsl(var(--destructive));
    border-color: hsl(var(--destructive) / 0.4);
}

.btn-chip.btn-danger:hover:not(:disabled) {
    background: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
    border-color: hsl(var(--destructive));
}

.btn-chip.btn-whatsapp {
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.4);
}

.btn-chip.btn-whatsapp:hover:not(:disabled) {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25D366;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-badge.status-pending {
    background: hsl(45, 93%, 47%, 0.1);
    color: hsl(45, 93%, 47%);
    border: 1px solid hsl(45, 93%, 47%, 0.3);
}

.status-badge.status-incoming {
    background: hsl(200, 93%, 47%, 0.1);
    color: hsl(200, 93%, 60%);
    border: 1px solid hsl(200, 93%, 47%, 0.3);
}

.status-badge.status-complete {
    background: hsl(142, 76%, 36%, 0.1);
    color: hsl(142, 76%, 36%);
    border: 1px solid hsl(142, 76%, 36%, 0.3);
}

.status-badge.status-override {
    background: hsl(270, 76%, 60%, 0.1);
    color: hsl(270, 76%, 60%);
    border: 1px solid hsl(270, 76%, 60%, 0.3);
}

.details-grid {
    max-width: 100% !important;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.details-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
}

.detail-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--foreground));
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-grid p {
    background: var(--background-field-group);
    padding: 0.75rem;
    border-radius: var(--radius-md);
}

.info-grid p strong {
    color: hsl(var(--muted-foreground));
    margin-right: 0.5rem;
}

#details-telefono,
#details-check-out,
#details-check-in {
    font-family: var(--font-mono);
    font-size: 1rem;
}

.actions-panel {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    padding: 1.5rem;
    align-self: start;
    /* Si allinea in alto */
}

.actions-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dropdown menu styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + var(--space-1, 4px));
    left: 0;
    background-color: hsl(var(--popover));
    color: hsl(var(--popover-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    padding: var(--space-1);
    list-style: none;
    min-width: 200px;
    z-index: 1001;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(0 0 0 / 0.05);
}

.dropdown-menu.align-right {
    left: auto;
    right: 0;
}

.dropdown.open .dropdown-menu {
    display: block;
    animation: shad-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shad-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }

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

.dropdown-menu li {
    margin: 0;
    padding: 0;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2);
    color: hsl(var(--popover-foreground));
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropdown-menu li a:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-action {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid hsl(216, 100%, 58%);
    background-color: hsl(217 71% 45%) !important;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    justify-content: flex-start;
}

.btn-action.btn-secondary {
    background-color: var(--background-field-group) !important;
    border-color: hsl(var(--border)) !important;
}

.btn-action.btn-danger {
    background-color: #381a1a !important;
    color: #ff8f8f !important;
    border-color: #5c2a2a !important;
}

/* Stili Modale */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: hsl(var(--card));
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: none !important;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-grid input,
.form-grid select {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-lg) !important;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid hsl(var(--border));
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

@media (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        width: 100%;
        margin-top: 1rem;
    }

    .header-actions .btn-chip {
        justify-content: center;
    }

    #delete-booking-btn {
        grid-column: 1 / -1;
    }

    .details-grid {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 1000px) {
    .info-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .header-badges {
        flex-direction: row;
        align-items: center;
        margin-top: 30px;
    }

    .accent-picker {
        display: flex;
        margin-top: 0;
        gap: 0.4rem;
        justify-content: space-between;
    }

    .accent-swatch {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }
}

@media (max-width: 730px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .details-header h1 {
        font-size: 2.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* ─── Soggiorno Flow mobile fix ─── */
    .soggiorno-flow {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .soggiorno-flow>div {
        width: 100%;
    }

    .soggiorno-flow .text-right {
        text-align: left;
    }

    .notti-arrow {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0.25rem 0;
        color: hsl(var(--muted-foreground));
        margin-top: 0;
    }

    .notti-arrow i {
        transform: rotate(90deg);
    }
}


/* =========================
   Ospiti Alloggiati Card - dettagli.html
   ========================= */

.ospiti-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.ospiti-meta {
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
}

.test-badge {
    display: inline-block;
    background: hsl(var(--warning) / 0.2);
    color: hsl(var(--warning));
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.ospiti-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ospite-item {
    background: var(--background-field-group);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.ospite-item:hover {
    border-color: hsl(var(--border));
}


.ospite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ospite-header:hover {
    background: hsl(var(--muted) / 0.5);
}

.ospite-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ospite-name {
    font-weight: 800;
    font-size: 0.95rem;
    font-family: var(--font-ospiti-det-name);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ospite-name i {
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
}

.ospite-item.capogruppo .ospite-name i {
    color: hsl(var(--warning));
}

.capogruppo-badge {
    background: hsl(var(--warning) / 0.25);
    color: rgb(255, 133, 19);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-style: italic;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ospite-toggle {
    color: hsl(var(--muted-foreground));
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.ospite-toggle.rotated {
    transform: rotate(180deg);
}

.ospite-details {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid hsl(var(--border));
}

.ospite-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
}

.ospite-details .detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ospite-details .detail-label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ospite-details .detail-value {
    font-size: 0.9rem;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sensitive-data .detail-value {
    font-family: var(--font-mono);
}

.masked-value {
    color: hsl(var(--muted-foreground));
}

.reveal-btn {
    background: transparent;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.reveal-btn:hover {
    color: hsl(var(--primary));
}

/* Invio Alloggiati - form-group-full */
.form-group-full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {

    button,
    .button,
    input,
    select,
    textarea {
        min-height: 44px;
    }
}

/* =========================
   Tabs10 Ultra / Large Screens Support
   ========================= */
@media (min-width: 1400px) {
    .inserisci-container {
        max-width: 1600px;
        padding: 0 2rem;
    }

    .inserisci-card {
        padding: 2.5rem;
    }

    .form-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .field-modern.full-width {
        grid-column: 1 / -1;
    }
}

/* =========================
   Next Booking Card Redesign
   ========================= */

#nextBookingDetails {
    cursor: pointer;
    transition: transform 0.2s ease;
}


.nb-card-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.5rem 0.25rem;
}

.nb-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.nb-guest-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nb-guest-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.2;
}

.nb-origin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
}

.nb-flag {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nb-meta-badge {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Dates Grid */
.nb-dates-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: hsl(var(--muted) / 0.3);
    border-radius: var(--radius-xl);
    padding: 1rem;
    gap: 0.5rem;
    border: 1px solid hsl(var(--border) / 0.5);
}

.nb-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center align for check-in/out */
    text-align: center;
}

.nb-date-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.nb-date-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    font-family: var(--font-display);
}

.nb-date-dow {
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
}

.nb-duration {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
    gap: 0.2rem;
}

.nb-duration i {
    font-size: 1rem;
    opacity: 0.5;
}

.nb-nights {
    font-size: 0.75rem;
    font-weight: 500;
    background: hsl(var(--background));
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    border: 1px solid hsl(var(--border));
}

/* Footer */
.nb-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border) / 0.5);
}

.nb-ref {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted) / 0.5);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
}

.nb-action-btn {
    background: transparent;
    color: hsl(var(--primary));
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
}

.nb-action-btn:hover {
    text-decoration: underline;
}

/* Empty State */
.nb-empty-btn {
    margin-top: 1rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.nb-empty-btn:hover {
    background: hsl(var(--primary) / 0.9);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .nb-header {
        flex-direction: column;
        gap: 0.8rem;
    }

    .nb-meta-badge {
        align-self: flex-start;
    }

    .nb-dates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }

    .nb-duration {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .nb-duration i {
        transform: rotate(0);
        /* Icon is already arrow right, rotated makes it down */
    }

    .nb-nights {
        transform: rotate(-90deg);
        /* Keep text legible? No, better just keep duration vertical */
    }

    /* Better mobile duration layout */
    .nb-duration {
        transform: none;
        flex-direction: row;
        gap: 1rem;
        width: 100%;
        justify-content: center;
        border-top: 1px dashed hsl(var(--border));
        border-bottom: 1px dashed hsl(var(--border));
        padding: 0.5rem 0;
    }
}

/* =================================================
   Next Booking Card (Ported from export.css)
   ================================================= */

/* Card Base */
.nb-card {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.nb-card:hover {
    transform: translateY(-2px);
}

/* Header */
.nb-card-header {
    padding: 1.25rem 1.25rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.nb-icon-box {
    width: 3rem;
    height: 3rem;
    background: hsl(var(--primary) / 0.1);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: hsl(var(--primary));
    border: 1px solid hsl(var(--primary) / 0.2);
    flex-shrink: 0;
}

.nb-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    letter-spacing: 0.04em;
    border: 1px solid hsl(var(--border) / 0.5);
}

.nb-badge.in-arrival {
    background: hsl(var(--chart-2) / 0.15);
    /* Keep green/teal for arrival */
    color: hsl(var(--chart-2));
    border-color: hsl(var(--chart-2) / 0.3);
}

/* Body */
.nb-card-body {
    padding: 0.5rem 0 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.nb-guest-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nb-guest-name {
    font-size: 2rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.3;
}

.nb-guest-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
}

.nb-flag {
    width: 20px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Dates Grid (Mini) */
.nb-dates-row {
    display: flex;
    align-items: center;
    background: hsl(var(--secondary) / 0.5);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--border) / 0.5);
    width: 100%;
    margin-top: 0.5rem;
}

.nb-date-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nb-date-item.end {
    align-items: flex-end;
    text-align: right;
}

.nb-date-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.nb-date-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    font-family: var(--font-display);
}

.nb-arrow-sep {
    padding: 0 1rem;
    color: hsl(var(--muted-foreground));
    opacity: 0.5;
    font-size: 0.9rem;
}

/* Footer */
.nb-card-footer {
    padding: 0.5rem 0;
    background: transparent;
    border-top: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nb-ref {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.nb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

/* ==========================================================
   LIGHT THEME OVERRIDES — elementi con colori hardcoded
   ========================================================== */

/* Pagina Dettagli Prenotazione */
body.light .details-header p {
    /* Era bianco hsl(0 0% 100% / 67%) — ora grigio scuro leggibile */
    color: hsl(220 15% 35%);
}

body.light .details-container::before {
    /* Colore base del gradiente è blu scuro: su chiaro risulta meno visibile */
    background-color: hsl(217 80% 80%);
    opacity: 0.4;
}

body.light .id-badge {
    /* Era scuro #3b3b3b su scuro — ora chiaro su chiaro */
    background: hsl(220 15% 92%);
    border-color: hsl(220 15% 78%);
    color: hsl(220 25% 10%);
}

body.light .status-badge.status-pending {
    /* Era giallo hsl(45) su sfondo giallino — ora ambra più scura per leggibilità */
    background: hsl(38 85% 92%);
    color: hsl(38 75% 28%);
    border-color: hsl(38 75% 65%);
}

body.light .status-badge.status-incoming {
    background: hsl(200 85% 92%);
    color: hsl(200 75% 35%);
    border-color: hsl(200 65% 65%);
}

body.light .status-badge.status-complete {
    /* Verde su verde chiaro — ora verde più saturo per buon contrasto */
    background: hsl(142 60% 90%);
    color: hsl(142 65% 22%);
    border-color: hsl(142 60% 60%);
}

body.light .status-badge.status-override {
    /* Viola su viola chiaro */
    background: hsl(270 70% 94%);
    color: hsl(270 65% 30%);
    border-color: hsl(270 60% 65%);
}

/* Fix testo piccolo "semitrasparente" nella home — erano troppo chiari su light */
body.light .nb-date-label,
body.light .nb-ref,
body.light .small-text,
body.light small {
    color: hsl(220 15% 40%);
}

/* Link redirect ricevute — colore più scuro e riconoscibile su chiaro */
body.light .link-redirect {
    color: hsl(217 80% 38%);
    font-weight: 500;
}

body.light .link-redirect:hover {
    color: hsl(217 80% 28%);
}

/* Scrollbar sul tema chiaro */
body.light ::-webkit-scrollbar-thumb {
    background: hsl(220 15% 72%);
}

body.light ::-webkit-scrollbar-thumb:hover {
    background: hsl(220 15% 55%);
}

/* Navbar in light: leggibilità link */
body.light .nav-links a,
body.light .nav-dropdown-trigger,
body.light .nav-dropdown-menu a {
    color: hsl(220 20% 30%);
}

body.light .nav-links a:hover,
body.light .nav-dropdown-trigger:hover,
body.light .nav-dropdown-menu a:hover {
    color: hsl(220 25% 8%);
    background: hsl(220 15% 85%);
}

body.light .nav-links a.active,
body.light .nav-dropdown-menu a.active {
    color: hsl(217 80% 38%);
}

body.light .nav-user-name {
    color: hsl(220 20% 25%);
}

/* Year select in light */
body.light .year-select {
    background: hsl(0 0% 100%);
    border-color: hsl(220 15% 72%);
    color: hsl(220 25% 15%);
}

/* Status badge ricevute in light */
body.light .status-badge.active {
    background: hsl(142 60% 90%);
    color: hsl(142 65% 22%);
    border-color: hsl(142 60% 60%);
}

body.light .status-badge.archived {
    background: hsl(220 15% 88%);
    color: hsl(220 20% 28%);
    border-color: hsl(220 15% 70%);
}

/* Filter pills sfondo in light: troppo simile al background */
body.light .filter-pill {
    background: hsl(0 0% 100%);
    border-color: hsl(220 15% 72%);
    color: hsl(220 20% 30%);
}

body.light .filter-pill.active {
    background: hsl(217 80% 42%);
    color: hsl(0 0% 100%);
    border-color: hsl(217 80% 42%);
}

body.light .filter-pill:hover:not(.active) {
    background: hsl(220 15% 88%);
    border-color: hsl(220 15% 65%);
    color: hsl(220 25% 15%);
}

/* Pulsanti "outline" (es. Vis. Fronte / Vis. Retro) sul tema chiaro:
   sfondo scuro di default per garantire leggibilità */
body.light .btn-outline {
    background: hsl(220 20% 15%);
    color: hsl(0 0% 95%);
    border-color: hsl(220 20% 25%);
}

body.light .btn-outline:hover {
    background: hsl(220 20% 8%);
    color: hsl(0 0% 100%);
    border-color: hsl(220 20% 15%);
}

/* Shared button hover cleanup: keep color feedback, remove lift/glow motion */
button:hover,
[class*="btn"]:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

[class*="btn"]::before,
[class*="btn"]::after {
    content: none !important;
    display: none !important;
}

/* =================================================
   Kinetics — Spring-Physics Utility Classes
   ================================================= */

/* Ripple wave (created dynamically by kinetics.js) */
.k-ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
    transform: scale(0);
    animation: k-ripple-out 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

/* Animation utility classes */
.k-bounce-in {
    animation: k-bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.k-scale-spring {
    animation: k-scale-spring 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.k-slide-up {
    animation: k-slide-up-spring 0.6s cubic-bezier(0.18, 1.25, 0.4, 1) both;
}

.k-slide-down {
    animation: k-slide-down-spring 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.k-fade-up {
    animation: k-fade-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.k-wiggle {
    animation: k-wiggle 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.k-pop {
    animation: k-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.k-pulse-glow {
    animation: k-pulse-glow 2s ease-in-out infinite;
}

/* Transition utility classes */
.k-spring {
    transition: all var(--k-spring-bounce) !important;
}

.k-spring-fast {
    transition: all var(--k-spring-micro) !important;
}

.k-spring-slow {
    transition: all var(--k-spring-elastic) !important;
}

/* Hover lift effect */
.k-hover-lift {
    transition: transform var(--k-spring-bounce), box-shadow var(--k-spring-bounce);
}

.k-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -8px hsl(0 0% 0% / 0.15);
}

/* Hover scale effect */
.k-hover-scale {
    transition: transform var(--k-spring-bounce);
}

.k-hover-scale:hover {
    transform: scale(1.03);
}

/* Stagger delay helpers (for use with stagger reveal) */
.k-delay-1 {
    animation-delay: 80ms !important;
}

.k-delay-2 {
    animation-delay: 160ms !important;
}

.k-delay-3 {
    animation-delay: 240ms !important;
}

.k-delay-4 {
    animation-delay: 320ms !important;
}

.k-delay-5 {
    animation-delay: 400ms !important;
}

/* Reduced motion — disable all Kinetics animations */
@media (prefers-reduced-motion: reduce) {

    .k-bounce-in,
    .k-scale-spring,
    .k-slide-up,
    .k-slide-down,
    .k-fade-up,
    .k-wiggle,
    .k-pop,
    .k-pulse-glow,
    .k-ripple-wave {
        animation: none !important;
    }

    .k-spring,
    .k-spring-fast,
    .k-spring-slow,
    .k-hover-lift,
    .k-hover-scale {
        transition: none !important;
    }

    .k-hover-lift:hover,
    .k-hover-scale:hover {
        transform: none !important;
    }
}

/* ========================================
   COMPACT NEXT BOOKING DESIGN
   ======================================== */
.nb-compact-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
}

.nb-compact-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nb-compact-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    letter-spacing: -0.01em;
}

.nb-compact-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    width: fit-content;
    border: 1px solid hsl(var(--primary) / 0.15);
}

.nb-compact-dates {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: hsl(var(--secondary) / 0.3);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid hsl(var(--border) / 0.4);
}

.nb-date-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
}

.nb-date-pill-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

.nb-date-pill-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.nb-date-pill-sep {
    color: hsl(var(--primary));
    font-size: 0.85rem;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .nb-compact-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .nb-compact-dates {
        width: 100%;
        justify-content: space-around;
        padding: 0.5rem 1rem;
    }
}

/* ==========================================================================
   UNIFIED BUTTON SYSTEM
   Unica fonte di verità per tutti i pulsanti dell'app.
   ========================================================================== */

/* --- Base: proprietà comuni a TUTTI i pulsanti del sistema --- */
:is(.btn-primary, .btn-secondary,
    .btn-action-sm.secondary, .alg-vh-btn,
    .secondary-btn, .btn-outline, .btn-outline-primary, .btn-logout:not(.danger), .login-social-btn, .btn-danger,
    .btn-icon-only.delete-trigger,
    .btn-logout.danger, .btn-success,
    .primary-btn, .secondary-btn, .btn-outline, .btn-outline-primary, .btn-add-passkey, .btn-logout, .login-social-btn,
    .btn-action-sm.primary, .btn-action-sm.secondary, .btn-icon-only.delete-trigger,
    .home-add-btn,
    .toolbar-btn-primary, .toolbar-btn-secondary, .toolbar-btn-danger, .toolbar-btn-success, .toolbar-btn-counter,
    .action-btn-primary, .action-btn-outline, .action-btn-danger,
    .cm-btn-primary, .cm-btn-secondary,
    .shad-btn-default, .shad-btn-secondary, .shad-btn-outline, .shad-btn-destructive, .shad-btn-ghost,
    .alg-action-btn--filled, .alg-action-btn--outline,
    .download-btn,
    .dialog-btn-confirm, .dialog-btn-cancel, .dialog-btn-danger,
    .wizard-btn-primary, .wizard-btn-secondary, .wizard-btn-success,
    .generator-btn,
    .shad-dt-btn-confirm, .shad-dt-btn-clear,
    .status-btn-primary, .status-btn-secondary,
    .archive-btn,
    .cal-today-btn,
    .nb-action-btn) {
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 1. ─── PRIMARY (Blue) ─── */
:is(.btn-primary, .home-add-btn,
    .btn-action-sm.primary, .alg-vh-btn,
    .primary-btn, .btn-add-passkey,
    .toolbar-btn-primary,
    .action-btn-primary,
    .cm-btn-primary,
    .shad-btn-default,
    .alg-action-btn--filled,
    .dialog-btn-confirm,
    .wizard-btn-primary,
    .generator-btn,
    .login-submit,
    .shad-dt-btn-confirm) {
    background: linear-gradient(to bottom, #3b7dff, #1a5afe) !important;
    color: white !important;
    box-shadow: 0 1px 3px 0 rgba(15, 76, 245, 0.35) !important;
    border: none !important;
    border-bottom: 2px solid #0d42d0 !important;
}

:is(.btn-primary, .home-add-btn,
    .btn-action-sm.primary, .alg-vh-btn,
    .primary-btn, .btn-add-passkey,
    .toolbar-btn-primary,
    .action-btn-primary,
    .cm-btn-primary,
    .shad-btn-default,
    .alg-action-btn--filled,
    .dialog-btn-confirm,
    .wizard-btn-primary,
    .generator-btn,
    .login-submit,
    .shad-dt-btn-confirm):hover:not(:disabled) {
    background: linear-gradient(to bottom, #4b89ff, #2563eb) !important;
    box-shadow: 0 2px 6px 0 rgba(15, 76, 245, 0.4) !important;
    border-bottom: 3px solid #0d42d0 !important;
    translate: 0 -1px;
}

:is(.btn-primary, .home-add-btn,
    .btn-action-sm.primary, .alg-vh-btn,
    .primary-btn, .btn-add-passkey,
    .toolbar-btn-primary,
    .action-btn-primary,
    .cm-btn-primary,
    .shad-btn-default,
    .alg-action-btn--filled,
    .dialog-btn-confirm,
    .wizard-btn-primary,
    .generator-btn,
    .login-submit,
    .shad-dt-btn-confirm):active:not(:disabled) {
    background: linear-gradient(to bottom, #2563eb, #1a5afe) !important;
    box-shadow: 0 0 0 0 transparent !important;
    border-bottom: 1px solid #0d42d0 !important;
    translate: 0 0;
}

/* 2. ─── SECONDARY (White) ─── */
:is(.btn-secondary,
    .btn-action-sm.secondary,
    .secondary-btn, .btn-outline, .btn-outline-primary, .btn-logout:not(.danger), .login-social-btn,
    .toolbar-btn-secondary, .toolbar-btn-counter,
    .action-btn-outline,
    .cm-btn-secondary,
    .shad-btn-secondary, .shad-btn-outline,
    .alg-action-btn--outline,
    .download-btn,
    .dialog-btn-cancel,
    .wizard-btn-secondary,
    .status-btn-secondary,
    .archive-btn:not(.delete),
    .shad-dt-btn-clear,
    .cal-today-btn,
    .nb-action-btn) {
    background: #fff !important;
    color: #374151 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #e5e7eb !important;
    border-bottom: 2px solid #d1d5db !important;
}

:is(.btn-secondary,
    .btn-action-sm.secondary,
    .secondary-btn, .btn-outline, .btn-outline-primary, .btn-logout:not(.danger), .login-social-btn,
    .toolbar-btn-secondary, .toolbar-btn-counter,
    .action-btn-outline,
    .cm-btn-secondary,
    .shad-btn-secondary, .shad-btn-outline,
    .alg-action-btn--outline,
    .download-btn,
    .dialog-btn-cancel,
    .wizard-btn-secondary,
    .status-btn-secondary,
    .archive-btn:not(.delete),
    .shad-dt-btn-clear,
    .cal-today-btn,
    .nb-action-btn):hover:not(:disabled) {
    background: #f9fafb !important;
    border-bottom: 3px solid #d1d5db !important;
    translate: 0 -1px;
}

:is(.btn-secondary,
    .btn-action-sm.secondary,
    .secondary-btn, .btn-outline, .btn-outline-primary, .btn-logout:not(.danger), .login-social-btn,
    .toolbar-btn-secondary, .toolbar-btn-counter,
    .action-btn-outline,
    .cm-btn-secondary,
    .shad-btn-secondary, .shad-btn-outline,
    .alg-action-btn--outline,
    .download-btn,
    .dialog-btn-cancel,
    .wizard-btn-secondary,
    .status-btn-secondary,
    .archive-btn:not(.delete),
    .shad-dt-btn-clear,
    .cal-today-btn,
    .nb-action-btn):active:not(:disabled) {
    box-shadow: none !important;
    border-bottom: 1px solid #d1d5db !important;
    translate: 0 0;
}

/* 3. ─── DANGER (Red) ─── */
:is(.btn-danger,
    .btn-icon-only.delete-trigger,
    .btn-logout.danger,
    .toolbar-btn-danger,
    .action-btn-danger,
    .shad-btn-destructive,
    .dialog-btn-danger,
    .archive-btn.delete,
    #deleteBtn, .deleteBtn) {
    background: linear-gradient(to bottom, #f87171, #ef4444) !important;
    color: white !important;
    box-shadow: 0 1px 3px 0 rgba(239, 68, 68, 0.35) !important;
    border: none !important;
    border-bottom: 2px solid #dc2626 !important;
}

:is(.btn-danger,
    .btn-icon-only.delete-trigger,
    .btn-logout.danger,
    .toolbar-btn-danger,
    .action-btn-danger,
    .shad-btn-destructive,
    .dialog-btn-danger,
    .archive-btn.delete,
    #deleteBtn, .deleteBtn):hover:not(:disabled) {
    background: linear-gradient(to bottom, #fca5a5, #f87171) !important;
    box-shadow: 0 2px 6px 0 rgba(239, 68, 68, 0.4) !important;
    border-bottom: 3px solid #dc2626 !important;
    translate: 0 -1px;
}

:is(.btn-danger,
    .btn-icon-only.delete-trigger,
    .btn-logout.danger,
    .toolbar-btn-danger,
    .action-btn-danger,
    .shad-btn-destructive,
    .dialog-btn-danger,
    .archive-btn.delete,
    #deleteBtn, .deleteBtn):active:not(:disabled) {
    background: linear-gradient(to bottom, #ef4444, #dc2626) !important;
    box-shadow: 0 0 0 0 transparent !important;
    border-bottom: 1px solid #dc2626 !important;
    translate: 0 0;
}

/* 4. ─── SUCCESS (Green) ─── */
:is(.btn-success,
    .toolbar-btn-success,
    .wizard-btn-success,
    .status-btn-primary) {
    background: linear-gradient(to bottom, #34d399, #10b981) !important;
    color: white !important;
    box-shadow: 0 1px 3px 0 rgba(16, 185, 129, 0.35) !important;
    border: none !important;
    border-bottom: 2px solid #059669 !important;
}

:is(.btn-success,
    .toolbar-btn-success,
    .wizard-btn-success,
    .status-btn-primary):hover:not(:disabled) {
    background: linear-gradient(to bottom, #6ee7b7, #34d399) !important;
    box-shadow: 0 2px 6px 0 rgba(16, 185, 129, 0.4) !important;
    border-bottom: 3px solid #059669 !important;
    translate: 0 -1px;
}

:is(.btn-success,
    .toolbar-btn-success,
    .wizard-btn-success,
    .status-btn-primary):active:not(:disabled) {
    background: linear-gradient(to bottom, #10b981, #059669) !important;
    box-shadow: 0 0 0 0 transparent !important;
    border-bottom: 1px solid #059669 !important;
    translate: 0 0;
}

/* ─── Disabled state (tutti i tipi) ─── */
:is(.btn-primary, .btn-secondary,
    .btn-action-sm.secondary, .alg-vh-btn,
    .secondary-btn, .btn-outline, .btn-outline-primary, .btn-logout:not(.danger), .login-social-btn, .btn-danger,
    .btn-icon-only.delete-trigger,
    .btn-logout.danger, .btn-success,
    .primary-btn, .secondary-btn, .btn-outline, .btn-outline-primary, .btn-add-passkey, .btn-logout, .login-social-btn,
    .btn-action-sm.primary, .btn-action-sm.secondary, .btn-icon-only.delete-trigger,
    .home-add-btn,
    .toolbar-btn-primary, .toolbar-btn-secondary, .toolbar-btn-danger, .toolbar-btn-success,
    .action-btn-primary, .action-btn-outline, .action-btn-danger,
    .wizard-btn-primary, .wizard-btn-secondary, .wizard-btn-success,
    .generator-btn):disabled {
    opacity: 0.5;
    cursor: not-allowed;
    translate: 0 0 !important;
}

/* =========================================
   FLAG UTILITIES
   ========================================= */
.flag-icon {
    width: 24px;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid hsl(var(--border));
    display: inline-block;
    vertical-align: middle;
}

.card-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    flex-shrink: 0;
}

.card-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-flag-placeholder {
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
}