/* SKS CRM — theme clair SaaS (sidebar, tuiles, kanban) */

@font-face {
  font-family: 'Geist';
  src: url('/public/fonts/Geist-VariableFont_wght.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/public/fonts/Figtree-VariableFont_wght.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --ink: #18181b;
  --muted: #6b6b74;
  --faint: #a1a1aa;
  --line: #e9e9ec;
  --teal: oklch(0.44 0.079 173);
  --teal-hover: oklch(0.38 0.079 173);
  --teal-wash: oklch(0.95 0.028 173);
  --gold: #96690f;
  --gold-wash: #f9f0d8;
  --red: #c03434;
  --red-wash: #fbecec;
  --radius: 12px;
  --radius-s: 8px;
  --shadow-1: 0 1px 2px rgb(24 24 27 / 0.04), 0 4px 12px rgb(24 24 27 / 0.04);
  --font-display: 'Geist', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 0.95rem/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
h2 { font-size: 1rem; font-weight: 650; margin: 1.6rem 0 .7rem; }
a { color: inherit; }
svg { width: 1.05em; height: 1.05em; flex: none; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--radius-s); }

/* ---------- Coquille ---------- */

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }

.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1.1rem .9rem 1rem;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.side__brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; padding: .3rem .5rem 1rem;
}
.side__logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--teal); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
}
.side__name { display: flex; flex-direction: column; line-height: 1.2; }
.side__name strong { font-family: var(--font-display); font-size: .95rem; }
.side__name small { color: var(--faint); font-size: .72rem; }

.side__section {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
  padding: .9rem .55rem .35rem;
}
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .5em .55rem; border-radius: var(--radius-s);
  text-decoration: none; font-weight: 550; color: var(--muted);
  transition: background .12s ease, color .12s ease;
}
.side nav a svg { color: var(--faint); }
.side nav a:hover { background: var(--surface-2); color: var(--ink); }
.side nav a.is-active { background: var(--surface-2); color: var(--ink); }
.side nav a.is-active svg { color: var(--teal); }
.side nav a span:first-of-type { flex: 1; }

.nav-count {
  font-size: .72rem; font-weight: 650; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 0 .5em; border-radius: 99px; min-width: 1.6em; text-align: center;
}
.nav-count--alert { background: var(--red); border-color: var(--red); color: #fff; }

.side__group summary {
  display: flex; align-items: center; gap: .6rem;
  padding: .5em .55rem; border-radius: var(--radius-s);
  font-weight: 550; color: var(--muted); cursor: pointer; list-style: none;
  transition: background .12s ease, color .12s ease;
}
.side__group summary::-webkit-details-marker { display: none; }
.side__group summary:hover { background: var(--surface-2); color: var(--ink); }
.side__group summary svg:first-child { color: var(--faint); }
.side__group summary span { flex: 1; }
.side__group .chev { color: var(--faint); transition: transform .15s ease; }
.side__group[open] summary .chev { transform: rotate(180deg); }

.side__sub { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 2px 1.7rem; }
.side__sub a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .4em .55rem; border-radius: var(--radius-s);
  text-decoration: none; font-size: .85rem; font-weight: 500; color: var(--muted);
}
.side__sub a:hover { background: var(--surface-2); color: var(--ink); }
.side__sub a.is-active { background: var(--surface-2); color: var(--ink); }

/* ---------- Calendrier ---------- */

.cal-nav { display: flex; align-items: center; gap: .6rem; }
.cal-nav__label { font-family: var(--font-display); text-transform: capitalize; }
.cal-nav .btn-outline { padding: .35em .8em; }

