/* ============================================================
   SortieBISP — Design System v2
   OpenApply-inspired layout: Sidebar + Topbar + Responsive
   BISP Colors: Navy, Orange, Clean Professional
   ============================================================ */

:root {
  --bisp-navy: #022c5e;
  --bisp-navy-dark: #011d3f;
  --bisp-orange: #ff6633;
  --bisp-green: #9de055;
  --bisp-blue: #559cf5;
  --bisp-blue-light: #a4d0fb;
  --bisp-yellow: #f9cc70;
  --bisp-coral: #f4927d;
  --bisp-peach: #f5b29b;
  --bisp-gray: #f3f3f3;
  --bisp-bg: #f8f9fb;
  --bisp-border: #e2e6ed;
  --bisp-border-light: #f0f1f4;
  --bisp-white: #ffffff;
  --bisp-text: #1a1a2e;
  --bisp-text-light: #5a6178;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(2, 44, 94, 0.06), 0 1px 2px rgba(2, 44, 94, 0.04);
  --shadow-md: 0 2px 8px rgba(2, 44, 94, 0.08);
  --shadow-lg: 0 4px 20px rgba(2, 44, 94, 0.12);
  --nav-height: 72px;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bisp-bg);
  color: var(--bisp-text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   APP SHELL — Grid Layout (Sidebar + Main)
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100dvh;
}

/* --- Sidebar --- */
.sidebar {
  background: var(--bisp-navy-dark);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 400;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--bisp-orange);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-logo-sub {
  font-size: 0.7rem;
  opacity: 0.5;
  font-weight: 400;
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.sidebar-nav-item.active {
  background: rgba(255,255,255,0.12);
  color: white;
  font-weight: 600;
}

.sidebar-nav-item .nav-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav-item.active .nav-icon-svg {
  opacity: 1;
}

.sidebar-nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-staff {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-staff-info {
  flex: 1;
  min-width: 0;
}

.sidebar-staff-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-staff-role {
  font-size: 0.7rem;
  opacity: 0.5;
}

.sidebar-logout {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.2s;
}

.sidebar-logout:hover {
  color: rgba(255,255,255,0.8);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 399;
}

.sidebar-overlay.active {
  display: block;
}

/* --- Main Area --- */
.main-area {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-width: 0;
}

/* --- Topbar --- */
.topbar {
  background: white;
  border-bottom: 1px solid var(--bisp-border);
  padding: 0 32px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--bisp-text);
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  border-radius: var(--radius-sm);
}

.topbar-hamburger:hover {
  background: var(--bisp-bg);
}

.topbar-hamburger svg {
  width: 24px;
  height: 24px;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bisp-text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 0.8rem;
  color: var(--bisp-text-light);
  font-weight: 500;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  background: var(--bisp-navy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Content area --- */
.content-area {
  flex: 1;
  padding: 24px 32px;
  max-width: 1200px;
  width: 100%;
}

/* --- Flash messages (inside content) --- */
.flash-messages {
  margin-bottom: 16px;
}

.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.flash-success {
  background: rgba(157, 224, 85, 0.15);
  color: #1e7a1e;
  border: 1px solid rgba(157, 224, 85, 0.3);
}

.flash-error {
  background: rgba(244, 146, 125, 0.15);
  color: #c0392b;
  border: 1px solid rgba(244, 146, 125, 0.3);
}

.flash-warning {
  background: rgba(249, 204, 112, 0.2);
  color: #8b6914;
  border: 1px solid rgba(249, 204, 112, 0.3);
}

/* ============================================================
   BOTTOM NAV — Mobile only
   ============================================================ */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: white;
  border-top: 1px solid var(--bisp-border);
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--bisp-text-light);
  font-size: 0.6rem;
  font-weight: 600;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 8px 4px;
}

.nav-item .nav-icon-svg {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--bisp-orange);
}

.nav-item:hover {
  color: var(--bisp-navy);
}

