/* Wazaaa.fr — design tokens + components. Every colour comes from a variable. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../fonts/manrope-700.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("../fonts/manrope-800.woff2") format("woff2"); }

:root {
  /* Brand */
  --wz-night: #090D1B;
  --wz-violet: #5127EF;
  --wz-violet-bright: #8D56FF;
  --wz-cyan: #24D9E8;
  --wz-lime: #D4F36A;
  --wz-gradient-start: #24D9E8;
  --wz-gradient-end: #C45CFF;
  --wz-gradient: linear-gradient(90deg, var(--wz-gradient-start), var(--wz-gradient-end));
  --wz-white: #FFFFFF;

  /* Semantic (light theme) */
  --bg: #F3F4F8;
  --surface: var(--wz-white);
  --surface-2: #F7F8FB;
  --border: #E4E6EE;
  --text: var(--wz-night);
  --text-muted: #5B6178;
  --text-soft: #646A82;
  --primary: var(--wz-violet);
  --primary-hover: #4219D6;
  --primary-soft: #EFEAFF;
  --primary-text: var(--wz-white);
  --focus: var(--wz-violet-bright);
  --active: var(--wz-lime);
  --active-text: var(--wz-night);
  --success: #12805C;
  --success-soft: #E3F6EE;
  --warning: #9A6200;
  --warning-soft: #FFF3D6;
  --danger: #C62845;
  --danger-soft: #FDE8EC;
  --info-soft: #E3F8FA;
  --info: #0B7E88;

  --sidebar-bg: var(--wz-night);
  --sidebar-text: #C3C7D6;
  --sidebar-text-strong: var(--wz-white);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-border: rgba(255, 255, 255, 0.08);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(9, 13, 27, 0.04), 0 4px 16px rgba(9, 13, 27, 0.06);
  --shadow-lg: 0 2px 4px rgba(9, 13, 27, 0.04), 0 16px 40px rgba(9, 13, 27, 0.10);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0B1022;
  --surface: #121833;
  --surface-2: #171E3D;
  --border: #252D52;
  --text: #EEF0F7;
  --text-muted: #A3A9C2;
  --text-soft: #9097B3;
  --primary: var(--wz-violet-bright);
  --primary-hover: #A57AFF;
  --primary-soft: rgba(141, 86, 255, 0.16);
  --success: #4FD1A1;
  --success-soft: rgba(79, 209, 161, 0.12);
  --warning: #F5C26B;
  --warning-soft: rgba(245, 194, 107, 0.12);
  --danger: #FF7A93;
  --danger-soft: rgba(255, 122, 147, 0.12);
  --info: var(--wz-cyan);
  --info-soft: rgba(36, 217, 232, 0.12);
  --sidebar-bg: #060914;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

.sidebar {
  align-self: start;
  background: var(--sidebar-bg); color: var(--sidebar-text); padding: 22px 14px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--sidebar-text-strong); }
