/* ===========================================================================
   Snipp Portal - feuille de style
   Dark mode, accent cyan, typographie systeme.
   =========================================================================== */

:root {
  --bg:          #080b10;
  --bg-soft:     #0d1219;
  --surface:     #111822;
  --surface-2:   #16202c;
  --border:      #1f2a38;
  --border-soft: #18222e;

  --text:        #e6edf5;
  --text-muted:  #8494a8;
  --text-dim:    #5d6b7c;

  --accent:      #38bdf8;
  --accent-dark: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, .12);

  --danger:      #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --success:     #4ade80;
  --success-soft:rgba(74, 222, 128, .12);
  --warning:     #fbbf24;
  --warning-soft:rgba(251, 191, 36, .12);

  --radius:    12px;
  --radius-sm: 8px;
  --wrap:      1080px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(56, 189, 248, .07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7dd3fc; }

h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.02em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-block: 40px 64px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono  { font-family: var(--mono); font-size: 13px; }
.inline { display: inline; }

/* --- Barre superieure ---------------------------------------------------- */
.topbar {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 11, 16, .8);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { color: var(--text); }
.brand__mark {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-dark));
  color: #04121c; font-weight: 800; font-size: 15px;
}
.brand__text { letter-spacing: -.01em; }

.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--text-muted); font-size: 14px; }
.topnav a:hover { color: var(--text); }
.topnav a.btn { color: #04121c; }

/* --- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn--primary { background: var(--accent); color: #04121c; }
.btn--primary:hover { background: #7dd3fc; color: #04121c; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: #2c3b4d; background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--block { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* --- Cartes -------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card + .card { margin-top: 20px; }
.card__head { margin-bottom: 22px; }
.card__title { font-size: 22px; font-weight: 650; }
.card__title--sm { font-size: 16px; margin-bottom: 14px; }
.card__sub { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.card__foot {
  margin: 22px 0 0; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  text-align: center; font-size: 14px; color: var(--text-muted);
}

/* --- Pages d'authentification -------------------------------------------- */
.auth { display: flex; justify-content: center; padding-top: 24px; }
.card--auth { width: 100%; max-width: 440px; }

/* --- Formulaires --------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field__label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.field__optional { color: var(--text-dim); font-weight: 400; }
.field__input {
  width: 100%; padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: var(--text-dim); }
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field--invalid .field__input { border-color: var(--danger); }
.field--invalid .field__input:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.field__hint  { margin: 6px 0 0; font-size: 12.5px; color: var(--text-dim); }
.field__error { margin: 6px 0 0; font-size: 12.5px; color: var(--danger); }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-muted); }
.check input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; }
.check label { cursor: pointer; }
.check--invalid label { color: var(--danger); }

.row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.row--between { justify-content: space-between; flex-wrap: wrap; }
.link--muted { color: var(--text-muted); font-size: 13.5px; }
.link--muted:hover { color: var(--accent); }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Alertes ------------------------------------------------------------- */
.flashes { margin-bottom: 22px; display: grid; gap: 10px; }
.alert {
  padding: 12px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 14px;
}
.alert--success { background: var(--success-soft); border-color: rgba(74,222,128,.3);  color: #bbf7d0; }
.alert--error   { background: var(--danger-soft);  border-color: rgba(248,113,113,.3); color: #fecaca; }
.alert--warning { background: var(--warning-soft); border-color: rgba(251,191,36,.3);  color: #fde68a; }
.card .alert { margin-bottom: 20px; }

/* --- Accueil ------------------------------------------------------------- */
.hero { padding: 40px 0 56px; max-width: 680px; }
.eyebrow {
  margin: 0 0 16px; font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.hero__title { font-size: clamp(32px, 5.5vw, 50px); font-weight: 700; }
.hero__lead { margin: 20px 0 0; font-size: 17px; color: var(--text-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* --- Grilles ------------------------------------------------------------- */
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid .card { margin-top: 0; }

/* --- Statistiques -------------------------------------------------------- */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat__label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.stat__value { font-size: 20px; font-weight: 650; }

/* --- En-tete de page ----------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 26px;
}
.page-title { font-size: 26px; font-weight: 650; }

.badge {
  display: inline-block; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-2); white-space: nowrap;
}
.badge--accent { color: var(--accent); border-color: rgba(56,189,248,.35); background: var(--accent-soft); }

/* --- Tableaux ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 9px 12px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-muted); }
.table tr:last-child td { border-bottom: none; }

/* --- Liste de definitions ------------------------------------------------ */
.deflist { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: 14px; }
.deflist dt { color: var(--text-dim); }
.deflist dd { margin: 0; color: var(--text); }

/* --- Encart -------------------------------------------------------------- */
.note {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px; border: 1px dashed var(--border);
  border-radius: var(--radius); background: var(--bg-soft);
}
.note p { margin: 0; font-size: 14px; }

/* --- Page d'erreur ------------------------------------------------------- */
.errpage { text-align: center; padding: 60px 0; }
.errpage__code { margin: 0; font-size: 64px; font-weight: 700; color: var(--accent); line-height: 1; }
.errpage__title { margin: 12px 0 8px; font-size: 22px; }
.errpage .btn { margin-top: 22px; }

/* --- Pied de page -------------------------------------------------------- */
.footer { border-top: 1px solid var(--border-soft); padding-block: 22px; }
.footer__inner { display: flex; gap: 10px; font-size: 13px; color: var(--text-dim); }
.footer__sep { color: var(--border); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 780px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .topnav { gap: 12px; }
  .topnav a:not(.btn) { font-size: 13.5px; }
  .page-head { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand__text { display: none; }
  .card { padding: 20px 18px; }
}

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

/* ===========================================================================
   Enseigne — interface de jeu
   =========================================================================== */

:root {
  --pos: #4ade80;
  --neg: #f87171;
  --work: #fbbf24;
}

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.ta-r { text-align: right; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.crumb { margin: 0 0 6px; font-size: 13px; color: var(--text-dim); }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--accent); }

.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat__unit { font-size: 14px; color: var(--text-dim); font-weight: 400; }
.stat--alert { border-color: rgba(248, 113, 113, .45); }

/* --- puces ---------------------------------------------------------------- */
.chip {
  display: inline-block;
  padding: 2px 7px;
  margin-left: 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-muted);
  white-space: nowrap;
  vertical-align: 1px;
}
.chip--work  { color: var(--work);   border-color: rgba(251, 191, 36, .35);  background: var(--warning-soft); }
.chip--out   { color: var(--neg);    border-color: rgba(248, 113, 113, .35); background: var(--danger-soft); }
.chip--mine  { color: var(--accent); border-color: rgba(56, 189, 248, .35);  background: var(--accent-soft); }
.chip--calm  { color: var(--pos);    border-color: rgba(74, 222, 128, .3);   background: var(--success-soft); }

/* --- listes ligne par ligne ---------------------------------------------- */
.worklist { list-style: none; margin: 0; padding: 0; }
.worklist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.worklist li:last-child { border-bottom: none; }
.worklist li:first-child { padding-top: 0; }
.worklist--ledger li { font-size: 13.5px; }

.deflist--money dd { font-variant-numeric: tabular-nums; text-align: right; }

/* --- jauge de rayon ------------------------------------------------------- */
.gauge {
  display: inline-block;
  width: 54px; height: 5px;
  margin-left: 8px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}
.gauge--wide { display: block; width: 100%; height: 7px; margin: 0 0 18px; }
.gauge__fill { display: block; height: 100%; background: var(--accent); }
.gauge__fill--low { background: var(--neg); }

/* --- la ville ------------------------------------------------------------- */
.city-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.qt {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px 16px;
  min-height: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .15s, background .15s;
}
a.qt:hover { border-color: #33465c; background: var(--surface-2); color: var(--text); }
.qt--starter { border-color: rgba(56, 189, 248, .4); }
.qt--industry {
  background: repeating-linear-gradient(135deg,
    var(--surface), var(--surface) 8px, var(--bg-soft) 8px, var(--bg-soft) 16px);
  border-style: dashed;
  color: var(--text-muted);
}
.qt__name { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.qt__stat { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.qt__blurb { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.qt__foot {
  margin-top: auto;
  padding-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
}

/* --- emplacements --------------------------------------------------------- */
.premises {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.premise {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 15px 15px;
}
.premise--taken { opacity: .55; }
.premise__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.premise__area { font-size: 16px; font-weight: 650; }
.premise__rent { font-size: 12px; color: var(--text-muted); }
.premise__status { margin: 0; font-size: 13px; color: var(--text-dim); }
.premise__form { display: grid; gap: 9px; }
.premise__note { margin: 2px 0 0; font-size: 11.5px; color: var(--text-dim); text-align: center; }
.field__input--sm { padding: 8px 10px; font-size: 13px; }

/* --- formulaires en ligne ------------------------------------------------- */
.inline-form .field:last-of-type { margin-bottom: 14px; }
.row-tight { display: flex; gap: 10px; }
.row-tight .field__input { flex: 1; }

/* --- graphe horaire ------------------------------------------------------- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.chart__bar {
  flex: 1;
  min-width: 4px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: .85;
}
.chart__bar--out { background: var(--neg); opacity: 1; }
.chart__axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 18px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.chart__axis .muted { font-family: var(--font); }

.row--mine td { background: var(--accent-soft); color: var(--text); }
.row--mine td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .city-grid { grid-template-columns: 1fr; }
  .chart__axis .muted { display: none; }
}
