/* ==========================================================================
   Gestion Résidences — Design System (CSS natif)
   Inspiré du projet de référence (palette violette, sidebar, stat-cards, tables)
   ========================================================================== */

/* ---------- Reset & Variables ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 260px;
    --header-height: 64px;

    /* Couleurs */
    --primary: #472A7A;
    --primary-light: #6B4B9E;
    --primary-gradient: linear-gradient(135deg, #472A7A 0%, #6B4B9E 100%);
    --primary-tint: rgba(71, 42, 122, 0.1);
    --primary-tint-strong: rgba(71, 42, 122, 0.08);

    --bg: #F5F6F8;
    --surface: #FFFFFF;
    --surface-hover: #F9FAFB;
    --border: #E5E7EB;
    --border-soft: #F3F4F6;
    --border-card: #F0F0F0;

    --text: #111111;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-faint: #9CA3AF;

    --green-bg: #D1FAE5; --green: #059669;
    --red-bg: #FEE2E2; --red: #DC2626;
    --orange-bg: #FEF3C7; --orange: #D97706;
    --blue-bg: #DBEAFE; --blue: #2563EB;
    --gray-bg: #F3F4F6;
    --purple-bg: #EDE9FE; --purple: #7C3AED;

    --radius: 12px;
    --radius-sm: 10px;
    --radius-xs: 8px;

    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Layout ---------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-logo {
    height: var(--header-height);
    flex-shrink: 0;
    padding: 0 0 0 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    gap: 10px;
}

.sidebar-logo-box {
    width: 34px;
    height: 34px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.sidebar-menu {
    flex: 1;
    padding: 0 8px 16px;
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 14px 16px 8px;
    font-weight: 600;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 150ms;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    margin: 2px 8px;
    text-align: left;
    cursor: pointer;
}

.sidebar-menu-item:hover { background: var(--border-soft); color: var(--text); }

.sidebar-menu-item.active {
    background: var(--primary-tint);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-menu-item i {
    font-size: 17px;
    width: 20px;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu-item.active i { color: var(--primary); }

.sidebar-badge {
    margin-left: auto;
    background: #EF4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Sous-menu (chambres/niveaux) */
.sidebar-submenu { overflow: hidden; }
.sidebar-submenu.collapsed { display: none; }
.sidebar-dropdown-toggle { position: relative; }
.sidebar-dropdown-toggle .fa-chevron-down {
    margin-left: auto;
    font-size: 10px;
    transition: transform 200ms;
}
.sidebar-menu-group.open .sidebar-dropdown-toggle .fa-chevron-down { transform: rotate(180deg); }
.sidebar-submenu-item {
    display: flex;
    align-items: center;
    padding: 0 16px 0 52px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    transition: all 150ms;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    margin: 1px 8px;
    text-align: left;
    cursor: pointer;
}
.sidebar-submenu-item:hover { background: var(--border-soft); color: var(--text-secondary); }
.sidebar-submenu-item.active { background: var(--primary-tint-strong); color: var(--primary); font-weight: 600; }

/* ---------- Main / Header ---------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-width: 0;
}

.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99;
}

.header-breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-toggle { display: none; cursor: pointer; font-size: 18px; color: var(--text-muted); }

.header-breadcrumb span { color: var(--text); font-weight: 500; }

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

.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: var(--text-muted);
}
.header-icon-btn:hover { background: var(--surface-hover); }

.badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: white;
    font-size: 9px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-xs);
}
.header-user:hover { background: var(--surface-hover); }

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}
.header-user-info { display: flex; flex-direction: column; }
.header-user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.header-user-role { font-size: 11px; color: var(--text-muted); }
.header-user-arrow { font-size: 10px; color: var(--text-faint); margin-left: 8px; }

/* Dropdowns */
.header-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 200ms ease;
}
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
}
.dropdown-header span { font-size: 14px; font-weight: 600; color: var(--text); }
.dropdown-content { max-height: 320px; overflow-y: auto; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    text-decoration: none;
    transition: background 150ms;
    color: var(--text);
    font-size: 14px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item i { width: 18px; color: var(--text-muted); }
.dropdown-item.danger, .dropdown-item.danger i { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notification-icon.blue { background: var(--blue-bg); color: var(--blue); }
.notification-icon.green { background: var(--green-bg); color: var(--green); }
.notification-icon.yellow { background: var(--orange-bg); color: var(--orange); }
.notification-icon.gray { background: var(--gray-bg); color: var(--text-muted); }
.notification-content { flex: 1; min-width: 0; }
.notification-text { font-size: 13px; color: var(--text); margin: 0; line-height: 1.4; }
.notification-time { font-size: 11px; color: var(--text-faint); }

/* ---------- Page content ---------- */
.page-content { padding: 24px; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 { font-size: 24px; font-weight: 700; color: var(--text); margin: 0 0 6px 0; }
.page-title p { font-size: 14px; color: var(--text-muted); margin: 0; }

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Boutons ---------- */
.btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: all 150ms;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); }
.btn i { font-size: 13px; }

.btn-primary {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: #FFFFFF;
}
.btn-primary:hover { background: var(--primary); color: #FFFFFF; }

.btn-dark { background: #111; border-color: #111; color: #fff; }
.btn-dark:hover { background: #000; }

.btn-danger { color: var(--red); border-color: var(--red-bg); }
.btn-danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }

/* ---------- Stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 150ms;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.06); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-icon.blue { background: #EEF2FF; color: #4F46E5; }
.stat-icon.green { background: #ECFDF5; color: #10B981; }
.stat-icon.yellow { background: #FEFCE8; color: #EAB308; }
.stat-icon.gray { background: var(--gray-bg); color: var(--text-muted); }
.stat-icon.purple { background: #F3E8FF; color: var(--purple); }
.stat-icon.teal { background: #F0FDFA; color: #14B8A6; }
.stat-icon.orange { background: #FFF7ED; color: #EA580C; }
.stat-icon.red { background: #FEF2F2; color: #EF4444; }

.stat-info h3 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 2px 0; line-height: 1.2; }
.stat-info p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---------- Cartes ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-card);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

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

.view-all-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.view-all-btn:hover { background: var(--surface-hover); }

/* ---------- Tableaux ---------- */
.table-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-card);
    overflow: hidden;
}
.table-card .table-scroll { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }

.table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.table td {
    font-size: 13px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    vertical-align: middle;
}

.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table th.text-right, .table td.text-right { text-align: right; }
.table th.text-center, .table td.text-center { text-align: center; }

/* Liens de tri dans les en-têtes de tableau */
.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-faint);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.sort-link:hover { color: var(--text); }
.sort-link i { font-size: 9px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge.success { background: var(--green-bg); color: var(--green); }
.badge.warning { background: var(--orange-bg); color: var(--orange); }
.badge.danger { background: var(--red-bg); color: var(--red); }
.badge.secondary { background: var(--gray-bg); color: var(--text-muted); }
.badge.info { background: var(--blue-bg); color: var(--blue); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }

.badge.role-super_admin { background: var(--purple-bg); color: var(--purple); }
.badge.role-proprietaire { background: var(--blue-bg); color: var(--blue); }
.badge.role-gerant { background: var(--green-bg); color: var(--green); }
.badge.role-gouvernante { background: var(--orange-bg); color: var(--orange); }
.badge.role-receptionniste { background: var(--teal-bg, #E6FCF5); color: var(--teal, #0B7285); }
.badge.role-femme_menage { background: var(--pink-bg, #FCE7F3); color: var(--pink, #A61E4D); }

/* ---------- Filtres / recherche ---------- */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 150ms;
}
.filter-btn:hover { border-color: #D1D5DB; color: var(--text); }
.filter-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: #FFFFFF;
}

.search-box { position: relative; flex: 1; max-width: 400px; }
.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 14px;
}
.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--surface);
    transition: all 150ms;
    color: var(--text);
}
.search-box input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17,17,17,0.05);
}
.search-box input::placeholder { color: var(--text-faint); }

.select-filter {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    color: var(--text);
    min-width: 150px;
}
.select-filter:focus { outline: none; border-color: #111; }

/* ---------- Cellules utilisateur ---------- */
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 500; color: var(--text); font-size: 14px; }
.user-email { font-size: 12px; color: var(--text-muted); }

/* ---------- Boutons d'action (icônes) ---------- */
.actions { display: flex; gap: 8px; justify-content: flex-end; }

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 150ms;
    font-size: 13px;
}
.action-btn:hover { background: var(--surface-hover); color: var(--text); border-color: #D1D5DB; }
.action-btn.danger { color: var(--red); border-color: var(--red-bg); }
.action-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.action-btn.primary { color: var(--primary); border-color: var(--primary-tint); }
.action-btn.primary:hover { background: var(--primary-tint); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding: 4px 0; flex-wrap: wrap; gap: 12px; }
.pagination-info { color: var(--text-muted); font-size: 14px; }
.pagination-buttons { display: flex; gap: 4px; }
.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: all 150ms;
    cursor: pointer;
    background: #fff;
}
.pagination-btn:hover { background: var(--border-soft); border-color: #D1D5DB; }
.pagination-btn.active { background: #111; border-color: #111; color: white; }
.pagination-ellipsis { display: flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; color: var(--text-faint); }

/* ---------- États vides ---------- */
.empty-state {
    background: var(--border-soft);
    border-radius: var(--radius-sm);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 24px;
}
.empty-state.light { background: transparent; }
.empty-icon { font-size: 36px; color: var(--text-faint); }
.empty-text { font-size: 13px; color: var(--text-muted); }

/* ---------- Formulaires ---------- */
.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-card);
    padding: 24px;
    max-width: 720px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.form-group .required { color: var(--red); }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    box-sizing: border-box;
    color: var(--text);
    background: #fff;
    transition: border-color 150ms, box-shadow 150ms;
}
.form-control:focus { outline: none; border-color: #111; box-shadow: 0 0 0 3px rgba(17,17,17,0.05); }
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-error { color: var(--red); font-size: 12px; margin-top: 4px; }

.password-field { position: relative; }
.password-field .form-control { padding-right: 44px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-faint);
    font-size: 15px;
    line-height: 1;
    border-radius: 6px;
    transition: color 150ms, background 150ms;
}
.password-toggle:hover { color: var(--primary); background: var(--primary-tint); }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.form-actions .reservation-step-actions { display: flex; gap: 12px; }

/* ---------- Modales ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.modal-overlay.show { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 520px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal.lg { max-width: 720px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.modal-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-faint);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.modal-close:hover { color: var(--text); }

/* ---------- Toasts ---------- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 200ms ease;
}
.toast.success { background: var(--green-bg); color: #065F46; }
.toast.error { background: var(--red-bg); color: #B91C1C; }
.toast.info { background: var(--blue-bg); color: #1E40AF; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Alertes flash ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: var(--green-bg); color: #065F46; }
.alert-error { background: var(--red-bg); color: #B91C1C; }

/* ---------- Calendrier réservations ---------- */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-title { font-size: 16px; font-weight: 700; margin: 0 8px; min-width: 180px; text-align: center; }

.calendar-wrap { overflow-x: auto; }
.calendar { border-collapse: collapse; min-width: 900px; width: 100%; }
.calendar th, .calendar td { border: 1px solid var(--border-soft); padding: 0; }
.calendar .col-chambre { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 160px; }
.calendar thead th {
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    padding: 10px 4px;
    min-width: 90px;
}
.calendar thead th.today { background: var(--primary-tint); color: var(--primary); }

.calendar .chambre-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
}
.chambre-num { font-weight: 600; color: var(--text); }
.chambre-type { font-size: 11px; color: var(--text-faint); }

