/* ═════════════════════════════════════════════════════════════════════
   DASHBOARD APPRENANT — DESIGN SYSTEM REA-INSTITUT
   Bleu Nuit: #1E3D59 | Ocre Doré: #C49A4A | Surface: #FFFFFF / #F8FAFC
   ═════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #1E3D59;
  --primary-hover: #162f45;
  --accent: #C49A4A;
  --accent-hover: #a6813b;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --success: #15803D;
  --success-bg: #F0FDF4;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

body.dashboard-body {
  font-size: 1.15rem;
  display: flex;
  min-height: 100vh;
  background: var(--surface-alt);
  color: var(--text-main);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
}

/* SIDEBAR */
.sidebar {
  width: 290px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0.5rem 1.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sidebar-brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.95rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.15rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.nav-item.active {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--primary);
  border-left: 3px solid var(--accent);
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* MAIN AREA */
.main-content {
  margin-left: 290px;
  flex: 1;
  padding: 2.2rem 3rem;
  min-width: 0;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.topbar-left h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
}

.topbar-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quota-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* GRILLES ET CARTES */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
}

.progress-bar {
  height: 8px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.85rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.section-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin: 1.8rem 0 1rem 0;
  font-weight: 700;
}

/* TABLEAUX */
.table-card {
  padding: 0;
  overflow-x: auto;
}

.dz-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 1.15rem;
}

.dz-table th {
  background: #F1F5F9;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.dz-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.dz-table tr:last-child td {
  border-bottom: none;
}

/* BADGES & BOUTONS */
.badge-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.badge-graded { background: var(--success-bg); color: var(--success); }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-ready { background: #EFF6FF; color: #1E40AF; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--primary);
  color: #FFFFFF;
}
.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--accent {
  background: var(--accent);
  color: #FFFFFF;
}
.btn--accent:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}
.btn--secondary:hover {
  background: var(--surface-alt);
}

/* AUTH MODAL / POPUP */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.auth-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 540px;
  padding: 2.2rem;
  border: 1px solid var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1.45rem;
}

.auth-form-group {
  margin-bottom: 1.2rem;
}

.auth-form-group label {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.auth-form-group input,
.auth-form-group select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-family: inherit;
}

.auth-form-group input:focus,
.auth-form-group select:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    width: 72px;
    padding: 1rem 0.5rem;
  }
  .sidebar-brand-name, .sidebar-brand-sub, .nav-item span {
    display: none;
  }
  .main-content {
    margin-left: 72px;
    padding: 1.5rem;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