/* ============================================================
   STATS — Dashboard cards
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--bisp-border-light);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.stat-departs::before { background: var(--bisp-orange); }
.stat-card.stat-arrivees::before { background: var(--bisp-blue); }
.stat-card.stat-absents::before { background: var(--bisp-coral); }

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card.stat-departs .stat-card-icon {
  background: rgba(255, 102, 51, 0.1);
  color: var(--bisp-orange);
}

.stat-card.stat-arrivees .stat-card-icon {
  background: rgba(85, 156, 245, 0.1);
  color: var(--bisp-blue);
}

.stat-card.stat-absents .stat-card-icon {
  background: rgba(244, 146, 125, 0.12);
  color: var(--bisp-coral);
}

.stat-card-icon svg {
  width: 22px;
  height: 22px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--bisp-text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--bisp-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  font-weight: 600;
}

/* ============================================================
   CARD PANEL — White container for sections
   ============================================================ */

.card-panel {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--bisp-border-light);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bisp-border-light);
}

.card-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bisp-text-light);
}

.card-panel-body {
  padding: 8px;
}

/* ============================================================
   FORM CARD — White wrapper for forms
   ============================================================ */

.form-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--bisp-border-light);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  max-width: 640px;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bisp-text-light);
  margin: 20px 0 10px;
}

/* ============================================================
   MOVEMENT CARDS
   ============================================================ */

.movement-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 2px;
  border-left: 4px solid var(--bisp-border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.15s;
}

.movement-card:hover {
  background: var(--bisp-bg);
}

.movement-card.depart {
  border-left-color: var(--bisp-orange);
}

.movement-card.arrivee {
  border-left-color: var(--bisp-blue);
}

.movement-card.new {
  animation: slideIn 0.4s ease;
}

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

.mov-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.mov-icon.depart {
  background: rgba(255, 102, 51, 0.12);
  color: var(--bisp-orange);
}

.mov-icon.arrivee {
  background: rgba(85, 156, 245, 0.12);
  color: var(--bisp-blue);
}

.mov-body {
  flex: 1;
  min-width: 0;
}

.mov-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bisp-navy);
}

.mov-class {
  font-size: 0.75rem;
  color: var(--bisp-text-light);
}

.mov-detail {
  font-size: 0.8rem;
  color: var(--bisp-text);
  margin-top: 4px;
}

.mov-time {
  font-size: 0.75rem;
  color: var(--bisp-text-light);
  font-weight: 600;
  white-space: nowrap;
}

.mov-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-depart {
  background: rgba(255, 102, 51, 0.12);
  color: var(--bisp-orange);
}

.badge-arrivee {
  background: rgba(85, 156, 245, 0.12);
  color: var(--bisp-blue);
}

.badge-absent {
  background: rgba(244, 146, 125, 0.15);
  color: #c0392b;
}

.badge-signed {
  background: rgba(157, 224, 85, 0.15);
  color: #27ae60;
}

.badge-no-sig {
  background: rgba(249, 204, 112, 0.2);
  color: #b8860b;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  margin-bottom: 18px;
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--bisp-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: var(--bisp-text);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--bisp-blue);
  box-shadow: 0 0 0 3px rgba(85, 156, 245, 0.15);
}

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

/* --- Search input --- */
.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bisp-text-light);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  border: 2px solid var(--bisp-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--bisp-blue);
  box-shadow: 0 0 0 3px rgba(85, 156, 245, 0.15);
}

/* --- Autocomplete dropdown --- */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--bisp-blue);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
}

.autocomplete-list.active {
  display: block;
}

.autocomplete-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--bisp-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: rgba(85, 156, 245, 0.08);
}

.autocomplete-item .name {
  font-weight: 600;
  color: var(--bisp-navy);
}

.autocomplete-item .class-tag {
  font-size: 0.7rem;
  color: var(--bisp-text-light);
  background: var(--bisp-gray);
  padding: 2px 8px;
  border-radius: 10px;
}

/* --- Student selected --- */
.student-selected {
  background: rgba(157, 224, 85, 0.1);
  border: 2px solid var(--bisp-green);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 16px;
}

.student-selected .authorized-info {
  flex-basis: 100%;
}

.student-selected .name {
  font-weight: 700;
  color: var(--bisp-navy);
}

.student-selected .class-tag {
  font-size: 0.75rem;
  color: var(--bisp-text-light);
}

