/* =========================
   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 shadcn tokens */
    --background-spacer-color: hsl(var(--border));
    --background-color: hsl(var(--background));
    --background-card-color: hsl(var(--card));
    --background-field-group: hsl(var(--secondary));
    --background-color-light: hsl(var(--muted));
    --small-text-color: hsl(var(--muted-foreground));
    --background-button-color: hsl(var(--primary));
    --background-button-color-shadow: hsl(var(--primary) / 0.6);
    --text-color: hsl(var(--foreground));
    --text-color-btn: hsl(var(--primary-foreground));
    --border-input-color: hsl(var(--ring));
    --background-a-element-active-hover: hsl(var(--primary));
    --danger-color: hsl(var(--destructive));
    --success-color: hsl(var(--success));

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

* {
    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-color: hsl(var(--background));
    /* Clean solid background - SoundCloud style */
    min-height: 100vh;
    color: hsl(var(--foreground));
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-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(--transition-fast);
}

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

button {
    background-color: hsl(var(--primary)) !important;
    color: hsl(var(--primary-foreground)) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-sans);
    border: none;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

.button {
    background-color: hsl(var(--primary)) !important;
    padding: var(--space-2) var(--space-4) !important;
    text-decoration: none !important;
    color: hsl(var(--primary-foreground)) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--transition-fast);
}

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

/* Cookie Banner Style */
.cookie-banner {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: calc(100% - var(--space-12));
    max-width: 400px;
    background: hsl(var(--muted) / 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid hsl(var(--border) / 0.5);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: 100;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

    /* 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.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1300px;
    height: 55px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.85rem 0 1rem;
    background: hsl(var(--card) / 0.8);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    border: 1px solid hsl(var(--border) / 0.5);
    border-radius: 14px;
    z-index: 1000;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.nav-brand-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    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.75;
}

.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: 8px;
    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;
    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: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    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.5);
}

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

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

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

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

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

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

.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-nav);
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.nav-dropdown-trigger:hover {
    color: hsl(var(--foreground)) !important;
    background: hsl(var(--accent) / 0.5) !important;
}

.nav-dropdown.open .nav-dropdown-trigger {
    color: hsl(var(--foreground)) !important;
    background: hsl(var(--accent) / 0.5) !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%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 190px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    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: 0;
}

.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: 8px;
    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(--accent));
    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: 10px !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nav-user-trigger:hover {
    background: hsl(var(--accent) / 0.5) !important;
}

.nav-user-name {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    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 0.15s ease;
}

.nav-user-trigger:hover .nav-avatar-container img {
    border-color: hsl(var(--primary) / 0.4);
}

.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: none;
    transition: opacity 0.15s ease;
}

.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: 12px;
    }

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

    .nav-brand {
        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 ─── */
    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0.5rem;
        right: 0.5rem;
        background: hsl(var(--card));
        padding: 0.4rem;
        flex-direction: column;
        gap: 0;
        border: 1px solid hsl(var(--border));
        border-radius: 14px;
        box-shadow: 0 8px 32px hsl(var(--foreground) / 0.1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        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.65rem 0.85rem;
        font-size: 0.88rem;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.65rem;
    }

    .nav-links a i {
        display: block;
        width: 1.15rem;
        text-align: center;
        color: hsl(var(--muted-foreground));
        font-size: 0.9em;
        opacity: 0.65;
    }

    .nav-links a:hover i,
    .nav-links a.active i {
        color: inherit;
        opacity: 1;
    }

    /* 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: 0;
        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;
    }

    #navbar {
        padding-top: 60px;
    }
}

.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 {
    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: 4px;
    cursor: pointer;
    position: relative;
    transition: all 150ms ease;
    margin-right: 0.5rem;
    background: var(--background-color);
}

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: var(--background-color);
}

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: var(--text-color);
}

/* 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: var(--background-color-light); */
    color: var(--text-color);
    border-radius: 12px;
    /* border: 3px solid var(--background-spacer-color); */
    padding: 1.5rem;
    min-width: 100%;
    margin: auto;
    transition: transform 0.2s, box-shadow 0.2s;
}

#nextBookingDetails {
    font-size: 1rem;
    color: var(--text-color);
    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: 'Matter', sans-serif;
    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;
}

