/* Akore internal console — stylesheet.
 *
 * Written against styles/akore-tokens.css, which is the platform's single source of colour,
 * type and spacing. Nothing here redefines a token; everything references one, so this console
 * and the client-facing pages stay the same product.
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font-body, "Manrope", system-ui, sans-serif);
  color: var(--dark, #08090c); background: var(--ice, #f4f6f8);
  -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; line-height: 1; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line, #e3e6ea); background: #fff; color: var(--dark, #08090c);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, transform .08s; }
.btn:hover { background: var(--ice2, #f4f2fb); border-color: var(--violet-300, #bcaef7); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--violet-600, #6d4fe0); border-color: var(--violet-600, #6d4fe0); color: #fff; }
.btn-primary:hover { background: var(--violet-700, #4834b0); border-color: var(--violet-700, #4834b0); }
.btn-danger { color: #b3261e; border-color: #f0c9c6; }
.btn-danger:hover { background: #fdf3f2; border-color: #e5a9a4; }
.btn-sm { font-size: 12.5px; padding: 7px 12px; border-radius: 8px; }
.btn-wide { width: 100%; }
.btn-quiet { border-color: transparent; background: none; }
.btn-quiet:hover { background: var(--ice2, #f4f2fb); border-color: transparent; }
/* ── Shell ───────────────────────────────────────────────────────────────────────────────── */
.shell { display: flex; height: 100vh; }
.shell[hidden] { display: none; }

.rail { position: relative; flex: 0 0 68px; z-index: 40; }
.rail-inner { position: absolute; inset: 0 auto 0 0; width: 68px; background: #0f1117;
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .18s var(--ease-standard, cubic-bezier(.2,.6,.2,1)); }
.rail:hover .rail-inner, .rail.pinned .rail-inner, .rail:focus-within .rail-inner {
  width: 244px; box-shadow: 14px 0 34px rgba(8,9,12,.28); }
