/* =====================================================================
   VIVI-PALACE - Design System CSS
   Palette élégante, sobre, professionnelle
   ===================================================================== */

/* ─── Google Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

/* ─── Variables CSS - Light Mode ───────────────────────────────────── */
:root {
    /* Brand Colors */
    --brand-primary:    #1a3a5c;
    --brand-secondary:  #c9a84c;
    --brand-accent:     #2d6a9f;

    /* Backgrounds */
    --bg-body:          #f0f2f5;
    --bg-surface:       #ffffff;
    --bg-surface-alt:   #f8f9fa;
    --bg-sidebar:       #1a2940;
    --bg-sidebar-hover: #243554;
    --bg-sidebar-active:#2d6a9f;
    --bg-header:        #ffffff;
    --bg-overlay:       rgba(0,0,0,0.5);

    /* Text */
    --text-primary:     #1a2940;
    --text-secondary:   #5a6a7e;
    --text-muted:       #8a9ab0;
    --text-light:       #ffffff;
    --text-sidebar:     #c5d4e8;
    --text-sidebar-active: #ffffff;

    /* Borders */
    --border-color:     #e2e8f0;
    --border-light:     #f0f4f8;
    --border-focus:     #2d6a9f;

    /* Status Colors */
    --color-success:    #22c55e;
    --color-success-bg: #f0fdf4;
    --color-warning:    #f59e0b;
    --color-warning-bg: #fffbeb;
    --color-danger:     #ef4444;
    --color-danger-bg:  #fef2f2;
    --color-info:       #3b82f6;
    --color-info-bg:    #eff6ff;
    --color-secondary:  #64748b;

    /* Shadows */
    --shadow-xs:        0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:        0 2px 8px rgba(0,0,0,0.06);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:        0 8px 32px rgba(0,0,0,0.10);
    --shadow-xl:        0 16px 48px rgba(0,0,0,0.12);
    --shadow-card:      0 2px 12px rgba(26,42,64,0.08);

    /* Dimensions */
    --sidebar-width:    260px;
    --sidebar-collapsed:72px;
    --header-height:    64px;
    --border-radius:    10px;
    --border-radius-sm: 6px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    /* Transitions */
    --transition-fast:  150ms ease;
    --transition:       250ms ease;
    --transition-slow:  400ms ease;
}

/* ─── Dark Mode Variables ──────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-body:          #0f1923;
    --bg-surface:       #1a2535;
    --bg-surface-alt:   #1e2d42;
    --bg-sidebar:       #111c2b;
    --bg-sidebar-hover: #1a2840;
    --bg-sidebar-active:#2d6a9f;
    --bg-header:        #1a2535;
    --bg-overlay:       rgba(0,0,0,0.7);

    --text-primary:     #e8edf5;
    --text-secondary:   #8da2c0;
    --text-muted:       #5c7090;

    --border-color:     #243554;
    --border-light:     #1e2d42;
    --border-focus:     #3d84c4;

    --color-success-bg: rgba(34,197,94,0.12);
    --color-warning-bg: rgba(245,158,11,0.12);
    --color-danger-bg:  rgba(239,68,68,0.12);
    --color-info-bg:    rgba(59,130,246,0.12);

    --shadow-xs:        0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm:        0 2px 8px rgba(0,0,0,0.25);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg:        0 8px 32px rgba(0,0,0,0.35);
    --shadow-card:      0 2px 12px rgba(0,0,0,0.3);
}

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* ─── Layout Principal ─────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width var(--transition), transform var(--transition);
    overflow-x: hidden;
    overflow-y: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--brand-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: var(--brand-primary);
}

.sidebar-brand-text {
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    display: block;
}

.sidebar-brand-sub {
    font-size: 10px;
    color: var(--brand-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: block;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* crucial pour que flex + overflow-y:auto fonctionne */
}

.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.55); }

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(197,212,232,0.4);
    padding: 8px 20px 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
}

.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: #ffffff;
}

.nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand-secondary);
    border-radius: 0 2px 2px 0;
}

