/* ==========================================================================
   Moï — feuille de style principale
   ========================================================================== */

:root {
  --brand: #7C3AED;
  --brand-dark: #5B21B6;
  --brand-light: #A78BFA;
  --brand-soft: #F4EFFF;
  --ink: #17132A;
  --ink-soft: #3C3654;
  --muted: #6B6880;
  --line: #E8E5F3;
  --bg: #F6F5FB;
  --surface: #FFFFFF;
  --success: #10B981;
  --warn: #F59E0B;
  --info: #0EA5E9;
  --danger: #EF4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 19, 42, .06), 0 1px 3px rgba(23, 19, 42, .04);
  --shadow: 0 8px 24px rgba(23, 19, 42, .08);
  --shadow-lg: 0 18px 48px rgba(23, 19, 42, .14);
  --nav-height: 68px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 780px; }
.section { padding: 56px 0; }
.section--tight { padding: 32px 0; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.page-content { padding-bottom: calc(var(--nav-height) + 28px + env(safe-area-inset-bottom, 0px)); }

/* ------------------------------- En-tête ------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff; display: grid; place-items: center;
  font-size: .95rem; font-weight: 800;
}
.brand__name { font-size: 1.06rem; }
.brand__sub { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.topnav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.topnav a {
  padding: 8px 12px; border-radius: 10px; color: var(--ink-soft);
  font-size: .93rem; font-weight: 600;
}
.topnav a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.topnav a.is-active { background: var(--brand-soft); color: var(--brand-dark); }

.nav-toggle {
  margin-left: auto; display: none;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------------------------- Barre du bas ---------------------------- */

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 12px; color: var(--muted);
  font-size: .7rem; font-weight: 650; letter-spacing: .01em;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.is-active { color: var(--brand); background: var(--brand-soft); }
.bottom-nav svg { width: 21px; height: 21px; }

/* ------------------------------- Boutons ------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: .95rem; font-weight: 650;
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  font-family: inherit; line-height: 1.2;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn--soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn--soft:hover { background: #E9DEFF; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #DC2626; }
.btn--success { background: var(--success); }
.btn--success:hover { background: #0EA372; }
.btn--sm { padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------- Cartes ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.card__title { font-size: 1.02rem; font-weight: 750; margin: 0; }
.card + .card { margin-top: 18px; }

.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--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm);
}
.kpi__label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi__value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi__meta { font-size: .82rem; color: var(--muted); }
.kpi--accent { background: linear-gradient(140deg, var(--brand), var(--brand-dark)); border-color: transparent; color: #fff; }
.kpi--accent .kpi__label, .kpi--accent .kpi__meta { color: rgba(255, 255, 255, .82); }

/* ------------------------------- Badges ------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em;
  background: #F0EEF9; color: var(--ink-soft);
}
.badge--pending { background: #FFF4E2; color: #B45309; }
.badge--confirmed { background: #E4F4FF; color: #0369A1; }
.badge--completed { background: #E5F8F1; color: #047857; }
.badge--cancelled { background: #FDECEC; color: #B91C1C; }
.badge--brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ------------------------------ Formulaires ------------------------------ */

.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: .86rem; font-weight: 650; margin-bottom: 6px; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; font-size: .95rem; font-family: inherit;
  color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .14);
}
.textarea { min-height: 110px; resize: vertical; }
.field__hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.field--inline { display: flex; align-items: center; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 150px; }

.segmented { display: inline-flex; background: #EFEDF7; border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 9px;
  font-size: .85rem; font-weight: 650; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.segmented button.is-active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow-sm); }

/* ------------------------------- Tableaux ------------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 620px; }
table.data th, table.data td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #FBFAFE; }
table.data tbody tr:hover { background: #FBFAFE; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

.avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); font-weight: 750; font-size: .85rem;
  flex: 0 0 auto;
}
.avatar--sm { width: 32px; height: 32px; border-radius: 10px; font-size: .78rem; }
.avatar--lg { width: 52px; height: 52px; border-radius: 16px; font-size: 1.05rem; }

.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.list-item__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------- Agenda -------------------------------- */

