/* ============================================================
   Dugsi — Plateforme de gestion scolaire
   Design system · v4 · thème Frappe Education
   (blanc / gris / noir / bleu — inspiré de frappe-ui)
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-var.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Frappe palette (échelle Tailwind gris / bleu) */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafb;       /* gray-50 */
  --surface-3: #f3f4f6;       /* gray-100 */
  --surface-4: #e5e7eb;       /* gray-200 */
  --border: #e5e7eb;          /* gray-200 */
  --border-strong: #d1d5db;   /* gray-300 */

  --text: #111827;            /* gray-900 */
  --text-2: #374151;          /* gray-700 */
  --muted: #6b7280;           /* gray-500 */
  --faint: #9ca3af;           /* gray-400 */

  --primary: #2563eb;         /* blue-600 */
  --primary-2: #1d4ed8;       /* blue-700 */
  --primary-3: #1e40af;       /* blue-800 */
  --primary-soft: #eff6ff;    /* blue-50 */
  --primary-soft-2: #dbeafe;  /* blue-100 */
  --primary-border: #bfdbfe;  /* blue-200 */
  --accent: #2563eb;
  --accent-soft: #eff6ff;

  --success: #16a34a;         /* green-600 */
  --success-soft: #dcfce7;    /* green-100 */
  --success-text: #15803d;    /* green-700 */
  --warning: #d97706;         /* amber-600 */
  --warning-soft: #fef3c7;    /* amber-100 */
  --warning-text: #b45309;    /* amber-700 */
  --danger: #dc2626;          /* red-600 */
  --danger-soft: #fee2e2;     /* red-100 */
  --danger-text: #b91c1c;     /* red-700 */
  --info: #2563eb;
  --info-soft: #eff6ff;

  --sidebar-w: 224px;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);
  --shadow: 0 4px 10px rgba(0, 0, 0, .06);
  --shadow-lg: 0 16px 40px -16px rgba(17, 24, 39, .25);
  --grad: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --ring: 0 0 0 4px rgba(59, 130, 246, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; color: var(--text); }
svg { display: inline-block; flex-shrink: 0; }

/* ============================================================
   Structure générale
   ============================================================ */
