/* ============================================================================
   L'Échappée — Admin Design System
   ============================================================================
   Aesthetic direction : « Auberge contemporaine »
   - Refined minimalism, terracotta chaud + vert forêt + crème feutrée
   - Typographie : DM Serif Display (titres) + DM Sans (corps)
   - Inspiration : hôtels de charme, pierre ardennaise, bois clair, lin
   ----------------------------------------------------------------------------
   Ordre de cascade :
     1. app.css           (ce fichier : tokens + base + layout + composants)
     2. pages/*.css       (surcharges par page, optionnel)
   ============================================================================ */


/* ============================================================
   1. DESIGN TOKENS
============================================================ */
:root {
    /* ── Fonds ── */
    /* Palette « Sous-bois ardennais » — inspirée de la nature, sans blanc criard.
       Hiérarchie : sapin #28634f (primaire) · prairie #509534 (positif) ·
       olive #607447 (neutre chaud) · ardoise #22486c (info/focus) */
    --bg-page:           #F6F3EB;  /* crème d'aubier, lin brut non teint */
    --bg-surface:        #FFFFFF;  /* cartes — blanc pour lisibilité */
    --bg-surface-alt:    #FAF6EC;  /* parchemin, alternance tableaux */
    --bg-sidebar:        #FFFFFF;
    --bg-sidebar-hover:  #EDE8D8;  /* lin vieilli */
    --bg-sidebar-active: #DDE8DB;  /* bourgeon tendre */

    /* ── Texte ── encre de brou de noix, jamais de noir pur ── */
    --text-primary:      #1E2A20;  /* feuille morte humide */
    --text-secondary:    #525A45;  /* écorce sèche */
    --text-muted:        #8A8E78;  /* tronc blanchi par la pluie */
    --text-inverse:      #FFFFFF;

    /* ── Accents ──
       Les noms historiques (forest, terracotta, bordeaux, ochre, stone)
       sont conservés pour ne rien casser dans les fichiers PHP, mais leur
       signification sémantique change pour refléter la palette nature. */

    /* Sapin profond — couleur primaire (boutons, liens, sidebar active) */
    --accent-forest:        #28634F;
    --accent-forest-dark:   #1B4A3A;
    --accent-forest-light:  #DDE8DB;

    /* Vert prairie — accent positif vivant (badges succès, highlights) */
    --accent-terracotta:      #509534;  /* remappé : vert prairie */
    --accent-terracotta-light:#E4EFD6;

    /* Baie de sureau — destructif, s'harmonise avec les verts */
    --accent-bordeaux:       #7A2E2E;
    --accent-bordeaux-light: #F0DDD8;

    /* Lichen doré — avertissements (champignon d'automne) */
    --accent-ochre:        #B5832A;
    --accent-ochre-light:  #F2E6C8;

    /* Olive / vert mousse — neutre chaud (badges neutres, éléments tertiaires) */
    --accent-stone:        #607447;
    --accent-stone-light:  #E8EBDA;

    /* Ardoise — informations, focus, bleu ciel d'orage ardennais */
    --accent-slate:        #22486C;
    --accent-slate-light:  #DCE4EF;

    /* ── Structure ── */
    --border-color:      #D9D3BE;  /* ficelle de chanvre */
    --border-subtle:     #E8E2CE;
    --border-radius-sm:  6px;
    --border-radius:     12px;
    --border-radius-lg:  16px;

    --shadow-xs:   0 1px 2px rgba(31, 28, 22, 0.04);
    --shadow-sm:   0 2px 8px rgba(31, 28, 22, 0.05), 0 1px 3px rgba(31, 28, 22, 0.03);
    --shadow-md:   0 4px 20px rgba(31, 28, 22, 0.07), 0 2px 6px rgba(31, 28, 22, 0.04);
    --shadow-lg:   0 8px 32px rgba(31, 28, 22, 0.10), 0 4px 12px rgba(31, 28, 22, 0.06);

    /* ── Layout ── */
    --sidebar-width:     240px;
    --sidebar-width-collapsed: 72px;
    --topbar-height:     68px;
    --content-max:       1400px;

    /* ── Typographie ── */
    --font-display: 'DM Serif Display', 'Libre Caslon Text', Georgia, serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --fs-xs:   11px;
    --fs-sm:   12.5px;
    --fs-base: 14px;
    --fs-md:   15.5px;
    --fs-lg:   18px;
    --fs-xl:   22px;
    --fs-2xl:  28px;
    --fs-3xl:  36px;

    /* ── Animation ── */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition:      180ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================
   2. RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--bg-page);
    min-height: 100vh;
}

