/* ============================================================
   CIR HUB — Design System
   Couleurs : Bleu marine CIR #1e2a72 + Orange CIR #e05a2b
   ============================================================ */

:root {
    /* Couleurs CIR */
    --cir-navy:      #1e2a72;
    --cir-navy-dark: #141c50;
    --cir-navy-light:#2a3a9e;
    --cir-orange:    #e05a2b;
    --cir-orange-dk: #b8431a;
    --cir-orange-lt: #f5813f;

    /* Surfaces */
    --bg-page:   #f0f2f8;
    --bg-card:   #ffffff;
    --bg-sidebar:#1e2a72;

    /* Textes */
    --text-primary:   #1a1f36;
    --text-secondary: #6b7280;
    --text-muted:     #9ca3af;
    --text-on-dark:   #ffffff;
    --text-on-orange: #ffffff;

    /* Bordures */
    --border:      #e5e7eb;
    --border-focus:#e05a2b;

    /* États */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger:  #ef4444;
    --color-info:    #3b82f6;

    /* Sidebar */
    --sidebar-w:     260px;
    --sidebar-bg:    var(--cir-navy);
    --sidebar-text:  rgba(255,255,255,0.75);
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active:rgba(224,90,43,0.2);
    --sidebar-accent:var(--cir-orange);

    /* Topbar */
    --topbar-h:    60px;
    --topbar-bg:   #ffffff;
    --topbar-shadow: 0 1px 4px rgba(0,0,0,0.08);

    /* Misc */
    --radius:    8px;
    --radius-lg: 12px;
    --shadow:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --transition:0.2s ease;

    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg-page); color: var(--text-primary); line-height: 1.6; }
a { color: var(--cir-navy); text-decoration: none; }
a:hover { color: var(--cir-orange); }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
}
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left var(--transition);
}
.main-content { flex: 1; padding: 24px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
/* Sidebar logo image */
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
}
.sidebar-logo-img {
    width: 110px; flex-shrink: 0;
    filter: brightness(0) invert(1); /* logo blanc sur fond marine */
    opacity: 0.95;
}
.sidebar-hub-badge {
    background: var(--cir-orange);
    color: #fff;
    font-size: 10px; font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
}
/* Auth logo */
.auth-logo {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 28px;
}
.auth-logo-main { font-size: 20px; font-weight: 800; color: var(--cir-navy); display:block; }
.auth-logo-sub  { font-size: 11px; color: var(--text-muted); }

.sidebar-toggle {
    display: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.1); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { padding: 8px 0; }
.nav-section-title {
    display: block;
    font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    padding: 4px 16px 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    color: var(--sidebar-text);
    font-size: 14px; font-weight: 500;
    transition: background var(--transition), color var(--transition);
    border-radius: 0;
    position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
    background: var(--sidebar-active);
    color: var(--cir-orange-lt);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--cir-orange);
    border-radius: 0 3px 3px 0;
}
.nav-item i { font-size: 18px; flex-shrink: 0; }

.badge-count {
    margin-left: auto;
    background: var(--cir-orange);
    color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 20px; text-align: center;
}
.badge-count.badge-danger { background: var(--color-danger); }

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.sidebar-user {
    flex: 1; display: flex; align-items: center; gap: 10px;
    color: var(--sidebar-text);
    border-radius: var(--radius);
    padding: 6px;
    transition: background var(--transition);
}
.sidebar-user:hover { background: var(--sidebar-hover); color: #fff; }
.user-avatar {
    width: 34px; height: 34px;
    background: var(--cir-orange);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff;
    flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
.logout-btn {
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    padding: 6px;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.logout-btn:hover { color: var(--color-danger); background: rgba(239,68,68,0.1); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--topbar-bg);
    box-shadow: var(--topbar-shadow);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    position: sticky; top: 0; z-index: 50;
    gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-menu-btn {
    display: none;
    font-size: 22px; color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius);
}
.topbar-menu-btn:hover { background: var(--bg-page); color: var(--text-primary); }
.breadcrumb-page { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* Notifications */
.topbar-notif { position: relative; }
.notif-btn {
    position: relative;
    font-size: 20px;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.notif-btn:hover { background: var(--bg-page); color: var(--text-primary); }
.notif-badge {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--cir-orange);
    border-radius: 50%;
    border: 2px solid #fff;
}
.notif-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 200;
}
.notif-dropdown.open { display: block; }
.notif-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.notif-mark-all { font-size: 12px; color: var(--cir-navy); cursor: pointer; }
.notif-mark-all:hover { color: var(--cir-orange); }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
}
.notif-item:hover { background: var(--bg-page); }
.notif-item.unread { background: rgba(30,42,114,0.04); }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container {
    padding: 12px 24px 0;
    display: flex; flex-direction: column; gap: 8px;
}
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
    animation: slideDown 0.3s ease;
}
.flash i { font-size: 18px; flex-shrink: 0; }
.flash span { flex: 1; }
.flash-close { color: inherit; opacity: 0.6; font-size: 16px; margin-left: auto; }
.flash-close:hover { opacity: 1; }

