/* ==========================================================================
   Papacrochete — feuille de style
   ========================================================================== */

:root {
  --cream: #faf6ef;
  --cream-2: #f3ece0;
  --card: #ffffff;
  --ink: #2b2b2b;
  --ink-soft: #554d44;
  --muted: #8a8177;
  --line: #e9e0d1;
  --terra: #c9743f;
  --terra-dark: #a85c2c;
  --terra-soft: #f6e2d2;
  --teal: #2f6f6b;
  --teal-soft: #dcebe9;
  --danger: #b03a3a;
  --ok: #3f7d3f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 16px rgba(60, 42, 20, 0.07);
  --shadow-lg: 0 12px 34px rgba(60, 42, 20, 0.12);
  --nav-h: 66px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}

/* admin */
body.admin-body {
  --cream: #eef1f4;
  --cream-2: #e3e8ec;
  --card: #ffffff;
  --terra: #2b3a45;
  --terra-dark: #1d2830;
  --terra-soft: #dfe6ea;
  --teal: #3f7d8c;
  --teal-soft: #dcebee;
  --line: #dde4e8;
  --ink: #22303a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

body.admin-body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

img { max-width: 100%; display: block; }
a { color: var(--terra-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; }
h2 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); font-size: .88rem; }
.source-line { color: var(--muted); font-size: .86rem; margin: 0 0 12px; }

/* ------------------------------------------------------------ ecran d'ouverture */
#app-splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #faf6ef;
  color: #c9743f;
  font-weight: 700;
  letter-spacing: .04em;
}
body.admin-body #app-splash { background: #2b3a45; color: #fff; }
#app-splash.show { display: flex; animation: splashOut .45s ease 1.2s forwards; }
#app-splash img { border-radius: 22px; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ------------------------------------------------------------ barre du haut */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: rgba(250, 246, 239, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
body.admin-body .topbar { background: rgba(238, 241, 244, .9); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark { display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--serif); font-size: 1.1rem; }
.brand-text em { font-style: normal; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.topnav { display: none; gap: 4px; margin-left: 12px; }
.topnav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.topnav a.active, .topnav a:hover { background: var(--terra-soft); color: var(--terra-dark); text-decoration: none; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, color .18s ease, border-color .18s ease;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-ghost.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 13px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------ structure */
.page { max-width: 1180px; margin: 0 auto; padding: 18px 14px 28px; }
.section { margin: 30px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, .03);
}
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 12px; grid-template-columns: 1fr; }

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, #36302a, #1e1a16);
  color: #fff;
  padding: 34px 22px 28px;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 12%, rgba(201, 116, 63, .45), transparent 58%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 640px; }
