@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --ds-bg:           #0f1117;
    --ds-surface:      #1a1d2b;
    --ds-surface-2:    #151824;
    --ds-border:       #2a2d3a;
    --ds-accent:       #e2b96f; /* Oro */
    --ds-accent-text:  #1a1a2e;
    --ds-text:         #e8eaf0;
    --ds-text-muted:   #8b90a0;
    --ds-success:      #4ade80;
    --ds-warning:      #fb923c;
    --ds-danger:       #e07a6b;
    --ds-radius-sm:    8px;
    --ds-radius:       12px;
    --ds-radius-lg:    16px;
    --ds-transition:   0.18s ease;
    --ds-shadow:       0 8px 32px rgba(0, 0, 0, 0.4);
    --ds-font:         'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base resets & styles override if class is present */
.ds-body {
    background-color: var(--ds-bg) !important;
    color: var(--ds-text) !important;
    font-family: var(--ds-font) !important;
}

/* Card Component */
.ds-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--ds-shadow);
}

.ds-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ds-accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--ds-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ds-font);
    cursor: pointer;
    transition: var(--ds-transition);
    border: none;
    text-decoration: none;
}

.ds-btn-primary {
    background-color: var(--ds-accent);
    color: var(--ds-accent-text);
}
.ds-btn-primary:hover {
    filter: brightness(1.1);
}

.ds-btn-secondary {
    background-color: var(--ds-surface-2);
    color: var(--ds-text);
    border: 1px solid var(--ds-border);
}
.ds-btn-secondary:hover {
    background-color: var(--ds-border);
}

.ds-btn-danger {
    background-color: var(--ds-danger);
    color: #ffffff;
}
.ds-btn-danger:hover {
    filter: brightness(1.1);
}

.ds-btn-ghost {
    background: transparent;
    color: var(--ds-text-muted);
}
.ds-btn-ghost:hover {
    color: var(--ds-text);
    background: rgba(255, 255, 255, 0.05);
}

.ds-btn-icon {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: var(--ds-radius-sm);
    background-color: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    color: var(--ds-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--ds-transition);
}
.ds-btn-icon:hover {
    color: var(--ds-text);
    border-color: var(--ds-accent);
}

/* Badges */
.ds-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
}

.ds-badge-success {
    background-color: rgba(74, 222, 128, 0.15);
    color: var(--ds-success);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.ds-badge-warning {
    background-color: rgba(251, 146, 60, 0.15);
    color: var(--ds-warning);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.ds-badge-danger {
    background-color: rgba(224, 122, 107, 0.15);
    color: var(--ds-danger);
    border: 1px solid rgba(224, 122, 107, 0.3);
}

.ds-badge-muted {
    background-color: rgba(139, 144, 160, 0.15);
    color: var(--ds-text-muted);
    border: 1px solid rgba(139, 144, 160, 0.3);
}

/* Modal Overlay & Box */
.ds-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: var(--ds-transition);
}

.ds-modal-box {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--ds-shadow);
    transform: scale(0.9);
    transition: var(--ds-transition);
}

.ds-modal-overlay.active {
    display: flex;
}

.ds-modal-overlay.active .ds-modal-box {
    transform: scale(1);
}

.ds-modal-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.ds-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ds-text);
    text-align: center;
    margin-bottom: 12px;
}

.ds-modal-desc {
    color: var(--ds-text-muted);
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

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

.ds-modal-actions button {
    flex: 1;
}

/* Toast Component */
.ds-toast-container {
    position: fixed;
    bottom: 80px; /* Sopra la bottom nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.ds-toast {
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    padding: 12px 16px;
    border-radius: var(--ds-radius);
    color: var(--ds-text);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--ds-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: dsToastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

@keyframes dsToastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ds-toast-success { border-left: 4px solid var(--ds-success); }
.ds-toast-danger { border-left: 4px solid var(--ds-danger); }
.ds-toast-warning { border-left: 4px solid var(--ds-warning); }

/* Navigation Layout */
.ds-page-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;   /* non sfora mai lo schermo */
    overflow-x: hidden;
}

.ds-admin-main {
    flex: 1;
    min-width: 0;           /* impedisce al flex-child di espandersi oltre il parent */
    padding: 24px;
    overflow-x: hidden;     /* taglia qualsiasi overflow figlio */
    margin-bottom: 80px;    /* spazio bottom-nav mobile */
}

/* Sidebar Navigation (Desktop) */
.ds-sidebar {
    width: 260px;
    background: var(--ds-surface);
    border-right: 1px solid var(--ds-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.ds-sidebar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ds-accent);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    padding-left: 12px;
}

.ds-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ds-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--ds-transition);
}

.ds-nav-item i {
    font-size: 20px;
}

