/* ==========================================================================
   WAIC — application UI kit (dashboards, auth, forms).
   Used by: layouts/dashboard.php, layouts/auth.php, layouts/minimal.php, learning player.
   Follows the brand charter (Charte graphique WIAC v1.0):
     Rouge fraise #F20D42 · Bleu électrique #2C75FF · Vert bouteille #096A09 · Gris #575756,
     navy of the charter motif #0F2E65 (img/motif-wiac.webp), Poppins for titles, Helvetica for text.
   The public immersive site has its own stylesheet (site.css).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* brand (charte graphique) */
  --crimson: #F20D42;
  --crimson-600: #D80B3B;
  --crimson-50: #FFF0F4;
  --green: #096A09;
  --green-600: #074907;
  --green-50: #ECF8F0;
  --blue: #2C75FF;
  --blue-600: #2A6CD8;
  --blue-50: #EEF4FF;
  --blue-light: #8BC6FF;
  --green-light: #A6E6A1;
  --gold: #C9A227;
  --gold-50: #FBF6E6;
  --ink: #0F2E65;          /* navy of the charter motif */
  --ink-2: #133A7D;
  --ink-3: #1B4794;

  /* neutrals */
  --bg: #F4F7FC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFE;
  --line: #E3E9F3;
  --line-2: #D2DBEA;
  --text: #1D1D1B;
  --text-2: #575756;
  --text-3: #868684;

  /* status */
  --success: #096A09; --success-bg: #E8F6EE;
  --warning: #B7791F; --warning-bg: #FEF6E4;
  --danger: #D4183D;  --danger-bg: #FDECEF;
  --info: #2A6CD8;    --info-bg: #EEF4FF;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 33, 74, .06);
  --shadow: 0 6px 24px -8px rgba(11, 33, 74, .14), 0 1px 3px rgba(11, 33, 74, .06);
  --shadow-lg: 0 24px 60px -20px rgba(11, 33, 74, .28);

  --font: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;   /* charter: body text */
  --font-display: 'Poppins', 'Helvetica Neue', Arial, sans-serif;      /* charter: titles */
  --font-tech: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --motif: url('../img/motif-wiac.webp');

  --sidebar-w: 268px;
  --topbar-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-lg { width: 24px; height: 24px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- layout: dashboard ---------- */
.dash { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #D5DFF2; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 40; isolation: isolate; }
.sidebar::before { content: ''; position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 46, 101, .55), rgba(15, 46, 101, .88) 60%, rgba(15, 46, 101, .96)), var(--motif) center top / 620px auto repeat-y; opacity: 1; }
.sidebar > * { position: relative; }
/* charter: on a dark background the colour logo sits in a white cartouche */
.sidebar-brand { display: flex; align-items: center; justify-content: center; margin: 18px 16px 14px; padding: 9px 12px; background: #FFFFFF; border-radius: 12px; box-shadow: 0 10px 24px -14px rgba(3, 12, 32, .6); }
.sidebar-brand img { height: 50px; width: auto; }
.sidebar-role { margin: 0 22px 10px; font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--green-light); }
.nav-group { padding: 8px 12px; }
.nav-group-title { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-light); padding: 10px 12px 6px; font-family: var(--font-display); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #DCE5F6; font: 500 14px/1.3 var(--font-display); transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(139, 198, 255, .12); color: #fff; }
.nav-link.active { background: var(--crimson); color: #fff; box-shadow: 0 10px 22px -12px rgba(242, 13, 66, .95); }
.nav-link .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 16px 22px 22px; border-top: 1px solid rgba(139, 198, 255, .18); font-size: 13px; }
.sidebar-foot a { color: #DCE5F6; }
.sidebar-foot a:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 28px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); box-shadow: inset 0 -2px 0 rgba(44, 117, 255, .08); position: sticky; top: 0; z-index: 30; }
.topbar-title { font: 600 16px/1.2 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }
.content { padding: 28px; max-width: 1320px; width: 100%; }
.content-narrow { max-width: 880px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.65rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.page-head .lead { color: var(--text-2); margin: 4px 0 0; }
.breadcrumb { display: flex; gap: 6px; align-items: center; font: 600 11.5px/1.4 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--green); }
.breadcrumb a:hover { color: var(--ink); }

