/* ============================================================
   Feldenkrais Education — Design System
   Refined for warmth, clarity, and considered craft
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --- Design tokens ----------------------------------------- */
:root {
  color-scheme: light;

  /* Palette — warmed-up neutrals */
  --bg: #f5f6f4;
  --panel: #ffffff;
  --ink: #1a2732;
  --ink-soft: #2d3e4a;
  --muted: #64748b;
  --accent: #0d8a76;
  --accent-hover: #0b7566;
  --accent-2: #1e5ea0;
  --accent-soft: #def4f0;
  --border: #e2e6e0;
  --border-strong: #cdd3ca;
  --success-bg: #e5f7ee;
  --success-ink: #0f6b43;
  --warning-bg: #fff3df;
  --warning-ink: #8d5200;
  --danger-bg: #fde8e8;
  --danger-ink: #9e2f2f;
  --info-bg: #e6f2ff;
  --info-ink: #1f5ea8;
  --muted-bg: #f0f2ee;
  --muted-ink: #4b5b68;

  /* Location palette */
  --loc-brussels: #1e5ea0;
  --loc-brussels-tint: #e8f0fa;
  --loc-brussels-border: #b5d0ec;
  --loc-cantal: #e67e22;
  --loc-cantal-tint: #fdf0e2;
  --loc-cantal-border: #f0c891;
  --loc-paris: #8B2252;
  --loc-paris-tint: #f5e6ed;
  --loc-paris-border: #d4a0b8;
  --loc-unknown: var(--muted);
  --loc-unknown-tint: var(--muted-bg);
  --loc-unknown-border: #d9e1e9;

  /* Sidebar */
  --sidebar-bg: #f9faf8;
  --sidebar-border: var(--border);
  --sidebar-ink: var(--ink);
  --sidebar-muted: var(--muted);
  --sidebar-active-bg: var(--accent-soft);
  --sidebar-active-ink: var(--accent);
  --sidebar-hover-bg: #eef1ec;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Type scale */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.8125rem;   /* 13px */
  --text-base: 0.875rem;  /* 14px */
  --text-md: 1rem;        /* 16px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 1.75rem;    /* 28px */

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows — layered for depth */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-focus: 0 0 0 3px rgba(13, 138, 118, 0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", "Helvetica Neue", "Segoe UI", "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- App shell --------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}
.app-shell.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

/* --- Sidebar ----------------------------------------------- */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: var(--sp-4) var(--sp-2) var(--sp-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

.brand {
  margin: var(--sp-2) var(--sp-3) var(--sp-6);
}
.brand-logo {
  display: block;
  max-width: 180px;
  height: auto;
}
.nav-group {
  margin-bottom: var(--sp-4);
}
.nav-group-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: var(--sp-1) var(--sp-3) var(--sp-2);
  font-weight: 600;
  opacity: 0.8;
}
.nav-group a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--ink-soft);
  padding: 7px var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out), transform 80ms ease;
  margin-bottom: 1px;
}
.nav-group a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--ink);
}
.nav-group a:active {
  transform: scale(0.98);
}
.nav-group a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-ink);
  font-weight: 600;
}
.nav-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  opacity: 0.7;
}
.nav-group a.active .nav-icon {
  opacity: 1;
}
.nav-label {
  flex: 1;
  min-width: 0;
}
.sidebar-footer {
  margin-top: auto;
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
  border-top: 1px solid var(--border);
}
.sidebar-footer .user {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.sidebar-footer a {
  display: inline-block;
  text-decoration: none;
  font-size: var(--text-sm);
  color: var(--accent-2);
  font-weight: 500;
  margin-right: var(--sp-3);
}
.sidebar-footer a:hover {
  text-decoration: underline;
}

/* --- Mobile topbar ----------------------------------------- */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
}
.mobile-brand {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.mobile-nav {
  color: var(--ink);
}
.mobile-nav summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 6px var(--sp-3);
  transition: box-shadow 150ms ease;
}
.mobile-nav summary:hover {
  box-shadow: var(--shadow-sm);
}
.mobile-nav summary::-webkit-details-marker {
  display: none;
}
.mobile-nav nav {
  margin-top: var(--sp-2);
  width: min(86vw, 320px);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: absolute;
  right: var(--sp-4);
  z-index: 100;
}
.mobile-nav nav a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  transition: background 120ms ease;
}
.mobile-nav nav a:last-child { border-bottom: 0; }
.mobile-nav nav a:hover { background: var(--sidebar-hover-bg); }
.mobile-nav nav a.active {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--accent);
}