/* Subtle grain texture on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(40, 99, 79, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(34, 72, 108, 0.025) 0%, transparent 50%);
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 1em 0; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-forest);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--accent-forest-dark); }

code, pre, .mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
}
code {
    background: var(--accent-stone-light);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-forest-dark);
}

/* Scrollbar raffinée */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--bg-page);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

::selection { background: var(--accent-forest-light); color: var(--accent-forest-dark); }

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}


/* ============================================================
   3. LAYOUT — Sidebar + Topbar + Main
============================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-mark {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-forest) 0%, var(--accent-forest-dark) 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(40, 99, 79, 0.28);
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sidebar-brand-text strong {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.sidebar-brand-text span {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 18px;
}
.sidebar-section-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0 12px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}
.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}
.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--accent-forest-dark);
    font-weight: 600;
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    background: var(--accent-forest);
    border-radius: 0 3px 3px 0;
}
.sidebar-link i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-link .badge-count {
    margin-left: auto;
    background: var(--accent-forest-light);
    color: var(--accent-forest-dark);
    font-size: var(--fs-xs);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ── Main content ── */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: rgba(245, 241, 234, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.topbar-title .breadcrumb {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.topbar-title h1 {
    font-size: var(--fs-xl);
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px; height: 40px;
    cursor: pointer;
    color: var(--text-primary);
    margin-right: 12px;
}

.page-content {
    flex: 1;
    padding: 28px 32px 40px;
    max-width: var(--content-max);
    width: 100%;
}


/* ============================================================
   4. CARDS
============================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-header h3 {
    font-size: var(--fs-md);
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.card-header .card-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-left: 8px;
}

.card-body { padding: 22px; }
.card-body.compact { padding: 14px 18px; }

.card-footer {
    padding: 14px 22px;
    background: var(--bg-surface-alt);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}


/* ============================================================
   5. BUTTONS
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 500;
    line-height: 1.4;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}
.btn:focus-visible {
    outline: 2px solid var(--accent-forest);
    outline-offset: 2px;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn i { font-size: 15px; }

.btn-sm { padding: 6px 12px; font-size: var(--fs-sm); border-radius: 7px; gap: 5px; }
.btn-sm i { font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: var(--fs-md); }

.btn-icon {
    padding: 7px;
    aspect-ratio: 1;
    justify-content: center;
}
.btn-icon.btn-sm { padding: 5px; }

/* Primaire : vert forêt plein */
.btn-primary {
    background: var(--accent-forest);
    color: #fff;
    border-color: var(--accent-forest);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-forest-dark);
    border-color: var(--accent-forest-dark);
    box-shadow: 0 4px 12px rgba(40, 99, 79, 0.28);
    transform: translateY(-1px);
    color: #fff;
}

/* Secondaire : contour */
.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-sidebar-hover);
    border-color: var(--text-muted);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

/* Terracotta */
.btn-accent {
    background: var(--accent-terracotta);
    color: #fff;
    border-color: var(--accent-terracotta);
}
.btn-accent:hover:not(:disabled) {
    background: #3E7527;
    border-color: #3E7527;
    color: #fff;
}

/* Danger */
.btn-danger {
    background: var(--bg-surface);
    color: var(--accent-bordeaux);
    border-color: var(--accent-bordeaux-light);
}
.btn-danger:hover:not(:disabled) {
    background: var(--accent-bordeaux);
    color: #fff;
    border-color: var(--accent-bordeaux);
}