.app { display: flex; min-height: 100vh; background: var(--bg); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============================================================
   Barre latérale — Frappe (bg gray-50, liens plats)
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface-2);
  color: var(--text-2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar .brand {
  padding: 12px 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand-logo svg { width: 18px; height: 18px; color: #fff; }
.brand-logo-img {
  width: 34px; height: 34px; flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
  border: 1px solid var(--border);
}
.brand-text { line-height: 1.3; min-width: 0; }
.brand-text b { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 14px 10px 4px; font-weight: 500;
}
.nav-label:first-child { margin-top: 2px; }
.sidebar nav a.nav-item {
  display: flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 10px; border-radius: var(--radius-sm);
  color: #1f2937; font-weight: 400; font-size: 13.5px;
  margin-bottom: 2px; position: relative;
  transition: background .12s, box-shadow .12s;
}
.sidebar nav a.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.sidebar nav a.nav-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}
.sidebar nav a.nav-item.active::before {
  content: ""; position: absolute; left: -6px; top: 5px; bottom: 5px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-ico {
  width: 20px; height: 20px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: color .12s;
}
.nav-ico svg { width: 18px; height: 18px; }
.sidebar nav a.nav-item:hover .nav-ico { color: var(--text); }
.sidebar nav a.nav-item.active .nav-ico { color: var(--primary); }

.sidebar .user-card {
  margin: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 8px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); color: #fff; font-weight: 500; font-size: 12.5px;
  display: grid; place-items: center; font-family: var(--font-display);
  overflow: hidden;
}
.avatar.has-photo { background: var(--surface-2); padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Icônes duotone : forme pâle + accent plein */
svg .i-shape { fill: currentColor; opacity: .3; }
svg .i-accent { fill: currentColor; }
.nav-ico svg .i-accent, .pillar svg .i-accent, .brand-logo svg .i-accent { opacity: .95; }
.user-card .u-name { color: var(--text); font-weight: 500; font-size: 13px; line-height: 1.25; }
.user-card .u-role { font-size: 12px; color: var(--muted); }
.user-card .logout-form { display: contents; }
.user-card a.logout, .user-card a.passwd, .user-card button.logout { display: grid; place-items: center; padding: 5px; border-radius: var(--radius-sm); transition: background .12s, color .12s; }
.user-card button.logout {
  border: none; background: none; cursor: pointer;
  width: 26px; height: 26px; padding: 0;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
}
.user-card a.passwd { margin-left: auto; color: var(--muted); }
.user-card a.logout, .user-card button.logout { color: var(--muted); }
.user-card a.logout svg, .user-card button.logout svg, .user-card a.passwd svg { width: 15px; height: 15px; }
.user-card a.logout:hover, .user-card button.logout:hover, .user-card a.passwd:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }

/* ----- Mode replié (façon Frappe Education : 52px, icônes seules) ----- */
.sidebar { transition: width .25s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1); }
.sidebar.collapsed { width: 52px; }
.sidebar.collapsed .brand { justify-content: center; padding: 14px 0 12px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .collapse-label,
.sidebar.collapsed .u-name,
.sidebar.collapsed .u-role,
.sidebar.collapsed .user-card a.passwd { display: none; }
.sidebar.collapsed nav { padding: 6px 4px; }
.sidebar.collapsed nav a.nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed nav a.nav-item.active::before { left: -4px; }
.sidebar.collapsed .user-card { justify-content: center; padding: 6px 2px; gap: 4px; }
.sidebar.collapsed .avatar { width: 28px; height: 28px; font-size: 11px; }
.sidebar.collapsed .user-card a.logout, .sidebar.collapsed .user-card button.logout { padding: 4px; }
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .collapse-btn { justify-content: center; padding: 0; }
.sidebar.collapsed [data-tip]::after { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); bottom: auto; right: auto; }
.sidebar.collapsed [data-tip]::before { left: calc(100% + 4px); top: 50%; transform: translateY(-50%); bottom: auto; right: auto; }

.collapse-btn {
  display: flex; align-items: center; gap: 8px;
  height: 28px; margin: 6px 8px; padding: 0 10px; border: none; cursor: pointer;
  border-radius: var(--radius-sm); background: transparent;
  color: #1f2937; font-size: 13.5px; font-family: var(--font-body);
  transition: background .12s, color .12s;
}
.collapse-btn:hover { background: var(--surface-3); color: var(--text); }
.collapse-btn .nav-ico svg { transition: transform .2s; }
.collapse-btn .collapse-label { color: #1f2937; font-size: 13.5px; }

.overlay { display: none; }

/* ============================================================
   Barre supérieure — Frappe (navbar blanche h-12)
   ============================================================ */
.topbar {
  padding: 0 20px;
  height: 48px;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { min-width: 0; }
.topbar-title .crumb { font-size: 12px; color: var(--muted); margin-bottom: 0; }
.topbar-title .crumb:empty { display: none; }
.topbar h1 { font-size: 18px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn {
  display: none;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; color: var(--text-2); place-items: center;
  flex-shrink: 0;
}
.menu-btn svg { width: 18px; height: 18px; }
.menu-btn:hover { background: var(--surface-2); color: var(--text); }
.year-badge {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-3); color: var(--text-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.year-badge svg { width: 13px; height: 13px; color: var(--muted); }

.content { padding: 20px 24px 48px; flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; }

/* ====== Bannière d'accueil ====== */
.hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, #eff6ff 0%, #f9fafb 60%, #ffffff 100%);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.hero-text { position: relative; z-index: 2; flex: 1; min-width: 240px; }
.hero-text h2 { font-size: 18px; font-weight: 600; color: var(--text); }
.hero-text p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.hero-text p b { color: var(--text); }
.hero-badge { position: relative; z-index: 2; margin-left: auto; }
.hero-badge .badge { background: var(--surface); color: var(--primary); border: 1px solid var(--primary-border); }

/* ============================================================
   Cartes KPI
   ============================================================ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow .14s, border-color .14s;
  position: relative; overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.kpi { display: flex; align-items: flex-start; gap: 12px; }
.kpi-ico {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center;
}
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-ico.blue { background: var(--primary-soft); color: var(--primary); }
.kpi-ico.green { background: var(--success-soft); color: var(--success); }
.kpi-ico.amber { background: var(--warning-soft); color: var(--warning); }
.kpi-ico.red { background: var(--danger-soft); color: var(--danger); }
.kpi-ico.teal { background: #ecfdf5; color: #059669; }
.kpi .num { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.15; }
.kpi .num .unit { font-size: 12px; color: var(--muted); font-family: var(--font-body); font-weight: 500; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.kpi-group { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-group .kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 15px;
}
.kpi .num.danger { color: var(--danger); }
.danger { color: var(--danger); }
.success { color: var(--success); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.danger { border-color: var(--danger-soft); color: var(--danger-text); background: var(--danger-soft); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form input {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 13.5px;
  background: var(--surface);
}
.inline-form input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  cursor: pointer;
  background: var(--surface);
  font-weight: 500;
  font-size: 13px;
  transition: all .12s;
  user-select: none;
}
.weekday input { display: none; }
.weekday:hover { border-color: var(--primary); color: var(--primary); }
.weekday.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   Panneaux
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.panel-head h2, .panel-head .ptitle { font-size: 14.5px; font-weight: 500; }
.panel-head .pdesc { font-size: 12px; color: var(--muted); }
.panel-head .grow { flex: 1; }
.panel-head .panel-ico {
  width: 26px; height: 26px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.panel-head .panel-ico svg { width: 14px; height: 14px; }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--muted); }

/* ============================================================
   Tableaux — style liste Frappe (ListView / ListRow)
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 500;
  padding: 10px 16px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #f8fafc; }
table tbody tr:focus-within td { background: var(--primary-soft); }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.td-center { text-align: center; }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.td-actions form { display: inline; margin: 0; }
tbody tr.row-link { cursor: pointer; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar.small { width: 30px; height: 30px; font-size: 11px; }
.avatar.md { width: 44px; height: 44px; font-size: 15px; }
.cell-title b { display: block; font-weight: 500; color: var(--text); line-height: 1.3; }
.cell-title span { font-size: 12px; color: var(--muted); }
.cell-user .cell-title { min-width: 0; }
.cell-user .cell-title b, .cell-user .cell-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Badges — Frappe (pill, subtle)
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge.actif, .badge.present { background: var(--success-soft); color: var(--success-text); }
.badge.absent, .badge.radie { background: var(--danger-soft); color: var(--danger-text); }
.badge.retard, .badge.transfert { background: var(--warning-soft); color: var(--warning-text); }
.badge.justifie { background: var(--primary-soft-2); color: var(--primary-2); }
.badge.neutre, .badge { background: var(--surface-3); color: var(--text-2); }
.badge.poste { background: var(--primary-soft-2); color: var(--primary-2); }
.class-card .cc-top > .badge { margin-left: auto; }
.badge.role-admin { background: var(--danger-soft); color: var(--danger-text); }
.badge.role-enseignant { background: var(--primary-soft-2); color: var(--primary-2); }
.badge.role-secretaire { background: var(--warning-soft); color: var(--warning-text); }
.badge.role-parent { background: #ecfdf5; color: #047857; }

/* ============================================================
   Boutons — FrappeUI
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500;
  background: var(--primary); color: #fff;
  text-decoration: none; line-height: 1.4;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-2); color: #fff; text-decoration: none; }
.btn:active { background: var(--primary-3); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.primary:active { background: var(--primary-3); }
.btn.secondary {
  background: var(--surface-3); color: var(--text-2);
  border-color: transparent;
}
.btn.secondary:hover { background: var(--surface-4); color: var(--text); }
.btn.outline {
  background: var(--surface); color: var(--text-2);
  border-color: var(--border-strong);
}
.btn.outline:hover { border-color: var(--faint); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: var(--danger-text); }
.btn.warning { background: var(--warning); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn.small svg { width: 13px; height: 13px; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); color: var(--primary-2); }
.btn-block { width: 100%; height: 40px; font-size: 14px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.right { margin-left: auto; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Formulaires — FrappeUI TextInput
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.field textarea { height: auto; padding: 9px 11px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.field textarea { resize: vertical; min-height: 84px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.input-ico { position: relative; }
.input-ico > svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--faint); pointer-events: none;
}
.input-ico input { padding-left: 36px; }
.input-ico select { padding-left: 36px; }

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 18px;
}
.toolbar input, .toolbar select {
  height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: var(--surface); color: var(--text);
}
.toolbar input:hover, .toolbar select:hover { border-color: var(--border-strong); }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.toolbar .input-ico input { padding-left: 36px; }
.toolbar .spacer, .spacer { flex: 1; }

/* Sélecteur segmenté (matin / après-midi) */
.segmented { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px 13px; border-radius: 4px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all .12s;
}
.segmented label:has(input:checked) span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Réinitialisation de mot de passe (détails) */
details.reset-pass summary { list-style: none; cursor: pointer; }
details.reset-pass summary::-webkit-details-marker { display: none; }
details.reset-pass[open] summary { background: var(--primary-soft); color: var(--primary); }
details.reset-pass[open] form input { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; flex: 1; min-width: 160px; }
details.reset-pass[open] form input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* ============================================================
   Alertes
   ============================================================ */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
  animation: fadeIn .2s ease;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert.error { background: var(--danger-soft); color: var(--danger-text); border-color: #fecaca; }
.alert.success { background: var(--success-soft); color: var(--success-text); border-color: #bbf7d0; }
.alert.info { background: var(--primary-soft); color: var(--primary-2); border-color: var(--primary-border); }
.alert.warning { background: var(--warning-soft); color: var(--warning-text); border-color: #fde68a; }

/* ============================================================
   Page de connexion — Frappe (blanc / gris / bleu)
   ============================================================ */
.login-body {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
}
.login-brand {
  background:
    linear-gradient(165deg, rgba(250,251,252,.34) 0%, rgba(239,246,255,.26) 55%, rgba(249,250,251,.32) 100%),
    url('/static/eleves.jpg') center / cover no-repeat;
  color: var(--text);
  padding: 40px 48px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--border);
}
.login-brand::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.08), transparent 65%);
  top: -140px; right: -120px;
}
.login-brand .lbl-top, .login-brand .lbl-bottom { position: relative; z-index: 2; }
.login-brand .lbl-mid { position: relative; z-index: 2; }
.ministry-line { display: flex; align-items: center; gap: 12px; }
.ministry-line b, .logo-mobile b { display: block; font-family: var(--font-display); font-size: 14px; line-height: 1.25; color: var(--text); }
.ministry-line span, .logo-mobile span { font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.ministry-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; padding: 2px; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.school-line { margin-top: 18px; font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.school-line::before { content: ""; width: 22px; height: 3px; border-radius: 99px; background: var(--primary); }
.brand-link {
  display: inline-flex; align-items: center; gap: 14px;
  text-decoration: none; transition: transform .15s ease;
}
.brand-link:hover { transform: translateY(-1px); text-decoration: none; }
.brand-img {
  height: 54px; width: auto; display: block;
  filter: drop-shadow(0 4px 10px rgba(15, 118, 110, .25));
  transition: transform .15s ease;
}
.brand-link:hover .brand-img { transform: scale(1.02); }
.brand-img.brand-home { height: 80px; }
.login-brand .mini-logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); }
.login-brand h1 { font-size: 28px; line-height: 1.22; margin: 22px 0 12px; font-weight: 600; color: var(--text); }
.login-brand p.lead { color: var(--text-2); font-size: 14.5px; max-width: 440px; line-height: 1.6; }
.login-brand p.lead-sub { color: var(--muted); font-size: 12.5px; max-width: 440px; margin-top: 14px; line-height: 1.55; }
.login-brand .pillars { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.login-brand .pillar {
  background: rgba(255,255,255,.85); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 13px; font-size: 12.5px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; color: var(--text-2);
}
.login-brand .pillar svg { width: 15px; height: 15px; color: var(--primary); }
.login-brand .lbl-bottom { color: var(--muted); font-size: 12px; }

.login-panel {
  display: flex; align-items: center; justify-content: center; padding: 32px 36px;
  background:
    radial-gradient(circle at 12% 18%, rgba(37,99,235,.055), transparent 55%),
    linear-gradient(160deg, #fbfcfe 0%, #f5f7fb 100%);
}
.login-panel:only-child { grid-column: 1 / -1; }
.login-card {
  width: 100%; max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .3s ease;
}
.login-card .logo-mobile { display: none; }
.login-card .logo-mobile img { height: 42px; width: auto; display: block; }
.login-card h2 { font-size: 21px; font-weight: 600; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; }
.login-card .field { margin-bottom: 12px; }
.login-card .field input { height: 32px; padding: 0 10px; font-size: 13px; }
.login-card .input-ico input { padding-left: 34px; }
.login-card .btn-block { margin-top: 6px; }
.login-card .btn-block svg { transition: transform .15s ease; }
.login-card .btn-block:hover svg { transform: translateX(3px); }
.login-footnote { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.unlock-ico {
  width: 52px; height: 52px; border-radius: var(--radius); margin-bottom: 18px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.unlock-ico svg { width: 26px; height: 26px; }

/* ============================================================
   Feuille de présence
   ============================================================ */
.att-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 2px; border-bottom: 1px solid var(--border);
}
.att-row:last-child { border-bottom: none; }
.att-row .name { flex: 1; min-width: 200px; }
.att-row .name b { color: var(--text); font-weight: 500; }
.att-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.att-pills label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: all .12s;
}
.att-pills label:hover { border-color: var(--primary); color: var(--primary); }
.att-pills input { display: none; }
.att-pills label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.att-pills label:has(input:checked).p-absent { border-color: var(--danger); background: var(--danger-soft); color: var(--danger-text); }
.att-pills label:has(input:checked).p-retard { border-color: var(--warning); background: var(--warning-soft); color: var(--warning-text); }
.att-pills label:has(input:checked).p-present { border-color: var(--success); background: var(--success-soft); color: var(--success-text); }
.att-stats { display: flex; gap: 10px; flex-wrap: wrap; }

.note-input { width: 84px; text-align: center; padding: 0 8px !important; font-weight: 500; }
.fee-input { width: 110px; text-align: right; padding: 0 8px !important; font-weight: 500; }

/* ============================================================
   Graphiques
   ============================================================ */
.donut { position: relative; width: 150px; height: 150px; border-radius: 50%; margin: 0 auto; }
.donut-center {
  position: absolute; inset: 20px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; text-align: center;
  box-shadow: var(--shadow-sm);
}
.donut-center b { font-family: var(--font-display); font-size: 22px; display: block; line-height: 1; }
.donut-center span { font-size: 11px; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 44px; gap: 12px; align-items: center; font-size: 13px; }
.bar-track { background: var(--surface-3); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--grad); width: 0; transition: width .8s ease; }
.bar-num { text-align: right; font-weight: 500; font-family: var(--font-display); color: var(--text-2); }

.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-item b { margin-left: auto; color: var(--text); font-family: var(--font-display); }

/* ----- Calendrier mensuel des présences (façon Frappe Education) ----- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 16px 22px 22px;
}
.cal-head {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; text-align: center; padding-bottom: 4px;
}
.cal-cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-end;
  min-height: 84px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
a.cal-cell { color: var(--text); }
a.cal-cell:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); text-decoration: none; }
.cal-cell.out { background: var(--surface-2); opacity: .5; pointer-events: none; }
.cal-cell.off { background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.cal-num { font-size: 12.5px; font-weight: 500; color: var(--text-2); line-height: 1; }
.cal-cell.off .cal-num { color: var(--muted); }
.cal-num.today {
  color: #fff; background: var(--primary); border-radius: 50%;
  width: 21px; height: 21px; display: grid; place-items: center; font-size: 11.5px;
}
.cal-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-top: 8px; }
.chip { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.chip.absent { background: var(--danger-soft); color: var(--danger-text); }
.chip.retard { background: var(--warning-soft); color: var(--warning-text); }
.cal-cell.present { background: var(--success-soft); border-color: rgba(22, 163, 74, .3); }
.cal-cell.absent { background: var(--danger-soft); border-color: rgba(220, 38, 38, .3); }
.cal-cell.retard { background: var(--warning-soft); border-color: rgba(245, 158, 11, .35); }
.legend-item i.sw.present { background: var(--success); }
.legend-item i.sw.retard { background: var(--warning); }
.legend-item i.sw.absent { background: var(--danger); }

/* ============================================================
   Accès rapide
   ============================================================ */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.quick {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 500; font-size: 13.5px;
  transition: border-color .12s, box-shadow .12s;
}
.quick:hover { box-shadow: var(--shadow); border-color: var(--primary-border); color: var(--primary); text-decoration: none; }
.quick .q-ico {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.quick .q-ico svg { width: 16px; height: 16px; }
.quick small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }

/* ============================================================
   Fiche élève / détail
   ============================================================ */
.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.detail-hero .avatar.lg { width: 54px; height: 54px; font-size: 20px; }
.detail-hero h2 { font-size: 18px; }
.detail-hero .meta { color: var(--muted); font-size: 12.5px; }
.detail-hero .hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; }
.kv { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
.kv .v { font-size: 13.5px; font-weight: 500; color: var(--text); margin-top: 2px; word-break: break-word; }

/* ============================================================
   Cartes classe (grille)
   ============================================================ */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.class-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; position: relative; overflow: hidden;
  transition: box-shadow .14s, border-color .14s;
}
.class-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.class-card .cc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.class-card .cc-ico {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: var(--shadow-sm);
}
.class-card .cc-ico svg { width: 18px; height: 18px; }
.class-card h3 { font-size: 15.5px; }
.class-card .cc-sub { font-size: 12px; color: var(--muted); }
.class-card .cc-progress { margin: 6px 0 12px; }
.class-card .cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.class-card .cc-num { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.class-card .cc-num span { font-size: 12px; color: var(--muted); font-family: var(--font-body); font-weight: 400; }

/* Barre de progression simple */
.progress { background: var(--surface-3); border-radius: 999px; height: 8px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }

/* Grille à deux colonnes */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-2col .panel { margin-bottom: 0; }
@media (max-width: 900px) { .grid-2col { grid-template-columns: 1fr; } }

/* ============================================================
   Divers
   ============================================================ */
.muted { color: var(--muted); }
.flex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 28px; }
.empty svg { width: 28px; height: 28px; opacity: .3; margin-bottom: 6px; }
.rank-medal {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; font-weight: 600; font-family: var(--font-display);
  background: var(--surface-3); color: var(--text-2); font-size: 12px;
}
.rank-medal.r1 { background: #fef3c7; color: #b45309; }
.rank-medal.r2 { background: #f3f4f6; color: #4b5563; }
.rank-medal.r3 { background: #fde8e8; color: #b91c1c; }
pre.code-block { background: var(--surface-2); border: 1px solid var(--border); padding: 12px; border-radius: var(--radius-sm); font-size: 12.5px; overflow-x: auto; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================================================
   Sélecteur de photo (élèves, enseignants, profil)
   ============================================================ */
.photo-picker { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.photo-picker .photo-preview {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); background: var(--surface-2); flex-shrink: 0;
}
.photo-preview.placeholder {
  display: grid; place-items: center; color: var(--muted);
}
.photo-preview.placeholder svg { width: 28px; height: 28px; }
.profile-avatar .avatar { width: 72px; height: 72px; font-size: 26px; }
.photo-picker .photo-input {
  display: block; width: 100%; font-size: 12.5px; color: var(--muted);
}
.photo-picker .photo-input::file-selector-button {
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 500; cursor: pointer;
  margin-right: 12px; font-size: 12.5px;
}
.photo-picker .photo-input::file-selector-button:hover { background: var(--surface-4); }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 10px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Infobulles (survol des boutons icônes)
   ============================================================ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1f2937; color: #fff;
  font-size: 11.5px; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .14s, transform .14s;
  z-index: 70; box-shadow: var(--shadow-lg);
}
[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1f2937;
  opacity: 0; transition: opacity .14s; z-index: 70;
}
[data-tip]:hover::after, [data-tip]:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }
.sidebar.collapsed [data-tip]:hover::after,
.sidebar.collapsed [data-tip]:hover::before { transform: translateY(-50%); }

/* ============================================================
   Boîtes de dialogue — Frappe Dialog
   ============================================================ */
.dialog-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 24, 39, .5);
  display: grid; place-items: center; padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
  backdrop-filter: blur(2px);
}
.dialog-overlay.open { opacity: 1; pointer-events: auto; }
.dialog {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 500px;
  max-height: 92vh; overflow: auto;
  transform: translateY(10px) scale(.98);
  transition: transform .18s ease;
}
.dialog-overlay.open .dialog { transform: none; }
.dialog-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.dialog-head .dlg-ico {
  width: 28px; height: 28px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.dialog-head .dlg-ico svg { width: 15px; height: 15px; }
.dialog-head h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.dialog-head .close {
  margin-left: auto; width: 28px; height: 28px; flex-shrink: 0;
  border: none; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--muted); display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.dialog-head .close:hover { background: var(--surface-3); color: var(--text); }
.dialog-head .close svg { width: 16px; height: 16px; }
.dialog-body { padding: 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.dialog-body .field { margin-bottom: 12px; }
.dialog-body .field:last-child { margin-bottom: 0; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 10px 10px;
  position: sticky; bottom: 0; z-index: 2;
}
.dialog-foot .btn { height: 32px; }
.dialog-msg { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.dialog-msg svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.dialog-msg.warning { color: var(--warning-text); }
.dialog-msg.danger { color: var(--danger-text); }

/* ============================================================
   Responsive — tablette / mobile
   ============================================================ */
@media (max-width: 1000px) {
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100dvh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .overlay {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(17, 24, 39, .45); opacity: 0; pointer-events: none;
    transition: opacity .25s;
    backdrop-filter: blur(2px);
  }
  body.sidebar-open .overlay { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 40px; }
}

@media (max-width: 760px) {
  .login-body { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 28px 22px; }
  .login-card .logo-mobile { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
  .login-card .logo-mobile span { color: var(--muted); }
  .cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  .bar-row { grid-template-columns: 96px 1fr 38px; }
  .year-badge { font-size: 11px; padding: 3px 9px; }
  .panel-body { padding: 14px 16px; }
  .panel-head { padding: 11px 14px; }
  thead th, tbody td { padding: 9px 12px; }
  .detail-hero { padding: 14px 16px; }
  .hero-actions { margin-left: 0 !important; width: 100%; }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .kpi .num { font-size: 19px; }
  .kpi-ico { width: 32px; height: 32px; }
  .kpi-ico svg { width: 16px; height: 16px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Carnet d'évaluation
   ============================================================ */
.carnet-domain { background: #fdf3d0; }
.carnet-domain .ptitle { color: #7a5b00; }
.progress-bar { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
th.center, td.center { text-align: center; }
th.right, td.right { text-align: right; }
.table-wrap td.small { font-size: 12.5px; color: var(--text-2); }
.kv .v.accent { font-weight: 700; color: var(--primary); }

/* ============================================================
   Impression
   ============================================================ */
@media print {
  .sidebar, .topbar, .menu-btn, .actions, .toolbar, .btn, .badge, .alert, .hero-actions { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: 100%; }
  body { background: #fff; }
  .panel, .card { box-shadow: none; border-color: #ddd; }
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft, #e5e7eb);
}
.page-btn {
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: #fff;
  border: 1px solid var(--border-strong, #d1d5db);
  border-radius: 8px;
  text-decoration: none;
}
.page-btn:hover { background: var(--primary, #2563eb); color: #fff; }
.page-btn.disabled { opacity: .45; pointer-events: none; }
.page-info { font-size: 13px; color: var(--muted, #6b7280); }