.rail-top { display: flex; align-items: center; gap: 12px; padding: 18px 16px 22px; min-height: 64px; }
.rail-mark { flex: 0 0 36px; }
.rail-mark img { width: 36px; height: 36px; display: block; border-radius: 9px; }
.rail-co { font-family: var(--font-display, sans-serif); font-weight: 700; font-size: 14px;
  color: #fff; white-space: nowrap; }
.rail-nav, .rail-foot { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.rail-foot { margin-top: auto; padding-bottom: 16px; }
.rail-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 10px;
  border: 0; border-radius: 10px; background: none; color: #c9c2e8; cursor: pointer;
  text-align: left; font-size: 14px; white-space: nowrap; text-decoration: none; }
.rail-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.rail-item.active { background: var(--violet-600, #6d4fe0); color: #fff; font-weight: 600; }
.rail-item:focus-visible { outline: 2px solid var(--emerald-400, #34c592); outline-offset: 2px; }
.rail-ico { flex: 0 0 24px; display: flex; align-items: center; justify-content: center; }
.rail-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.rail-lang { display: flex; gap: 4px; padding: 10px 10px 6px; }
.rail-lang button { flex: 1; font-size: 11.5px; font-weight: 700; color: #c9c2e8; cursor: pointer;
  background: rgba(255,255,255,.06); border: 0; border-radius: 8px; padding: 7px 0; }
.rail-lang button.active { background: var(--violet-600, #6d4fe0); color: #fff; }

.content { flex: 1; min-width: 0; overflow-y: auto; }
.content.fixed { overflow: hidden; }

/* ── Page furniture ──────────────────────────────────────────────────────────────────────── */
.page { padding: 30px 38px 64px; }
.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head-main { min-width: 0; }
.page-h1 { font-family: var(--font-display, sans-serif); font-size: 26px; font-weight: 700; }
.page-sub { font-size: 14px; color: var(--ink-60, #5b6472); margin-top: 5px; max-width: 72ch; line-height: 1.55; }
.page-acts { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1 1 240px; max-width: 380px; font-size: 14px; padding: 10px 13px;
  border: 1px solid var(--line, #e3e6ea); border-radius: 10px; background: #fff; }
.toolbar input:focus { outline: none; border-color: var(--violet-400, #9b86f2); box-shadow: 0 0 0 3px rgba(109,79,224,.12); }
.count { font-size: 12.5px; color: var(--ink-60, #5b6472); }

.seg { display: inline-flex; background: #fff; border: 1px solid var(--line, #e3e6ea); border-radius: 10px; padding: 3px; }
.seg button { font-size: 12.5px; font-weight: 600; padding: 7px 14px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-60, #5b6472); cursor: pointer; }
.seg button.active { background: var(--violet-600, #6d4fe0); color: #fff; }

.empty { background: #fff; border: 1px dashed var(--line, #e3e6ea); border-radius: 14px;
  padding: 44px 26px; text-align: center; color: var(--ink-60, #5b6472); font-size: 14px; }
.panel { background: #fff; border: 1px solid var(--line, #e3e6ea); border-radius: 16px; padding: 22px 24px; margin-bottom: 18px; }
.panel-h { font-family: var(--font-display, sans-serif); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.panel-sub { font-size: 13px; color: var(--ink-60, #5b6472); line-height: 1.55; margin-bottom: 16px; max-width: 70ch; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--emerald-100, #d5f4e8); color: var(--emerald-700, #0f7d5b); }
.chip.warn { background: #fff3e0; color: #8a5a00; }
.chip.idle { background: #f1f2f4; color: #6b7280; }
.chip.info { background: var(--violet-100, #ece7fd); color: var(--violet-700, #4834b0); }

/* ── Customer grid ───────────────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card-link { display: flex; flex-direction: column; text-align: left; background: #fff; cursor: pointer;
  border: 1px solid var(--line, #e3e6ea); border-radius: 16px; padding: 20px 20px 16px;
  transition: transform .14s, box-shadow .14s, border-color .14s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(16,19,25,.10);
  border-color: var(--violet-300, #bcaef7); }
.card-name { font-family: var(--font-display, sans-serif); font-size: 18px; font-weight: 700; }
.card-meta { font-family: var(--font-mono, monospace); font-size: 11.5px; color: #9aa3ae; margin: 3px 0 15px; }
.steps { display: flex; flex-direction: column; gap: 7px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.step-l { flex: 0 0 76px; color: var(--ink-60, #5b6472); }
.card-foot { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line, #e3e6ea);
  display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-60, #5b6472); }
.card-go { font-weight: 700; color: var(--violet-600, #6d4fe0); }
.dot { display: inline-flex; align-items: center; gap: 6px; }
.dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-500, #1ea97c); }
.dot.off i { background: #cdd3db; }

/* ── Customer detail ─────────────────────────────────────────────────────────────────────── */
.subnav { display: flex; align-items: center; gap: 10px; padding: 0 38px; background: #fff;
  border-bottom: 1px solid var(--line, #e3e6ea); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.subnav-back { margin-right: 4px; }
.subnav-name { font-family: var(--font-display, sans-serif); font-weight: 700; font-size: 15px; margin-right: 10px; }
.subnav-tabs { display: flex; gap: 2px; margin-left: auto; }
.subnav-tab { font-size: 13px; padding: 15px 14px; border: 0; background: none; cursor: pointer;
  color: var(--ink-60, #5b6472); border-bottom: 2px solid transparent; }
.subnav-tab:hover { color: var(--dark, #08090c); }
.subnav-tab.active { color: var(--violet-700, #4834b0); border-bottom-color: var(--violet-600, #6d4fe0); font-weight: 600; }

.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 18px; font-size: 13.5px; align-items: center; }
.kv dt { color: var(--ink-60, #5b6472); }
.kv dd { margin: 0; }
.row-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ── Tables (users) ──────────────────────────────────────────────────────────────────────── */
.tbl-wrap { background: #fff; border: 1px solid var(--line, #e3e6ea); border-radius: 16px; overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-60, #5b6472); padding: 13px 18px; border-bottom: 1px solid var(--line, #e3e6ea); background: var(--ice, #f8f9fb); }
.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--line, #e3e6ea); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--ice2, #f4f2fb); }
.tbl .u-name { font-weight: 600; }
.tbl .u-sub { font-family: var(--font-mono, monospace); font-size: 11.5px; color: #9aa3ae; }
.tbl td.right { text-align: right; white-space: nowrap; }

/* A row's actions live behind one control rather than three competing buttons. */
.menu { position: relative; display: inline-block; }
.menu-btn { width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 1px solid transparent;
  background: none; cursor: pointer; color: var(--ink-60, #5b6472); font-size: 17px; line-height: 1; }
.menu-btn:hover { background: #fff; border-color: var(--line, #e3e6ea); }
.menu-pop { position: absolute; right: 0; top: 34px; min-width: 212px; background: #fff; z-index: 20;
  border: 1px solid var(--line, #e3e6ea); border-radius: 12px; box-shadow: 0 14px 34px rgba(16,19,25,.14);
  padding: 6px; display: none; }
.menu.open .menu-pop { display: block; }
.menu-pop button { display: block; width: 100%; text-align: left; font-size: 13px; padding: 9px 11px;
  border: 0; border-radius: 8px; background: none; cursor: pointer; }
.menu-pop button:hover { background: var(--ice2, #f4f2fb); }
.menu-pop button.danger { color: #b3261e; }
.menu-pop button.danger:hover { background: #fdf3f2; }
.menu-sep { height: 1px; background: var(--line, #e3e6ea); margin: 5px 0; }

/* ── Dialog ──────────────────────────────────────────────────────────────────────────────── */
.dlg-back { position: fixed; inset: 0; background: rgba(8,9,12,.46); display: flex; align-items: center;
  justify-content: center; padding: 24px; z-index: 90; }
.dlg { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; padding: 26px;
  box-shadow: 0 24px 60px rgba(16,19,25,.22); max-height: 88vh; overflow-y: auto; }
.dlg h2 { font-family: var(--font-display, sans-serif); font-size: 18px; font-weight: 700; }
.dlg p.dlg-sub { font-size: 13px; color: var(--ink-60, #5b6472); margin: 7px 0 20px; line-height: 1.55; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select { width: 100%; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line, #e3e6ea); border-radius: 10px; background: #fff; }
.field input:focus, .field select:focus { outline: none; border-color: var(--violet-400, #9b86f2);
  box-shadow: 0 0 0 3px rgba(109,79,224,.12); }
.field .hint { font-size: 11.5px; color: var(--ink-60, #5b6472); margin-top: 5px; line-height: 1.45; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.dlg-err { font-size: 12.5px; color: #b3261e; margin-top: 12px; min-height: 1em; }
.dlg-note { background: var(--violet-50, #f6f3fe); border: 1px solid var(--violet-100, #ece7fd);
  border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.55; margin-top: 16px; }
.dlg-note code { font-family: var(--font-mono, monospace); font-size: 13px; background: #fff;
  padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line, #e3e6ea); }

/* ── Toast ───────────────────────────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #0f1117; color: #fff; font-size: 13.5px; padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 12px 30px rgba(8,9,12,.3); z-index: 120; }
.toast[hidden] { display: none; }

@media (max-width: 820px) {
  .page { padding: 22px 16px 56px; }
  .subnav { padding: 0 16px; }
  .subnav-tabs { margin-left: 0; width: 100%; overflow-x: auto; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv dt { margin-top: 10px; }
}


/* A collapsed rail is 68px, but its labels are laid out at full width and were simply clipped by
   the overflow — so every label showed its first letter or two, sliced down the middle. They are
   hidden outright when collapsed and faded in with the rail. */
.rail-co,
.rail-item > span:not(.rail-ico),
.rail-lang { opacity: 0; transition: opacity .14s; }
.rail:hover .rail-co, .rail:hover .rail-item > span:not(.rail-ico), .rail:hover .rail-lang,
.rail.pinned .rail-co, .rail.pinned .rail-item > span:not(.rail-ico), .rail.pinned .rail-lang,
.rail:focus-within .rail-co, .rail:focus-within .rail-item > span:not(.rail-ico), .rail:focus-within .rail-lang {
  opacity: 1; }
.rail-lang { pointer-events: none; }
.rail:hover .rail-lang, .rail.pinned .rail-lang, .rail:focus-within .rail-lang { pointer-events: auto; }

/* Search sits in the page header, beside the title. */
.page-acts input[type=search] { font-size: 14px; padding: 10px 13px; min-width: 260px;
  border: 1px solid var(--line,#e3e6ea); border-radius: 10px; background: #fff; }
.page-acts input[type=search]:focus { outline: none; border-color: var(--violet-400,#9b86f2);
  box-shadow: 0 0 0 3px rgba(109,79,224,.12); }

/* The row menu is positioned against the viewport (see portal-app.js), so the table may clip
   its own overflow without cutting the menu. */
.menu-pop { position: fixed; top: auto; }
.page { padding-top: 26px; }

.field-msg { font-size: 12.5px; color: var(--ink-60,#5b6472); margin-top: 12px; min-height: 1em; line-height: 1.5; }

/* Stacked, not squeezed side by side: three password boxes on one row truncate their own
   placeholders and read as a single control. */
.field-grid { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 380px; margin-bottom: 16px; }
.field-grid input { width: 100%; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line,#e3e6ea); border-radius: 10px; background: #fff; }
.field-grid input:focus { outline: none; border-color: var(--violet-400,#9b86f2);
  box-shadow: 0 0 0 3px rgba(109,79,224,.12); }
.acct { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--ink-60,#5b6472); }

/* Settings rows: one line per thing, opening its own screen. */
.set-list { display: flex; flex-direction: column; border: 1px solid var(--line,#e3e6ea);
  border-radius: 14px; overflow: hidden; background: #fff; }
.set-row { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  font-family: inherit; background: none; border: 0; border-bottom: 1px solid var(--line,#e3e6ea);
  padding: 18px 20px; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row:hover { background: var(--ice2,#f4f2fb); }
.set-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.set-row-title { font-weight: 600; font-size: 14.5px; color: var(--dark,#08090c); }
.set-row-desc { font-size: 12.5px; color: var(--ink-60,#5b6472); line-height: 1.45; }
.set-row-value { font-size: 13px; color: var(--ink-60,#5b6472); white-space: nowrap; }
.set-row-chev { font-size: 22px; line-height: 1; color: #b9bfc9; }
.field-msg.ok  { color: #1b7f5a; }
.field-msg.bad { color: #b4232a; }
/* Recovery codes are shown once and get copied by hand, so they are monospaced and roomy. */
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px;
  margin-top: 12px; max-width: 460px; }
.codes code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px;
  letter-spacing: .06em; padding: 9px 10px; text-align: center; color: var(--dark,#08090c);
  background: var(--ice2,#f4f2fb); border: 1px solid var(--line,#e3e6ea); border-radius: 8px;
  user-select: all; }

/* The account screens are a single reading column: the menu and every screen behind it line up
   on the same edge, instead of a 380px form floating inside a full-width box. */
.page.acct .set-list, .page.acct .panel { max-width: 640px; }
.page.acct .field-grid { max-width: 100%; }

/* ── GEO scanner ─────────────────────────────────────────────────────────────────────────── */
.geo-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.geo-input { flex: 1 1 320px; min-width: 240px; font-family: inherit; font-size: 14px;
  padding: 11px 14px; border: 1px solid var(--line,#e3e6ea); border-radius: 10px; background: #fff; }
.geo-input:focus { outline: none; border-color: var(--violet-400,#9b86f2);
  box-shadow: 0 0 0 3px rgba(109,79,224,.12); }
.geo-check { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px;
  color: var(--ink-60,#5b6472); cursor: pointer; }
.geo-check input { cursor: pointer; }
.geo-paste { width: 100%; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px;
  padding: 10px 12px; border: 1px solid var(--line,#e3e6ea); border-radius: 10px; background: #fff;
  resize: vertical; }
/* The same four numbers, in the same order, as the panel on a customer page. */
.geo-scores { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 18px; }
.geo-score { display: flex; flex-direction: column; gap: 4px; }
.geo-score .n { font-family: var(--font-display, sans-serif); font-size: 26px; font-weight: 800;
  line-height: 1; color: var(--violet-500,#6d4fe0); font-variant-numeric: tabular-nums; }
.geo-score.muted .n { color: var(--ink-60,#5b6472); }
.geo-score .l { font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-60,#5b6472); font-weight: 700; }
.geo-foot { font-size: 12.5px; color: var(--ink-60,#5b6472); margin-top: 12px; }
.geo-acts { gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* The card is one big target; its menu sits above that target rather than inside it. */
.card-wrap { position: relative; display: flex; }
.card-wrap .card-link { flex: 1 1 auto; }
.card-menu { position: absolute; top: 12px; right: 12px; z-index: 2; }