/* --- Content area ------------------------------------------ */
.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  max-width: 1160px;
  margin: var(--sp-6) auto var(--sp-10);
  padding: 0 var(--sp-6);
  width: 100%;
}

/* --- Page header ------------------------------------------- */
.page-header {
  margin-bottom: var(--sp-6);
}
.page-header h1 {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-1);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.page-header .subtitle {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0;
  line-height: 1.5;
}
.page-header .page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* --- Breadcrumbs ------------------------------------------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--sp-3);
}
.breadcrumbs a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumbs a:hover { text-decoration: underline; }

/* --- Flash messages ---------------------------------------- */
.flash-list { margin-bottom: var(--sp-4); }
.flash {
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-2);
  border: 1px solid var(--border);
  background: #fefce8;
  color: #854d0e;
  font-size: var(--text-sm);
  animation: flash-in 300ms var(--ease-out) both;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash.error {
  background: var(--danger-bg);
  border-color: #f3b4b4;
  color: var(--danger-ink);
}
.flash.success {
  background: var(--success-bg);
  border-color: #9cc9b0;
  color: var(--success-ink);
}

/* --- Panels / cards ---------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.panel-compact {
  padding: var(--sp-3) var(--sp-4);
}
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  flex-wrap: wrap;
}
.panel-warning {
  border-left: 3px solid #f2af4a;
  background: #fffbf5;
}
.panel-danger {
  border-left: 3px solid #e87171;
  background: #fef5f5;
}
.panel-success {
  border-left: 3px solid #4ca67a;
  background: #f5fcf8;
}
.panel-hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}
.panel-muted {
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
}

/* --- Login page -------------------------------------------- */
body.login-page main {
  max-width: 400px;
  margin: var(--sp-10) auto;
  padding: 0 var(--sp-4);
}
body.login-page .login-panel {
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  margin-bottom: 0;
  box-shadow: var(--shadow-md);
}
body.login-page .login-panel h1 {
  font-size: var(--text-lg);
  margin-bottom: var(--sp-4);
}
body.login-page .login-panel p {
  margin: 0 0 var(--sp-2);
}
body.login-page .login-panel label {
  display: block;
  margin-bottom: var(--sp-1);
  font-size: var(--text-sm);
  color: var(--muted);
}
body.login-page .login-panel input[type="text"],
body.login-page .login-panel input[type="password"],
body.login-page .login-panel input[type="email"] {
  padding: var(--sp-2) var(--sp-3);
  min-height: 36px;
}
body.login-page .login-panel .actions {
  margin-top: var(--sp-4);
}
body.login-page .login-panel .btn {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
}

/* --- Typography -------------------------------------------- */
h1, h2, h3 {
  margin-top: 0;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.3;
}
h1 {
  margin-bottom: var(--sp-2);
  font-size: var(--text-lg);
  font-weight: 700;
}
h2 {
  margin-bottom: var(--sp-2);
  font-size: var(--text-md);
  font-weight: 600;
}
h3 {
  font-size: var(--text-base);
  font-weight: 600;
}
.muted {
  color: var(--muted);
  font-size: var(--text-sm);
}
p.muted, div.muted { line-height: 1.55; }

/* Helper text colors */
.text-success { color: var(--success-ink); font-weight: 600; }
.text-warning { color: var(--warning-ink); font-weight: 600; }
.text-danger  { color: var(--danger-ink); font-weight: 600; }