/* user chip & dropdown */
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: 14px; color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--crimson), #AD3B53); color: #fff; display: grid; place-items: center; font: 600 13px var(--font-display); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 22px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-sep { height: 1px; background: var(--line); margin: 6px 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); border: 2px solid var(--surface); }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad, .card-body { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid > *, .grid-sidebar > * { min-width: 0; }
label.dropzone { display: block; }
.stack > * + * { margin-top: 20px; }
.stack-sm > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: 13px; }
.small { font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* stat tiles */
.stat { padding: 20px 22px; position: relative; overflow: hidden; }
.stat-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; color: var(--ink); }
.stat-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.tone-crimson { background: var(--crimson-50); color: var(--crimson); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-blue { background: var(--blue-50); color: var(--blue-600); }
.tone-gold { background: var(--gold-50); color: #8C6D0A; }
.tone-ink { background: #E8EEF9; color: var(--ink); }

/* hero banner in dashboards */
.welcome { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 28px 30px; background: var(--ink); color: #fff; isolation: isolate; }
.welcome::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(15, 46, 101, .96) 0%, rgba(15, 46, 101, .82) 45%, rgba(15, 46, 101, .45) 100%), var(--motif) right center / 560px auto; }
.welcome::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--crimson) 0 34%, var(--blue) 34% 67%, var(--green) 67% 100%); }
.welcome > * { position: relative; }
.welcome h1, .welcome h2 { color: #fff; font-family: var(--font-display); font-weight: 700; }
.welcome p { color: #D5DFF2; }

/* ---------- buttons ---------- */
.btn { --b: var(--crimson); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; font: 500 14px/1.2 var(--font-display); border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s, color .15s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--crimson-600); color: #fff; box-shadow: 0 8px 20px -10px rgba(242, 13, 66, .8); }
.btn-primary:hover { background: #AD3B53; color: #fff; }
.btn-blue { background: var(--blue-600); color: #fff; }
.btn-blue:hover { background: var(--ink); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-600); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--blue-600); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-outline:hover { border-color: var(--text-3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(11, 33, 74, .05); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 24px; font-size: 15.5px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-600); cursor: pointer; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font: 500 12px/1.5 var(--font-display); background: #EDF1F8; color: var(--ink); white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-crimson { background: var(--crimson-600); color: #fff; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- alerts / flash ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-bg); color: #074907; border-color: #CBEAD6; }
.alert-error, .alert-danger { background: var(--danger-bg); color: #A3112E; border-color: #F7C9D3; }
.alert-warning { background: var(--warning-bg); color: #8A5A10; border-color: #F5E0B5; }
.alert-info { background: var(--info-bg); color: #1D4FA8; border-color: #D3DBFB; }
.flash-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: flashIn .35s ease; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2, .form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font: 500 13.5px/1.35 var(--font-display); color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.req { color: var(--crimson); }
.input, .select, .textarea { width: 100%; font: 400 14.5px/1.4 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(44, 117, 255, .15); }
.inline-form { display: inline-flex; margin: 0; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg); color: var(--text-3); cursor: not-allowed; }
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C5770' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.input[type=file] { padding: 9px; background: var(--surface-2); }
.input[data-code] { font: 600 18px/1.3 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.input[data-code]::placeholder { letter-spacing: .12em; opacity: .45; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-left: 0; border-radius: 0 10px 10px 0; font-size: 13px; color: var(--text-2); }
.input-group .addon-left { border-left: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; }
.input-group .addon-left + .input { border-radius: 0 10px 10px 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--crimson); flex: none; }
/* selectable option cards (radio/checkbox) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box { display: block; height: 100%; padding: 16px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s, background .15s; }
.choice-box strong { display: block; font-weight: 600; }
.choice-box small { color: var(--text-2); }
.choice input:checked + .choice-box { border-color: var(--crimson); background: var(--crimson-50); box-shadow: 0 0 0 3px rgba(242, 13, 66, .12); }
.choice input:focus-visible + .choice-box { outline: 2px solid var(--crimson); outline-offset: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(17px); }
.switch input:disabled { opacity: .55; cursor: not-allowed; }
.switch:has(input:disabled) { cursor: not-allowed; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-50); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font: 600 15px/1.3 var(--font-display); color: var(--ink); margin-bottom: 10px; }

/* language tabs for bilingual fields */
.lang-tabs { display: inline-flex; gap: 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.lang-tabs button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; font: 500 12px var(--font-tech); color: var(--text-2); cursor: pointer; }
.lang-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
[data-lang-pane] { display: none; } [data-lang-pane].active { display: block; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 600 11.5px/1.3 var(--font-display); color: var(--ink); text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #F2F6FD; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #F8FAFE; }
.table .cell-user { display: flex; align-items: center; gap: 10px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; padding: 8px 12px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .icon-lg { margin: 0 auto 12px; color: var(--text-3); width: 40px; height: 40px; }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { padding: 11px 16px; font: 500 14px var(--font-display); color: var(--text-2); border: 0; background: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs a.active, .tabs button.active { color: var(--crimson-600); border-bottom-color: var(--crimson); }

/* ---------- stepper (multi-step forms) ---------- */
.stepper { display: flex; gap: 6px; counter-reset: step; margin-bottom: 26px; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 92px; position: relative; padding-top: 34px; text-align: center; font-size: 12px; color: var(--text-3); }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line-2); font: 600 12px var(--font-tech); color: var(--text-3); z-index: 1; }
.step::after { content: ''; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--line); }
.step:last-child::after { display: none; }
.step.done::before { content: '✓'; background: var(--green); border-color: var(--green); color: #fff; }
.step.done::after { background: var(--green); }
.step.current { color: var(--text); font-weight: 600; }
.step.current::before { background: var(--crimson); border-color: var(--crimson); color: #fff; box-shadow: 0 0 0 5px rgba(242, 13, 66, .15); }
.step a { color: inherit; }

/* progress */
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--crimson), #E94A67); transition: width .4s ease; }
.progress-blue > span { background: linear-gradient(90deg, var(--blue-600), var(--blue-light)); }
.progress-green > span { background: linear-gradient(90deg, var(--green), #3E9E3E); }

/* key-value list */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--crimson); box-shadow: 0 0 0 4px var(--crimson-50); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(11, 33, 74, .55); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 150; }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); }
.modal-box.lg { width: min(900px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* spinner */
.spinner { width: 22px; height: 22px; border: 2.5px solid rgba(0, 0, 0, .12); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* media thumbs */
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.thumb-lg { width: 100%; aspect-ratio: 16/10; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }

/* ---------- auth layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-visual { position: relative; overflow: hidden; background: var(--ink) var(--motif) center / 760px auto; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(15, 46, 101, .55) 0%, rgba(15, 46, 101, .86) 55%, rgba(15, 46, 101, .96) 100%); pointer-events: none; }
.auth-logo { display: inline-flex; align-self: flex-start; padding: 10px 14px; background: #FFFFFF; border-radius: 12px; box-shadow: 0 12px 28px -14px rgba(3, 12, 32, .6); }
.auth-logo img { height: 42px; width: auto; }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.15; max-width: 14ch; }
.auth-visual p { color: #D5DFF2; max-width: 38ch; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: min(440px, 100%); }
.auth-form h1 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.auth-form .lead { color: var(--text-2); margin-bottom: 26px; }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 22px 0; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* minimal layout (errors, verification pages) */
.minimal { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 80% 0%, rgba(242, 13, 66, .07), transparent), radial-gradient(60% 50% at 0% 100%, rgba(44, 117, 255, .09), transparent), var(--bg); }
.minimal-box { width: min(560px, 100%); text-align: center; }
.minimal-box .code { font-family: var(--font-display); font-weight: 700; font-size: 6rem; line-height: 1; background: linear-gradient(135deg, var(--crimson), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .dash.nav-open .sidebar { transform: none; }
  .dash.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(11, 33, 74, .45); z-index: 35; }
  .menu-toggle { display: grid; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 220px; padding: 28px; }
  .auth-visual h2 { font-size: 1.6rem; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .page-head h1 { font-size: 1.35rem; }
  .user-chip .name { display: none; }
  .stat-value { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .dash { display: block; }
  body { background: #fff; }
}