.student-selected .remove-btn {
  background: none;
  border: none;
  color: var(--bisp-coral);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--bisp-orange);
  color: white;
}

.btn-primary:hover {
  background: #e55a2b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 102, 51, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bisp-navy);
  color: white;
}

.btn-secondary:hover {
  background: #033975;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--bisp-border);
  color: var(--bisp-text);
}

.btn-outline:hover {
  border-color: var(--bisp-navy);
  color: var(--bisp-navy);
}

.btn-danger {
  background: var(--bisp-coral);
  color: white;
}

.btn-danger:hover {
  background: #e8826c;
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.8rem;
  width: auto;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  left: auto;
  max-width: 420px;
  background: var(--bisp-navy);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transform: translateY(-120%);
  transition: transform 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.toast.show {
  transform: translateY(0);
}

.toast.success { background: #27ae60; }
.toast.error { background: #c0392b; }
.toast.warning { background: #d4a017; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px;
  background: var(--bisp-navy);
  position: relative;
  overflow: hidden;
}

.login-bg-logo {
  position: absolute;
  width: 420px;
  height: 420px;
  opacity: 0.07;
  pointer-events: none;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-logo {
  margin-bottom: 12px;
}

.login-logo img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--bisp-navy);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--bisp-text-light);
  margin-bottom: 28px;
}

.pin-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--bisp-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-align: left;
  letter-spacing: normal;
  font-weight: 500;
  font-family: inherit;
  margin-bottom: 0;
}

.pin-input:focus {
  outline: none;
  border-color: var(--bisp-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 51, 0.15);
}

/* ============================================================
   SIGNATURE PAGE
   ============================================================ */

.signature-container {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 500;
  display: flex;
  flex-direction: column;
}

.signature-header {
  background: var(--bisp-navy);
  color: white;
  padding: 14px 20px;
  text-align: center;
}

.signature-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.signature-header p {
  font-size: 0.8rem;
  opacity: 0.7;
}

.signature-canvas-wrapper {
  flex: 1;
  position: relative;
  border-bottom: 2px solid var(--bisp-border);
}

.signature-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

.signature-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bisp-border);
  font-size: 1.2rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s;
}

.signature-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  background: var(--bisp-gray);
  flex-shrink: 0;
}

.signature-actions .btn {
  flex: 1;
}

/* ============================================================
   ABSENCE CARD
   ============================================================ */

.absence-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--bisp-border-light);
  border-left: 4px solid var(--bisp-coral);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.absence-info .name {
  font-weight: 700;
  color: var(--bisp-navy);
}

.absence-info .detail {
  font-size: 0.8rem;
  color: var(--bisp-text-light);
}

/* ============================================================
   STUDENT LIST
   ============================================================ */

.student-row {
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--bisp-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.student-row .name {
  font-weight: 600;
  color: var(--bisp-navy);
}

.student-row .detail {
  font-size: 0.8rem;
  color: var(--bisp-text-light);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--bisp-text-light);
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ============================================================
   PAGE TITLE (used inside content for pages without topbar title)
   ============================================================ */

.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--bisp-navy);
  margin-bottom: 16px;
}

/* ============================================================
   MOTIF CHIPS (Absences)
   ============================================================ */

.motif-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.motif-chip {
  padding: 8px 16px;
  border: 2px solid var(--bisp-border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--bisp-text);
}

.motif-chip:hover {
  border-color: var(--bisp-navy);
}

.motif-chip.active {
  background: var(--bisp-navy);
  color: white;
  border-color: var(--bisp-navy);
}

/* ============================================================
   CLASS FILTER (Students)
   ============================================================ */

.class-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.class-chip {
  padding: 6px 12px;
  border: 1px solid var(--bisp-border);
  border-radius: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: white;
  color: var(--bisp-text-light);
  transition: all 0.2s;
  text-decoration: none;
}

.class-chip:hover,
.class-chip.active {
  background: var(--bisp-navy);
  color: white;
  border-color: var(--bisp-navy);
}