/* =================================================
      GENERATOR PAGE - Lettere di Benvenuto
      ================================================= */
.generator-page {
    min-height: calc(100vh - 64px);
    padding: 2rem 1.5rem 4rem;
}

.generator-container {
    max-width: 800px;
    margin: 0 auto;
}

.generator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.generator-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.generator-header h1 i {
    color: hsl(var(--primary));
}

.generator-subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    margin: 0;
}

/* Tabs */
.generator-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: hsl(var(--secondary));
    padding: 0.375rem;
    border-radius: var(--radius-lg);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.tab-btn.active {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Generator Card */
.generator-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    padding: 1.5rem;
}

.generator-card-header {
    margin-bottom: 1.5rem;
    position: relative;
}

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

.generator-card-header p {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

.refresh-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all 0.15s ease;
}

.refresh-btn:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

/* Generator Form */
.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.85rem;
}

.field-divider::before,
.field-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: hsl(var(--border));
}

.generator-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 0.5rem;
}

.generator-btn:hover {
    background: hsl(var(--primary) / 0.85);
}

.generator-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Letter Status */
.letter-status {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: hsl(var(--success) / 0.08);
    border: 1px solid hsl(var(--success) / 0.3);
    border-radius: var(--radius-lg);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: hsl(var(--success) / 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon i {
    font-size: 1.5rem;
    color: hsl(var(--success));
}

.status-info {
    flex: 1;
    min-width: 150px;
}

.status-info h3 {
    font-size: 1.1rem;
    font-weight: 300;
    color: hsl(var(--foreground));
    margin: 0 0 0.25rem;
}

.status-info p {
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

.status-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: none;
}

.status-btn-primary {
    background: hsl(var(--success));
    color: #242323;
}

.status-btn-primary:hover {
    background: hsl(var(--success) / 0.85);
}

.status-btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.status-btn-secondary:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

/* Archive List */
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.archive-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: hsl(var(--muted-foreground));
}

.archive-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: hsl(var(--muted-foreground));
}

.archive-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.archive-item:hover {
    border-color: hsl(var(--primary) / 0.3);
}

.archive-item-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    background: hsl(var(--primary) / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.archive-item-icon i {
    font-size: 1rem;
    color: hsl(var(--primary));
}

.archive-item-info {
    flex: 1;
    min-width: 0;
}

.archive-item-name {
    font-weight: 600;
    color: hsl(var(--foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-item-date {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
}

.archive-item-actions {
    display: flex;
    gap: 0.5rem;
}

.archive-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-sm);
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.archive-btn:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

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

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

    .generator-header h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }

    .tab-btn span {
        display: none;
    }

    .status-content {
        flex-direction: column;
        text-align: center;
    }

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

    .archive-item {
        flex-wrap: wrap;
    }

    .archive-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* =================================================
      End Generator Page
      ================================================= */

.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: 'Matter', sans-serif !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: 20px !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: 20px !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: var(--background-color-light);
    padding: 2rem;
    border-radius: 12px;
    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;
    border-bottom: 1px solid hsl(var(--border));
}

.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;
    transition: all 0.15s ease;
    outline: none;
}

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

.wizard-btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.wizard-btn-primary:hover {
    background: hsl(var(--primary) / 0.85);
    transform: translateX(2px);
}

.wizard-btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.wizard-btn-secondary:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    transform: translateX(-2px);
}

.wizard-btn-success {
    background: hsl(var(--success));
    color: hsl(var(--success-foreground));
}

.wizard-btn-success:hover {
    background: hsl(var(--success) / 0.85);
    box-shadow: 0 0 20px hsl(var(--success) / 0.3);
}

/* 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;
    justify-content: space-around;
    align-items: center;
    background: var(--background-card-color);
    outline: 2px solid var(--background-spacer-color);
    color: var(--text-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.summary-value {
    font-family: 'Host Grotesk', monospace;
    font-size: 3rem;
    font-weight: bold;
}

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

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

.summary-label {
    color: var(--small-text-color);
    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: black;
}

/* =================================================
      HOME PAGE - Design moderno
      ================================================= */
/* ─── Modern Dashboard v2 ─── */
.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: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.home-greeting h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.home-date {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    margin: 0.35rem 0 0 0;
    text-transform: capitalize;
    font-weight: 500;
}

