/**
 * ColdSales V3 — Design System
 * ═══════════════════════════════════════════════════════════════════════════════
 * 
 * Fichier CSS centralisé — source unique de vérité pour tout le styling.
 * Les templates ne doivent PAS redéfinir ces styles en inline.
 * 
 * Table of Contents:
 *  1. Design Tokens (Variables)
 *  2. Reset & Base
 *  3. Typography
 *  4. Buttons
 *  5. Cards
 *  6. Badges & Status
 *  7. Forms
 *  8. Tables
 *  9. Alerts & Messages
 * 10. Layout & Grid
 * 11. Utilities
 * 12. Sales Header
 * 13. Admin Sidebar & Layout
 * 14. Page Components (Stats, Leads, Brief, Contact, Empty)
 * 15. Progress Bars
 * 16. Dark Mode (Admin)
 * 17. Animations
 * 18. Responsive
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Brand Colors ── */
    --primary: #0057ff;           /* Full Spectrum Blue */
    --primary-dark: #0046cc;
    --primary-light: #3b82f6;
    --dark-amethyst: #110033;     /* Dark Amethyst */
    --alice-blue: #ebf2ff;        /* Alice Blue */
    --platinum: #F2F2F2;          /* Platinum */
    
    /* ── Status Colors ── */
    --success: #22c55e;
    --success-dark: #16a34a;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #3b82f6;
    --info-dark: #2563eb;
    
    /* ── Slate Scale ── */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    
    /* ── Gray Scale ── */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* ── Semantic Aliases ── */
    --text-primary: var(--dark-amethyst);
    --text-secondary: var(--slate-600);
    --text-muted: var(--slate-500);
    --text-subtle: var(--slate-400);
    --text-inverse: #ffffff;
    
    --bg-body: var(--alice-blue);
    --bg-card: #ffffff;
    --bg-subtle: var(--slate-50);
    --bg-hover: var(--slate-100);
    
    --border-default: var(--slate-200);
    --border-light: var(--slate-100);
    --border-dark: var(--slate-300);
    
    /* ── Font Sizes ── */
    --fs-2xs: 0.65rem;     /* 10.4px */
    --fs-xs: 0.7rem;       /* 11.2px */
    --fs-sm: 0.75rem;      /* 12px */
    --fs-base: 0.875rem;   /* 14px */
    --fs-md: 1rem;         /* 16px */
    --fs-lg: 1.125rem;     /* 18px */
    --fs-xl: 1.25rem;      /* 20px */
    --fs-2xl: 1.5rem;      /* 24px */
    --fs-3xl: 1.75rem;     /* 28px */
    --fs-4xl: 2rem;        /* 32px */
    --fs-5xl: 3rem;        /* 48px */
    
    /* ── Font Weights ── */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 900;
    
    /* ── Spacing ── */
    --sp-0: 0;
    --sp-1: 0.25rem;       /* 4px */
    --sp-2: 0.5rem;        /* 8px */
    --sp-3: 0.75rem;       /* 12px */
    --sp-4: 1rem;          /* 16px */
    --sp-5: 1.25rem;       /* 20px */
    --sp-6: 1.5rem;        /* 24px */
    --sp-8: 2rem;          /* 32px */
    --sp-10: 2.5rem;       /* 40px */
    --sp-12: 3rem;         /* 48px */
    
    /* ── Border Radius ── */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-pill: 99px;
    --radius-full: 50%;
    
    /* ── Shadows ── */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-brand: 0 4px 12px rgba(0, 87, 255, 0.3);
    
    /* ── Transitions ── */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.3s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ── Layout ── */
    --sidebar-width: 260px;
    --header-height: 60px;
    --container-max: 1200px;
    
    /* ── Z-Index Scale ── */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--fs-base);
    font-weight: var(--fw-normal);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-body);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════════ */

.text-2xs { font-size: var(--fs-2xs); }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }
.text-3xl { font-size: var(--fs-3xl); }
.text-4xl { font-size: var(--fs-4xl); }

