/* XODNS B2B panel. Tokens and shapes follow the main site's ui/app.css. */
@font-face { font-family: "SiteDigits"; src: local("Segoe UI"), local("Roboto"), local("Helvetica Neue"), local("Arial"); unicode-range: U+0030-0039; }
@font-face { font-family: "LabSans"; src: url("/fonts/Vazirmatn-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "LabSans"; src: url("/fonts/Vazirmatn-FD-Medium.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "LabSans"; src: url("/fonts/Vazirmatn-FD-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
:root {
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #f0f0ec; --surface-3: #e7e7e2;
  --line: rgba(20,22,26,.09); --line-strong: rgba(20,22,26,.16);
  --text: #121417; --text-2: #3a3f46; --muted: #676d76; --faint: #9aa0a8;
  --accent: #3f6d00; --accent-ink: #f7ffe6; --accent-soft: rgba(95,150,0,.11); --accent-line: rgba(63,109,0,.35);
  --ok: #3f6d00; --ok-soft: rgba(95,150,0,.1); --ok-line: rgba(63,109,0,.3);
  --warn: #a16207; --warn-soft: rgba(202,138,4,.1); --warn-line: rgba(161,98,7,.3);
  --danger: #dc2626; --danger-soft: rgba(220,38,38,.08); --danger-line: rgba(220,38,38,.3);
  --shadow: 0 1px 0 rgba(20,22,26,.04), 0 12px 32px -18px rgba(20,22,26,.2);
  --overlay: rgba(10,11,13,.45);
  --radius: 18px; --radius-sm: 12px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "SiteDigits", "LabSans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0b0d; --surface: #111317; --surface-2: #171a1f; --surface-3: #1e2228;
  --line: rgba(255,255,255,.07); --line-strong: rgba(255,255,255,.14);
  --text: #eceef1; --text-2: #c9cdd3; --muted: #8b929c; --faint: #5c636d;
  --accent: #c6f432; --accent-ink: #0d1200; --accent-soft: rgba(198,244,50,.1); --accent-line: rgba(198,244,50,.35);
  --ok: #c6f432; --ok-soft: rgba(198,244,50,.09); --ok-line: rgba(198,244,50,.28);
  --warn: #fbbf24; --warn-soft: rgba(251,191,36,.09); --warn-line: rgba(251,191,36,.28);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.09); --danger-line: rgba(248,113,113,.3);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.8);
  --overlay: rgba(5,6,8,.66);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.app { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
body.app::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 480px at 50% -240px, var(--accent-soft), transparent 70%), radial-gradient(var(--line) 1px, transparent 1.2px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(#000, transparent 60%); mask-image: linear-gradient(#000, transparent 60%); }
a { color: inherit; text-decoration: none; }
a.link, button.link { color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
a.link:hover, button.link:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.bar-inner { display: flex; align-items: center; gap: 10px; height: 62px; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--bg); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; flex: none; }
.brand-name { font-family: var(--mono); letter-spacing: .02em; direction: ltr; }
.brand-sub { font-size: 13px; color: var(--muted); font-weight: 400; padding-inline-start: 10px; border-inline-start: 1px solid var(--line-strong); }
.spacer { flex: 1; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); flex: none; }
.icon-btn:hover { border-color: var(--text); }
.dot { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.balance { display: inline-flex; flex-direction: column; line-height: 1.25; padding-inline-end: 6px; text-align: end; }
.balance b { font-size: 14px; font-weight: 700; }
.balance span { font-size: 11px; color: var(--muted); }

/* shell */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; max-width: 1320px; margin: 0 auto; padding: 24px 16px 64px; align-items: start; }
.side { position: sticky; top: 86px; display: grid; gap: 3px; }
.side a { display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 13px; border-radius: 12px; color: var(--muted); font-weight: 500; font-size: 14px; }
.side a:hover { color: var(--text); background: var(--surface-2); }
.side a.on { color: var(--accent-ink); background: var(--accent); font-weight: 700; }
.side a .count { margin-inline-start: auto; font-size: 12px; background: var(--surface-3); color: var(--text); border-radius: 99px; padding: 0 8px; line-height: 20px; }
.side a.on .count { background: var(--accent-ink); color: var(--accent); }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 12px; }
  .side { position: static; display: flex; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side a { flex: none; height: 38px; padding: 0 12px; }
  .brand-sub, .balance span { display: none; }
}
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.view-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-head h1 { margin: 0; font-size: 22px; font-weight: 700; flex: 1; min-width: 180px; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--accent); direction: ltr; text-align: end; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card > h2, .card-head h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1050px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow); min-width: 0; }
.tile .val { display: block; font-size: 23px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.tile .lbl { font-size: 13px; color: var(--muted); }
a.tile:hover { border-color: var(--line-strong); }
.tile.alert .val { color: var(--warn); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s, transform .1s; }
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn-accent:hover { border-color: transparent; filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* forms */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 13px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-height: 42px; padding: 8px 13px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: middle; margin: 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row > .grow, .row > input.grow { flex: 1; width: auto; min-width: 150px; }
.row > select.sort { flex: none; width: auto; min-width: 140px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

/* table */
.scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
td.wrap { white-space: normal; min-width: 180px; }
.sub-line { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.neg { color: var(--danger); } .pos { color: var(--ok); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--text-2); }
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.chip.bad { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filters button { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 13px; }
.filters button.on { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 600; }
.ip-chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 5px 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; font-family: var(--mono); font-size: 13px; direction: ltr; }
.ip-chip button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 7px; }
.ip-chip button:hover { color: var(--danger); background: var(--danger-soft); }
.ip-chip.closed { color: var(--muted); border-style: dashed; }

/* usage bar */
.meter { display: block; width: 100%; min-width: 80px; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--danger); }

/* notes */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong); font-size: 14px; background: var(--surface-2); }
.note .i { margin-top: 3px; }
.note.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.note.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.note p { margin: 0; color: var(--text-2); white-space: pre-wrap; }
.note b { display: block; }

/* bulk bar */
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 14px; }