.home-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.4rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px hsl(var(--primary) / 0.25);
}

.home-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px hsl(var(--primary) / 0.35);
    filter: brightness(1.1);
}

/* Stats Grid */
.home-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.stat-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 16px;
    padding: 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px hsl(0 0% 0% / 0.1);
    border-color: hsl(var(--border));
}

.stat-card-highlight {
    /* border-color: hsl(var(--primary) / 0.4); */
    /* box-shadow: 0 8px 24px -8px hsl(var(--primary) / 0.15); */
}

.stat-card-highlight:hover {
    /* border-color: hsl(var(--primary) / 0.4); */
    /* box-shadow: 0 8px 24px -8px hsl(var(--primary) / 0.15); */
}

.stat-icon-box {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 12px;
    background: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-box.accent {
    background: hsl(var(--accent) / 0.15);
    color: hsl(var(--accent));
}

.stat-icon-box.success {
    background: hsl(var(--success) / 0.15);
    color: hsl(var(--success));
}

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

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.82rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    margin-top: 0.1rem;
}

.stat-label-top {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.stat-value-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dashboard Layout */
.home-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

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

.home-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border) / 0.6);
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    /* Reset padding for header/content separation */
}

.home-card-header {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: hsl(var(--secondary) / 0.3);
}

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

.home-card-title i {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
}

.home-card-title h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: hsl(var(--foreground));
}

/* Badge */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-upcoming {
    background: hsl(var(--primary) / 0.15);
    color: hsl(var(--primary));
}

/* Next Booking Card */
.next-booking-content {
    padding: 1.5rem;
    min-height: 140px;
}

.next-booking-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: hsl(var(--muted-foreground));
    text-align: center;
    padding: 2rem 0;
}

.next-booking-empty i {
    font-size: 2rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.next-booking-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Next Booking Details (Generated by JS) */
#nextBookingDetails .nextBookingDetails-nome {
    font-size: 1.4rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.75rem;
    display: block;
}


#nextBookingDetails div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    color: hsl(var(--muted-foreground));
}

#nextBookingDetails div i {
    width: 20px;
    text-align: center;
    color: hsl(var(--primary));
    opacity: 0.8;
}

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

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    border-bottom: 1px solid hsl(var(--border) / 0.5);
    transition: background-color 0.15s ease;
}

.quick-action-item:last-child {
    border-bottom: none;
}

.quick-action-item:hover {
    background: hsl(var(--secondary) / 0.5);
}