.agenda { display: grid; gap: 14px; }
.agenda__day {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.agenda__day.is-today { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(124, 58, 237, .1); }
.agenda__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.agenda__date { font-weight: 750; }
.agenda__slot {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border-radius: 12px; background: #FBFAFE; border: 1px solid var(--line);
  margin-bottom: 8px; cursor: pointer;
}
.agenda__slot:hover { border-color: var(--brand-light); background: var(--brand-soft); }
.agenda__slot:last-child { margin-bottom: 0; }
.agenda__time { font-weight: 750; font-size: .85rem; font-variant-numeric: tabular-nums; min-width: 46px; }
.agenda__body { min-width: 0; }
.agenda__client { font-weight: 650; font-size: .92rem; }
.agenda__service { font-size: .78rem; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-strip button {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 6px;
  cursor: pointer; font-family: inherit; text-align: center;
}
.week-strip button.is-active { border-color: var(--brand); background: var(--brand-soft); }
.week-strip .d { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.week-strip .n { font-size: 1.05rem; font-weight: 750; }
.week-strip .c { font-size: .68rem; color: var(--brand); font-weight: 700; }

/* ------------------------------- Graphiques ------------------------------- */

.chart-box { position: relative; height: 280px; }
.chart-box--sm { height: 220px; }

.progress { height: 8px; border-radius: 999px; background: #EFEDF7; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }

/* -------------------------------- Modales -------------------------------- */

.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 16, 38, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow-y: auto;
}
.modal__panel {
  background: #fff; border-radius: 20px; width: 100%; max-width: 620px;
  padding: 26px; box-shadow: var(--shadow-lg); margin: auto;
}
.modal__panel--wide { max-width: 860px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal__close {
  border: 0; background: #F3F1FA; width: 36px; height: 36px; border-radius: 11px;
  cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--ink-soft);
}

/* -------------------------------- Toasts -------------------------------- */

.toast-zone {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 120; display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100% - 24px));
}
.toast {
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 13px;
  font-size: .9rem; font-weight: 550; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}
.toast--error { background: var(--danger); }
.toast--success { background: #0F9D6E; }
.toast.is-out { opacity: 0; transform: translateY(-8px); transition: all .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ------------------------------ États vides ------------------------------ */

.empty {
  text-align: center; padding: 38px 20px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: #FCFBFE;
}
.empty svg { width: 40px; height: 40px; color: var(--brand-light); margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, #F1EFF8, #F8F7FC, #F1EFF8); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* -------------------------------- Hero -------------------------------- */

.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(140deg, #2B1B54 0%, #5B21B6 55%, #7C3AED 100%);
  padding: 64px 0 72px;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--hero-image, none);
  background-size: cover; background-position: center;
  opacity: .22; mix-blend-mode: luminosity;
}
.hero__inner { position: relative; z-index: 2; display: grid; gap: 42px; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); color: #fff; }
.hero p { color: rgba(255, 255, 255, .88); font-size: 1.05rem; max-width: 36em; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); font-size: .8rem; font-weight: 650; margin-bottom: 18px;
}
.hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.hero__stat { background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 14px; }
.hero__stat b { display: block; font-size: 1.5rem; font-weight: 800; }
.hero__stat span { font-size: .78rem; color: rgba(255, 255, 255, .8); }
.hero__media { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .18); }
.hero__media img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

.eyebrow { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); }

/* ------------------------------- Sections ------------------------------- */

.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.service-card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.service-card__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.service-card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.service-card__price { font-weight: 800; font-size: 1.05rem; }

.step-card { display: flex; gap: 14px; align-items: flex-start; }
.step-card__num {
  width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 800; flex: 0 0 auto;
}

.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; width: 100%; }
.gallery img:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: 1 / 1; }

.quote { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.quote__text { font-size: 1rem; color: var(--ink-soft); }
.quote__author { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.stars { color: #F59E0B; font-size: .9rem; letter-spacing: .12em; }

/* ------------------------------- Auth pages ------------------------------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__aside {
  position: relative; color: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #2B1B54, #5B21B6 60%, #7C3AED);
}
.auth__aside img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .2; }
.auth__aside > * { position: relative; z-index: 2; }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 44px 24px; }
.auth__form-inner { width: 100%; max-width: 420px; }
.auth__points { display: grid; gap: 12px; margin-top: 22px; }
.auth__point { display: flex; gap: 10px; align-items: center; font-size: .92rem; color: rgba(255, 255, 255, .9); }

/* -------------------------------- Footer -------------------------------- */

.footer { background: #17132A; color: rgba(255, 255, 255, .72); padding: 48px 0 calc(var(--nav-height) + 24px + env(safe-area-inset-bottom, 0px)); }
.footer a { color: rgba(255, 255, 255, .84); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.footer h4 { color: #fff; font-size: .95rem; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 32px; padding-top: 18px; font-size: .82rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer--flat { padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom, 0px)); }

/* --------------------------- Installer l'appli --------------------------- */

.install-panel {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 38, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.install-panel__box { background: #fff; border-radius: 20px; padding: 26px; max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); }
.install-steps { display: grid; gap: 14px; margin: 18px 0; }
.install-step { display: flex; gap: 12px; align-items: flex-start; }
.install-step__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex: 0 0 auto; }

/* ------------------------------ Utilitaires ------------------------------ */

.hide-desktop { display: none; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a, .tabs button {
  padding: 9px 15px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-soft); font-weight: 620; font-size: .88rem; font-family: inherit; cursor: pointer;
}
.tabs a.is-active, .tabs button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a:hover, .tabs button:hover { text-decoration: none; }

.sticky-actions { position: sticky; bottom: calc(var(--nav-height) + 12px + env(safe-area-inset-bottom, 0px)); }

/* ============================== Responsive ============================== */

@media (max-width: 1024px) {
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero { padding: 44px 0 52px; }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .hero__media { order: -1; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__aside { padding: 34px 24px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 768px) {
  .topnav {
    display: none; width: 100%; margin: 0 0 8px; padding-top: 10px;
    border-top: 1px solid var(--line); order: 3;
  }
  .topnav.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .topnav a { padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .topbar__inner { flex-wrap: wrap; }

  .grid--2, .grid--3, .grid--4, .grid--stats, .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery img:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 9; }
  .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section { padding: 40px 0; }
  h1 { font-size: 1.7rem; }
  .card { padding: 18px; }
  .kpi__value { font-size: 1.55rem; }
  .hide-desktop { display: block; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field { min-width: 0; }
  .table-scroll { margin: 0 -18px; padding: 0 18px; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 15px; }
  .bottom-nav a { font-size: .64rem; }
  .hero__stats { grid-template-columns: minmax(0, 1fr); }
}