/* Groupe de boutons */
.btn-group {
    display: inline-flex;
    gap: 0;
}
.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}
.btn-group .btn:first-child {
    border-radius: 9px 0 0 9px;
}
.btn-group .btn:last-child {
    border-radius: 0 9px 9px 0;
    border-right-width: 1px;
}
.btn-group .btn-sm:first-child { border-radius: 7px 0 0 7px; }
.btn-group .btn-sm:last-child { border-radius: 0 7px 7px 0; }


/* ============================================================
   6. FORMS
============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.form-label .optional {
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
}

.form-control,
.form-select {
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 9px 12px;
    transition: all var(--transition-fast);
    line-height: 1.4;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:hover,
.form-select:hover {
    border-color: var(--text-muted);
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-forest);
    box-shadow: 0 0 0 3px var(--accent-forest-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.55;
}

.form-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 12 12'%3E%3Cpath fill='%236B6458' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.form-control-sm,
.form-select-sm {
    padding: 6px 10px;
    font-size: var(--fs-sm);
    border-radius: 7px;
}

.form-text {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}
.form-check-input {
    width: 17px; height: 17px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    background: var(--bg-surface);
}
.form-check-input:checked {
    background: var(--accent-forest);
    border-color: var(--accent-forest);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.854 3.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 9.793l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}
.form-check-input[type="radio"] {
    border-radius: 50%;
}
.form-check-label {
    font-size: var(--fs-base);
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    border-radius: 9px 0 0 9px;
    border-right: none;
}
.input-group .btn {
    border-radius: 0 9px 9px 0;
}


/* ============================================================
   7. BADGES
============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    text-transform: none;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-forest     { background: var(--accent-forest-light);     color: var(--accent-forest-dark); }
.badge-terracotta { background: var(--accent-terracotta-light); color: var(--accent-terracotta); }
.badge-bordeaux   { background: var(--accent-bordeaux-light);   color: var(--accent-bordeaux); }
.badge-ochre      { background: var(--accent-ochre-light);      color: var(--accent-ochre); }
.badge-stone      { background: var(--accent-stone-light);      color: var(--accent-stone); }
.badge-slate      { background: var(--accent-slate-light);      color: var(--accent-slate); }
.badge-lang       { background: var(--accent-forest-light); color: var(--accent-forest-dark); font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em; padding: 3px 7px; }

/* Tag flag emoji pour langues */
.lang-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-sm);
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}


/* ============================================================
   8. TABLES
============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-base);
}

.table thead th {
    background: var(--bg-surface-alt);
    color: var(--text-muted);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table tbody tr {
    transition: background-color var(--transition-fast);
}
.table tbody tr:hover {
    background: var(--bg-surface-alt);
}

.table .cell-primary {
    font-weight: 600;
    color: var(--text-primary);
}
.table .cell-muted {
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.table .cell-mono {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}
.table .cell-actions {
    text-align: right;
    white-space: nowrap;
}

/* Table sans bordures externes (pour intégrer dans une card) */
.card .table-wrapper {
    border: none;
    border-radius: 0;
}


/* ============================================================
   9. ALERTS
============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    margin-bottom: 18px;
    font-size: var(--fs-base);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.alert-success {
    background: var(--accent-forest-light);
    border-color: rgba(40, 99, 79, 0.18);
    color: var(--accent-forest-dark);
}
.alert-info {
    background: #EFF4F7;
    border-color: #D6E2EC;
    color: #2F4858;
}
.alert-warning {
    background: var(--accent-ochre-light);
    border-color: rgba(184, 137, 31, 0.2);
    color: #7D5D0F;
}
.alert-danger {
    background: var(--accent-bordeaux-light);
    border-color: rgba(139, 46, 46, 0.15);
    color: var(--accent-bordeaux);
}
.alert .btn-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}
.alert .btn-close:hover { opacity: 1; }


/* ============================================================
   10. FILTER BAR (liste des réservations)
============================================================ */
.filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}
.filter-bar .filter-group.grow { flex: 1; min-width: 200px; }
.filter-bar label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.filter-bar .form-control,
.filter-bar .form-select {
    padding: 8px 12px;
    font-size: var(--fs-sm);
}