/* Dropdowns Primaire / Secondaire */
.class-filter { overflow: visible; flex-wrap: wrap; }
.class-dd { position: relative; display: inline-block; }
.class-dd > summary { list-style: none; cursor: pointer; }
.class-dd > summary::-webkit-details-marker { display: none; }
.class-dd[open] > summary { background: var(--bisp-navy); color: white; border-color: var(--bisp-navy); }
.class-dd-menu {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0;
  background: white; border: 1px solid var(--bisp-border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px;
  min-width: 190px; max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.class-dd-item {
  padding: 9px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  color: var(--bisp-text-light); text-decoration: none; white-space: nowrap;
}
.class-dd-item:hover, .class-dd-item.active { background: var(--bisp-navy); color: white; }

/* ============================================================
   UTILITIES
   ============================================================ */

/* ============================================================
   AUTHORIZED PERSONS INFO
   ============================================================ */

.authorized-info {
  background: rgba(85, 156, 245, 0.08);
  border: 1px solid rgba(85, 156, 245, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--bisp-navy);
}

.authorized-info .auth-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
  margin-top: 1px;
}

.authorized-info .auth-names {
  font-weight: 500;
  line-height: 1.4;
}

.authorized-info .auth-label {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bisp-blue);
  margin-bottom: 2px;
}

.student-row .authorized-detail {
  font-size: 0.72rem;
  color: var(--bisp-blue);
  margin-top: 2px;
}

/* ============================================================
   PENDING DEPARTURES SECTION
   ============================================================ */

.pending-section {
  background: rgba(255, 102, 51, 0.06);
  border: 2px solid var(--bisp-orange);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.pending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 102, 51, 0.08);
  border-bottom: 1px solid rgba(255, 102, 51, 0.15);
}

.pending-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bisp-orange);
}

.badge-pending {
  background: var(--bisp-orange);
  color: white;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.pending-list {
  padding: 8px;
}

.pending-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 6px;
  border-left: 4px solid var(--bisp-orange);
  box-shadow: var(--shadow);
}

.pending-card:last-child {
  margin-bottom: 0;
}

.pending-card.new {
  animation: slideIn 0.4s ease;
}

.pending-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pending-info {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   AUTHORIZATION ALERTS (pending cards + signature confirm)
   ============================================================ */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: 0.8rem;
}

.auth-alert-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 1px;
}

.auth-alert-label {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-alert-names {
  font-weight: 500;
  line-height: 1.4;
  margin-top: 2px;
}

.auth-alert.auth-info {
  background: rgba(85, 156, 245, 0.08);
  border: 1px solid rgba(85, 156, 245, 0.2);
  color: var(--bisp-navy);
}

.auth-alert.auth-info .auth-alert-label {
  color: var(--bisp-blue);
}

.auth-alert.auth-warning-red {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.2);
  color: #c0392b;
}

.auth-alert.auth-mismatch {
  background: rgba(249, 204, 112, 0.15);
  border: 1px solid rgba(249, 204, 112, 0.3);
  color: #8b6914;
}

.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--bisp-text-light); font-size: 0.85rem; }

/* ============================================================
   RESPONSIVE — Tablet (768 - 1023px)
   ============================================================ */

@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    grid-column: 1;
  }

  .topbar {
    padding: 0 20px;
  }

  .topbar-hamburger {
    display: flex;
  }

  .content-area {
    padding: 20px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (< 768px)
   ============================================================ */

@media (max-width: 767px) {
  body.has-shell {
    padding-bottom: var(--nav-height);
  }

  .bottom-nav {
    display: flex;
  }

  .content-area {
    padding: 16px;
    padding-bottom: 8px;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .topbar-date {
    display: none;
  }

  /* Stats responsive */
  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-card-icon {
    width: 32px;
    height: 32px;
  }

  .stat-card-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Form card full width on mobile */
  .form-card {
    padding: 20px 16px;
    border-radius: var(--radius-sm);
  }

  /* Card panel */
  .card-panel-header {
    padding: 12px 16px;
  }

  .card-panel-body {
    padding: 4px;
  }

  /* Toast position */
  .toast {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* ============================================================
   RESPONSIVE — Desktop (>= 1024px) - sidebar visible
   ============================================================ */

@media (min-width: 1024px) {
  .sidebar {
    transform: none;
  }

  .topbar-hamburger {
    display: none;
  }
}