.font-normal { font-weight: var(--fw-normal); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-small { font-size: var(--fs-base); }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-wide { letter-spacing: 0.5px; }
.tracking-wider { letter-spacing: 1px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   4. BUTTONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

/* Button Variants */
.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}
.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-inverse);
}
.btn-warning:hover:not(:disabled) {
    background: var(--warning-dark);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}
.btn-outline:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

/* Button Sizes */
.btn-sm {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-sm);
}

.btn-lg,
.btn-large {
    padding: var(--sp-3) var(--sp-6);
    font-size: var(--fs-md);
}

.btn-block {
    width: 100%;
}

/* Icon Buttons */
.btn-icon {
    padding: var(--sp-2);
    width: 36px;
    height: 36px;
}

.btn-icon-sm {
    padding: var(--sp-1);
    width: 28px;
    height: 28px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   5. CARDS
   ═══════════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(17, 0, 51, 0.08);
    padding: var(--sp-6);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border-default);
}

.card-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

.card-body {
    /* Default spacing if needed */
}

.card-footer {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border-default);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   6. BADGES & STATUS
   ═══════════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-sm);
    line-height: 1;
}

.badge-primary {
    background: rgba(0, 87, 255, 0.15);
    color: var(--primary);
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

.status-new { background: #dbeafe; color: #1e40af; }
.status-callback { background: #fef3c7; color: #92400e; }
.status-qualified { background: #d1fae5; color: #065f46; }
.status-won { background: #d1fae5; color: #065f46; }
.status-lost { background: #fee2e2; color: #991b1b; }
.status-skipped { background: var(--gray-100); color: var(--gray-600); }

/* Score Badges (Circle) */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--text-inverse);
    border-radius: var(--radius-full);
}

.score-badge-sm {
    width: 32px;
    height: 32px;
    font-size: var(--fs-sm);
}

.score-high { background: var(--success); }
.score-medium { background: var(--warning); }
.score-low { background: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════════
   7. FORMS
   ═══════════════════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--sp-4);
}

.form-label {
    display: block;
    margin-bottom: var(--sp-2);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-subtle);
}

.form-input-sm {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
}

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

.form-error {
    margin-top: var(--sp-1);
    font-size: var(--fs-sm);
    color: var(--danger);
}

.form-help {
    font-size: var(--fs-sm);
    color: var(--gray-500);
    margin-top: var(--sp-1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   8. TABLES
   ═══════════════════════════════════════════════════════════════════════════════ */

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

.table th,
.table td {
    padding: var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: var(--fw-semibold);
    color: var(--gray-600);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   9. ALERTS & MESSAGES
   ═══════════════════════════════════════════════════════════════════════════════ */

.alert {
    padding: var(--sp-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-4);
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Legacy message classes (base.html) */
.messages {
    margin-bottom: var(--sp-4);
}

.message {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-2);
}

.message-success { background: #d1fae5; color: #065f46; }
.message-error   { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════════════════════════════════════════
   10. LAYOUT & GRID
   ═══════════════════════════════════════════════════════════════════════════════ */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--sp-4);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

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

/* Main content area (sales pages) */
main {
    padding: var(--sp-8) 0;
    min-height: calc(100vh - 120px);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   11. UTILITIES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: var(--sp-1); }
.m-2 { margin: var(--sp-2); }
.m-4 { margin: var(--sp-4); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mb-1 { margin-bottom: var(--sp-2); }
.mb-2 { margin-bottom: var(--sp-4); }
.mb-3 { margin-bottom: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mr-2 { margin-right: var(--sp-2); }
.ml-2 { margin-left: var(--sp-2); }

/* Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--sp-2); }
.p-4 { padding: var(--sp-4); }
.p-6 { padding: var(--sp-6); }
.px-2 { padding-left: var(--sp-2); padding-right: var(--sp-2); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Border */
.border { border: 1px solid var(--border-default); }
.border-t { border-top: 1px solid var(--border-default); }
.border-b { border-bottom: 1px solid var(--border-default); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Background */
.bg-white { background: white; }
.bg-subtle { background: var(--bg-subtle); }
.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Transition */
.transition { transition: all var(--transition-base); }

/* Shadow */
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Action buttons row */
.action-buttons {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   12. SALES HEADER (base.html + _header_sales.html)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Legacy header (base.html) */
header {
    background: var(--dark-amethyst);
    color: white;
    padding: var(--sp-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: white;
    text-decoration: none;
}

header .logo .by-stapes {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: var(--fw-normal);
    color: rgba(255, 255, 255, 0.6);
}

header .logo .by-stapes img {
    height: 11px;
}

header nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-left: var(--sp-6);
    font-size: var(--fs-base);
    transition: color var(--transition-base);
}

header nav a:hover {
    color: white;
}

/* Paris Clock */
.paris-clock {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.paris-clock .clock-icon {
    font-size: 0.9rem;
}

.paris-clock .clock-time {
    font-weight: var(--fw-semibold);
    color: white;
    font-size: 0.95rem;
}

.paris-clock .clock-label {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* Sales Header (partial: _header_sales.html) */
.sales-header {
    background: var(--dark-amethyst);
    color: white;
    padding: var(--sp-3) var(--sp-6);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
}

.sales-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
}

.sales-header .logo {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    text-decoration: none;
    color: white;
    font-weight: var(--fw-bold);
    font-size: 1.1rem;
}

.sales-header .logo-icon {
    font-size: var(--fs-xl);
}

.sales-header .logo span.by-stapes {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-normal);
    color: rgba(255, 255, 255, 0.5);
    margin-left: var(--sp-1);
}

.sales-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.sales-nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.4rem var(--sp-3);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: var(--fw-medium);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sales-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sales-nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.sales-nav-item .nav-icon {
    font-size: var(--fs-md);
}

.header-mission-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.header-stat-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: var(--sp-1) 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.header-stat-badge.success {
    background: var(--success);
}

.sales-header .user-name {
    font-size: 0.85rem;
    font-weight: var(--fw-medium);
    color: rgba(255, 255, 255, 0.9);
}

.sales-header .logout-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: var(--fs-sm);
    padding: 0.3rem var(--sp-2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.sales-header .logout-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: var(--fw-medium);
    transition: all var(--transition-base);
}

.user-dropdown-btn:hover,
.user-dropdown.open .user-dropdown-btn {
    background: rgba(255, 255, 255, 0.15);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    min-width: 170px;
    z-index: 9999;
    overflow: hidden;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.55rem 0.9rem;
    color: var(--dark-amethyst);
    text-decoration: none;
    font-size: var(--fs-sm);
    transition: background var(--transition-base);
}

.dropdown-item:hover {
    background: var(--slate-100);
}

/* Mobile nav extras (contrat + déconnexion en mobile) */
.mobile-nav-extras {
    display: none;
}

.mobile-nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--sp-2) 0;
}

.mobile-greeting {
    display: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: var(--fw-medium);
    padding: 0.4rem var(--sp-3);
    margin-bottom: var(--sp-1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   13. ADMIN SIDEBAR & LAYOUT (base_admin.html)
   ═══════════════════════════════════════════════════════════════════════════════ */

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0c0024 0%, #110033 40%, #170040 100%);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-smooth);
}

.sidebar-header {
    padding: 1.25rem var(--sp-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    box-shadow: var(--shadow-brand);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: 1.15rem;
    font-weight: var(--fw-bold);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: var(--fs-2xs);
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-3) 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: var(--radius-sm); }

.nav-section {
    padding: var(--sp-4) var(--sp-6) 0.4rem;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.08em;
    font-weight: var(--fw-semibold);
}

.nav-section:first-child {
    padding-top: var(--sp-1);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0.6rem var(--sp-6);
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: var(--fs-base);
    font-weight: 450;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(0, 87, 255, 0.15) 0%, rgba(0, 87, 255, 0.05) 100%);
    color: white;
    border-left-color: var(--primary);
    font-weight: var(--fw-medium);
}

.nav-link.active .nav-icon {
    filter: drop-shadow(0 0 4px rgba(0, 87, 255, 0.4));
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    padding: 0.15rem var(--sp-2);
    border-radius: 10px;
    line-height: 1.3;
}

.nav-badge-blue  { background: rgba(0, 87, 255, 0.2); color: #60a5fa; }
.nav-badge-green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.nav-badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: var(--sp-2) var(--sp-6);
}

.sidebar-footer {
    flex-shrink: 0;
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: var(--sp-2);
    border-radius: 10px;
    transition: background 0.2s;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-semibold);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: var(--fw-medium);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Admin Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--sp-8);
    background: var(--bg-body);
}

.page-header {
    margin-bottom: var(--sp-8);
}

.page-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--dark-amethyst);
}

.page-subtitle {
    color: var(--gray-600);
    margin-top: var(--sp-1);
}

/* Mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.sidebar-overlay.open {
    opacity: 1;
    display: block;
}

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--dark-amethyst);
    z-index: 998;
    padding: 0 var(--sp-4);
    align-items: center;
    gap: var(--sp-4);
    color: white;
    justify-content: space-between;
}

.mobile-header h1 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-header-title {
    color: white;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   14. PAGE COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Stats Grid (admin dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-8);
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: var(--fw-bold);
    color: var(--gray-900);
}

.stat-card .stat-label {
    font-size: var(--fs-base);
    color: var(--gray-600);
    margin-top: var(--sp-1);
}

.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.primary .stat-value { color: var(--primary); }

/* Stats (sales inline) */
.stats {
    display: flex;
    gap: var(--sp-8);
    margin-bottom: var(--sp-6);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: var(--fw-bold);
    color: var(--dark-amethyst);
}

.stat-label {
    font-size: var(--fs-sm);
    color: var(--gray-600);
    text-transform: uppercase;
}

/* Lead List */
.lead-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.lead-item {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

.lead-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.lead-info {
    flex: 1;
}

.lead-domain {
    font-weight: var(--fw-semibold);
    color: var(--dark-amethyst);
}

.lead-meta {
    font-size: var(--fs-sm);
    color: var(--gray-600);
    margin-top: var(--sp-1);
}

/* Brief Card */
.brief-section {
    margin-bottom: var(--sp-6);
}

.brief-label {
    font-size: var(--fs-sm);
    text-transform: uppercase;
    color: var(--gray-600);
    font-weight: var(--fw-semibold);
    margin-bottom: var(--sp-2);
}

.brief-content {
    font-size: var(--fs-md);
    color: var(--dark-amethyst);
}

.hooks-list {
    list-style: none;
}

.hooks-list li {
    padding: var(--sp-2);
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-2);
    font-size: var(--fs-base);
}

/* Contact Card */
.contact-card {
    padding: var(--sp-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-2);
}

.contact-name {
    font-weight: var(--fw-semibold);
}

.contact-role {
    font-size: var(--fs-base);
    color: var(--gray-600);
}

.contact-phone {
    font-size: var(--fs-md);
    color: var(--primary);
    font-weight: var(--fw-medium);
    margin-top: var(--sp-2);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--sp-12);
    color: var(--gray-600);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--sp-4);
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   15. PROGRESS BARS
   ═══════════════════════════════════════════════════════════════════════════════ */

.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-slow);
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════════
   16. DARK MODE (ADMIN)
   ═══════════════════════════════════════════════════════════════════════════════ */

.dark {
    --bg-body: #0d1117;
    --bg-card: var(--slate-800);
    --bg-subtle: var(--slate-900);
    --bg-hover: rgba(255, 255, 255, 0.04);
    
    --text-primary: var(--slate-100);
    --text-secondary: var(--slate-300);
    --text-muted: var(--slate-400);
    --text-subtle: var(--slate-500);
    
    --border-default: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.03);
}

.dark .card,
.card-dark {
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-700) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.dark .badge-success { background: rgba(34, 197, 94, 0.2); }
.dark .badge-warning { background: rgba(245, 158, 11, 0.2); }
.dark .badge-danger  { background: rgba(239, 68, 68, 0.2); }

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background: var(--slate-900);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--slate-100);
}