.brand img { width: 34px; height: 34px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--sidebar-hover); color: var(--active); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--sidebar-border); margin: 12px 8px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 0; border-top: 1px solid var(--sidebar-border); }
.sidebar-user { font-size: 13px; color: var(--sidebar-text); overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { color: var(--sidebar-text-strong); display: block; font-weight: 600; }
.sidebar-actions { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 10px;
  border-radius: 9px; border: 1px solid var(--sidebar-border); background: transparent; color: var(--sidebar-text);
  font: inherit; font-size: 13px; cursor: pointer;
}
.icon-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.icon-btn svg { width: 16px; height: 16px; }

.main { min-width: 0; padding: 32px 40px 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--text-muted); }
.mobile-bar { display: none; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px 24px;
}
.stack > * + *, .card + .card { margin-top: 18px; }
.grid > .card + .card, .grid > .stack + .stack { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-soft); font-weight: 600; margin: 28px 0 12px; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--text-muted); font-size: 14px; }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; }
.stat-foot { font-size: 14px; color: var(--text-muted); }
.gradient-bar { height: 4px; border-radius: 4px; background: var(--wz-gradient); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-muted); white-space: nowrap;
}
.badge-count { background: var(--wz-violet); color: var(--wz-white); min-width: 22px; justify-content: center; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-active { background: var(--active); color: var(--active-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot-live { background: var(--active); box-shadow: 0 0 0 0 rgba(212, 243, 106, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 243, 106, .7); } 70% { box-shadow: 0 0 0 9px rgba(212, 243, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 243, 106, 0); } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } * { transition: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s; white-space: nowrap;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.hint { font-size: 13px; color: var(--text-soft); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=file] { font: inherit; font-size: 14px; color: var(--text-muted); max-width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); vertical-align: middle; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented label { margin: 0; padding: 6px 12px; border-radius: 8px; font-weight: 500; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: var(--text); }
.segmented label:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); }

/* ---------- Alerts ---------- */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
.row-link { color: var(--text); font-weight: 600; }

/* ---------- Specific blocks ---------- */
.hello h1 { font-size: 34px; }
.hello .state { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; }
.live-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface-2); }
.live-card + .live-card { margin-top: 10px; }
.live-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.live-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.empty { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty svg { width: 40px; height: 40px; color: var(--text-soft); margin-bottom: 8px; }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.checklist .tick svg { width: 13px; height: 13px; }
.checklist .done .tick { background: var(--success-soft); color: var(--success); }
.checklist .todo .tick { background: var(--surface-2); color: var(--text-soft); border: 1px dashed var(--border); }
.checklist .done span.txt { color: var(--text-muted); }
.transcript { background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: 10px; padding: 14px 16px; font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
audio { width: 100%; margin: 6px 0 4px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }
.key {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--wz-night); color: var(--wz-white); font-family: var(--font-display); font-weight: 800; font-size: 16px; flex: none;
}
[data-theme="dark"] .key { background: var(--surface-2); border: 1px solid var(--border); }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.option:last-child { border-bottom: none; }
.option-body { flex: 1; min-width: 0; }
.option-title { font-weight: 600; }
.option-meta { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
details.edit > summary { list-style: none; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > summary { margin-bottom: 14px; }
.edit-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.prompt-preview { font-size: 14px; color: var(--text-muted); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; border: 1px dashed var(--border); }
.day-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.day-row:last-child { border-bottom: none; }
.slots { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.slot { display: inline-flex; align-items: center; gap: 6px; }
.slot input { width: 116px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="true"] { color: var(--text); border-color: var(--primary); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; }
.filters input, .filters select { height: 38px; font-size: 14px; }
.pagination { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 16px; font-size: 14px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.anchor { scroll-margin-top: 24px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: var(--wz-night); color: var(--wz-white); padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(141, 86, 255, .35), transparent 65%); pointer-events: none;
}
.auth-side .brand { padding: 0; }
.auth-side h1 { font-size: 44px; color: var(--wz-white); max-width: 460px; }
.auth-side p { color: #B9BED0; font-size: 17px; max-width: 440px; margin-top: 14px; }
.auth-kw { display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 8px 16px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  body { overflow-x: hidden; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .2s var(--ease); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(9, 13, 27, .5); z-index: 40; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--sidebar-bg); color: var(--wz-white); position: sticky; top: 0; z-index: 30; }
  .mobile-bar .brand { padding: 0; }
  .main { padding: 22px 16px 48px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hello h1 { font-size: 26px; }
  h1 { font-size: 24px; }
  .card { padding: 18px; border-radius: var(--radius); }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; min-height: auto; }
  .auth-side h1 { font-size: 28px; }
  .auth-side .auth-kw, .auth-side .auth-foot { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .day-row { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .stats-row .card { padding: 14px 12px; }
  .stats-row .stat-value { font-size: 26px; }
  .stats-row .stat-label { font-size: 12px; line-height: 1.3; }
  .stats-row .stat-foot, .stats-row .gradient-bar { display: none; }
  table.stack-mobile thead { display: none; }
  table.stack-mobile, table.stack-mobile tbody, table.stack-mobile tr, table.stack-mobile td { display: block; width: 100%; }
  table.stack-mobile tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  table.stack-mobile tr:last-child { border-bottom: none; }
  table.stack-mobile td { border: none; padding: 2px 0; }
  table.stack-mobile td.hide-mobile { display: none; }
}