.qa-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: hsl(var(--card));
    /* Fallback */
    background: color-mix(in srgb, var(--qa-color) 15%, transparent);
    color: var(--qa-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.qa-info {
    flex: 1;
    min-width: 0;
}

.qa-info h3 {
    font-size: 0.92rem;
    font-weight: 400;
    color: hsl(var(--foreground));
    margin: 0 0 0.15rem 0;
}

.qa-info p {
    font-size: 0.78rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qa-arrow {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.quick-action-item:hover .qa-arrow {
    transform: translateX(3px);
    opacity: 1;
    color: hsl(var(--primary));
}

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

    .dashboard-side-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .home-stats {
        grid-template-columns: 1fr;
    }

    .home-header {
        flex-direction: column;
        align-items: stretch;
    }

    .home-add-btn {
        justify-content: center;
    }

    .home-greeting h1 {
        font-size: 1.8rem;
    }
}


/* Chart Section */
.chart-section {
    grid-column: 1 / -1;
}

.chart-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.chart-refresh-btn i {
    font-size: 0.75rem;
}

.chart-container {
    height: 340px;
    margin-top: 1rem;
}

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

@media (max-width: 600px) {
    .home-page {
        padding: 1.5rem 1rem 3rem;
    }

    .home-header {
        flex-direction: column;
        align-items: stretch;
    }

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

    .home-greeting h1 {
        font-size: 1.5rem;
    }

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

    .stat-value {
        font-size: 1.75rem;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-container {
        height: 280px;
    }
}

/* =========================
         Buttons
         ========================= */
.btn-primary {
    background: #000;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    background-color: var(--background-button-color);
    color: var(--text-color-btn);
    border: none;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #4a7c8c;
}

.btn-small {
    background: #c5d5d9;
    color: #000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}

.buttonsdetails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.buttondetail {
    background: #c5d5d9;
    color: #000;
    border: none;
    padding: 1rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* =========================
         Lista Prenotazioni
         ========================= */
.list-page {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

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

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Card Prenotazione */
.card-booking {
    background: rgba(38, 38, 43, 0.432);
    color: var(--text-color);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    height: 350px;
    display: flex;
    flex-direction: column;
    transition: all 200ms ease;
}

.card-booking:hover {
    transform: translateY(-6px);
    outline: 2px solid var(--background-spacer-color);
}

.card-booking h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.flag-icon {
    width: 20px;
    height: auto;
    border-radius: 3px;
}

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

.card-booking .info,
.dates>div {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.card-booking .info span {
    font-weight: 600;
    color: var(--text-color);
}

.card-booking .dates {
    margin-top: 1rem;
    font-size: 0.85rem;
}

.card-booking .dates span {
    font-weight: 600;
    color: var(--text-color);
}


.card-booking .dates div {
    color: var(--text-color);
}

.actions {
    margin-top: 20px !important;
}

@media (max-width: 600px) {
    .actions {
        width: 100%;
    }

    .actions>button {
        width: 100%;
    }
}

.selected {
    outline: 1px solid var(--light-border-color) !important;
    color: #fff !important;
}

/* 1) toolbar come flex container */
.list-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* 2) raggruppa ricerca + sort */
.search-sort-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    /* prende lo spazio disponibile */
    min-width: 200px;
    /* non si restringe troppo */
}

/* 3) input di ricerca */
.search-sort-group input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    font-size: 0.95rem;
}

/* 4) select sort */
.search-sort-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    font-size: 0.95rem;
    background-color: white;
}

/* 5) stili base bottoni */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

/* 6) varianti */
.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #006ae6;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:disabled {
    background-color: #e99;
    cursor: not-allowed;
}

.btn-danger:hover:enabled {
    background-color: #c82333;
}

.btn-outline-primary {
    background-color: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: #fff;
}

/* 7) icone leggere, allineate */
.btn i {
    font-size: 1rem;
    line-height: 1;
}

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

/* ========================================
      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-radius: var(--radius-lg);
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

/* 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);
}

/* Sort dropdown */
.toolbar-sort select {
    height: 2.5rem;
    padding: 0 2rem 0 0.875rem;
    font-size: 0.875rem;
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    color: hsl(var(--secondary-foreground));
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    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 0.75rem center;
}

.toolbar-sort select:hover {
    background-color: hsl(var(--secondary) / 0.8);
}

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

/* Action buttons group */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.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;
    transition: all 0.15s ease;
    outline: none;
    font-size: 0.95rem;
}

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

/* Primary button (Add) */
.toolbar-btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.toolbar-btn-primary:hover {
    background: hsl(var(--primary) / 0.85);
    transform: scale(1.05);
}

/* Danger button (Delete) */
.toolbar-btn-danger {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.toolbar-btn-danger:hover:not(:disabled) {
    background: hsl(var(--destructive) / 0.85);
    transform: scale(1.05);
}

.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-sort {
        order: 2;
        flex: 1;
    }

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

    .toolbar-actions {
        order: 3;
    }
}

@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 {
        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: var(--background-color-light);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    margin-top: 2rem;
}

/* pulsanti numerati e frecce */
#pagination button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 6px;
    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: var(--text-color);
    color: var(--background-color);
    font-weight: 600;
}

/* pallini di ellissi */
#pagination .ellipsis {
    color: var(--small-text-color);
    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: 12px 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: 12px;
}