/* --- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 7px 15px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 1px solid var(--accent);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms var(--ease-out);
  line-height: 1.4;
  font-family: inherit;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(13, 138, 118, 0.18);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn.secondary,
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn.secondary:hover,
.btn.ghost:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}
.btn.danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}
.btn.mini {
  padding: 3px 8px;
  font-size: var(--text-xs);
  line-height: 1.2;
  border-radius: var(--radius-sm);
}
.actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}
.header-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}
.actions.compact-actions {
  margin-top: var(--sp-3);
  gap: var(--sp-2);
}
.actions.compact-actions .btn {
  padding: 6px var(--sp-3);
  font-size: var(--text-sm);
}
.back-link {
  margin-left: auto;
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  font-size: var(--text-sm);
  padding-top: 2px;
}
.back-link::before { content: "\2190  "; }
.back-link:hover { text-decoration: underline; }
.link-action {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.link-action:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }
.icon-btn {
  min-width: 32px;
  padding: 4px var(--sp-2);
  font-size: var(--text-base);
  line-height: 1;
  text-align: center;
}
.text-danger-link {
  color: var(--danger-ink);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
}
.text-danger-link:hover { text-decoration: underline; }

/* --- Tables ------------------------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-3);
  font-size: var(--text-sm);
}
th, td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  vertical-align: top;
}
th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  background: transparent;
  white-space: nowrap;
}
td {
  border-bottom: 1px solid var(--muted-bg);
}
tbody tr {
  transition: background 80ms ease;
}
tbody tr:hover td {
  background: #f8faf7;
}
.row-actions {
  opacity: 0;
  transition: opacity 120ms ease;
  white-space: nowrap;
}
tr:hover .row-actions {
  opacity: 1;
}
.table-compact { margin-top: var(--sp-2); }
.table-compact th,
.table-compact td {
  padding: 5px var(--sp-2);
  font-size: var(--text-xs);
}
.table-compact th {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}
.table-compact .btn {
  padding: 3px var(--sp-2);
  font-size: var(--text-xs);
}

/* --- Forms ------------------------------------------------- */
label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-1);
}
input, select, textarea {
  width: 100%;
  padding: 8px var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: white;
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  color: var(--ink);
}
.inline-select {
  width: auto;
  padding: 4px 8px;
  font-size: var(--text-sm);
}
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.filter-bar label {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
input[type="checkbox"], input[type="radio"] {
  width: auto;
  padding: 0;
}
textarea { min-height: 100px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-2);
  align-items: start;
}
.form-grid-compact > p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.form-grid-compact label {
  margin-top: 0;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-grid-compact input,
.form-grid-compact select,
.form-grid-compact textarea {
  padding: 6px var(--sp-2);
  font-size: var(--text-sm);
}
.form-grid-compact textarea {
  min-height: 80px;
}
.form-grid-compact input[type="checkbox"],
.form-grid-compact input[type="radio"] {
  margin-top: var(--sp-2);
  box-shadow: none;
}
.form-grid-compact .helptext {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.3;
}
.form-grid-compact .errorlist {
  margin: 0;
  padding-left: var(--sp-4);
  color: var(--danger-ink);
  font-size: var(--text-xs);
}

/* --- KPI cards --------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: var(--sp-4) var(--sp-3);
  position: relative;
  overflow: hidden;
  transition: box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-card h3 {
  margin: 0;
  font-size: var(--text-2xl);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kpi-card p {
  margin: var(--sp-2) 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* --- Mini-list --------------------------------------------- */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.mini-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.mini-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.mini-item .title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
}