/* chart */
.chart { position: relative; }
.chart-total { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.chart svg { display: block; width: 100%; height: 130px; overflow: visible; }
.chart .b { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .hit:hover + .b, .chart g:hover .b { filter: brightness(1.25); }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 9px; padding: 3px 9px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); }

/* dialog */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 22px; width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--overlay); }
dialog h2 { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
dialog h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs button.on { background: var(--text); color: var(--bg); font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kv > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }

/* code */
pre { direction: ltr; text-align: left; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; padding: 13px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; margin: 8px 0; }
code { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
pre code { background: none; padding: 0; }
.secret { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--accent-line); border-radius: 12px; padding: 7px 7px 7px 13px; }
.secret code { flex: 1; background: none; overflow-wrap: anywhere; direction: ltr; text-align: left; padding: 0; }

/* tickets */
.thread { display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.msg { max-width: 86%; padding: 9px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg.me { justify-self: start; background: var(--accent-soft); border-color: var(--accent-line); }
.msg.them { justify-self: end; }
.msg time { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }

/* sign-in */
.auth { min-height: calc(100vh - 63px); display: grid; align-items: center; padding: 32px 16px; }
.auth-card { width: min(430px, 100%); margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { margin: 10px 0 3px; font-size: 24px; font-weight: 700; }
.auth-head p { margin: 0; color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; height: 26px; padding: 0 12px; align-items: center; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.toast { padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); text-align: center; }
.toast.bad { background: var(--danger); color: #fff; }

/* docs + status */
.page { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 16px; }
.docs td { white-space: normal; }
.docs h3 { margin: 16px 0 6px; font-size: 14px; }
.docs p { margin: 6px 0; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface-2); }
details + details { margin-top: 8px; }
summary { cursor: pointer; padding: 10px 0; font-weight: 500; }
details ol { margin: 0 0 12px; padding-inline-start: 20px; font-size: 14px; color: var(--text-2); }
.dns-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dns-row:last-child { border-bottom: 0; }
.dns-row b { font-family: var(--mono); font-size: 20px; direction: ltr; }
.gap-top { margin-top: 14px; }