.cal-wrap { overflow-x: auto; margin-bottom: 1.4rem; }
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; min-width: 700px;
}
.cal__head {
  background: var(--surface-2); text-align: center;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: .45rem 0;
}
.cal__day { background: var(--surface); min-height: 92px; padding: .3rem .35rem; font-size: .78rem; }
.cal__day--out { background: var(--surface-2); }
.cal__num {
  display: inline-grid; place-items: center;
  width: 1.8em; height: 1.8em; font-weight: 600; border-radius: 99px;
}
.cal__day--today .cal__num { background: var(--teal); color: #fff; }
.cal__event {
  display: block; margin-top: 2px; padding: .12em .45em; border-radius: 6px;
  background: var(--teal-wash); color: var(--teal);
  font-size: .7rem; font-weight: 600; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal__event--meet { background: #eef2fb; color: #4a6cb3; }
.cal__event--done { opacity: .45; text-decoration: line-through; }

.chip--rdv-physique { background: var(--teal-wash); border-color: transparent; color: var(--teal); }
.chip--rdv-meet { background: #eef2fb; border-color: transparent; color: #4a6cb3; }
.btn-small { padding: .3em .8em; font-size: .78rem; }

.rdv-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line);
}
.rdv-item:last-child { border-bottom: none; }
.rdv-item__when { display: flex; flex-direction: column; min-width: 90px; font-size: .85rem; }
.rdv-item__when span { color: var(--muted); }
.rdv-item__body { flex: 1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rdv-item__body a { text-decoration: none; }
.rdv-item__body a:hover strong { color: var(--teal); }
.rdv-item__loc { color: var(--muted); font-size: .82rem; }
.rdv-item__notes { margin: 0; width: 100%; color: var(--muted); font-size: .82rem; }
.rdv-item__actions { display: flex; flex-direction: column; gap: .25rem; align-items: flex-end; }
.rdv-item__actions form { display: flex; gap: .25rem; }

.rdv-quick { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.rdv-quick label { flex: 1 1 120px; margin: 0; }
.rdv-quick button { flex: none; }

.chip--task-backlog { background: var(--surface-2); }
.chip--task-in_progress { background: #eef2fb; border-color: transparent; color: #4a6cb3; }
.chip--task-validation { background: var(--gold-wash); border-color: transparent; color: var(--gold); }
.chip--task-done { background: var(--teal-wash); border-color: transparent; color: var(--teal); }

.side__foot {
  margin-top: auto; padding: .8rem .55rem 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: .1rem;
}
.side__foot strong { font-size: .85rem; }
.side__foot button {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: .78rem; color: var(--muted); text-align: left;
}
.side__foot button:hover { color: var(--red); }

.shell { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar__brand { display: none; text-decoration: none; }
.topbar__search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-s); padding: .4em .8em;
  color: var(--faint);
  transition: border-color .12s ease, background .12s ease;
}
.topbar__search:focus-within { background: var(--surface); border-color: var(--teal); }
.topbar__search input {
  border: none; background: none; padding: 0; margin: 0; width: 100%;
  font: inherit; color: var(--ink);
}
.topbar__search input:focus { outline: none; box-shadow: none; }
.topbar .btn-dark { margin-left: auto; }

.page { width: 100%; padding: 1.6rem clamp(1rem, 1.8vw, 1.9rem) 4rem; }
.page--narrow { max-width: 800px; }

.bottomnav { display: none; }

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

button, .btn-primary, .btn-outline, .btn-ghost, .btn-dark {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-s);
  padding: .55em 1.1em; border: 1px solid transparent;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--faint); }
.btn-ghost { background: transparent; color: var(--muted); border: none; padding: .45em .7em; }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-big { padding: .8em 1.4em; width: 100%; }

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

form label { display: block; margin-bottom: .95rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); width: 100%; margin-top: .3em;
  padding: .55em .8em; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-wash);
}

/* ---------- En-tete de page, tuiles ---------- */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem;
}
.page-sub { margin: .25em 0 0; color: var(--muted); font-size: .88rem; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.filters select { width: auto; margin: 0; font-size: .85rem; padding-block: .5em; }
.filters button { font-size: .85rem; }

.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem; margin-bottom: 1.5rem;
}
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1.1rem;
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: .15rem;
}
.tile__label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.tile__num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; }
.tile__num--teal { color: var(--teal); }
.tile--alert { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.tile--alert .tile__num { color: var(--red); }

/* ---------- Relances du jour ---------- */

.due {
  background: var(--gold-wash);
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: var(--radius);
  padding: .9rem 1.1rem 1.1rem;
  margin-bottom: 1.5rem;
}
.due h2 {
  margin: 0 0 .7rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--gold);
}
.due__row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .7rem;
}

/* ---------- Kanban ---------- */

