:root {
  /* Palette logo SYGESCHOOL */
  --brand: #0056a8;
  --brand-dark: #003f7a;
  --brand-2: #f7941d;
  --brand-2-dark: #d9780a;
  --bg: #f2f6fc;
  --ink: #0f2744;
  --muted: #5a6f86;
  --line: #d5e0ee;
  --panel: #ffffff;
  --sidebar: #0a2f6b;
  --sidebar-2: #063a8c;
  --sidebar-text: #dbe7f7;
  --accent: #1a7fc1;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 63, 122, 0.08);
  --font: "Segoe UI", "Candara", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 15%, rgba(247, 148, 29, 0.28), transparent 42%),
    radial-gradient(circle at 88% 80%, rgba(0, 86, 168, 0.35), transparent 45%),
    linear-gradient(145deg, #04275a, #0056a8 48%, #0a3d7a);
}
.auth-wrap { width: min(460px, 92vw); }
.auth-card {
  background: var(--panel);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-logo {
  display: block;
  width: min(280px, 85%);
  height: auto;
  margin: 0 auto 0.35rem;
}
.auth-brand h1 { display: none; }
.auth-brand p {
  color: var(--muted);
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
}

/* Shell */
.app-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.9rem;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
  padding: 0.35rem 0.35rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 1rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.sidebar-brand:hover {
  opacity: 0.92;
  color: inherit;
}
.sidebar-brand .brand-logo-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  display: grid;
  place-items: center;
}
.sidebar-brand .brand-logo {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
}
.sidebar-brand .brand-meta {
  padding: 0 0.25rem;
}
.sidebar-brand strong { display: block; color: #fff; font-size: 0.95rem; }
.sidebar-brand small { color: #9eb6d8; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-link.disabled { opacity: 0.45; pointer-events: none; }
.sidebar-section {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8eabcf;
  margin: 0.9rem 0.75rem 0.35rem;
}
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.user-chip {
  display: flex; gap: 0.6rem; align-items: center;
  padding: 0.4rem 0.5rem 0.8rem;
}
.user-chip-link {
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  transition: background 0.15s ease;
}
.user-chip-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.user-chip i { font-size: 1.5rem; }
.user-chip strong { display: block; color: #fff; font-size: 0.92rem; }
.user-chip small { color: #9eb6d8; }
.btn-logout { cursor: pointer; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 1.5rem 0.5rem;
  gap: 1rem;
}
.topbar h1 { margin: 0; font-size: 1.45rem; color: var(--brand-dark); }
.content { padding: 1rem 1.5rem 2rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.85rem;
}
.panel-head h2 { margin: 0; font-size: 1.05rem; color: var(--brand-dark); }
.panel-head a { text-decoration: none; color: var(--brand); font-weight: 600; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.stat-card span { display: block; color: var(--muted); font-size: 0.86rem; margin-bottom: 0.35rem; }
.stat-card strong { font-size: 1.55rem; color: var(--brand-dark); }
.stat-card.accent { border-color: #c5daf0; background: #f3f8fd; }
.stat-card.finance { border-color: #f5d7b0; background: #fff8ef; }
.stat-card.finance strong { color: var(--brand-2); font-size: 1.15rem; }

.detail-dl dt { color: var(--muted); font-weight: 500; }
.detail-dl dd { margin-bottom: 0.55rem; }

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
}
.btn-success {
  --bs-btn-bg: var(--brand-2);
  --bs-btn-border-color: var(--brand-2);
  --bs-btn-hover-bg: var(--brand-2-dark);
  --bs-btn-hover-border-color: var(--brand-2-dark);
}
.table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom-color: var(--line);
}
.badge.text-bg-success {
  background-color: var(--brand) !important;
}
.badge.text-bg-warning {
  background-color: var(--brand-2) !important;
  color: #fff !important;
}

/* Champ mot de passe — œil à l'intérieur */
.password-field {
  position: relative !important;
  display: block !important;
  width: 100% !important;
}
.password-field input.form-control,
.password-field input[type="password"],
.password-field input[type="text"] {
  width: 100% !important;
  padding-right: 3.25rem !important;
}
.password-field .password-eye {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 3rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #5a6f86 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
}
.password-field .password-eye:hover,
.password-field .password-eye:focus-visible {
  color: var(--brand) !important;
  outline: none !important;
}
.password-field .password-eye i {
  font-size: 1.2rem !important;
  pointer-events: none !important;
}

/* Supports de cours par type */
.course-file-group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  color: #234;
}
.course-file-group-head i { font-size: 1.15rem; color: var(--brand); }
.course-file-list { border: 1px solid #e6edf5; border-radius: 12px; overflow: hidden; }
.course-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #eef2f7;
  flex-wrap: wrap;
}
.course-file-item:last-child { border-bottom: 0; }
.course-file-meta { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.course-file-meta i { font-size: 1.35rem; }
.course-file-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.course-upload-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.course-upload-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 0.75rem;
  background: #f8fbff;
}
.course-upload-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
  color: #1e3a5f;
}
.course-upload-card-head i { color: var(--brand); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; }
}
