/* GeoGab — console API des clients.
   D’après les maquettes v2 (25 novembre 2026) : barre latérale flottante en
   verre (la seule surface en verre, comme le veut le guide d’Apple), contenu
   en listes groupées, tableaux sobres, vert GeoGab pour les actions. */

@font-face {
  font-family: "Inter GeoGab";
  src: url("/admin/vendor/inter/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --glass: rgba(232, 232, 237, 0.78);
  --glass-border: rgba(0, 0, 0, 0.08);
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #636366;
  --hover: rgba(0, 0, 0, 0.04);
  --selected: rgba(0, 0, 0, 0.08);
  --accent: #0b7558;
  --accent-hover: #09634a;
  --accent-text: #0b7558;
  --orange: #c55300;
  --red: #d70015;
  --focus: rgba(11, 117, 88, 0.45);
  --series: #0b7558, #0b4fa0, #12a9bc, #8a6420;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter GeoGab", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --glass: rgba(44, 44, 46, 0.78);
    --glass-border: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.2);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #a1a1a6;
    --hover: rgba(255, 255, 255, 0.06);
    --selected: rgba(255, 255, 255, 0.12);
    --accent: #0b7558;
    --accent-hover: #0d8a68;
    --accent-text: #5fd6a9;
    --orange: #ffa056;
    --red: #ff6961;
    --focus: rgba(95, 214, 169, 0.55);
  }
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
p {
  margin: 0;
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover,
p a {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted {
  color: var(--text-2);
}
.small {
  font-size: 12px;
  line-height: 16px;
}
.center {
  text-align: center;
}
.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---- Boutons (capsules macOS 26) ------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 16px;
  border: 0.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
  font-weight: 500;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover {
  background: var(--accent-hover);
}
.btn.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 600;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn.block {
  width: 100%;
  min-height: 40px;
}
.text-btn {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
}
.icon-btn,
.more-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
}
.more-btn {
  color: var(--accent-text);
}
.icon-btn:hover,
.more-btn:hover,
.more-btn[aria-expanded="true"] {
  background: var(--hover);
}
.more-btn .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}
.add-btn {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.add-btn .icon {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

/* ---- Connexion ------------------------------------------------------------------- */
.gate {
  display: grid;
  min-height: 100dvh;
  padding: 24px 16px;
  place-items: center;
}
.gate-panel {
  width: min(100%, 380px);
}
.gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
}
.gate-brand img {
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 0.5px var(--line);
}
.gate-form {
  padding: 24px;
  border: 0.5px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.gate-form h1 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  text-align: center;
}
.gate-form > .muted:first-of-type {
  margin: 4px 0 18px;
  text-align: center;
}
.gate-form .muted.small {
  margin-top: 16px;
}

/* ---- Champs ------------------------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field > span {
  font-weight: 500;
}
.field em {
  margin-left: 4px;
  color: var(--text-2);
  font-style: normal;
  font-weight: 400;
}
.field input,
.field textarea,
.copy-line input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
}
.field textarea {
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
.field.top {
  margin-top: 12px;
}
.form-error {
  margin-bottom: 12px;
  color: var(--red);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  cursor: pointer;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

/* ---- Structure ------------------------------------------------------------------------ */
.app {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 8px;
  display: flex;
  flex: 0 0 240px;
  flex-direction: column;
  gap: 1px;
  height: calc(100dvh - 16px);
  margin: 8px 0 8px 8px;
  padding: 12px 8px;
  border: 0.5px solid var(--glass-border);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
}
.account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 14px;
}
.account img {
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 0 0 0.5px var(--line);
}
.account-name {
  font-weight: 600;
  line-height: 18px;
}
.account-plan {
  color: var(--text-3);
  font-size: 12px;
  line-height: 16px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text);
}
.nav-item:hover {
  background: var(--hover);
  text-decoration: none;
}
.nav-item .icon {
  color: var(--accent-text);
}
.nav-item span {
  flex: 1;
}
.nav-item .ext {
  width: 11px;
  height: 11px;
  color: var(--text-3);
}
.nav-item[aria-current="page"] {
  background: var(--selected);
  font-weight: 600;
}
.nav-section {
  padding: 16px 8px 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}
.me {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 4px 0 8px;
  border-top: 0.5px solid var(--line);
}
.me-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.monogram {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(#a5abb8, #858994);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 28px 40px;
  outline: none;
}
.view {
  max-width: 980px;
}
.toolbar {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
}
.toolbar h1 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 4px 8px;
}
.section-title h2 {
  font-size: 13px;
  font-weight: 600;
}
.section-title .muted {
  font-weight: 400;
}