.flash-success { background: #d1fae5; color: #065f46; }
.flash-error   { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef3c7; color: #92400e; }
.flash-info    { background: #dbeafe; color: #1e40af; }

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

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.card-body { padding: 20px; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-page);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-icon.navy  { background: rgba(30,42,114,0.1); color: var(--cir-navy); }
.stat-icon.orange{ background: rgba(224,90,43,0.1);  color: var(--cir-orange); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--color-success); }
.stat-icon.red   { background: rgba(239,68,68,0.1);  color: var(--color-danger); }
.stat-icon.blue  { background: rgba(59,130,246,0.1); color: var(--color-info); }
.stat-icon.amber { background: rgba(245,158,11,0.1); color: var(--color-warning); }

.stat-info {}
.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
    display: flex; justify-content: space-between;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-label-link { font-weight: 400; color: var(--cir-navy); font-size: 12px; }
.form-label-link:hover { color: var(--cir-orange); }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px; font-family: var(--font);
    background: #fff; color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--cir-navy);
    box-shadow: 0 0 0 3px rgba(30,42,114,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--color-danger); margin-top: 4px; }

.input-icon-wrap { position: relative; }
.input-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 17px; pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 36px; }
.input-icon-right {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 17px; padding: 2px;
}
.input-icon-right:hover { color: var(--text-primary); }

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px; font-weight: 600; font-family: var(--font);
    transition: all var(--transition);
    cursor: pointer; border: 1.5px solid transparent;
    white-space: nowrap;
}
.btn i { font-size: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary { background: var(--cir-navy); color: #fff; border-color: var(--cir-navy); }
.btn-primary:hover { background: var(--cir-navy-dark); border-color: var(--cir-navy-dark); color: #fff; }

.btn-orange { background: var(--cir-orange); color: #fff; border-color: var(--cir-orange); }
.btn-orange:hover { background: var(--cir-orange-dk); border-color: var(--cir-orange-dk); color: #fff; }

.btn-outline { background: transparent; color: var(--cir-navy); border-color: var(--cir-navy); }
.btn-outline:hover { background: var(--cir-navy); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-page); color: var(--text-primary); }

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

.btn-success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { background: #059669; color: #fff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.badge-primary      { background: rgba(30,42,114,0.1);   color: var(--cir-navy); }
.badge-info         { background: rgba(59,130,246,0.1);  color: #1d4ed8; }
.badge-warning      { background: rgba(245,158,11,0.12); color: #92400e; }
.badge-secondary    { background: rgba(107,114,128,0.1); color: #374151; }
.badge-success      { background: rgba(16,185,129,0.12); color: #065f46; }
.badge-success-soft { background: rgba(16,185,129,0.06); color: #047857; }
.badge-danger       { background: rgba(239,68,68,0.1);   color: #991b1b; }
.badge-dark         { background: rgba(17,24,39,0.12);   color: #111827; }

.badge-niveau {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
}

/* ============================================================
   TABLEAUX
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    text-align: left;
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 16px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:hover { background: rgba(30,42,114,0.02); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   FILTRES & RECHERCHE
   ============================================================ */
.filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px; align-items: center;
}
.filter-bar .form-control { min-width: 140px; }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap .form-control { padding-left: 36px; }
.search-input-wrap .input-icon { left: 10px; top: 50%; transform: translateY(-50%); }

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 300;
    align-items: center; justify-content: center;
    padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 760px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { font-size: 20px; color: var(--text-muted); padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text-primary); background: var(--bg-page); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end;
}

@keyframes modalIn {
    from { opacity:0; transform:scale(0.95); }
    to   { opacity:1; transform:scale(1); }
}

/* ============================================================
   EMPLOI DU TEMPS — Grille horaire
   ============================================================ */
.edt-container { overflow-x: auto; }
.edt-grid {
    display: grid;
    gap: 2px;
    min-width: 700px;
}
.edt-header-cell {
    background: var(--cir-navy);
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 13px; font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0;
}
.edt-time-col {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
    padding: 6px 8px;
    display: flex; align-items: center;
    background: var(--bg-page);
}
.edt-cell {
    background: #fff;
    border: 1px solid var(--border);
    min-height: 60px;
    padding: 4px;
    position: relative;
}
.edt-event {
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition);
    border-left: 3px solid rgba(0,0,0,0.2);
}
.edt-event:hover { opacity: 0.85; }
.edt-event-title { font-weight: 700; font-size: 12px; }
.edt-event-meta { font-size: 11px; opacity: 0.8; margin-top: 2px; }

/* Programme tabs */
.edt-tabs {
    display: flex; gap: 4px;
    background: var(--bg-page);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.edt-tab {
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
}
.edt-tab:hover { background: rgba(30,42,114,0.05); color: var(--cir-navy); }
.edt-tab.active { background: var(--cir-navy); color: #fff; }

/* ============================================================
   PAGINATOR
   ============================================================ */
.paginator { margin-top: 16px; display: flex; justify-content: center; }
.paginator ul { display: flex; gap: 4px; }
.paginator li a {
    display: flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px; color: var(--text-secondary);
    transition: all var(--transition);
    padding: 0 10px;
}
.paginator li a:hover { border-color: var(--cir-navy); color: var(--cir-navy); }
.paginator li.active a { background: var(--cir-navy); border-color: var(--cir-navy); color: #fff; }

/* ============================================================
   AUTH
   ============================================================ */
.auth-body { background: linear-gradient(135deg, var(--cir-navy) 0%, var(--cir-navy-light) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; justify-content: center; }
.auth-logo-icon { width: 48px; height: 48px; background: var(--cir-orange); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; }
.auth-logo-main { font-size: 20px; font-weight: 800; color: var(--cir-navy); }
.auth-logo-sub { font-size: 11px; color: var(--text-muted); }
.auth-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 12px; color: rgba(255,255,255,0.4); }
.auth-content {}

/* ============================================================
   UTILITAIRES
   ============================================================ */
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.gap-2 { gap: 8px; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.3; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

.overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}
.overlay.open { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle { display: flex; align-items: center; }
    .main-wrapper { margin-left: 0; }
    .topbar-menu-btn { display: flex; align-items: center; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 16px; }
    .modal { max-width: 100%; }
    .page-header { flex-direction: column; }
}

/* ============================================================
   STYLES COMPLÉMENTAIRES — Phase 2
   ============================================================ */

/* Lien auth retour */
.auth-logo { text-align:center; }

/* Dossier layout responsive */
@media (max-width:860px) {
    .dos-layout { grid-template-columns:1fr !important; }
    .dos-side   { order:-1; }
}

/* Grille inventaire fiche */
@media (max-width:600px) {
    .dos-layout > div > .card > div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns:1fr !important;
    }
}

/* Tag fichier */
.file-tag {
    display:inline-flex; align-items:center; gap:6px;
    background:var(--bg-page); border:1px solid var(--border);
    border-radius:6px; padding:4px 10px;
    font-size:12px; color:var(--text-secondary);
}

/* Code inline */
code {
    font-family:'Courier New',monospace;
    font-size:12px;
}

/* Grille EDT responsive */
.edt-table { font-size:13px; }
.edt-table th, .edt-table td { padding:6px 8px; }
@media (max-width:700px) {
    .edt-event-meta { display:none; }
    .edt-event-title { font-size:11px; }
}

/* Impression */
@media print {
    .sidebar,.topbar,.page-actions,
    .modal-overlay,button,a.btn { display:none !important; }
    .main-wrapper { margin-left:0 !important; }
    body { background:#fff; }
    .card { box-shadow:none !important; border:1px solid #ccc !important; }
    .page-title { font-size:18px; }
}

/* Sous-item de navigation */
.nav-sub {
    padding-left: 32px;
    font-size: 13px;
    opacity: 0.85;
}
.nav-sub i { font-size: 15px; }
.nav-sub.active { opacity: 1; }

/* Correction globale de la filter-bar */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

/* Les selects et inputs dans filter-bar ne prennent PAS toute la largeur */
.filter-bar .form-control,
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar input[type="month"],
.filter-bar input[type="date"] {
    width: auto !important;
    flex: 0 0 auto;
}

/* Exception : le champ de recherche texte peut être plus large */
.filter-bar .search-input-wrap {
    flex: 1 1 200px;
    min-width: 180px;
    max-width: 300px;
}

.filter-bar .search-input-wrap .form-control {
    width: 100% !important;
}

/* Correction pour les filtres inline dans les cards */
.card .filter-bar {
    margin-bottom: 0;
}

/* Fix spécifique pour les filtres dans les pages d'inscriptions et absences */
div[style*="display:flex"][style*="gap:10px"] select.form-control,
div[style*="display:flex"][style*="gap:10px"] input.form-control {
    flex: 0 0 auto;
    width: auto !important;
}

/* Inputs dans les cards de filtres compacts */
.card > div[style*="padding:12px"] select,
.card > div[style*="padding:14px"] select,
.card > div[style*="padding:12px"] input:not([type="submit"]),
.card > div[style*="padding:14px"] input:not([type="submit"]) {
    flex: 0 0 auto !important;
    width: auto !important;
}

/* Champ recherche dans les cards de filtres compacts */
.card > div[style*="padding:12px"] div[style*="position:relative"],
.card > div[style*="padding:14px"] div[style*="position:relative"] {
    flex: 1 1 180px;
    max-width: 280px;
}

.card > div[style*="padding:12px"] div[style*="position:relative"] input,
.card > div[style*="padding:14px"] div[style*="position:relative"] input {
    width: 100% !important;
}