/* ============================================================
   11. MODAL (remplace Bootstrap modal)
============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 28, 22, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition);
}
.modal-backdrop.open {
    display: flex;
    opacity: 1;
}
.modal {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px);
    transition: transform var(--transition);
}
.modal-backdrop.open .modal {
    transform: translateY(0);
}
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-header h3 {
    flex: 1;
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 400;
    font-style: italic;
}
.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}
.modal-footer {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--bg-surface-alt);
}


/* ============================================================
   12. TABS
============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab {
    padding: 10px 18px;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tab:hover {
    color: var(--text-primary);
}
.tab.active {
    color: var(--accent-forest);
    border-bottom-color: var(--accent-forest);
    font-weight: 600;
}


/* ============================================================
   13. ACCORDION (pour les textes multilingues)
============================================================ */
.accordion-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.accordion-item:hover { box-shadow: var(--shadow-xs); }
.accordion-item.open { box-shadow: var(--shadow-sm); }

.accordion-header {
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}
.accordion-header:hover { background: var(--bg-surface-alt); }
.accordion-header .accordion-number {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-style: italic;
    color: var(--accent-forest);
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.accordion-header .accordion-title {
    flex: 1;
    font-weight: 600;
    font-size: var(--fs-md);
    color: var(--text-primary);
}
.accordion-header .accordion-title code {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    background: var(--accent-stone-light);
    margin-left: 10px;
    font-weight: 400;
}
.accordion-header .accordion-completeness {
    display: flex;
    gap: 4px;
    margin-right: 10px;
}
.accordion-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background var(--transition-fast);
}
.accordion-dot.filled { background: var(--accent-forest); }

.accordion-chevron {
    color: var(--text-muted);
    transition: transform var(--transition);
    font-size: 14px;
}
.accordion-item.open .accordion-chevron {
    transform: rotate(180deg);
}
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}
.accordion-item.open .accordion-body {
    max-height: 2000px;
}
.accordion-body-inner {
    padding: 4px 22px 22px;
    border-top: 1px solid var(--border-subtle);
}

.text-editor {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    min-height: 220px;
}

/* ============================================================
   14c. PUBLICATION BAR & UNPUBLISHED STATE (texts.php)
============================================================ */
.accordion-item.unpublished {
    opacity: 0.72;
}
.accordion-item.unpublished .accordion-header {
    background: var(--bg-surface-alt);
}
.accordion-item.unpublished.open {
    opacity: 1;
}

.publish-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    flex-wrap: wrap;
}
.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}
.switch-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent-forest);
    cursor: pointer;
}
.switch-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
}
.switch-label input[type="checkbox"]:disabled + span {
    color: var(--text-muted);
}

/* ============================================================
   14d. RATING STARS, RISK BADGE, BATCH BAR
============================================================ */
.rating-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.rating-star {
    font-size: 22px;
    color: var(--border-color);
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
}
.rating-star:hover {
    transform: scale(1.15);
}
.rating-star.active,
.rating-star.bi-star-fill {
    color: var(--accent-ochre);
}
.rating-value {
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Étoiles compactes (pour l'affichage en lecture dans la liste) */
.rating-stars-ro {
    display: inline-flex;
    gap: 1px;
    vertical-align: middle;
}
.rating-stars-ro i {
    font-size: 11px;
    color: var(--accent-ochre);
}
.rating-stars-ro i.empty {
    color: var(--border-color);
}

/* Badge "locataire déjà venu" */
.badge-recurrent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--accent-forest-light);
    color: var(--accent-forest-dark);
    white-space: nowrap;
}
.badge-recurrent.warning { background: #fceedd; color: var(--accent-ochre); }
.badge-recurrent.danger  { background: #f5e0e0; color: var(--accent-bordeaux); }

/* Badge alerte groupe à risque */
.badge-risk {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #fceedd;
    color: var(--accent-bordeaux);
    border: 1px solid var(--accent-ochre);
    animation: riskPulse 2s ease-in-out infinite;
}
@keyframes riskPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(181, 131, 42, 0.4); }
    50%      { box-shadow: 0 0 0 4px rgba(181, 131, 42, 0); }
}