/* --- Progress ring ----------------------------------------- */
.progress-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress, 0deg), #e5edf5 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 200ms var(--ease-out);
}
.progress-ring:hover {
  transform: scale(1.04);
}
.progress-ring.location-cantal {
  background: conic-gradient(#e67e22 var(--progress, 0deg), #e5edf5 0);
}
.progress-ring.location-brussels {
  background: conic-gradient(#1e5ea0 var(--progress, 0deg), #e5edf5 0);
}
.progress-ring.location-paris {
  background: conic-gradient(#8B2252 var(--progress, 0deg), #e5edf5 0);
}
.location-filter {
  display: flex;
  gap: var(--sp-1);
}
.location-filter .btn {
  font-size: var(--text-xs);
  padding: 3px 10px;
}
.progress-ring .inner {
  width: 60px;
  height: 60px;
  background: #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  font-size: var(--text-sm);
  border: 1px solid var(--border);
}

/* --- Cohort progress card ---------------------------------- */
.cohort-progress-card {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  background: var(--panel);
  margin-bottom: var(--sp-2);
  transition: box-shadow 200ms var(--ease-out), border-color 200ms ease;
}
.cohort-progress-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.cohort-progress-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cohort-progress-meta .title {
  font-weight: 600;
  color: var(--ink);
  font-size: var(--text-base);
}
.cohort-progress-meta .muted {
  font-size: var(--text-xs);
}

/* --- Chips / badges ---------------------------------------- */
.badge {
  padding: 3px var(--sp-2);
  border-radius: 999px;
  background: var(--muted-bg);
  font-size: var(--text-xs);
  font-weight: 600;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  border-radius: 999px;
  padding: 2px var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  text-transform: uppercase;
  line-height: 1.4;
}
.chip-success { background: var(--success-bg); color: var(--success-ink); border-color: #bde8cf; }
.chip-warning { background: var(--warning-bg); color: var(--warning-ink); border-color: #ffdca6; }
.chip-danger  { background: var(--danger-bg);  color: var(--danger-ink);  border-color: #f3b4b4; }
.chip-info    { background: var(--info-bg);    color: var(--info-ink);    border-color: #b5d4f4; }
.chip-muted   { background: var(--muted-bg);   color: var(--muted-ink);  border-color: #d9e1e9; }
.chip-certified {
  background: #eaf7ef;
  color: #165a3a;
  border-color: #b8dfc7;
}
.chip-token {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1f9f64;
  border: 1px solid #17784b;
  flex: 0 0 auto;
}
.cert-corner-anchor {
  position: relative;
}
.cert-corner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}
.cert-corner-anchor.has-cert-badge {
  padding-top: 16px;
}
.cert-corner-anchor.has-cert-badge .pipeline-card-label {
  padding-right: 96px;
}

/* --- Location badges --------------------------------------- */
.loc-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  border-radius: 999px;
  padding: 1px var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  vertical-align: middle;
}
.loc-badge-brussels {
  background: var(--loc-brussels-tint);
  color: var(--loc-brussels);
  border: 1px solid var(--loc-brussels-border);
}
.loc-badge-cantal {
  background: var(--loc-cantal-tint);
  color: var(--loc-cantal);
  border: 1px solid var(--loc-cantal-border);
}
.loc-badge-paris {
  background: var(--loc-paris-tint);
  color: var(--loc-paris);
  border: 1px solid var(--loc-paris-border);
}
.loc-badge-unknown {
  background: var(--loc-unknown-tint);
  color: var(--loc-unknown);
  border: 1px solid var(--loc-unknown-border);
}

/* Location dot — tiny color indicator for compact contexts */
.loc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 3px;
}
.loc-dot-brussels { background: var(--loc-brussels); }
.loc-dot-cantal  { background: var(--loc-cantal); }
.loc-dot-paris   { background: var(--loc-paris); }
.loc-dot-unknown { background: var(--loc-unknown); }

/* Location page tint — subtle top border on page-header */
.page-header.loc-tint-brussels { border-top: 3px solid var(--loc-brussels); padding-top: var(--sp-2); }
.page-header.loc-tint-cantal  { border-top: 3px solid var(--loc-cantal); padding-top: var(--sp-2); }
.page-header.loc-tint-paris   { border-top: 3px solid var(--loc-paris); padding-top: var(--sp-2); }
.page-header.loc-tint-unknown { border-top: 3px solid var(--loc-unknown); padding-top: var(--sp-2); }

/* Location-tinted pipeline cards */
.pipeline-card.loc-left-brussels { border-left: 3px solid var(--loc-brussels); }
.pipeline-card.loc-left-cantal  { border-left: 3px solid var(--loc-cantal); }
.pipeline-card.loc-left-paris   { border-left: 3px solid var(--loc-paris); }
.pipeline-card.loc-left-unknown { border-left: 3px solid var(--loc-unknown); }

/* --- Section title ----------------------------------------- */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.section-title .nav-icon {
  color: var(--accent);
  opacity: 0.65;
}

/* --- Zones ------------------------------------------------- */
.zone {
  margin-bottom: var(--sp-8);
}
.zone-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--sp-3);
  padding-left: var(--sp-1);
  position: relative;
}

/* --- Action checklist -------------------------------------- */
.action-checklist-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--muted-bg);
  transition: background 100ms ease;
}
.action-checklist-item:last-of-type {
  border-bottom: none;
}
.action-checklist-item:hover {
  background: #fcfcfb;
  margin: 0 calc(-1 * var(--sp-2));
  padding-left: var(--sp-2);
  padding-right: var(--sp-2);
  border-radius: var(--radius-sm);
}
.action-checklist-item .action-check {
  font-size: var(--text-md);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.action-checklist-item.done .action-check {
  color: var(--success-ink);
}
.action-checklist-item.done .action-label {
  text-decoration: line-through;
  color: var(--muted);
}
.action-checklist-item .action-label {
  flex: 1;
  font-size: var(--text-sm);
}
.action-checklist-item .btn {
  margin-left: auto;
}
.action-checklist-extras {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

/* --- Footer ------------------------------------------------ */
footer {
  text-align: center;
  color: var(--muted);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

/* --- Collapsible details ----------------------------------- */
details > summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-2) 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "\25B6\00a0";
  font-size: 0.65em;
  vertical-align: 1px;
  transition: transform 200ms var(--ease-out);
  display: inline-block;
}
details[open] > summary::before {
  transform: rotate(90deg);
}
details > summary h2,
details > summary h3 {
  display: inline;
  font-size: var(--text-md);
}

/* --- Pipeline classes -------------------------------------- */
.pipeline-board {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  padding-bottom: var(--sp-4);
  align-items: flex-start;
  scroll-snap-type: x proximity;
}
.pipeline-col {
  width: 290px;
  flex: 0 0 auto;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  scroll-snap-align: start;
  transition: background 200ms ease, outline-color 200ms ease;
}
.pipeline-col h3 {
  font-size: var(--text-sm);
}
.pipeline-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  transition: box-shadow 150ms var(--ease-out), border-color 150ms ease, transform 150ms ease;
}
.pipeline-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.pipeline-card-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 0;
}
.pipeline-card-action {
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--muted-bg);
}
.pipeline-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.pipeline-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--muted-bg);
}
.pipeline-bulk-check {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  cursor: pointer;
}
/* Drag-and-drop */
.pipeline-card[draggable="true"] { cursor: grab; }
.pipeline-card[draggable="true"]:active { cursor: grabbing; }
.pipeline-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--accent);
  transform: rotate(1deg);
}
.pipeline-col.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* --- Tabs (CSS-only) --------------------------------------- */
.tabs {
  position: relative;
}
.tabs input[type="radio"] {
  display: none;
}
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
}
.tab-label {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
}
.tab-label:hover {
  color: var(--ink);
}
.tab-content {
  display: none;
  animation: tab-reveal 250ms var(--ease-out) both;
}
@keyframes tab-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Tab activation via radio inputs */
#tab-overview:checked ~ .tab-bar [for="tab-overview"],
#tab-attendance:checked ~ .tab-bar [for="tab-attendance"],
#tab-fi:checked ~ .tab-bar [for="tab-fi"],
#tab-payments:checked ~ .tab-bar [for="tab-payments"],
#tab-documents:checked ~ .tab-bar [for="tab-documents"],
#tab-audit:checked ~ .tab-bar [for="tab-audit"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
#tab-overview:checked ~ #content-overview,
#tab-attendance:checked ~ #content-attendance,
#tab-fi:checked ~ #content-fi,
#tab-payments:checked ~ #content-payments,
#tab-documents:checked ~ #content-documents,
#tab-audit:checked ~ #content-audit {
  display: block;
}