.nav-link-icon {
    font-size: 17px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.nav-link-text {
    font-size: 13.5px;
    font-weight: 500;
    flex: 1;
    transition: opacity var(--transition);
}

.sidebar.collapsed .nav-link-text { opacity: 0; width: 0; }

.nav-badge {
    background: var(--brand-secondary);
    color: var(--brand-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-badge { display: none; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
}

.sidebar-user:hover { background: var(--bg-sidebar-hover); }

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-secondary);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-info {
    overflow: hidden;
    flex: 1;
    transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-sidebar);
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    transition: margin-left var(--transition);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ═══════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════ */
.app-header {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: background var(--transition), border-color var(--transition);
    box-shadow: var(--shadow-xs);
    width: 100%;
    box-sizing: border-box;
}

.header-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}
.header-toggle:hover {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
}

.header-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.breadcrumb-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-sep { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.header-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}
.header-btn:hover {
    background: var(--bg-surface-alt);
    border-color: var(--border-focus);
    color: var(--brand-primary);
}

.header-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--color-danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
}

/* Header Theme Toggle */
.theme-toggle {
    width: 50px;
    height: 28px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: all var(--transition);
    position: relative;
    flex-shrink: 0;
}

.theme-toggle-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    transition: transform var(--transition);
    flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(22px);
    background: var(--brand-secondary);
}