/* Case à cocher pour sélection multiple dans res-header */
.res-header-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 2px;
}
.res-header-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-forest);
}

/* Barre flottante de sélection par lot */
.batch-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--text-primary);
    color: #fff;
    padding: 14px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 1000;
    transition: transform var(--transition);
    font-size: var(--fs-sm);
}
.batch-bar.visible {
    transform: translateX(-50%) translateY(0);
}
.batch-bar strong {
    color: #fff;
    font-size: var(--fs-md);
}
.batch-bar .btn {
    background: #fff;
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: var(--fs-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.batch-bar .btn:hover {
    background: var(--accent-forest);
    color: #fff;
}
.batch-bar .btn-ghost-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.batch-bar .btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Historique locataire dans le détail déplié */
.past-stays {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.past-stay-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-surface-alt);
    border-radius: 6px;
    border-left: 3px solid var(--accent-forest);
    font-size: var(--fs-sm);
}
.past-stay-dates {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}
.past-stay-rating {
    margin-left: auto;
    font-weight: 700;
    color: var(--accent-ochre);
    white-space: nowrap;
}
.past-stay-note {
    font-style: italic;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    width: 100%;
    margin-top: 4px;
}

/* ============================================================
   14e. BLACKLIST BUTTON + CALENDAR TOOLTIP
============================================================ */
.btn-outline-bordeaux {
    background: transparent;
    color: var(--accent-bordeaux);
    border: 1px solid var(--accent-bordeaux);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: var(--fs-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-outline-bordeaux:hover:not(:disabled) {
    background: var(--accent-bordeaux);
    color: #fff;
}
.btn-outline-bordeaux:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Tooltip riche pour calendrier et agenda 12 mois */
.resa-tooltip {
    position: fixed;
    z-index: 2000;
    background: var(--text-primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    font-size: var(--fs-sm);
    line-height: 1.5;
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s, transform 0.12s;
    white-space: normal;
}
.resa-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.resa-tooltip strong { color: #fff; font-weight: 700; }
.resa-tooltip .tip-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}
.resa-tooltip .tip-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.resa-tooltip .tip-dates {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--accent-forest-light);
    letter-spacing: 0.02em;
}
.resa-tooltip i { opacity: 0.75; width: 14px; text-align: center; }

[data-tip] { cursor: help; }



/* ============================================================
   14b. RESERVATION ACCORDION (liste des réservations)
============================================================ */
.res-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.res-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
    position: relative;
}
.res-item:hover {
    box-shadow: var(--shadow-xs);
}
.res-item.open {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-forest-light);
}

/* Barre verticale gauche selon statut */
.res-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--border-color);
    transition: background var(--transition);
}
.res-item.status-upcoming::before { background: var(--accent-forest); }
.res-item.status-current::before  { background: var(--accent-terracotta); }
.res-item.status-past::before     { background: var(--accent-stone); }
.res-item.status-archived::before { background: var(--border-color); }

.res-header {
    display: grid;
    grid-template-columns: 170px 56px minmax(180px, 1fr) 72px 48px 90px 36px;
    gap: 14px;
    padding: 14px 20px 14px 24px;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}
.res-list.batch-mode .res-header {
    grid-template-columns: 32px 170px 56px minmax(180px, 1fr) 72px 48px 90px 36px;
}
.res-header:hover { background: var(--bg-surface-alt); }

.res-header-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.res-header-dates strong {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--fs-base);
}
.res-header-dates .arrow {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}
.res-header-dates .end {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.res-header-type {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--accent-stone-light);
    color: var(--accent-stone);
    text-align: center;
    letter-spacing: 0.05em;
}

