/* Finspotfx platform UI — shared by client and crm (keep both copies identical). */
:root {
  --ink: #07110D; --ink-2: #0E1D17; --ink-3: #14271F; --ink-line: #22352C;
  --on-ink: #EAF0EC; --on-ink-2: #C9D4CE; --on-ink-muted: #9FB0A7;
  --lime: #B8F24A; --lime-2: #C8F86A; --green: #0E6E47; --green-dark: #0A5235; --green-soft: #E3F2E9;
  --paper: #F3F4F1; --white: #FFFFFF; --line: #D9DED9; --line-2: #E8EBE8;
  --text: #0C1411; --muted: #56625C; --muted-2: #7A857F;
  --warn: #8A4B00; --warn-soft: #FFF2DE; --bad: #B42318; --bad-soft: #FDECEA; --info-soft: #E8F0FB; --info: #1D4E89;
  --r: 12px; --r-lg: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Tight", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ico { flex: none; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 256px; flex: none; background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side__top { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 16px; border-bottom: 1px solid var(--ink-line); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand:hover { color: #fff; }
.brand b { color: var(--lime); font-weight: 800; }
.brand small { font-family: var(--font); font-weight: 600; font-size: 11px; color: var(--ink); background: var(--lime); border-radius: 999px; padding: 1px 8px; letter-spacing: .02em; }
.side__close { display: none; background: none; border: 0; color: var(--on-ink); width: 40px; height: 40px; cursor: pointer; align-items: center; justify-content: center; }
.side__nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; }
.side__nav a { display: flex; align-items: center; gap: 11px; color: var(--on-ink-2); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; min-height: 42px; }
.side__nav a:hover { background: var(--ink-2); color: #fff; }
.side__nav a[aria-current="page"] { background: var(--ink-3); color: var(--lime); }
.side__nav .count { margin-left: auto; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side__label { font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--on-ink-muted); padding: 16px 12px 6px; }
.side__foot { padding: 14px 18px; border-top: 1px solid var(--ink-line); font-size: 12px; color: var(--on-ink-muted); }
.side__foot a { color: var(--on-ink-2); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 64px; }
.topbar__menu { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; align-items: center; justify-content: center; color: var(--text); }
.topbar__title { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__actions form { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; min-height: 36px; }
.chip:hover { border-color: var(--text); color: var(--text); }
.chip--wallet b { font-family: var(--mono); font-weight: 500; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang a { font: 600 12px/1 var(--mono); padding: 9px 9px; color: var(--muted); text-decoration: none; }
.lang a[aria-current="true"] { background: var(--ink); color: #fff; }
.content { padding: 28px; width: 100%; max-width: 1240px; }
.scrim { display: none; }
@media (max-width: 980px) {
  .side { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(7,17,13,.55); }
  .side__close, .topbar__menu { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 48px; }
  .hide-sm { display: none !important; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #17302A; color: #fff; }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--lime:hover { background: var(--lime-2); color: var(--ink); }
.btn--ghost { background: var(--white); color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text); color: var(--text); }
.btn--danger { background: var(--white); color: var(--bad); border-color: #F1C4BF; }
.btn--danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: var(--green-dark); color: #fff; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.card--flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 18px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card__head--pad { padding: 18px 22px 0; }
.card__title { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card--dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.card--dark .muted { color: var(--on-ink-muted); }
.empty { text-align: center; padding: 44px 22px; color: var(--muted); }
.empty .ico { margin: 0 auto 10px; color: var(--muted-2); }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead p { color: var(--muted); max-width: 640px; }

/* Stats */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); margin-bottom: 18px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
a.stat:hover { border-color: var(--text); color: var(--text); }
.stat__label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat__value { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; }
.stat__value.mono { font-family: var(--mono); font-weight: 500; font-size: 24px; letter-spacing: -0.02em; }
.stat--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat--dark .stat__label { color: var(--on-ink-muted); }
.stat--dark .stat__value { color: var(--lime); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1.4 var(--font); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--green-soft); color: var(--green); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--mute { background: var(--line-2); color: var(--muted); }
.badge--info { background: var(--info-soft); color: var(--info); }
.tag { display: inline-block; font: 600 11px/1.6 var(--font); background: var(--line-2); color: var(--muted); border-radius: 6px; padding: 1px 7px; text-transform: uppercase; letter-spacing: .04em; }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert--ok { background: var(--green-soft); color: #0A4A30; border-color: #BFE0CC; }
.alert--error { background: var(--bad-soft); color: var(--bad); border-color: #F1C4BF; }
.alert--warn { background: var(--warn-soft); color: var(--warn); border-color: #F3DCB4; }
.alert--info { background: var(--info-soft); color: var(--info); border-color: #C9DAF1; }
.alert form { margin: 0; }
.alert .linkbtn { color: inherit; font-weight: 600; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; }
.help { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--bad); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], input[type="file"], select, textarea {
  width: 100%; font: 15px/1.45 var(--font); color: var(--text); background: var(--white);
  border: 1px solid #C9D0CB; border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
input[type="file"] { padding: 9px 10px; }
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: #8C9792; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(14,110,71,.18); }
input:disabled, select:disabled { background: var(--paper); color: var(--muted); }
.code-input { font-family: var(--mono) !important; font-size: 24px !important; letter-spacing: .4em; text-align: center; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.form-grid { display: grid; gap: 16px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.input-group { display: flex; }
.input-group span { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid #C9D0CB; border-right: 0; border-radius: 10px 0 0 10px; background: var(--paper); font-weight: 600; color: var(--muted); }
.input-group input { border-radius: 0 10px 10px 0; }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; background: var(--white); }
.option:hover { border-color: var(--muted-2); }
.option input { margin-top: 3px; accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.option strong { display: block; }
.option small { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 600 12px/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; background: #F7F8F6; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.table a.strong { font-weight: 600; color: var(--text); text-decoration: none; }
.table a.strong:hover { color: var(--green); }
.pos { color: var(--green); } .neg { color: var(--bad); }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--line-2); font-size: 13px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.filters input, .filters select { min-height: 40px; width: auto; flex: 1 1 180px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--text); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; }
.tabs a[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Definition list */
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }

/* Plans */
.product { margin-bottom: 28px; }
.product__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.product__head h2 { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.plan { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.plan--active { border: 2px solid var(--green); }
.plan__name { font-weight: 700; font-size: 17px; }
.plan__price { font-family: var(--mono); font-size: 26px; letter-spacing: -0.02em; }
.plan__price small { font-family: var(--font); font-size: 13px; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.plan li { display: flex; gap: 8px; }
.plan li .ico { color: var(--green); margin-top: 3px; }
.plan form { margin-top: auto; }

/* Pay box */
.paybox { background: var(--ink); color: var(--on-ink); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.paybox__amount { font-family: var(--mono); font-size: 30px; color: var(--lime); letter-spacing: -0.02em; }
.paybox .dl dt { color: var(--on-ink-muted); }
.paybox .copy { display: inline-flex; gap: 8px; align-items: center; }
.copybtn { background: var(--ink-3); color: var(--on-ink); border: 1px solid var(--ink-line); border-radius: 8px; padding: 4px 10px; font: 600 12px/1.4 var(--font); cursor: pointer; }
.copybtn:hover { border-color: var(--lime); }
.steps-mini { counter-reset: s; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--on-ink-2); }
.steps-mini li { counter-increment: s; display: flex; gap: 10px; }
.steps-mini li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-3); color: var(--lime); font: 700 12px/22px var(--font); text-align: center; }

/* Ticket thread */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; background: var(--white); max-width: 860px; }
.msg--staff { background: #F4FAF6; border-color: #CFE6D8; }
.msg--internal { background: var(--warn-soft); border-color: #F3DCB4; }
.msg__head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.msg__head strong { color: var(--text); }
.msg__body { white-space: pre-wrap; word-break: break-word; }
.msg__file { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__brand { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth__brand svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; pointer-events: none; }
.auth__brand > * { position: relative; }
.auth__brand h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.04; letter-spacing: -0.035em; color: #fff; max-width: 480px; }
.auth__brand h1 em { color: var(--lime); }
.auth__brand ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--on-ink-2); font-size: 15px; }
.auth__brand li { display: flex; gap: 10px; align-items: center; }
.auth__brand li .ico { color: var(--lime); }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth__card h2 { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.auth__card .sub { color: var(--muted); }
.auth__alt { text-align: center; font-size: 14px; color: var(--muted); }
.auth__top { position: absolute; top: 20px; right: 24px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { padding: 28px 24px; gap: 18px; }
  .auth__brand h1 { font-size: 28px; }
  .auth__brand ul { display: none; }
}

/* Misc */
.qr { background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--line); width: fit-content; }
.qr img, .qr canvas, .qr svg { width: 180px; height: 180px; }
.secret { font-family: var(--mono); font-size: 14px; letter-spacing: .08em; background: var(--paper); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.announce-item { border-left: 0; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.announce-item:last-child { border-bottom: 0; }
.announce-item h3 { font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.announce-item p { color: var(--muted); font-size: 14px; margin-top: 4px; white-space: pre-wrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.inline { display: inline; margin: 0; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; }
.timeline li:last-child { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