.hero h1 { font-size: 2rem; color: #fff; margin-bottom: .3em; }
.hero p { color: rgba(255, 255, 255, .82); font-size: 1.02rem; }
.hero .eyebrow { font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: #e8b48d; margin-bottom: 10px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero .btn-primary { background: var(--terra); }
.hero .btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; background: rgba(255, 255, 255, .06); }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.stat {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat strong { display: block; font-size: 1.35rem; font-family: var(--serif); }
.stat span { font-size: .78rem; color: rgba(255, 255, 255, .7); }

/* ------------------------------------------------------------ cartes motif */
.pattern-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pattern-card .thumb {
  background: var(--cream-2);
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
}
.pattern-card .thumb canvas { max-width: 100%; height: auto; }
.pattern-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pattern-card h3 { margin: 0; font-size: 1.02rem; }
.pattern-card .meta { font-size: .78rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.pattern-card .desc { font-size: .88rem; color: var(--ink-soft); flex: 1; }
.pattern-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--ink-soft);
}
.badge-terra { background: var(--terra-soft); color: var(--terra-dark); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-live { background: #e3f1e3; color: var(--ok); }

/* ------------------------------------------------------------ editeur */
.editor-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.editor-title {
  flex: 1 1 240px;
  font-family: var(--serif);
  font-size: 1.3rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
}
.editor-head-actions { display: flex; gap: 8px; margin-left: auto; }
.save-state { font-size: .78rem; color: var(--muted); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, background .18s ease;
}
.tool:active { transform: scale(.97); }
.tool.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.toolbar-sep { width: 1px; background: var(--line); margin: 4px 2px; }

.editor-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.canvas-scroll { overflow: auto; max-height: 62vh; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); }
#ed-canvas { display: block; touch-action: none; margin: 0 auto; }
.zoom { display: flex; align-items: center; gap: 8px; }
.zoom input[type=range] { width: 110px; accent-color: var(--terra); }

.editor-info { margin-top: 12px; font-size: .85rem; color: var(--ink-soft); }
.editor-info p { margin: 0 0 8px; }
.usage-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; margin-bottom: 8px; background: var(--cream-2); }
.usage-bar span { display: block; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .76rem; color: var(--muted); }
.usage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.usage-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.symbol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stitch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.stitch-btn:active { transform: scale(.97); }
.stitch-btn.active { border-color: var(--terra); background: var(--terra-soft); }
.stitch-btn canvas { width: 34px; height: 34px; }
.stitch-btn span { font-size: .68rem; font-weight: 700; color: var(--ink-soft); }
.stitch-btn em { font-style: normal; font-size: .6rem; color: var(--muted); text-align: center; line-height: 1.15; }

.color-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.swatch-wrap { position: relative; }
.swatch {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease;
}
.swatch:active { transform: scale(.94); }
.swatch.active { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-soft); }
.swatch-add { background: var(--cream-2); color: var(--ink-soft); font-size: 1.3rem; font-weight: 700; line-height: 1; }
.swatch-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--ink-soft);
  color: #fff;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.color-picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--ink-soft); margin-bottom: 10px; }
.color-picker input[type=color] { width: 56px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }
.color-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

.rows-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; }
.row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.row-item strong { font-size: .82rem; }
.row-info { font-size: .74rem; color: var(--muted); }
.row-mini { display: flex; gap: 3px; margin-left: auto; }
.row-mini i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.row-acts { display: flex; gap: 4px; }
.row-acts button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: .85rem;
  padding: 0;
}
.row-acts button.danger { color: var(--danger); }
.row-acts button[disabled] { opacity: .35; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-grid label, .wide { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 400;
  color: var(--ink);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--terra-soft); border-color: var(--terra); }

.export-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.preview-box { display: none; }
.preview-box.open { display: block; }
#ed-photo { width: 100%; border-radius: var(--radius-sm); background: #241d17; }

/* ------------------------------------------------------------ listes/divers */
.notice {
  background: var(--terra-soft);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: .88rem;
  margin-bottom: 16px;
}
.notice p { margin: 0; }

.empty {
  text-align: center;
  padding: 34px 18px;
  color: var(--muted);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty h3 { color: var(--ink); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; min-width: 0; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.list-row .grow { flex: 1 1 180px; min-width: 0; }
.list-row strong { display: block; }
.list-row .sub { font-size: .8rem; color: var(--muted); }
.list-row .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.gallery-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-card .thumb { background: var(--cream-2); padding: 10px; display: flex; justify-content: center; }
.gallery-card .thumb canvas { max-width: 100%; height: auto; }
.gallery-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gallery-card h3 { margin: 0; font-size: .98rem; }
.gallery-card .author { font-size: .78rem; color: var(--muted); }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-soft);
  align-self: flex-start;
  transition: transform .12s ease;
}
.like-btn:active { transform: scale(.96); }
.like-btn.liked { background: var(--terra-soft); border-color: var(--terra); color: var(--terra-dark); }

.price-card { display: flex; flex-direction: column; gap: 12px; }
.price-card .price { font-family: var(--serif); font-size: 2rem; color: var(--terra); }
.price-card ul { margin: 0; padding-left: 20px; font-size: .9rem; color: var(--ink-soft); }
.price-card.recommended { border: 2px solid var(--terra); }
.price-card .missing { color: var(--muted); }
.price-card .missing li { text-decoration: line-through; }

