/* ============================================================
   InspectAcad — Feuille de style principale
   Palette : bleu institutionnel profond + or académique + blanc
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bleu:       #1a2e5a;
  --bleu-med:   #2d4a8a;
  --bleu-clair: #4a6fa5;
  --or:         #c9a227;
  --or-clair:   #f0c940;
  --blanc:      #ffffff;
  --gris-pale:  #f4f6fb;
  --gris-bord:  #e2e8f0;
  --gris-txt:   #64748b;
  --vert:       #10b981;
  --orange:     #f59e0b;
  --rouge:      #ef4444;
  --ombre:      0 4px 24px rgba(26,46,90,0.10);
  --ombre-lg:   0 8px 40px rgba(26,46,90,0.16);
  --r:          10px;
  --r-lg:       16px;
  --font-d:     'Sora', sans-serif;
  --font-b:     'Inter', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-b);
  background: var(--gris-pale);
  color: var(--bleu);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── LAYOUT ── */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  grid-column: 1 / -1;
  background: var(--bleu);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--blanc);
  letter-spacing: -0.02em;
}

.topbar-logo .logo-badge {
  width: 36px; height: 36px;
  background: var(--or);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

.topbar-logo .logo-sub {
  font-size: 0.65rem;
  font-weight: 400;
  color: #a0b4d0;
  display: block;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-spacer { flex: 1; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c8d6e8;
  font-size: 0.875rem;
}

.topbar-avatar {
  width: 34px; height: 34px;
  background: var(--bleu-med);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blanc);
  border: 2px solid var(--or);
}

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

.topbar-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s;
}

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

/* ── SIDEBAR ── */
.sidebar {
  background: var(--bleu);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-section {
  padding: 8px 20px 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4d6a8a;
  margin-top: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #8aa8c8;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all .2s;
  cursor: pointer;
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--blanc);
}

.sidebar-link.active {
  background: rgba(201,162,39,0.12);
  color: var(--or-clair);
  border-left-color: var(--or);
}

.sidebar-link .icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-badge {
  margin-left: auto;
  background: var(--or);
  color: var(--bleu);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

/* ── MAIN CONTENT ── */
.main {
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 1400px;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-family: var(--font-d);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bleu);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--gris-txt);
  margin-top: 4px;
}

/* ── CARDS & GRIDS ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--blanc);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--ombre);
  border-top: 4px solid var(--bleu-med);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--ombre-lg); }
.stat-card.or    { border-top-color: var(--or); }
.stat-card.vert  { border-top-color: var(--vert); }
.stat-card.rouge { border-top-color: var(--rouge); }
.stat-card.orange{ border-top-color: var(--orange); }

.stat-card .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gris-txt);
  margin-bottom: 8px;
}

.stat-card .value {
  font-family: var(--font-d);
  font-size: 2rem;
  font-weight: 700;
  color: var(--bleu);
  line-height: 1;
}

.stat-card .sub {
  font-size: 0.75rem;
  color: var(--gris-txt);
  margin-top: 6px;
}

/* ── PANELS ── */
.panel {
  background: var(--blanc);
  border-radius: var(--r-lg);
  box-shadow: var(--ombre);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gris-bord);
}

.panel-title {
  font-family: var(--font-d);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bleu);
}

.panel-body { padding: 20px 24px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

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

th {
  background: var(--gris-pale);
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gris-txt);
  text-align: left;
  border-bottom: 2px solid var(--gris-bord);
}