.res-header-guest {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.res-header-guest-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.res-header-guest-name .firstname {
    color: var(--accent-forest-dark);
}
.res-header-guest-icons {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-size: 13px;
    flex-shrink: 0;
}

.res-header-pers {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}
.res-header-pers .label {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
    font-weight: 500;
}

.res-header-lang {
    display: flex;
    justify-content: center;
}

.res-header-sent {
    display: flex;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 15px;
}
.res-header-sent i.sent {
    color: var(--accent-forest);
}

.res-header-chevron {
    color: var(--text-muted);
    transition: transform var(--transition);
    text-align: center;
    font-size: 14px;
}
.res-item.open .res-header-chevron {
    transform: rotate(180deg);
    color: var(--accent-forest);
}

/* Corps déplié */
.res-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}
.res-item.open .res-body {
    max-height: 1200px;
}
.res-body-inner {
    padding: 4px 24px 20px;
    border-top: 1px solid var(--border-subtle);
}

.res-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 32px;
    padding-top: 16px;
}
.res-detail-block h4 {
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 6px 0;
}
.res-detail-block .detail-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-base);
    color: var(--text-primary);
    margin-bottom: 3px;
}
.res-detail-block .detail-line i {
    color: var(--text-muted);
    font-size: 14px;
    width: 16px;
    text-align: center;
}
.res-detail-block .detail-line.mono {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}
.res-detail-note {
    grid-column: 1 / -1;
    padding: 14px 16px;
    background: var(--bg-surface-alt);
    border-radius: 8px;
    border-left: 3px solid var(--accent-ochre);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}