.ds-nav-item:hover, .ds-nav-item.active {
    color: var(--ds-text);
    background: rgba(255, 255, 255, 0.05);
}

.ds-nav-item.active {
    color: var(--ds-accent);
    background: rgba(226, 185, 111, 0.1);
    font-weight: 600;
}

/* Bottom Navigation (Mobile) */
.ds-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(26, 29, 43, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--ds-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.ds-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ds-text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    flex: 1;
    height: 100%;
    transition: var(--ds-transition);
}

.ds-bottom-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.ds-bottom-item.active {
    color: var(--ds-accent);
}

/* Hide / Show classes */
@media (max-width: 767px) {
    .ds-sidebar {
        display: none !important;
    }
    .ds-desktop-only {
        display: none !important;
    }
    /* Padding ridotto su mobile per massimizzare lo spazio */
    .ds-admin-main {
        padding: 12px;
    }
    /* Card: niente padding eccessivo su mobile */
    .ds-card {
        padding: 14px;
    }
}

@media (min-width: 768px) {
    .ds-bottom-nav {
        display: none !important;
    }
    .ds-admin-main {
        margin-bottom: 0;
    }
    .ds-mobile-only {
        display: none !important;
    }
}

/* Expandable list card for mobile */
.ds-expandable-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--ds-shadow);
}

.ds-expandable-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.ds-expandable-title {
    font-weight: 600;
    color: var(--ds-text);
    font-size: 15px;
}

.ds-expandable-subtitle {
    color: var(--ds-text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.ds-expandable-chevron {
    color: var(--ds-text-muted);
    transition: var(--ds-transition);
    font-size: 18px;
}

.ds-expandable-card.open .ds-expandable-chevron {
    transform: rotate(180deg);
}

.ds-expandable-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--ds-border);
    display: none;
    background: var(--ds-surface-2);
}

.ds-expandable-card.open .ds-expandable-body {
    display: block;
}

.ds-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
}
.ds-detail-row:last-child {
    border-bottom: none;
}

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

.ds-detail-value {
    color: var(--ds-text);
    font-weight: 500;
    text-align: right;
}

.ds-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    border-top: 1px solid var(--ds-border);
    padding-top: 12px;
}

.ds-card-actions > * {
    flex: 1;
}

/* Guest Wizard styles */
.ds-wizard-steps-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 20px 0 35px;
    padding: 0 10px;
}
.ds-wizard-steps-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ds-border);
    transform: translateY(-50%);
    z-index: 1;
}
.ds-wizard-steps-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background: var(--ds-accent);
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.3s ease;
    width: 0%;
}
.ds-wizard-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ds-surface-2);
    border: 2px solid var(--ds-border);
    color: var(--ds-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
}
.ds-wizard-step-circle.active {
    background: var(--ds-bg);
    border-color: var(--ds-accent);
    color: var(--ds-accent);
    box-shadow: 0 0 12px rgba(226, 185, 111, 0.2);
}
.ds-wizard-step-circle.completed {
    background: var(--ds-accent);
    border-color: var(--ds-accent);
    color: var(--ds-accent-text);
}
.ds-wizard-step-label {
    position: absolute;
    bottom: -22px;
    font-size: 9px;
    font-weight: 600;
    color: var(--ds-text-muted);
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%);
}
.ds-wizard-step-circle.active .ds-wizard-step-label {
    color: var(--ds-accent);
}
.ds-wizard-step-circle.completed .ds-wizard-step-label {
    color: var(--ds-text);
}
.ds-wizard-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.ds-wizard-actions button, .ds-wizard-actions a {
    flex: 1;
}
.ds-step-section {
    display: none;
    animation: dsFadeIn 0.25s ease forwards;
}
.ds-step-section.active {
    display: block;
}

@keyframes dsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accordion / Details */
.ds-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.ds-accordion-item {
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    overflow: hidden;
    transition: var(--ds-transition);
}
.ds-accordion-item[open] {
    border-color: var(--ds-accent);
}
.ds-accordion-summary {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--ds-text);
    cursor: pointer;
    user-select: none;
    outline: none;
    font-size: 14px;
    list-style: none; /* Rimuove freccia default */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ds-accordion-summary::-webkit-details-marker {
    display: none; /* Rimuove freccia default Safari */
}
.ds-accordion-summary::after {
    content: "▾";
    font-size: 16px;
    color: var(--ds-text-muted);
    transition: transform 0.2s ease;
}
.ds-accordion-item[open] .ds-accordion-summary::after {
    transform: rotate(180deg);
    color: var(--ds-accent);
}
.ds-accordion-content {
    padding: 0 16px 16px;
    color: var(--ds-text);
    font-size: 13.5px;
    line-height: 1.6;
}
.ds-accordion-content p {
    margin: 0 0 8px 0;
}
.ds-accordion-content p:last-child {
    margin-bottom: 0;
}