/* 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: 10px;
    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: 24px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    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: 20px;
    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: 12px;
    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: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem;
    background: hsl(var(--muted) / 0.5);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    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: 20px;
}

.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: white !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: white;
    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: var(--background-color-light);
    border: 1px solid var(--background-spacer-color);
    border-radius: 16px;
    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 var(--background-spacer-color);
    background: var(--background-spacer-color);
}

.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: white;
    font-size: 0.9rem;
    border: 3px solid var(--background-color-light);
}

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

.user-email {
    font-size: 1rem;
    color: var(--small-text-color);
    margin: 0 0 0.75rem 0;
}

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

.profile-meta span {
    font-size: 0.9rem;
    color: var(--small-text-color);
    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: var(--background-color-light);
    border: 1px solid var(--background-spacer-color);
    border-radius: 12px;
    overflow: hidden;
}

.profile-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--background-spacer-color);
    background: var(--background-spacer-color);
}

.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: var(--text-color);
}

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

/* Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--background-spacer-color);
}

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

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

.info-label {
    font-size: 0.9rem;
    color: var(--small-text-color);
}

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

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

/* 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: var(--background-spacer-color);
    border-radius: 8px;
    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: 8px;
    font-size: 1rem;
}

.provider-icon.google {
    background: #ea4335;
    color: white;
}

.provider-icon.discord {
    background: #5865f2;
    color: white;
}

.provider-icon.github {
    background: #333;
    color: white;
}

.provider-icon.spotify {
    background: #1db954;
    color: white;
}

.unlink-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--background-spacer-color);
    color: var(--small-text-color);
    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: var(--background-spacer-color);
    border-radius: 8px;
    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: 4px;
    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;
    background: var(--background-spacer-color);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.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: var(--small-text-color);
}

.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 var(--background-spacer-color);
    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 var(--background-spacer-color);
    border-radius: 20px;
    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: var(--background-spacer-color);
}

.select-hide {
    display: none;
}

/* =========================
      Toast notifications
      ========================= */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
}

.toast {
    display: flex;
    align-items: center;
    background: #111111;
    color: #e0e0e0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #51ec9e;
    border: 1px solid #006130;
}

.toast.error {
    background: #f14949;
    border: 1px solid #570404;
}

#deleteBtn {
    text-align: center;
    background: #ff5f5f !important;
}

.deleteBtn {
    text-align: center;
    background: #ff5f5f !important;
}

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

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

#sortSelect {
    width: 200px;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    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: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
}

.querytent #bookingSelector {
    margin-bottom: 1rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    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-image: var(--details-bg-image, none);
    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: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.details-header p {
    color: hsl(0deg 0% 100% / 67%);
    font-size: 1.2rem;
}

.details-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0.5rem 0;
    letter-spacing: 1px;
}

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

.id-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #3b3b3b9c;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 1rem;
    border: 2px solid #5050508c;
}

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

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

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

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

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

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

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

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

.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: 8px;
}

.info-grid p strong {
    color: var(--small-text-color);
    margin-right: 0.5rem;
}

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

.actions-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;

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

    .dropdown-toggle {
        cursor: pointer;
    }

    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--background-color-light);
        border: 1px solid var(--background-spacer-color);
        border-radius: 8px;
        padding: 0.5rem 0;
        list-style: none;
        min-width: 200px;
        z-index: 1001;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        padding: 0.5rem 1rem;
        display: block;
        color: var(--text-color);
        text-decoration: none;
    }

    .dropdown-menu li a:hover {
        background-color: var(--background-a-element-active-hover);
    }

    align-items: center;
    gap: 0.5rem;
}

.btn-action {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
    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: var(--background-spacer-color) !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: var(--background-color-light);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--background-spacer-color);
    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: 8px !important;
}

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

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

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

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

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

.ospiti-card {
    background: var(--background-color-light);
    border: 1px solid var(--background-spacer-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.ospiti-meta {
    font-size: 0.85rem;
    color: var(--small-text-color);
    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: 4px;
    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: 12px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

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

.ospite-item.capogruppo {
    border-color: hsl(var(--primary) / 0.3);
    background: hsl(var(--primary) / 0.05);
}

.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: var(--small-text-color);
}

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

.capogruppo-badge {
    background: hsl(var(--warning) / 0.15);
    color: hsl(var(--warning));
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ospite-toggle {
    color: var(--small-text-color);
    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 var(--background-spacer-color);
}

.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: var(--small-text-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.sensitive-data .detail-value {
    font-family: 'JetBrains Mono', monospace;
}

.masked-value {
    color: var(--small-text-color);
}

.reveal-btn {
    background: transparent;
    border: none;
    color: var(--small-text-color);
    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: 12px;
    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: monospace;
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted) / 0.5);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.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: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    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: 10px;
    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: 6px;
    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: 8px;
    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: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    text-decoration: none;
}

.nb-action-btn:hover {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}