/* User Dropdown Menu */
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    max-width: calc(100vw - 20px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    overflow: hidden;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.user-dropdown-item:hover {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
}

.user-dropdown-item.text-danger {
    color: var(--color-danger);
}

.user-dropdown-item.text-danger:hover {
    background: var(--color-danger-bg);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.sidebar.collapsed .sidebar-logout-text {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   PAGE CONTENT
   ═══════════════════════════════════════════════════════════════════ */
.page-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

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

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i { color: var(--brand-accent); font-size: 16px; }

.card-body { padding: 20px; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface-alt);
}

/* ─── Stat Cards ──────────────────────────────────────────────────── */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon-blue   { background: rgba(45,106,159,0.12); color: #2d6a9f; }
.stat-icon-green  { background: rgba(34,197,94,0.12);  color: #16a34a; }
.stat-icon-amber  { background: rgba(245,158,11,0.12); color: #d97706; }
.stat-icon-red    { background: rgba(239,68,68,0.12);  color: #dc2626; }
.stat-icon-purple { background: rgba(139,92,246,0.12); color: #7c3aed; }
.stat-icon-teal   { background: rgba(20,184,166,0.12); color: #0d9488; }
.stat-icon-gold   { background: rgba(201,168,76,0.12); color: #b45309; }

.stat-card-body { flex: 1; min-width: 0; }

.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-card-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend-up   { color: var(--color-success); }
.stat-trend-down { color: var(--color-danger); }

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

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

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 5px; }

.btn-primary {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}
.btn-primary:hover { background: #1e4d7b; border-color: #1e4d7b; }

.btn-accent {
    background: var(--brand-secondary);
    color: var(--brand-primary);
    border-color: var(--brand-secondary);
    font-weight: 600;
}
.btn-accent:hover { background: #b8923f; border-color: #b8923f; }

.btn-success {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}
.btn-danger:hover { background: #dc2626; }

.btn-warning {
    background: var(--color-warning);
    color: white;
    border-color: var(--color-warning);
}
.btn-warning:hover { background: #d97706; }

.btn-info {
    background: var(--color-info);
    color: white;
    border-color: var(--color-info);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-outline:hover {
    background: var(--bg-surface-alt);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-outline-primary {
    background: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-outline-primary:hover {
    background: var(--brand-primary);
    color: white;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(45,106,159,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-select {
    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='%235a6a7e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
    appearance: none;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 11.5px;
    color: var(--color-danger);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    border-right: none;
    flex: 1;
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0 13px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* --- Tom Select Overrides --- */
.ts-wrapper.form-control { padding: 0 !important; border: none !important; background: transparent !important; box-shadow: none !important; }
.ts-wrapper.form-control.focus { box-shadow: none !important; }
.ts-control { padding: 9px 13px !important; border: 1px solid var(--border-color) !important; border-radius: var(--border-radius-sm) !important; background: var(--bg-surface) !important; color: var(--text-primary) !important; min-height: 38px; }
.ts-wrapper.focus .ts-control { border-color: var(--border-focus) !important; box-shadow: 0 0 0 3px rgba(45,106,159,0.12) !important; }
.ts-dropdown { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); box-shadow: var(--shadow-md); z-index: 1050; }
.facture-article-dropdown { z-index: 1000001 !important; }
.ts-dropdown .option { padding: 8px 13px; }
.ts-dropdown .option.active, .ts-dropdown .option:hover { background: var(--bg-surface-alt); color: var(--text-primary); }
.ts-control input { color: var(--text-primary) !important; }
[data-theme="dark"] .ts-control { background: var(--bg-surface) !important; }
[data-theme="dark"] .ts-dropdown { background: var(--bg-surface) !important; border-color: var(--border-color); }
[data-theme="dark"] .ts-dropdown .option.active, [data-theme="dark"] .ts-dropdown .option:hover { background: var(--bg-surface-alt); }
[data-theme="dark"] .ts-control input::placeholder { color: var(--text-muted) !important; }

/* ═══════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════ */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.table-wrapper, .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar, .table-responsive::-webkit-scrollbar, div[style*="overflow-x:auto"]::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb, .table-responsive::-webkit-scrollbar-thumb, div[style*="overflow-x:auto"]::-webkit-scrollbar-thumb {
    background: rgba(45, 106, 159, 0.25);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-track, .table-responsive::-webkit-scrollbar-track, div[style*="overflow-x:auto"]::-webkit-scrollbar-track {
    background: var(--bg-surface-alt);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.table-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.table-search .form-control {
    padding-left: 34px;
    font-size: 13px;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;    /* distribution fixe des colonnes, empêche l'expansion */
}

.data-table thead tr {
    background: var(--bg-surface-alt);
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.data-table th:hover { color: var(--text-primary); }
.data-table th.sort-asc::after  { content: ' ↑'; color: var(--brand-accent); }
.data-table th.sort-desc::after { content: ' ↓'; color: var(--brand-accent); }

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
    max-width: 0;           /* force les cellules à respecter la largeur du tableau */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover { background: var(--bg-surface-alt); }

.data-table tbody tr.selected { background: rgba(45,106,159,0.06); }

.table-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-accent);
    cursor: pointer;
}

/* ── Largeurs prédéfinies pour les colonnes ────────────────────────── */
.col-xs   { width: 60px;  min-width: 60px; }
.col-sm   { width: 90px;  min-width: 90px; }
.col-md   { width: 120px; min-width: 120px; }
.col-lg   { width: 160px; min-width: 160px; }
.col-xl   { width: 200px; min-width: 200px; }
.col-date { width: 100px; min-width: 100px; }
.col-num  { width: 80px;  min-width: 80px;  text-align: right; }
.col-actions { width: 120px; min-width: 110px; }

/* ── Cellule qui peut se wraper (ex: boutons d'actions groupés) ─────── */
.data-table td.td-actions,
.data-table th.th-actions {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
}

/* ── Tooltip natif sur cellules tronquées ──────────────────────────── */
.data-table td[title] { cursor: default; }

/* ── th : empêcher le wrapping des en-têtes ────────────────────────── */
.data-table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Badge & statut dans les cellules ──────────────────────────────── */
.data-table td .badge { vertical-align: middle; }

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 12.5px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 0 8px;
}

.page-btn:hover {
    background: var(--bg-surface-alt);
    border-color: var(--brand-accent);
    color: var(--brand-primary);
}

.page-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES & STATUS
   ═══════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success   { background: var(--color-success-bg); color: #15803d; }
.badge-warning   { background: var(--color-warning-bg); color: #b45309; }
.badge-danger    { background: var(--color-danger-bg);  color: #dc2626; }
.badge-info      { background: var(--color-info-bg);    color: #1d4ed8; }
.badge-secondary { background: var(--bg-surface-alt);   color: var(--text-secondary); border: 1px solid var(--border-color); }
.badge-primary   { background: rgba(45,106,159,0.12);   color: var(--brand-primary); }
.badge-dark      { background: rgba(26,42,64,0.12);     color: var(--brand-primary); }

[data-theme="dark"] .badge-success   { background: rgba(34,197,94,0.15);  color: #4ade80; }
[data-theme="dark"] .badge-warning   { background: rgba(245,158,11,0.15); color: #fbbf24; }
[data-theme="dark"] .badge-danger    { background: rgba(239,68,68,0.15);  color: #f87171; }
[data-theme="dark"] .badge-info      { background: rgba(59,130,246,0.15); color: #60a5fa; }
[data-theme="dark"] .badge-secondary { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
[data-theme="dark"] .badge-primary   { background: rgba(45,106,159,0.2);  color: #60a5fa; }

/* ═══════════════════════════════════════════════════════════════════
   ALERTS / FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--border-radius);
    font-size: 13.5px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--color-success-bg); color: #15803d; border-color: rgba(34,197,94,0.3); }
.alert-warning { background: var(--color-warning-bg); color: #b45309; border-color: rgba(245,158,11,0.3); }
.alert-danger  { background: var(--color-danger-bg);  color: #dc2626; border-color: rgba(239,68,68,0.3); }
.alert-info    { background: var(--color-info-bg);    color: #1d4ed8; border-color: rgba(59,130,246,0.3); }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: opacity var(--transition-fast);
}
.alert-close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════
   MODALS & FORMS CENTERING & OVERFLOW PREVENTION
   ═══════════════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.65) !important;
    z-index: 999999 !important;
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-sizing: border-box !important;
}

.modal-backdrop.show {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: var(--bg-surface) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35) !important;
    width: 92vw !important;
    max-width: 580px !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 1000000 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.modal-lg { max-width: 840px !important; }
.modal-xl { max-width: 1060px !important; }
.modal-sm { max-width: 440px !important; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title i { color: var(--brand-accent); }

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-surface-alt);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--color-danger-bg); color: var(--color-danger); }

.modal form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
}

.modal-body {
    padding: 22px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
}

.modal-footer {
    padding: 14px 22px !important;
    border-top: 1px solid var(--border-color) !important;
    background: var(--bg-surface-alt) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   GRID UTILS
   ═══════════════════════════════════════════════════════════════════ */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); gap: 16px; }
.grid-stat { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ═══════════════════════════════════════════════════════════════════
   LOADING / SKELETON
   ═══════════════════════════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface-alt) 25%, var(--border-color) 50%, var(--bg-surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--brand-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   TOASTS / NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    pointer-events: all;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
}

.toast-success { border-left: 3px solid var(--color-success); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-danger  { border-left: 3px solid var(--color-danger); }
.toast-info    { border-left: 3px solid var(--color-info); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════════
   AVATARS
   ═══════════════════════════════════════════════════════════════════ */
.avatar {
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--brand-primary);
    color: white;
}
.avatar-xs  { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.avatar-md  { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl  { width: 80px; height: 80px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════════════════════════════════════════════
   ROOM STATUS GRID
   ═══════════════════════════════════════════════════════════════════ */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.room-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-surface);
}

.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.room-card.disponible { border-color: var(--color-success); background: var(--color-success-bg); }
.room-card.occupee    { border-color: var(--color-danger);  background: var(--color-danger-bg); }
.room-card.maintenance{ border-color: var(--color-warning); background: var(--color-warning-bg); }
.room-card.hors_service{ border-color: var(--text-muted);   background: var(--bg-surface-alt); }

.room-card-num { font-size: 18px; font-weight: 700; }
.room-card-type { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.room-card-price { font-size: 11px; font-weight: 600; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════ */
@media print {
    .sidebar, .app-header, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0; }
    body { background: white; color: black; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .grid-stat { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content { margin-left: 0 !important; }
    
    .app-header {
        padding: 0 12px;
        gap: 8px;
        height: 56px;
    }

    .header-breadcrumb {
        display: none !important; /* Masquer le fil d'Ariane sur mobile pour ne pas écraser les boutons */
    }

    .header-actions {
        gap: 6px;
    }

    .header-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .theme-toggle {
        width: 44px;
        height: 26px;
    }

    .theme-toggle-thumb {
        width: 20px;
        height: 20px;
    }

    [data-theme="dark"] .theme-toggle-thumb {
        transform: translateX(18px);
    }

    .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .grid-stat { grid-template-columns: repeat(2, 1fr); }
    
    .page-content { padding: 16px; }
    .page-header { flex-direction: column; align-items: stretch; }
    
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-search { max-width: 100%; }
    
    .modal { max-width: 100%; }
    
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    .mobile-overlay.show { display: block; }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0 8px;
        gap: 6px;
    }
    .header-actions {
        gap: 4px;
    }
    .grid-stat { grid-template-columns: 1fr; }
    .stat-card-value { font-size: 20px; }
    .page-title { font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════════════════
   PWA MINIMAL BANNER
   ═══════════════════════════════════════════════════════════════════ */
.pwa-mini-banner {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 6px 8px 6px 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 10px;
    animation: pwaSlideUp 0.3s ease both;
    max-width: calc(100vw - 32px);
}

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

.pwa-mini-btn {
    background: var(--brand-accent);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s, transform 0.15s;
    text-decoration: none;
}

.pwa-mini-btn:hover {
    opacity: 0.92;
    transform: scale(1.02);
}

.pwa-mini-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.pwa-mini-close:hover {
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITIES & VISIBILITY
   ═══════════════════════════════════════════════════════════════════ */
.d-none         { display: none !important; }
.d-block        { display: block !important; }
.d-inline       { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex         { display: flex !important; }

@media (min-width: 576px) {
    .d-sm-none   { display: none !important; }
    .d-sm-block  { display: block !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-flex   { display: flex !important; }
}

@media (min-width: 768px) {
    .d-md-none   { display: none !important; }
    .d-md-block  { display: block !important; }
    .d-md-inline { display: inline !important; }
    .d-md-flex   { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none   { display: none !important; }
    .d-lg-block  { display: block !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-flex   { display: flex !important; }
}

.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-2          { gap: 8px; }
.gap-3          { gap: 12px; }
.gap-4          { gap: 16px; }
.flex-1         { flex: 1; }
.w-full         { width: 100%; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-sm        { font-size: 12px; }
.text-xs        { font-size: 11px; }
.text-lg        { font-size: 16px; }
.text-xl        { font-size: 18px; }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--color-success); }
.text-danger    { color: var(--color-danger); }
.text-warning   { color: var(--color-warning); }
.text-primary-brand { color: var(--brand-primary); }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded        { border-radius: var(--border-radius); }
.rounded-sm     { border-radius: var(--border-radius-sm); }
.rounded-full   { border-radius: 9999px; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.p-4   { padding: 16px; }
.p-6   { padding: 24px; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.overflow-hidden { overflow: hidden; }
.whitespace-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.border-top { border-top: 1px solid var(--border-color); padding-top: 16px; }
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

/* ─── Global Action Loader & Double-Submit Protection ──────────────── */
.vp-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: vpFadeIn 0.2s ease-out;
}

.vp-loader-card {
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #1a2940);
    padding: 28px 36px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 280px;
    max-width: 90vw;
    animation: vpScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.vp-spinner {
    width: 46px;
    height: 46px;
    border: 3.5px solid rgba(201, 168, 76, 0.2);
    border-top-color: var(--brand-secondary, #c9a84c);
    border-right-color: var(--brand-primary, #1a3a5c);
    border-radius: 50%;
    animation: vpSpin 0.75s linear infinite;
    margin-bottom: 16px;
}

.vp-loader-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1a2940);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.vp-loader-subtitle {
    font-size: 13px;
    color: var(--text-muted, #8a9ab0);
    line-height: 1.4;
}

/* Button Loading States */
.btn.is-loading,
.btn[disabled].is-loading,
button[type="submit"].is-loading {
    position: relative !important;
    pointer-events: none !important;
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    filter: grayscale(15%);
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: vpSpin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes vpSpin {
    to { transform: rotate(360deg); }
}

@keyframes vpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vpScaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