.dark .form-input:focus,
.dark .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.2);
}

.dark .page-title { color: var(--slate-100); }
.dark .page-subtitle { color: var(--slate-400); }
.dark .card-title { color: var(--slate-100); }
.dark .stat-card { background: var(--slate-800); }
.dark .stat-card .stat-value { color: var(--slate-100); }
.dark .stat-card .stat-label { color: var(--slate-400); }
.dark .table th { background: var(--slate-800); color: var(--slate-300); }
.dark .table td { border-color: rgba(255,255,255,0.06); color: var(--slate-300); }
.dark .table tbody tr:hover { background: rgba(255,255,255,0.03); }
.dark .text-muted { color: var(--slate-400); }
.dark .empty-state { color: var(--slate-400); }

/* ═══════════════════════════════════════════════════════════════════════════════
   17. ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-fadeIn { animation: fadeIn 0.2s ease-out; }
.animate-slideUp { animation: slideUp 0.3s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ═══════════════════════════════════════════════════════════════════════════════
   18. AUTH PAGES (login, forgot_password, setup_password, signup)
   ═══════════════════════════════════════════════════════════════════════════════ */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--alice-blue) 0%, var(--platinum) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(17, 0, 51, 0.08);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-amethyst);
}

.login-logo .by-stapes {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.login-logo .by-stapes img {
    height: 11px;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Auth form overrides — slightly larger inputs for auth pages */
.login-card .form-group { margin-bottom: 1.25rem; }
.login-card .form-label { color: var(--dark-amethyst); }
.login-card .form-input { padding: 0.75rem 1rem; font-size: 1rem; }

.btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.success-message {
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary);
}

.help-text {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   19. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Sales header: burger menu on tablets and mobile */
@media (max-width: 1024px) {
    .sales-header {
        padding: 0.6rem var(--sp-4);
    }
    
    .sales-header-inner {
        flex-wrap: wrap;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .sales-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: var(--sp-1);
        padding-top: var(--sp-3);
        margin-top: var(--sp-3);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sales-nav.show {
        display: flex;
    }
    
    .sales-nav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 0.6rem var(--sp-3);
    }
    
    .sales-header-right {
        display: none;
    }
    
    .mobile-nav-extras {
        display: block;
    }
    
    .mobile-greeting {
        display: block;
    }
    
    .header-mission-badge {
        max-width: 160px;
        font-size: 0.7rem;
    }
    
    .sales-header .logo span.logo-text {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .container {
        padding: 0 var(--sp-3);
    }
    
    .card {
        padding: var(--sp-4);
    }
    
    .grid-2,
    .grid-3,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Hide on mobile */
    .md\:hidden { display: none; }
    .md\:flex-col { flex-direction: column; }
    
    /* Legacy header responsive */
    header .container {
        flex-wrap: wrap;
        gap: var(--sp-2);
    }
    
    header .logo {
        font-size: 1.1rem;
    }
    
    .paris-clock {
        order: 0;
        padding: var(--sp-1) 0.65rem;
        font-size: var(--fs-sm);
    }
    
    .paris-clock .clock-time {
        font-size: 0.85rem;
    }
    
    .paris-clock .clock-label {
        display: none;
    }
    
    header nav {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        gap: var(--sp-1);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: var(--sp-2);
        margin-top: var(--sp-1);
    }
    
    header nav a {
        margin-left: 0;
        padding: var(--sp-1) var(--sp-2);
        font-size: 0.8rem;
    }
    
    /* Admin sidebar responsive */
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: var(--sp-4) !important;
        padding-top: 72px !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: var(--sp-2) var(--sp-1);
    }
    
    .page-title {
        font-size: var(--fs-xl);
    }
    
    .btn {
        padding: 0.4rem var(--sp-3);
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: var(--sp-4);
    }
    
    .stat-card .stat-value {
        font-size: var(--fs-2xl);
    }
    
    .header-stat-badge {
        display: none;
    }
}

@media (min-width: 769px) {
    .md\:block { display: block; }
    .md\:flex { display: flex; }
}