/* --- Responsive: tablets ----------------------------------- */
@media (max-width: 1024px) {
  main {
    margin: var(--sp-5) auto var(--sp-6);
    padding: 0 var(--sp-4);
  }
  .panel {
    padding: var(--sp-4) var(--sp-3);
  }
  h1 { font-size: var(--text-md); }
  .btn { min-height: 38px; padding: var(--sp-2) var(--sp-3); }
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .kpi-card h3 { font-size: var(--text-lg); }
}

/* --- Responsive: sidebar collapse -------------------------- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-topbar { display: flex; }
  .sidebar { display: none; }
  .grid-2, .grid-3, .grid-4, .kpi-grid, .form-grid-compact { grid-template-columns: 1fr; }
  .back-link { margin-left: 0; }
  .page-header .page-header-row { gap: var(--sp-3); }
  .cohort-progress-card { align-items: flex-start; }
  .pipeline-board { flex-direction: column; }
  .pipeline-col { width: 100%; flex: none; }
}

/* --- Responsive: mobile ------------------------------------ */
@media (max-width: 700px) {
  .actions .btn {
    width: 100%;
    text-align: center;
  }
  .cohort-progress-card { flex-direction: column; }
  .progress-ring {
    width: 72px;
    height: 72px;
  }
  .progress-ring .inner {
    width: 52px;
    height: 52px;
    font-size: var(--text-xs);
  }
  .chip { font-size: 0.7rem; }
}

/* --- Utility: page load stagger animations ----------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.zone {
  animation: fadeUp 400ms var(--ease-out) both;
}
.zone:nth-child(1) { animation-delay: 0ms; }
.zone:nth-child(2) { animation-delay: 60ms; }
.zone:nth-child(3) { animation-delay: 120ms; }
.zone:nth-child(4) { animation-delay: 180ms; }
