/* ================================================================
   EduDash INPTIC — CSS principal
   Charte INPTIC Gabon : bleu #003087, jaune #FFD700, vert #009A44
   Police : Arial, Helvetica uniquement (zéro dépendance externe)
   ================================================================ */

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

:root {
  --blue:      #003087;
  --blue-dk:   #001B5E;
  --blue-lt:   #E8EFFF;
  --yellow:    #FFD700;
  --green:     #009A44;
  --green-dk:  #007A35;
  --green-lt:  #E6F7ED;
  --red:       #DC2626;
  --red-lt:    #FEE2E2;
  --orange:    #F59E0B;
  --gray-50:   #F4F6F9;
  --gray-100:  #E8EFFF;
  --gray-200:  #D8E3F5;
  --gray-400:  #7B91B8;
  --gray-800:  #1A2B45;
  --shadow:    0 2px 10px rgba(0,48,135,.07);
  --shadow-lg: 0 8px 30px rgba(0,48,135,.13);
  --radius:    8px;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #F0F4FA;
  color: #1A2B45;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ───────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  width: 252px;
  background: linear-gradient(180deg, #001B5E 0%, #002575 55%, #003087 100%);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  overflow-y: auto; z-index: 300;
  box-shadow: 4px 0 20px rgba(0,0,0,.18);
  transition: transform .25s;
}
.sidebar-logo {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo img { height: 36px; width: auto; flex-shrink: 0; }
.sidebar-logo .app-name  { display: block; color: #FFD700; font-size: 14px; font-weight: 700; line-height: 1.2; }
.sidebar-logo .app-sub   { display: block; color: rgba(255,255,255,.42); font-size: 11px; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section {
  padding: 14px 16px 5px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,215,0,.55);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.68); text-decoration: none;
  font-size: 13px; font-weight: 600;
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,215,0,.1);
  color: #FFD700; border-left-color: #FFD700;
  text-decoration: none;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #FFD700; color: #003087;
  font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-user { color: rgba(255,255,255,.5); font-size: 12px; }
.sidebar-user strong { display: block; color: #fff; font-size: 13px; }

/* ── MAIN ─────────────────────────────────────────────────────── */
.main { margin-left: 252px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOPBAR ───────────────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 2px solid #E8EFFF;
  padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,48,135,.06);
}
.topbar-title { font-size: 16px; font-weight: 700; color: #001B5E; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-badge {
  background: var(--blue-lt); color: var(--blue);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.topbar-date { font-size: 12px; color: var(--gray-400); }

/* ── CONTENU ──────────────────────────────────────────────────── */
.content { padding: 24px; flex: 1; }

/* ── ALERTS ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 18px; font-size: 13px;
  font-weight: 600; border-left: 4px solid;
}
.alert-success { background: #E6F7ED; border-color: #009A44; color: #005A28; }
.alert-danger  { background: #FEE2E2; border-color: #DC2626; color: #991B1B; }
.alert-warning { background: #FFFBEB; border-color: #F59E0B; color: #92400E; }
.alert-info    { background: #E8EFFF; border-color: #003087; color: #001B5E; }

/* ── KPI ──────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: #fff; border: 1px solid #E8EFFF; border-radius: 12px;
  padding: 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-icon svg { width: 22px; height: 22px; color: #fff; }
.kpi-val { font-size: 26px; font-weight: 700; line-height: 1; color: #001B5E; }
.kpi-lbl { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.bg-primary   { background: #003087; }
.bg-secondary { background: #009A44; }
.bg-warning   { background: #F59E0B; }
.bg-danger    { background: #DC2626; }
.bg-info      { background: #6366F1; }

/* ── CARDS ────────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid #E8EFFF; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #E8EFFF; display: flex; align-items: center; justify-content: space-between; }
.card-title  { font-weight: 700; font-size: 15px; color: #001B5E; }
.card-body   { padding: 20px; }

/* ── TABLE ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #F4F7FF; text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6880AC; border-bottom: 1px solid #E8EFFF; }
td { padding: 12px 14px; border-bottom: 1px solid #F0F4FA; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F8FAFF; }

/* ── BADGES ───────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-success { background: #E6F7ED; color: #005A28; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #E8EFFF; color: #003087; }
.badge-muted   { background: #F1F5F9; color: #64748B; }

/* ── BOUTONS ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap; font-family: Arial, Helvetica, sans-serif; }
.btn:hover { text-decoration: none; }
.btn-primary   { background: #003087; color: #FFD700; }
.btn-primary:hover { background: #001B5E; color: #FFD700; }
.btn-secondary { background: #009A44; color: #fff; }
.btn-secondary:hover { background: #007A35; color: #fff; }
.btn-danger    { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-warning   { background: #F59E0B; color: #fff; }
.btn-warning:hover { background: #D97706; color: #fff; }
.btn-ghost     { background: transparent; color: #003087; border: 1.5px solid #D8E3F5; }
.btn-ghost:hover { background: #E8EFFF; color: #003087; }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

/* ── FORMULAIRES ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #001B5E; }
input, select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #D8E3F5; border-radius: 8px;
  font-size: 14px; font-family: Arial, Helvetica, sans-serif;
  background: #fff; color: #1A2B45; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #003087; box-shadow: 0 0 0 3px rgba(0,48,135,.1); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ── PROGRESS ─────────────────────────────────────────────────── */
.progress { background: #E8EFFF; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; background: #003087; transition: width .3s; }
.progress-bar.green  { background: #009A44; }
.progress-bar.orange { background: #F59E0B; }
.progress-bar.red    { background: #DC2626; }

/* ── AUTH ─────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #001B5E 0%, #003087 60%, #005BB5 100%);
  padding: 40px 16px;
}
.auth-box {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { max-width: 150px; height: auto; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }
.auth-logo h1 { font-size: 20px; font-weight: 700; color: #003087; margin-bottom: 4px; }
.auth-logo p  { color: var(--gray-400); font-size: 13px; }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: block !important; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr; }
}
