/* ============================================
   ANUTEL HOSPITALITY - CUSTOM STYLES (MINIMAL)
   ============================================ */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* ============================================
   GENERALE
   ============================================ */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f6fa;
}

/* ============================================
   NAVBAR MODERNA
   ============================================ */
.navbar {
    min-height: 56px;
}

.navbar-brand .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.1rem;
}

.navbar .nav-link {
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    margin-right: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.navbar .nav-link i {
    font-size: 1rem;
}

.navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.navbar .nav-link.active {
    background-color: #ffffff;
    color: #0d6efd !important;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.2);
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-menu-soft {
    border-radius: 0.6rem;
    border: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.dropdown-menu-soft .dropdown-item {
    font-size: 0.9rem;
    padding: 0.35rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dropdown-menu-soft .dropdown-item i {
    font-size: 0.95rem;
    color: #6c757d;
}

.dropdown-menu-soft .dropdown-item:hover {
    background-color: #e9f2ff;
}

.dropdown-menu-soft .dropdown-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================
   PROFILE PILL
   ============================================ */
.navbar-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    color: #ffffff;
    font-size: 0.85rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 999px;
    font-size: 0.9rem;
    padding: 0.35rem 0.9rem;
    border: none;
}

.btn-lg {
    padding: 0.55rem 1.35rem;
    font-size: 0.95rem;
    border-radius: 999px;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #4c8dff);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #3c7aea);
}

.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    box-shadow: 0 4px 12px rgba(56, 239, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    box-shadow: 0 4px 12px rgba(235, 51, 73, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    box-shadow: 0 4px 12px rgba(255, 210, 0, 0.3);
    color: #fff;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #56ccf2);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-secondary {
    background: #6c757d;
}

.btn-outline-primary {
    border-radius: 999px;
}

.btn i,
.btn span.bi {
    margin-right: 0.25rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table-sm td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Variante con sfondo bianco e bordo */
.table-light thead th {
    background-color: #ffffff;
    border-bottom: 2px solid #0d6efd;
    color: #0d6efd;
}

/* Variante minimal grigio chiaro */
.table-minimal thead th {
    background-color: #f1f3f5;
    color: #343a40;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
}


/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.stats-card .stats-icon {
    font-size: 3rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.stats-card .stats-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Override: stats card più compatte */
.stats-card {
    padding: 1rem;
    border-radius: 12px;
}

.stats-card .stats-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.stats-card .stats-value {
    font-size: 1.8rem;
    margin: 0.25rem 0;
}

.stats-card .stats-label {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}


/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.alert-success {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.1), rgba(56, 239, 125, 0.1));
    border-left: 4px solid #38ef7d;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(235, 51, 73, 0.1), rgba(244, 92, 67, 0.1));
    border-left: 4px solid #f45c43;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(247, 151, 30, 0.1), rgba(255, 210, 0, 0.1));
    border-left: 4px solid #ffd200;
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(86, 204, 242, 0.1));
    border-left: 4px solid #56ccf2;
}

/* ============================================
   TABS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid #e0e6ed;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 25px;
    border: 2px solid #e0e6ed;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e0e6ed;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* ============================================
   FOOTER
   ============================================ */
footer.footer {
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .stats-card .stats-value {
        font-size: 2rem;
    }
    
    .table-responsive {
        border-radius: 10px;
    }
}

/* ============================================
   TOAST NOTIFICATIONS - FIXED POSITIONING
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999 !important;  /* Sopra tutto */
    max-width: 400px;
    pointer-events: none;  /* Non blocca click sotto */
}

.toast-custom {
    min-width: 300px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    border: none;
    margin-bottom: 10px;
    pointer-events: auto;  /* Abilita click sul toast */
    animation: slideInRight 0.3s ease;
    background: white;
}

/* Animazione ingresso */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   TOAST NOTIFICATIONS - POSIZIONAMENTO CORRETTO
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999 !important;
    max-width: 400px;
    pointer-events: none;  /* Non blocca interazioni sotto */
}

.toast-custom {
    min-width: 300px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    border: none;
    margin-bottom: 10px;
    pointer-events: auto;  /* Ma il toast stesso è cliccabile */
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Colori per tipo */
.toast-custom.success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.toast-custom.error {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: white;
}

.toast-custom.warning {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: white;
}

.toast-custom.info {
    background: linear-gradient(135deg, #17a2b8, #56ccf2);
    color: white;
}

/* Transizioni fade */
.toast-custom.fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast-custom.show {
    opacity: 1;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        top: 70px;
        max-width: none;
    }
    
    .toast-custom {
        min-width: auto;
    }
}

.evento-title-wrapper {
    max-width: 80%;
}

.evento-title {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   STATS CARDS COMPACT (FORZATO)
   ============================================= */
.stats-card {
    padding: 0.75rem !important;
    border-radius: 10px !important;
}

.stats-card .stats-icon {
    font-size: 1.8rem !important;
    margin-bottom: 0.25rem !important;
}

.stats-card .stats-value {
    font-size: 1.4rem !important;
    margin: 0.15rem 0 !important;
}

.stats-card .stats-label {
    font-size: 0.75rem !important;
    letter-spacing: 0.06em !important;
}

/* Card strutture esterne: più visibili */
.camera-box.struttura-card {
    border-width: 2px;
    border-color: #4c8dff;
    background: linear-gradient(135deg, #ffffff, #f0f4ff);
    box-shadow: 0 6px 18px rgba(76, 141, 255, 0.25);
}

.camera-box.struttura-card .badge.bg-dark {
    background: #4c8dff;
}

.struttura-ospiti-list {
    max-height: 220px;
    overflow-y: auto;
}

.struttura-ospiti-list small {
    font-size: 0.86rem;
}

.struttura-ospite-link {
    color: #1f2933;
    text-decoration: none;
}

.struttura-ospite-link:hover {
    text-decoration: underline;
}

.struttura-ospite-row + .struttura-ospite-row {
    border-top: 1px dashed rgba(15, 23, 42, 0.08);
    padding-top: 0.25rem;
}

/* Header struttura più evidente */
.camera-box.struttura-card h5 {
    font-size: 1rem;
    font-weight: 700;
}

.camera-box.struttura-card .text-muted {
    color: #6b7280 !important;
}

/* Colonna Viaggio un po' più larga ma con testo tronco */
table.table .col-viaggio {
  width: 220px;          /* regola a gusto, es. 200–260px */
}

table.table .col-viaggio .viaggio-text {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;  /* "..." finale */
}

/* Dropdown sopra le intestazioni sticky */
.navbar,
.navbar .dropdown,
.navbar .dropdown-menu,
.dropdown-menu-soft {
    position: relative;        /* se non già impostato */
    z-index: 3000;             /* > sticky-top (1020 in Bootstrap) [web:5][web:10] */
}

/* Intestazioni tabella un po' più sotto del dropdown */
.table thead.sticky-top,
.table thead.sticky-top th {
    z-index: 900;              /* < 3000, ma comunque sopra il resto del contenuto [web:4][web:11] */
}

/* Blocca il thead sotto la navbar (56px = altezza navbar) */
#tableOspiti thead.sticky-top {
    top: 56px;           /* uguale a min-height della tua .navbar */
    z-index: 900;
}

/* Contenitore tabella con altezza fissa e scroll interno */
.table-wrapper-fixed {
    max-height: calc(100vh - 200px); /* regola in base alla tua UI */
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

/* Thead rimane fisso dentro il contenitore */
#tableOspiti thead.sticky-top {
    position: sticky;
    top: 0;
    z-index: 900;
}

/* ============================================
   THEAD FISSO - TABELLA DETTAGLIO EVENTO
   ============================================ */
/* RIMOSSO overflow: hidden da .table */
.table {
    border-radius: 10px;
    /* NON mettere overflow: hidden qui */
}

.table-wrapper-fixed {
    border-radius: 10px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

/* Thead fisso - variante dark (dashboard completo) */
#tableOspiti thead.thead-fixed th {
    position: sticky;
    top: 0;
    z-index: 900;
    background-color: #212529;
    color: #fff;
}

/* Thead fisso - variante light (dettaglio evento) */
.table-wrapper-fixed thead.thead-fixed th {
    position: sticky;
    top: 0;
    z-index: 900;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* ============================================
   TITOLO DETTAGLIO EVENTO
   ============================================ */
.evento-hero {
    background: linear-gradient(135deg, #0d6efd, #764ba2);
    color: #ffffff;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.25);
    position: relative;
    overflow: hidden;
}

.evento-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right,
                rgba(255,255,255,0.26), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.evento-hero-code {
    position: relative;
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    margin-bottom: 0.5rem;
}

.evento-hero-title {
    position: relative;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
}

.evento-hero-dates {
    position: relative;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.evento-hero-dates i {
    margin-right: 0.35rem;
}

/* Mobile: titolo un po' più compatto */
@media (max-width: 768px) {
    .evento-hero {
        padding: 0.9rem 1rem;
    }
    .evento-hero-title {
        font-size: 1.3rem;
    }
}

/* Variante compatta titolo evento (dashboard, pagine interne) */
.evento-hero-small {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.2);
}

.evento-hero-small .evento-hero-code {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.35rem;
}

.evento-hero-small .evento-hero-title {
    font-size: 1.25rem;
}

.evento-hero-small .evento-hero-dates {
    font-size: 0.8rem;
}

/* KPI orizzontali tipo badge */
.kpi-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(33, 37, 41, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.8rem;
    line-height: 1.2;
    color: #212529;
    white-space: nowrap;
}

.kpi-pill-main {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.kpi-pill-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    opacity: 0.8;
}

.kpi-pill-value {
    font-weight: 700;
    font-size: 1rem;
}

.kpi-pill-sub {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    opacity: 0.8;
    font-size: 0.7rem;
}

.kpi-pill-sub span i {
    margin-right: 0.15rem;
}

/* Varianti colore sottili */
.kpi-pill-primary {
    border-color: rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.06);
    color: #0b3b82;
}

.kpi-pill-success {
    border-color: rgba(25, 135, 84, 0.35);
    background: rgba(25, 135, 84, 0.06);
    color: #0f5132;
}

.kpi-pill-warning {
    border-color: rgba(255, 193, 7, 0.45);
    background: rgba(255, 193, 7, 0.08);
    color: #664d03;
}

.kpi-pill-danger {
    border-color: rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.06);
    color: #842029;
}

/* Hover leggero */
.kpi-pill {
    transition: background-color 0.15s ease, transform 0.15s ease,
                box-shadow 0.15s ease;
}

.kpi-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Responsività: permetti a pill di andare a capo bene */
@media (max-width: 767.98px) {
    .kpi-pill {
        width: 100%;
        justify-content: space-between;
    }
    .kpi-pill-main {
        justify-content: space-between;
    }
}

/* Azioni rapide compatte */
.quick-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.08);
    background-color: #ffffff;
    color: #212529;
    font-size: 0.8rem;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.15s ease;
}

.quick-action-pill i {
    font-size: 1rem;
}

.quick-action-pill span {
    font-weight: 500;
}

.quick-action-pill:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    text-decoration: none;
}

/* Dashboard: accordion movimenti più compatto */
.accordion-button {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.accordion-body {
    padding: 0.75rem 0.75rem 0.6rem 0.75rem;
}

.event-toolbar {
    position: relative;
    z-index: 2000;
}

.event-toolbar .dropdown-menu {
    z-index: 2050 !important;
}