td {
  padding: 13px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--gris-bord);
  color: var(--bleu);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8faff; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-vert   { background: #d1fae5; color: #065f46; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-rouge  { background: #fee2e2; color: #991b1b; }
.badge-bleu   { background: #dbeafe; color: #1e40af; }
.badge-gris   { background: #f1f5f9; color: #475569; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: var(--font-b);
  text-decoration: none;
}

.btn-primary {
  background: var(--bleu);
  color: var(--blanc);
}
.btn-primary:hover { background: var(--bleu-med); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,46,90,0.3); }

.btn-or {
  background: var(--or);
  color: var(--bleu);
}
.btn-or:hover { background: var(--or-clair); }

.btn-ghost {
  background: transparent;
  color: var(--bleu-clair);
  border: 1.5px solid var(--gris-bord);
}
.btn-ghost:hover { background: var(--gris-pale); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-danger { background: #fee2e2; color: var(--rouge); }
.btn-danger:hover { background: var(--rouge); color: #fff; }

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

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gris-bord);
  border-radius: var(--r);
  font-size: 0.875rem;
  font-family: var(--font-b);
  color: var(--bleu);
  background: var(--blanc);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--bleu-clair);
  box-shadow: 0 0 0 3px rgba(74,111,165,0.15);
}

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

select.form-control { cursor: pointer; }

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

.form-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* ── SCORE RING ── */
.score-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  font-family: var(--font-d);
  font-size: 1rem;
  font-weight: 700;
  color: var(--blanc);
}

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 8px;
  background: var(--gris-bord);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease;
}

/* ── CRITERE CARD ── */
.critere-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.critere-card {
  background: var(--gris-pale);
  border-radius: var(--r);
  padding: 16px;
  border-left: 4px solid var(--bleu-clair);
}

.critere-card .c-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gris-txt);
  margin-bottom: 8px;
}

.critere-card .c-score {
  font-family: var(--font-d);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bleu);
}

.critere-card .c-max { font-size: 0.8rem; color: var(--gris-txt); }

/* ── NOTE INPUT ── */
.note-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-input {
  width: 72px;
  padding: 8px 10px;
  border: 2px solid var(--gris-bord);
  border-radius: 8px;
  font-family: var(--font-d);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--bleu);
  outline: none;
  transition: border-color .2s;
}

.note-input:focus { border-color: var(--or); }

/* ── ALERT / FLASH ── */
.alert {
  padding: 13px 18px;
  border-radius: var(--r);
  font-size: 0.875rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--vert); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--rouge); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--bleu-clair); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--orange); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bleu);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(45,74,138,0.6) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201,162,39,0.15) 0%, transparent 50%);
}

.login-card {
  background: var(--blanc);
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: var(--bleu);
  border-radius: 16px;
  font-size: 2rem;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(26,46,90,0.35);
}

.login-logo h1 {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bleu);
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--gris-txt);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-accounts {
  background: var(--gris-pale);
  border-radius: 8px;
  padding: 12px;
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--gris-txt);
}

.demo-accounts strong { color: var(--bleu); }

.demo-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 10px;
  background: var(--bleu);
  color: #fff;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .2s;
}
.demo-btn:hover { background: var(--bleu-med); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gris-txt);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.875rem; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--blanc);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 680px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-d);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gris-txt);
  padding: 4px;
  line-height: 1;
}

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--gris-bord);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bleu-clair);
  border: 2px solid var(--blanc);
  box-shadow: 0 0 0 2px var(--bleu-clair);
}

.timeline-date { font-size: 0.75rem; color: var(--gris-txt); margin-bottom: 4px; }
.timeline-text { font-size: 0.875rem; font-weight: 500; }

/* ── RADAR CHART LEGEND ── */
.criteria-list { display: flex; flex-direction: column; gap: 12px; }

.criteria-item .ci-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gris-bord);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gris-txt);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}

.tab-btn.active {
  color: var(--bleu);
  border-bottom-color: var(--or);
}

.tab-btn:hover { color: var(--bleu); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 64px auto 1fr;
  }

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 12px;
    gap: 0;
  }

  .sidebar-link { padding: 12px 14px; white-space: nowrap; }
  .sidebar-section { display: none; }
  .sidebar-badge { display: none; }

  .main { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .critere-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .login-card { padding: 32px 24px; }
}