.res-detail-note strong {
    color: var(--text-primary);
    font-style: normal;
    display: block;
    margin-bottom: 4px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.res-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

/* En-têtes de colonnes triables (barre au-dessus de la liste) */
.res-sort-bar {
    display: grid;
    grid-template-columns: 170px 56px minmax(180px, 1fr) 72px 48px 90px 36px;
    gap: 14px;
    padding: 10px 20px 10px 24px;
    margin-bottom: 8px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}
.res-sort-bar.batch-mode {
    grid-template-columns: 32px 170px 56px minmax(180px, 1fr) 72px 48px 90px 36px;
}
.res-sort {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition-fast);
    text-align: left;
    white-space: nowrap;
}
.res-sort:hover {
    color: var(--text-primary);
}
.res-sort.active {
    color: var(--accent-forest);
}
.res-sort i {
    font-size: 11px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.res-sort.active i {
    opacity: 1;
}
.res-sort.center { justify-content: center; }

/* Responsive : sur mobile, on empile tout */
@media (max-width: 960px) {
    .res-header,
    .res-sort-bar {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 12px 16px;
    }
    .res-header-dates   { grid-column: 1; grid-row: 1; }
    .res-header-chevron { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
    .res-header-guest   { grid-column: 1 / -1; grid-row: 2; }
    .res-header-type,
    .res-header-pers,
    .res-header-lang,
    .res-header-sent    { display: none; }

    .res-sort-bar { display: none; }

    .res-detail-grid { grid-template-columns: 1fr; gap: 14px; }
}


/* ============================================================
   14. CALENDAR (admin/calendar.php)
============================================================ */
.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
}
.calendar-table thead th {
    background: var(--bg-surface-alt);
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.calendar-table tbody td {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    min-width: 110px;
    height: 96px;
    padding: 8px;
    position: relative;
}
.calendar-table tbody td:last-child { border-right: none; }
.calendar-table tbody tr:last-child td { border-bottom: none; }

.calendar-day {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 400;
    color: var(--text-muted);
}
.calendar-table tbody td.today { background: var(--accent-forest-light); }
.calendar-table tbody td.today .calendar-day {
    color: var(--accent-forest-dark);
    font-weight: 700;
    font-style: italic;
}
.calendar-table tbody td.empty { background: var(--bg-surface-alt); opacity: 0.4; }

.calendar-event {
    display: block;
    font-size: var(--fs-xs);
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 4px;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform var(--transition-fast);
}
.calendar-event:hover { transform: translateX(2px); color: #fff; }
.calendar-event.arrival { background: var(--accent-forest); }
.calendar-event.stay    { background: var(--accent-stone); }
.calendar-event.departure { background: var(--accent-bordeaux); }
.calendar-event.maintenance { background: var(--accent-ochre); color: #3D2F06; }


/* ============================================================
   15. MINI CALENDAR (agenda 12 mois)
============================================================ */
.mini-month {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-xs);
}
.mini-month th {
    color: var(--text-muted);
    font-weight: 500;
    padding: 3px 0;
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.05em;
}
.mini-month td {
    width: 14.28%;
    aspect-ratio: 1;
    text-align: center;
    padding: 0;
    font-size: 11.5px;
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
}
.mini-month td.today {
    outline: 2px solid var(--accent-forest);
    outline-offset: -1px;
    font-weight: 700;
}
.mini-month td.busy  { background: var(--accent-stone); color: #fff; }
.mini-month td.start { background: var(--accent-forest); color: #fff; font-weight: 600; }
.mini-month td.end   { background: var(--accent-bordeaux); color: #fff; font-weight: 600; }
.mini-month td.maint { background: var(--accent-ochre); color: #3D2F06; font-weight: 600; }
.mini-month td.empty { color: var(--border-color); }


/* ============================================================
   16. UTILITIES
============================================================ */
.text-muted        { color: var(--text-muted) !important; }
.text-secondary    { color: var(--text-secondary) !important; }
.text-primary      { color: var(--text-primary) !important; }
.text-forest       { color: var(--accent-forest) !important; }
.text-terracotta   { color: var(--accent-terracotta) !important; }
.text-bordeaux     { color: var(--accent-bordeaux) !important; }
.text-ochre        { color: var(--accent-ochre) !important; }
.text-slate        { color: var(--accent-slate) !important; }
.text-end          { text-align: right !important; }
.text-center       { text-align: center !important; }
.text-sm           { font-size: var(--fs-sm) !important; }
.text-xs           { font-size: var(--fs-xs) !important; }
.text-italic       { font-style: italic; }
.text-display      { font-family: var(--font-display); }
.text-mono         { font-family: var(--font-mono); }
.fw-500            { font-weight: 500; }
.fw-600            { font-weight: 600; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 14px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 30px !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 14px !important; }
.mt-4 { margin-top: 20px !important; }
.ms-auto { margin-left: auto !important; }

.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 14px !important; }
.w-100 { width: 100% !important; }

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}
.row > [class^="col-"],
.row > [class*=" col-"] {
    padding: 0 10px;
    flex-shrink: 0;
}
.col-12 { width: 100%; }
.col-6  { width: 50%; }
.col-4  { width: 33.333%; }
.col-3  { width: 25%; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }


/* ============================================================
   17. ANIMATIONS
============================================================ */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-content > * {
    animation: fade-in var(--transition-slow) backwards;
}
.page-content > *:nth-child(1) { animation-delay: 0ms; }
.page-content > *:nth-child(2) { animation-delay: 40ms; }
.page-content > *:nth-child(3) { animation-delay: 80ms; }
.page-content > *:nth-child(4) { animation-delay: 120ms; }

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================
   18. RESPONSIVE
============================================================ */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .topbar-toggle { display: grid; place-items: center; }
    .page-content { padding: 20px 16px 32px; }
    .topbar { padding: 0 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .col-6, .col-4, .col-3 { width: 100%; }
    .hide-sm { display: none !important; }
}

@media (max-width: 600px) {
    .topbar-title h1 { font-size: var(--fs-lg); }
    .card-body { padding: 16px; }
    .filter-bar { padding: 14px; }
    .modal { max-width: 100%; }
    .table thead th, .table tbody td { padding: 10px 12px; }
}


/* ============================================================
   19. LOGIN PAGE
============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-page);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(40, 99, 79, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(34, 72, 108, 0.05) 0%, transparent 40%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 42px 38px;
}
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.login-brand-mark {
    width: 56px; height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-forest) 0%, var(--accent-forest-dark) 100%);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(40, 99, 79, 0.32);
}
.login-brand h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-style: italic;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.login-brand p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}