/* ------------------------------------------------------------ install */
.install-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 22px 0;
  border: 1px solid var(--line);
}
.install-icons { display: flex; gap: 8px; color: var(--ink-soft); }
.install-card > div { flex: 1 1 220px; }
.install-card strong { display: block; }
.install-card p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------------------ modale / toast */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(30, 22, 14, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 84vh;
  overflow: auto;
}
.modal-box p { font-size: .92rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  transform: translate(-50%, 18px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: .88rem;
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: calc(100% - 28px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }

/* ------------------------------------------------------------ navigation du bas */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 2px;
  height: var(--nav-h);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
body.admin-body .bottom-nav { background: rgba(255, 255, 255, .88); }
.bottom-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .68rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 14px;
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
.bottom-item:hover { text-decoration: none; }
.bottom-item:active { transform: scale(.95); }
.bottom-item.active { background: var(--terra-soft); color: var(--terra-dark); font-weight: 700; }

/* ------------------------------------------------------------ pied de page */
.site-footer {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 24px 16px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.footer-inner { display: grid; gap: 18px; grid-template-columns: 1fr; }
.footer-inner strong { color: var(--ink); font-family: var(--serif); }
.footer-links { display: flex; flex-direction: column; gap: 5px; }
.footer-bottom { margin: 18px 0 0; font-size: .78rem; }

/* ------------------------------------------------------------ admin */
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 16px 14px 30px; }
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-head h1 { margin: 0; font-size: 1.4rem; }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.admin-tabs button {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, background .18s ease;
}
.admin-tabs button:active { transform: scale(.97); }
.admin-tabs button.active { background: var(--terra); border-color: var(--terra); color: #fff; }
.admin-section { display: none; }
.admin-section.active { display: block; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.kpi strong { display: block; font-family: var(--serif); font-size: 1.6rem; }
.kpi span { font-size: .78rem; color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--cream); }
tr:last-child td { border-bottom: none; }
td .btn-sm { margin-right: 4px; }
.pill { font-size: .7rem; padding: 3px 9px; border-radius: 999px; background: var(--cream-2); color: var(--ink-soft); white-space: nowrap; }
.pill.ok { background: #e3f1e3; color: var(--ok); }
.pill.off { background: #f6dede; color: var(--danger); }
.pill.premium { background: var(--terra-soft); color: var(--terra-dark); }

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

.admin-login {
  max-width: 420px;
  margin: 40px auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.gate {
  max-width: 520px;
  margin: 46px auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

/* ------------------------------------------------------------ auth pages */
.auth-page { max-width: 460px; margin: 0 auto; padding: 26px 16px 40px; }
.auth-card { background: var(--card); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: 13px; }
.auth-alt { font-size: .86rem; color: var(--muted); margin-top: 14px; }
.brand-strip { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }

/* ------------------------------------------------------------ responsive */
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .symbol-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 768px) {
  body { font-size: 16px; padding-bottom: 40px; }
  .topnav { display: flex; }
  .bottom-nav { display: none; }
  .toast { bottom: 26px; }
  .hero { padding: 52px 42px 44px; }
  .hero h1 { font-size: 2.7rem; }
  .page { padding: 26px 22px 40px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .editor-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); align-items: start; }
  .panel { padding: 20px; }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .symbol-grid { grid-template-columns: repeat(4, 1fr); }
}

/* impression des fiches */
@media print {
  .topbar, .bottom-nav, .site-footer, .toolbar, .export-row { display: none !important; }
  body { background: #fff; padding: 0; }
}

/* boutons de navigation du bas (administration) */
button.bottom-item {
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.admin-nav-simple .bottom-item { flex: 0 0 auto; padding: 0 18px; }

/* l'apercu photographique de l'ouvrage est visible d'emblee */
.preview-box { display: block; }