/* ---- Listes groupées et tableaux ------------------------------------------------- */
.box {
  overflow: hidden;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.box.pad {
  padding: 16px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-height: 40px;
  padding: 8px 14px;
}
.row + .row {
  border-top: 0.5px solid var(--line);
}
.row-label {
  flex: 0 0 170px;
  color: var(--text-2);
}
.row.muted-row {
  color: var(--text-2);
}
.table-box {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  height: 32px;
  padding: 0 12px;
  border-bottom: 0.5px solid var(--line-strong);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table td {
  height: 42px;
  padding: 0 12px;
  border-bottom: 0.5px solid var(--line);
  white-space: nowrap;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table th:first-child,
.table td:first-child {
  padding-left: 16px;
}
.table .num {
  text-align: right;
}
.table .act {
  width: 44px;
}
.table .strong {
  font-weight: 500;
}
.table .empty td {
  height: 60px;
  color: var(--text-2);
  text-align: center;
  white-space: normal;
}
.note {
  margin: 8px 4px 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 16px;
}
.notice {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}
.notice .icon {
  margin-top: 2px;
  color: var(--orange);
}
.code {
  margin: 0 0 10px;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--surface-2);
  white-space: pre;
}

/* ---- Utilisation ----------------------------------------------------------------------- */
.usage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
}
.big {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stack {
  display: flex;
  gap: 2px;
  height: 14px;
  margin: 12px 0 10px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-2);
}
.stack span {
  display: block;
  height: 100%;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.cols {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}
.col-wide {
  flex: 3 1 420px;
  min-width: 0;
}
.col {
  flex: 2 1 280px;
  min-width: 0;
}
.chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 160px auto;
  column-gap: 8px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  border-bottom: 0.5px solid var(--line-strong);
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat;
}
.chart-bars span {
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.chart-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: -6px 0;
  color: var(--text-2);
  font-size: 11px;
}
.chart-days {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  color: var(--text-2);
  font-size: 11px;
}

/* ---- Forfaits ---------------------------------------------------------------------------- */
.plan-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 14px;
  cursor: pointer;
}
.plan-option + .plan-option {
  border-top: 0.5px solid var(--line);
}
.plan-option:hover {
  background: var(--hover);
}
.plan-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.plan-option .grow strong {
  font-weight: 600;
}
.plan-option .price {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.plan-option.current {
  cursor: default;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ---- Menu et fenêtres ------------------------------------------------------------------- */
.menu {
  position: absolute;
  z-index: 60;
  min-width: 200px;
  padding: 5px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.menu button {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}
.menu button:hover,
.menu button:focus-visible {
  background: var(--hover);
  outline: none;
}
.menu .danger {
  color: var(--red);
}
dialog {
  color: var(--text);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.25);
}
.sheet {
  width: min(100vw - 32px, 520px);
  max-width: none;
  padding: 22px;
  border: 0.5px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
.sheet.small {
  width: min(100vw - 32px, 380px);
}
.sheet h2 {
  margin-bottom: 14px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}
.sheet .muted.small {
  margin-top: -6px;
}
.secret-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.secret-head h2 {
  margin-bottom: 2px;
}
.tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}
.copy-line {
  display: flex;
  gap: 8px;
}
.copy-line input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  font-size: 12px;
}
.toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: 10px;
  background: #1d1d1f;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: var(--red);
}

/* ---- Téléphone ------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .app {
    display: block;
  }
  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    height: auto;
    margin: 0;
    padding: 8px 10px;
    border-width: 0 0 0.5px;
    border-radius: 0;
  }
  .account {
    flex: 1 1 100%;
    padding: 0 4px 6px;
  }
  .nav-section,
  .nav-item[target],
  .nav-item[href^="mailto"] {
    display: none;
  }
  .nav-item {
    flex: 1 1 auto;
    justify-content: center;
    height: 34px;
    font-size: 13px;
  }
  .nav-item span {
    flex: none;
  }
  .me {
    position: absolute;
    top: 8px;
    right: 10px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .me-email,
  .me .monogram {
    display: none;
  }
  .content {
    padding: 12px 16px 40px;
  }
  .row-label {
    flex-basis: 100%;
  }
  .table .opt {
    display: none;
  }
  .table th,
  .table td {
    padding: 0 6px;
  }
  .table th:first-child,
  .table td:first-child {
    padding-left: 12px;
    white-space: normal;
  }
  .table td.mono {
    font-size: 11px;
  }
  .toast {
    right: 16px;
    left: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---- Essai et recharges ------------------------------------------------------------------ */
.trial-notice {
  margin: 0 0 14px;
}
.recharge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 20px;
  margin-top: 12px;
}
.recharge-row .field {
  width: 180px;
  margin-bottom: 0;
}
.recharge-total {
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
}
.recharge-total strong {
  font-size: 17px;
  font-weight: 600;
}
