/* ============================================================================
   IRTIQAA WEB — Design System v2
   Modern · White · Clean · RTL
   ============================================================================ */

/* Google Fonts Cairo chargée via <link> dans le layout (preconnect + non-bloquant) */

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

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
:root {
    /* Primary — Blue */
    --primary:        #2563EB;
    --primary-dark:   #1D4ED8;
    --primary-light:  #EFF6FF;

    /* Secondary — Emerald */
    --secondary:       #059669;
    --secondary-light: #ECFDF5;

    /* Gold / Warning */
    --gold:       #D97706;
    --gold-light: #FFFBEB;

    /* Red / Error */
    --red:       #DC2626;
    --red-light: #FEF2F2;

    /* Surfaces — White */
    --bg:      #F8FAFC;
    --surface: #FFFFFF;

    /* Text */
    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;

    /* Borders */
    --border:  #E2E8F0;
    --divider: #F1F5F9;

    /* Shadows */
    --shadow-1: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-3: 0 8px 24px rgba(37,99,235,0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #047857 100%);
    --gradient-gold:    linear-gradient(135deg, #D97706 0%, #B45309 100%);

    /* Radius */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --radius-pill: 100px;

    /* Layout */
    --transition:    all 0.18s ease;
    --nav-height:    64px;
    --sidebar-width: 256px;

    /* Legacy aliases */
    --glass-white:  #FFFFFF;
    --glass-border: #E2E8F0;
    --dark-bg:      #F8FAFC;
    --green-light:  #059669;
}

/* ============================================================================
   BASE
   ============================================================================ */
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.65;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.35em;
    line-height: 1.3;
}
h1 { font-size: 1.875rem; font-weight: 800; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 0.975rem; font-weight: 600; }

p { color: var(--text-secondary); margin-bottom: 0.6em; }

.text-muted       { color: var(--text-muted) !important; }
.text-gold        { color: var(--gold); }
.text-primary-c   { color: var(--primary); }
.text-secondary-c { color: var(--secondary); }
.text-success     { color: var(--secondary); }
.text-danger      { color: var(--red); }
.text-center      { text-align: center; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 16px; }

/* ============================================================================
   LAYOUT
   ============================================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.main-content {
    padding: calc(var(--nav-height) + 32px) 0 64px;
}
.main-content.with-sidebar {
    margin-right: var(--sidebar-width);
    padding: calc(var(--nav-height) + 32px) 32px 64px;
}

.page-header   { margin-bottom: 24px; }
.page-title    { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; }
.page-subtitle { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }

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

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    /* main-content.with-sidebar déjà géré à 1024px */
}

/* ============================================================================
   NAVBAR
   ============================================================================ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    z-index: 200;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 var(--border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.nav-logo img {
    width: 34px; height: 34px;
    border-radius: 9px;
}
.nav-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0;
}

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

.btn-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg); color: var(--text-primary); border-color: var(--text-muted); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: #FFFFFF;
    position: relative;
    user-select: none;
}
.nav-user:hover { background: var(--bg); }

/* Icône hamburger (☰) dans l'avatar — visible sur mobile/tablette uniquement */
.nav-hamburger {
    display: none;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1;
}
/* Nom masqué sur petit écran */
@media (max-width: 1024px) {
    .nav-hamburger { display: inline; }
    .nav-user-name  { display: none; }
}
@media (min-width: 1025px) {
    .nav-user-name  { font-size: 0.9rem; font-weight: 500; }
}

.nav-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    min-width: 172px;
    box-shadow: var(--shadow-2);
    z-index: 300;
}
.user-dropdown a, .user-dropdown button {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    width: 100%;
    text-align: right;
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg); color: var(--text-primary); }
.hidden { display: none !important; }

/* nav-toggle et nav-links supprimés : navigation via sidebar uniquement */

/* ============================================================================
   SIDEBAR
   ============================================================================ */
.sidebar {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #FFFFFF;
    border-left: 1px solid var(--border);
    padding: 8px;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.22s ease;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 1px; }

.sidebar-section {
    font-size: 0.72rem;
    letter-spacing: 0;
    color: var(--text-muted);
    padding: 16px 10px 5px;
    font-weight: 700;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition);
}
.sidebar-nav a:hover { background: var(--bg); color: var(--text-primary); }
.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-nav a.active .nav-icon { color: var(--primary); }

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Sidebar : caché sur mobile/tablette, affiché via l'avatar (menu unique) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(110%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    }
    /* Supprimer la marge réservée au sidebar sur mobile/tablette */
    .main-content.with-sidebar {
        margin-right: 0;
        padding: calc(var(--nav-height) + 24px) 20px 60px;
    }
}