.board {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: .8rem; align-items: start;
  overflow-x: auto; padding-bottom: 1rem;
}
.col {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: .6rem .6rem .7rem;
  display: flex; flex-direction: column; gap: .55rem;
  min-height: 120px;
}
.col__head {
  display: flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 650; color: var(--muted);
  padding: .1rem .3rem;
}
.col__dot { width: .55em; height: .55em; border-radius: 50%; background: var(--faint); }
.col--lead .col__dot { background: #f59e0b; }
.col--mql .col__dot { background: #10b981; }
.col--sql .col__dot { background: #8b5cf6; }
.col--opportunity .col__dot { background: #f97316; }
.col--on_hold .col__dot { background: #64748b; }
.col--customer .col__dot { background: var(--teal); }
.col--lost .col__dot { background: var(--red); }
.col__count { margin-left: auto; font-weight: 600; color: var(--faint); font-size: .75rem; }
.col__empty {
  border: 1px dashed var(--line); border-radius: var(--radius-s);
  min-height: 64px;
}

.bcard {
  display: flex; flex-direction: column; gap: .25rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .7rem .8rem;
  text-decoration: none; box-shadow: var(--shadow-1);
  transition: border-color .12s ease, transform .12s ease;
}
.bcard:hover { border-color: var(--faint); transform: translateY(-1px); }
.bcard strong { font-weight: 650; font-size: .9rem; }
.bcard__top { display: flex; justify-content: space-between; gap: .4rem; align-items: center; }
.bcard__meta { color: var(--muted); font-size: .78rem; }
.bcard__chips { display: flex; flex-wrap: wrap; gap: .3em; margin-top: .25rem; }

/* ---------- Onglets de vue, tableau, drag & drop ---------- */

.view-tabs {
  display: inline-flex; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; margin-bottom: 1rem;
}
.view-tabs a {
  padding: .35em .95em; border-radius: 7px;
  text-decoration: none; font-size: .83rem; font-weight: 600; color: var(--muted);
}
.view-tabs a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.table-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: .87rem; }
.ptable th {
  text-align: left; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  background: var(--surface-2);
  padding: .6rem 1rem; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ptable td { padding: .65rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tbody tr:last-child td { border-bottom: none; }
.ptable tbody tr:hover { background: var(--surface-2); }
.ptable td a { font-weight: 650; text-decoration: none; }
.ptable td a:hover { color: var(--teal); }

td.editable { cursor: pointer; }
td.editable:hover { box-shadow: inset 0 0 0 1px var(--line); border-radius: 6px; }
td.is-editing { padding-block: .3rem; }
.inline-editor { margin: 0; padding: .35em .6em; font-size: .85rem; min-width: 110px; }
td.inline-error { box-shadow: inset 0 0 0 1.5px var(--red); border-radius: 6px; }

.rowmenu { position: relative; width: 44px; text-align: right; }
.rowmenu__btn {
  background: none; border: none; color: var(--faint);
  padding: .3em .45em; border-radius: 6px; line-height: 0;
}
.rowmenu__btn:hover { background: var(--surface-2); color: var(--ink); }
.rowmenu__list {
  position: fixed; z-index: 50;
  min-width: 170px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 28px rgb(24 24 27 / .12);
  padding: .3rem; display: flex; flex-direction: column;
}
.rowmenu__list a, .rowmenu__list button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; text-decoration: none;
  font-size: .85rem; font-weight: 500; color: var(--ink);
  padding: .45em .7em; border-radius: 7px; cursor: pointer;
}
.rowmenu__list[hidden] { display: none; }
.rowmenu__list a:hover, .rowmenu__list button:hover { background: var(--surface-2); }
.rowmenu__list .danger { color: var(--red); }
.rowmenu__list .danger:hover { background: var(--red-wash); }

.col.is-over { outline: 2px dashed var(--teal); outline-offset: -2px; background: var(--teal-wash); }

/* ---------- Projets et tâches ---------- */

.col--task-backlog .col__dot { background: var(--faint); }
.col--task-in_progress .col__dot { background: #6d8fd6; }
.col--task-validation .col__dot { background: var(--gold); }
.col--task-done .col__dot { background: var(--teal); }

.task-add { display: flex; gap: .5rem; margin-block: 1rem; max-width: 460px; }
.task-add input { margin: 0; }
.task-add button { flex: none; }

.tcard { cursor: grab; }
.tcard__row { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.tcard__actions { display: none; gap: .1rem; flex: none; }
.tcard:hover .tcard__actions { display: inline-flex; }
.tcard__actions button {
  background: none; border: none; padding: 0 .3em; line-height: 1;
  color: var(--faint); font-size: .95rem; cursor: pointer; border-radius: 5px;
}
.tcard__actions button:hover { color: var(--ink); background: var(--surface-2); }

.chip--teal { background: var(--teal-wash); border-color: transparent; color: var(--teal); }
.danger-text { color: var(--red); }
.danger-text:hover { color: var(--red); background: var(--red-wash); }

.panel__title { margin: 0 0 .8rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.mini-list { display: flex; flex-direction: column; margin-bottom: 1rem; }
.mini-item {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .5rem .2rem; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mini-item:hover strong { color: var(--teal); }
.bcard.is-dragging { opacity: .45; }
.bcard[draggable] { cursor: grab; }
.bcard[draggable]:active { cursor: grabbing; }

/* ---------- Chips, badges, statuts ---------- */

.chip, .badge, .status {
  font-size: .7rem; font-weight: 600;
  padding: .18em .6em; border-radius: 99px;
  white-space: nowrap;
}
.chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.chip--red { background: var(--red-wash); border-color: transparent; color: var(--red); }
.chip--gold { background: var(--gold-wash); border-color: transparent; color: var(--gold); }

.badge { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.badge--gold { background: var(--gold-wash); border-color: transparent; color: var(--gold); }
.badge--warn { background: var(--red-wash); border-color: transparent; color: var(--red); }

.status { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.status--lead { background: #fef3c7; border-color: transparent; color: #b45309; }
.status--mql { background: #d1fae5; border-color: transparent; color: #065f46; }
.status--sql { background: #ede9fe; border-color: transparent; color: #5b21b6; }
.status--opportunity { background: #ffedd5; border-color: transparent; color: #c2410c; }
.status--on_hold { background: #f1f5f9; border-color: transparent; color: #475569; }
.status--customer { background: var(--teal); border-color: var(--teal); color: #fff; }
.status--lost { background: var(--red-wash); border-color: transparent; color: var(--red); }

/* ---------- Panneaux, listes simples ---------- */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-block: 1rem;
  box-shadow: var(--shadow-1);
}
.panel form { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.panel form label { flex: 1 1 200px; margin: 0; }
.panel form button { flex: 0 0 auto; }
.panel form:has(textarea) { flex-direction: column; align-items: stretch; }

.empty-state { text-align: center; padding: 2.5rem 1.5rem; }
.empty-state p { color: var(--muted); margin: .4em 0 0; }
.empty-state a { color: var(--teal); font-weight: 600; }

.list {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1);
}
.card {
  display: block; text-decoration: none;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line);
  transition: background .12s ease;
}
.card:last-child { border-bottom: none; }
.card:hover { background: var(--surface-2); }
.card__head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.card__head strong { font-weight: 650; }
.card__meta { color: var(--muted); font-size: .82rem; margin-top: .1em; }
.card__badges { margin-top: .4em; display: flex; flex-wrap: wrap; gap: .35em; }

/* ---------- Fiche prospect ---------- */

.back {
  display: inline-block; margin-bottom: .6rem;
  font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.back:hover { color: var(--teal); }
.meta { color: var(--muted); margin-top: .3rem; }

.contact-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-block: 1.2rem; }
.contact-actions .btn-big { width: auto; flex: 1 1 40%; }

.log-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .82rem; color: var(--muted); margin-block: 1.1rem;
}
.log-actions button {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  padding: .35em .9em; font-size: .8rem; font-weight: 550;
}
.log-actions button:hover { border-color: var(--teal); color: var(--teal); }

.journal__item { border-bottom: 1px solid var(--line); padding-block: .65rem; font-size: .85rem; }
.journal__item:last-child { border-bottom: none; }
.journal__type {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--teal);
}
.journal__date { color: var(--faint); margin-left: .6em; font-size: .75rem; }
.journal__item p { margin: .2em 0 0; }

/* ---------- Import ---------- */

.result {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.result:last-of-type { border-bottom: none; }
.result input[type="checkbox"] { width: 1.2em; height: 1.2em; margin-top: .15em; accent-color: var(--teal); }
.result--dup { opacity: .5; }
.result__body { flex: 1; display: block; }
.result__body .card__meta { display: block; }
.result__body .card__badges { display: flex; }

/* ---------- Divers ---------- */

.error {
  background: var(--red-wash); color: var(--red);
  border-radius: var(--radius-s); padding: .65rem 1rem;
  font-size: .88rem; margin-bottom: 1rem;
}
.empty { color: var(--muted); }
h1 .count { color: var(--faint); font-weight: 500; margin-left: .2em; }

/* ---------- Login ---------- */

.login-page {
  min-height: 100dvh; display: grid; place-items: center; padding: 1rem;
  background: var(--bg);
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 2.1rem 2rem; box-shadow: 0 12px 40px rgb(24 24 27 / .08);
}
.login-box .login-eyebrow {
  display: block; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .15em;
  color: var(--teal); margin-bottom: .3em;
}
.login-box h1 { margin: 0 0 1.3rem; }

/* ---------- Mobile ---------- */

@media (max-width: 899px) {
  .app { display: block; }
  .side { display: none; }
  .topbar { padding: .55rem 1rem; gap: .7rem; }
  .topbar__brand { display: block; }
  .topbar .btn-dark { display: none; }
  body { padding-bottom: 68px; }

  .bottomnav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .55em .25em; text-decoration: none;
    font-size: .68rem; font-weight: 600; color: var(--muted);
  }
  .bottomnav a svg { width: 1.25em; height: 1.25em; }
  .bottomnav a.is-active { color: var(--teal); }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-auto-columns: 78vw; }
  .page-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