.calendar td.day-cell { height: 56px; position: relative; cursor: pointer; transition: background 120ms; }
.calendar td.day-cell:hover { background: var(--surface-hover); }
.calendar td.day-cell.today-col { background: rgba(71,42,122,0.03); }

.booking-block {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 4px;
    cursor: pointer;
    border-radius: 0;
}
.booking-block.continue { border-radius: 0; }
.booking-block.start { border-radius: 6px 0 0 6px; }
.booking-block.end { border-radius: 0 6px 6px 0; }
.booking-block.full { border-radius: 6px; }
.booking-block.reservation-confirmee { background: #BBF7D0; color: #166534; }
.booking-block.reservation-en_attente { background: #FDE68A; color: #92400E; }
.booking-block.reservation-terminee { background: #E5E7EB; color: #4B5563; }
.booking-block.reservation-annulee { background: #FECACA; color: #991B1B; }
.booking-block.entretien { background: repeating-linear-gradient(45deg, #E0E7FF, #E0E7FF 6px, #C7D2FE 6px, #C7D2FE 12px); color: #3730A3; }

.calendar-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Login / Guest ---------- */
.guest-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 24px;
}
.guest-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.guest-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    text-align: center;
}
.guest-logo .logo-box {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}
.guest-logo h1 { font-size: 20px; font-weight: 700; margin: 0; }
.guest-logo p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---------- Divers ---------- */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.fw-600 { font-weight: 600; }

.chart-container { position: relative; width: 100%; height: 300px; }
.chart-container.sm { height: 240px; }

/* ---------- Custom select (dropdown searchable) ---------- */
.cs { position: relative; width: 100%; }
.filters .cs, .filters-bar .cs { width: auto; min-width: 160px; max-width: 260px; }

.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: #fff;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: border-color 150ms, box-shadow 150ms;
    white-space: nowrap;
    min-width: 0;
}
.cs-trigger:hover { border-color: #D1D5DB; }
.cs-trigger.open { border-color: #111; box-shadow: 0 0 0 3px rgba(17,17,17,0.05); }
.cs-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-value.cs-placeholder { color: var(--text-faint); }
.cs-chevron { font-size: 10px; color: var(--text-faint); transition: transform 150ms; flex-shrink: 0; }
.cs.open .cs-chevron { transform: rotate(180deg); }

.cs-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    display: none;
    overflow: hidden;
}
.cs.open .cs-dropdown { display: block; }

.cs-search { position: relative; border-bottom: 1px solid var(--border-soft); }
.cs-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 13px;
}
.cs-search input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text);
}
.cs-search input:focus { outline: none; }
.cs-search input::placeholder { color: var(--text-faint); }

.cs-options { max-height: 240px; overflow-y: auto; padding: 4px; }
.cs-option {
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}
.cs-option:hover, .cs-option.highlighted { background: var(--border-soft); color: var(--text); }
.cs-option.selected { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.cs-option.empty { color: var(--text-faint); cursor: default; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .content-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 200ms; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .main-header { left: 0; }
    .header-user-info { display: none; }
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .header-breadcrumb { display: none; }
    .sidebar-toggle { display: inline-block; }
}