/* Overlay sombre derrière le sidebar quand ouvert sur mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
    cursor: pointer;
}
.sidebar-overlay.active { display: block; }

/* Classe supprimée — le menu unique est l'avatar (.nav-user) */

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-1);
}
.card:hover { box-shadow: var(--shadow-2); }

.card-body { padding: 20px; }

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.card-text { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.65; }

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
}

.card-header-gradient {
    background: var(--gradient-primary);
    padding: 20px;
    color: white;
}
.card-header-gradient h1,
.card-header-gradient h2,
.card-header-gradient h3,
.card-header-gradient p { color: white; }

/* ============================================================================
   BADGES
   ============================================================================ */
.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.73rem;
    font-weight: 600;
}
.badge-primary   { background: var(--primary-light);   color: var(--primary); }
.badge-gold      { background: var(--gold-light);       color: var(--gold); }
.badge-green     { background: var(--secondary-light);  color: var(--secondary); }
.badge-red       { background: var(--red-light);        color: var(--red); }
.badge-muted     { background: var(--bg);               color: var(--text-muted); border: 1px solid var(--border); }

.badge-batches     { background: #EFF6FF; color: #1D4ED8; }
.badge-sessions    { background: var(--secondary-light); color: var(--secondary); }
.badge-individuals { background: #FEF3C7; color: #92400E; }

/* ============================================================================
   STAT CARDS
   ============================================================================ */
.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-1);
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

.stat-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 5px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--secondary);
    color: #FFFFFF;
    border-color: var(--secondary);
}
.btn-success:hover {
    background: #047857;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

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

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

.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-sm  { padding: 6px 14px;  font-size: 0.82rem; }
.btn-block { width: 100%; }

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

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

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    direction: rtl;
    line-height: 1.5;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:hover  { border-color: #CBD5E1; }
.form-control:focus  {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control.is-invalid { border-color: var(--red); }

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

/* ============================================================================
   ALERTS
   ============================================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-success { background: var(--secondary-light); color: #065F46; border-color: #A7F3D0; }
.alert-error   { background: var(--red-light);        color: #991B1B; border-color: #FECACA; }
.alert-info    { background: var(--primary-light);    color: #1E40AF; border-color: #BFDBFE; }
.alert-warning { background: var(--gold-light);       color: #92400E; border-color: #FDE68A; }

.alert-close {
    margin-right: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    flex-shrink: 0;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */
.progress {
    height: 6px;
    background: var(--bg);
    border-radius: 50px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 50px;
    background: var(--primary);
    transition: width 0.5s ease;
}
.progress-bar.success { background: var(--secondary); }
.progress-bar.warning { background: var(--gold); }
.progress-bar.danger  { background: var(--red); }

/* ============================================================================
   TABLES
   ============================================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: #FFFFFF;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: right; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
th { background: var(--bg); font-weight: 600; color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ============================================================================
   AUTH PAGES — Redesign avec logo + couleurs Flutter (#056299 · #145253)
   ============================================================================ */

/* Corps des pages auth */
.auth-body {
    background: #F0F4F8;
    min-height: 100vh;
}

/* Conteneur global : panneau déco gauche + carte droite */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* ── Panneau décoratif gauche (brand) ──────────────────────────────────────── */
.auth-brand-panel {
    flex: 1;
    background: linear-gradient(160deg, #056299 0%, #044A73 40%, #145253 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FFFFFF' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-brand-logo {
    width: 96px;
    height: 96px;
    border-radius: 26px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    backdrop-filter: blur(8px);
    position: relative;
}
.auth-brand-logo img { width: 72px; height: 72px; border-radius: 18px; object-fit: contain; }
.auth-brand-title {
    font-size: 2.6rem;
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    position: relative;
}
.auth-brand-tagline {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    line-height: 1.8;
    text-align: center;
    max-width: 280px;
    position: relative;
}
.auth-brand-dots {
    display: flex;
    gap: 8px;
    margin-top: 40px;
    position: relative;
}
.auth-brand-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}
.auth-brand-dots span.active { background: #FFFFFF; width: 24px; border-radius: 4px; }

/* ── Zone formulaire droite ────────────────────────────────────────────────── */
.auth-form-panel {
    width: 100%;
    max-width: 480px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 44px;
    overflow-y: auto;
}

/* Logo compact pour mobile (caché sur desktop) */
.auth-mobile-logo {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.auth-mobile-logo img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
}
.auth-mobile-logo span {
    font-size: 1.4rem;
    font-weight: 800;
    color: #056299;
}

/* En-tête du formulaire */
.auth-form-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 6px;
}
.auth-form-subtitle {
    color: #64748B;
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* Séparateur */
.auth-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 24px 0;
    position: relative;
}

/* Champs avec icône */
.auth-field {
    position: relative;
    margin-bottom: 18px;
}
.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.auth-field .field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1rem;
    pointer-events: none;
    margin-top: 13px;
}
.auth-field input {
    width: 100%;
    padding: 12px 42px 12px 16px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: #0F172A;
    background: #F8FAFC;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
}
.auth-field input:focus {
    border-color: #056299;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(5,98,153,0.12);
}
.auth-field input.is-invalid {
    border-color: #EF5350;
    background: #FEF2F2;
}
.auth-field .form-error {
    font-size: 0.78rem;
    color: #C62828;
    margin-top: 4px;
}

/* Bouton principal */
.auth-btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #056299 0%, #145253 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.12s;
    margin-top: 8px;
    letter-spacing: 0.2px;
}
.auth-btn-primary:hover  { opacity: 0.92; }
.auth-btn-primary:active { transform: scale(0.98); }

/* Lien bas de page */
.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: #64748B;
}
.auth-footer-link a { color: #056299; font-weight: 600; text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

/* Alertes */
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.auth-alert.error   { background: #FDECEA; color: #C62828; border: 1px solid #FFCDD2; }
.auth-alert.success { background: #E8EFED; color: #145253; border: 1px solid #B2DFDB; }

/* Responsive : mobile → colonne unique (panneau déco masqué) */
@media (max-width: 768px) {
    .auth-wrapper { flex-direction: column; }
    .auth-brand-panel { display: none; }
    .auth-form-panel {
        max-width: 100%;
        min-height: 100vh;
        padding: 36px 24px;
        justify-content: flex-start;
        padding-top: 48px;
    }
    .auth-mobile-logo { display: flex; }
    .auth-form-title  { font-size: 1.35rem; }
}

/* Rétro-compat : anciennes classes (utilisées dans d'autres vues auth) */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-2);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 12px; }
.auth-logo h1  { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.auth-logo p   { color: var(--text-muted); font-size: 0.875rem; margin-top: 3px; }

.auth-header-gradient {
    background: linear-gradient(135deg, #056299 0%, #145253 100%);
    border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0;
    padding: 28px;
    text-align: center;
    margin: -36px -32px 28px;
}
.auth-header-gradient h2, .auth-header-gradient p { color: white; }
.auth-header-gradient .auth-icon {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: rgba(255,255,255,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
    background: var(--text-primary);
    color: rgba(255,255,255,0.65);
    padding: 48px 0 0;
    margin-top: 64px;
    transition: margin-right 0.22s ease;
}

/* Décalage pour ne pas passer sous la sidebar sur desktop */
.footer.with-sidebar { margin-right: var(--sidebar-width); }
@media (max-width: 1024px) {
    .footer.with-sidebar { margin-right: 0; }
}

/* Grille 4 colonnes : marque + liens + app + contact */
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

/* Colonne marque */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.footer-brand .nav-logo-text { color: #FFFFFF; }
.footer-brand p {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    line-height: 1.9;
    margin: 0;
    max-width: 320px;
    text-align: right;
}

/* Titres de colonne */
.footer-title {
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

/* Liens */
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}
.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    padding: 2px 0;
}
.footer-links a:hover {
    color: #FFFFFF;
    padding-right: 6px;
}

/* Barre basse copyright */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 0;
    margin-top: 8px;
    text-align: center;
}
.footer-bottom p {
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
    margin: 0;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer { padding: 36px 0 0; margin-top: 40px; }
    .footer-content { grid-template-columns: 1fr; gap: 28px; }
    .footer-brand p { max-width: none; }
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state-icon { font-size: 2.8rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 6px; }
.empty-state p  { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================================================
   CHIPS & STATUS
   ============================================================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 600;
}
.chip-primary   { background: var(--primary-light);   color: var(--primary); }
.chip-success   { background: var(--secondary-light); color: var(--secondary); }
.chip-warning   { background: var(--gold-light);       color: var(--gold); }
.chip-danger    { background: var(--red-light);        color: var(--red); }
.chip-muted     { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================================
   UTILITIES
   ============================================================================ */
.hover-bg:hover   { background: var(--bg) !important; }
.hover-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.3s ease both; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
.pulse { animation: pulse 2s ease-in-out infinite; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) { .hide-md { display: none !important; } }
@media (max-width: 640px) {
    .auth-card { padding: 24px 18px; }
    .auth-header-gradient { margin: -24px -18px 22px; padding: 22px 18px; }
    .hide-sm { display: none !important; }
}

/* ============================================================================
   LAYOUT RESPONSIVE CLASSES — remplacent les inline grid-template-columns
   ============================================================================ */

/* Grille 2 colonnes égales → 1 colonne sur mobile */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Profil : panneau latéral (1fr) + contenu principal (2fr) */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

/* Section héro de la page d'accueil */
.hero-section { text-align: center; padding: 80px 0 60px; }
.hero-title {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1.2;
}

/* ============================================================================
   APP DOWNLOAD — Section bannière + bouton Google Play
   ============================================================================ */

/* Bannière de la page d'accueil */
.app-download-section {
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    margin: 0 0 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.app-download-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    flex-wrap: wrap;
}

.app-download-text h2 {
    color: #FFFFFF;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.app-download-text p {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin: 0;
    max-width: 460px;
    line-height: 1.6;
}

/* Grand bouton Google Play (bannière home) */
.btn-play-store {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #000000;
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
}
.btn-play-store:hover {
    background: #1a1a1a;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.btn-play-store svg { flex-shrink: 0; }
.btn-play-store span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    direction: ltr;
}
.btn-play-store small {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.btn-play-store span > :last-child {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Badge Play Store dans le footer */
.footer-play-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    text-decoration: none;
    color: #FFFFFF;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}
.footer-play-badge:hover {
    background: rgba(255,255,255,0.16);
    color: #FFFFFF;
    border-color: rgba(255,255,255,0.35);
}
.footer-play-badge svg { flex-shrink: 0; fill: #FFFFFF; }
.footer-play-badge span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    direction: ltr;
}
.footer-play-badge small {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.footer-play-badge span > :last-child {
    font-size: 0.9rem;
    font-weight: 700;
}

/* ============================================================================
   RESPONSIVE — TABLETTE (≤ 768px)
   ============================================================================ */
@media (max-width: 768px) {
    /* Grilles adaptatives */
    .two-col-grid     { grid-template-columns: 1fr; gap: 16px; }
    .profile-grid     { grid-template-columns: 1fr; }

    /* Typographie */
    .page-title       { font-size: 1.3rem; }
    h1                { font-size: 1.5rem; }
    .stat-value       { font-size: 1.2rem; }

    /* Espacement */
    .container        { padding: 0 16px; }
    .card-body        { padding: 16px; }

    /* Héro */
    .hero-section     { padding: 52px 0 40px; }
    .hero-title       { font-size: 2.2rem; }

    /* App download */
    .app-download-section { padding: 28px 24px; margin-bottom: 40px; }
    .app-download-inner   { flex-direction: column; align-items: flex-start; gap: 20px; }
    .app-download-text p  { max-width: none; }

    /* Footer 4 colonnes → 2 colonnes tablette */
    .footer-content { grid-template-columns: 1fr 1fr; gap: 28px; }

    /* En-têtes de page flex — évite l'écrasement */
    .page-header.d-flex { flex-wrap: wrap; gap: 8px; }

    /* Formulaire de recherche */
    .d-flex > .form-control { flex: 1 1 140px; max-width: 100%; }

    /* Formations show — card body */
    .card-body[style*="padding:32px"],
    .card-body[style*="padding: 32px"] { padding: 20px !important; }
}

/* ============================================================================
   RESPONSIVE — SMARTPHONE (≤ 480px)
   ============================================================================ */
@media (max-width: 480px) {
    /* Espacement général */
    .container        { padding: 0 12px; }
    .main-content     { padding: calc(var(--nav-height) + 20px) 0 48px; }
    .main-content.with-sidebar { padding: calc(var(--nav-height) + 16px) 0 48px; }

    /* Typographie */
    .page-title       { font-size: 1.15rem; }
    h1                { font-size: 1.25rem; }
    .stat-value       { font-size: 1.1rem; }
    .stat-label       { font-size: 0.72rem; }
    .stat-icon        { width: 28px; height: 28px; font-size: 0.9rem; }

    /* Cards */
    .card-body        { padding: 12px; }
    .card-img         { height: 130px; }

    /* Héro */
    .hero-section     { padding: 36px 0 24px; }
    .hero-title       { font-size: 1.8rem; }

    /* App download — mobile */
    .app-download-section { padding: 24px 16px; border-radius: var(--radius-lg); }
    .app-download-text h2 { font-size: 1.15rem; }
    .btn-play-store       { padding: 10px 18px; }

    /* Footer 1 colonne sur mobile (override 768px) */
    .footer-content { grid-template-columns: 1fr; gap: 24px; }

    /* Boutons */
    .btn              { padding: 9px 14px; font-size: 0.88rem; }
    .btn-lg           { padding: 11px 20px; font-size: 0.95rem; }
    .btn-sm           { padding: 5px 12px; font-size: 0.79rem; }

    /* Barre de navigation */
    .nav-container    { padding: 0 14px; }

    /* Tableaux */
    th, td            { padding: 10px 12px; font-size: 0.82rem; }

    /* Formulaires */
    .form-control     { padding: 10px 12px; font-size: 0.88rem; }
    .auth-card        { padding: 20px 14px; }
    .auth-header-gradient { margin: -20px -14px 20px; padding: 20px 14px; }
}

/* ============================================================================
   PDF VIEWER RESPONSIVE
   Desktop  → <iframe> natif (Chrome / Firefox / Edge / Safari desktop)
   Android  → <embed>  natif (Chrome Android)
   iOS      → Google Docs Viewer via <iframe> (JS swap dans app.js)
   ============================================================================ */

/* ── Structure commune ────────────────────────────────────────────────────── */
.pdfv {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* ── Desktop (≥ 769 px) : <iframe> natif ────────────────────────────────── */
.pdfv__desktop { display: block; }
.pdfv__mobile  { display: none;  }

.pdfv__iframe {
    display: block;
    width: 100%;
    height: 680px;
    border: none;
    background: var(--bg);
}

.pdfv__fb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Mobile (≤ 768 px) ───────────────────────────────────────────────────── */
@media (max-width: 768px) {

    .pdfv__desktop { display: none;  }
    .pdfv__mobile  { display: block; }

    /* Boutons d'action */
    .pdfv__actions {
        display: flex;
        gap: 10px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        background: var(--surface);
    }

    /* Bouton principal "Ouvrir" */
    .pdfv__open {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        background: var(--primary);
        color: #FFFFFF;
        border-radius: var(--radius-lg);
        text-decoration: none;
        transition: var(--transition);
        min-width: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .pdfv__open:hover,
    .pdfv__open:active { background: var(--primary-dark); color: #FFFFFF; }
    .pdfv__open svg    { flex-shrink: 0; }
    .pdfv__open div    {
        display: flex;
        flex-direction: column;
        line-height: 1.3;
        min-width: 0;
        overflow: hidden;
    }
    .pdfv__open strong {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pdfv__open span { font-size: 0.7rem; opacity: 0.8; }

    /* Bouton secondaire "Télécharger" */
    .pdfv__dl {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 12px 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 0.78rem;
        font-weight: 600;
        flex-shrink: 0;
        transition: var(--transition);
        -webkit-tap-highlight-color: transparent;
    }
    .pdfv__dl:hover,
    .pdfv__dl:active { background: var(--bg); color: var(--text-primary); }

    /* Zone de prévisualisation inline */
    .pdfv__preview {
        width: 100%;
        height: 480px;
        background: var(--bg);
        position: relative;
        overflow: hidden;
    }

    /* <embed> pour Android Chrome */
    .pdfv__embed {
        display: block;
        width: 100%;
        height: 100%;
        border: none;
    }

    /* <iframe> Google Docs (iOS) — injecté par JS, même style que embed */
    .pdfv__preview iframe {
        display: block;
        width: 100%;
        height: 100%;
        border: none;
    }
}

/* Ajustement tablette : hauteur iframe légèrement réduite */
@media (max-width: 1024px) and (min-width: 769px) {
    .pdfv__iframe { height: 560px; }
}
