/* ============================================================
   DirectPilot — светлый терминал ставок
   ============================================================ */
:root {
  --bg: #f2f5f9;
  --bg-soft: #eaf0f6;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #eef3f9;
  --line: #e2e9f1;
  --line-2: #d2dde9;
  --text: #172033;
  --text-2: #43526a;
  --muted: #74849b;
  --muted-2: #93a1b4;
  --accent: #0e9f6e;
  --accent-2: #0b8a5f;
  --accent-soft: #e6f7f0;
  --blue: #2563eb;
  --blue-soft: #e9f1ff;
  --violet: #7c3aed;
  --warn: #b8730a;
  --warn-soft: #fff4df;
  --danger: #d92d48;
  --danger-soft: #fdecef;
  --gold: #a86b12;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .07);
  --shadow-lg: 0 24px 70px rgba(16, 24, 40, .18);
  --sidebar-w: 244px;
  --topbar-h: 70px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 520px at 82% -12%, rgba(14, 159, 110, .075), transparent 62%),
    radial-gradient(900px 480px at 6% -6%, rgba(37, 99, 235, .065), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(14, 159, 110, .2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd6e3; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ── layout ───────────────────────────────────────────────── */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  height: var(--topbar-h); padding: 0 20px; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(145deg, #e8f8f1, #e7f0ff);
  border: 1px solid #cdeee1;
  display: grid; place-items: center; color: var(--accent);
}
.brand-name { font-weight: 750; letter-spacing: .12em; font-size: 13px; color: #142033; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-label { padding: 14px 10px 6px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; position: relative;
  border: 1px solid transparent; transition: background .14s, color .14s, border-color .14s;
}
.nav-item svg { color: #8b99ad; flex: 0 0 auto; transition: color .14s; }
.nav-item:hover { background: #f2f6fa; color: var(--text); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.active { background: var(--accent-soft); color: #086d4b; border-color: #c9eddf; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: var(--accent);
}
.nav-item.active svg { color: var(--accent); }
.nav-badge {
  margin-left: auto; font-size: 10px; font-family: var(--mono); padding: 2px 6px; border-radius: 6px;
  background: #f1f5f9; color: var(--muted); border: 1px solid var(--line);
}
.side-foot { padding: 14px 14px 16px; border-top: 1px solid var(--line); }
.engine-mini {
  border: 1px solid var(--line); background: #f8fafc; border-radius: 12px; padding: 12px;
}
.engine-mini .row { display: flex; align-items: center; gap: 8px; }
.engine-mini .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.engine-mini .value { font-size: 12.5px; font-weight: 600; margin-top: 5px; }
.engine-mini .hint { font-size: 11px; color: var(--muted-2); margin-top: 6px; }
.side-version { margin-top: 10px; text-align: center; font-size: 10.5px; color: var(--muted-2); letter-spacing: .08em; }

.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px);
}
.page-heading { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.page-heading h1 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.page-heading .crumb { font-size: 11px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.mobile-menu { display: none; }

.view { padding: 26px 28px 56px; width: 100%; max-width: 1660px; margin: 0 auto; flex: 1; }
.view.narrow { max-width: 1100px; }

/* ── controls ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line-2);
  background: #fff; color: var(--text-2); font-size: 13px; font-weight: 550;
  transition: background .14s, border-color .14s, color .14s, transform .06s;
  white-space: nowrap; box-shadow: 0 1px 1px rgba(16, 24, 40, .02);
}
.btn:hover { background: #f5f8fc; border-color: #c2d0df; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { flex: 0 0 auto; }
.btn-primary {
  background: linear-gradient(180deg, #12b17d, #0e9f6e); color: #fff; border-color: #0b8a5f;
  box-shadow: 0 4px 14px rgba(14, 159, 110, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #15c089, #0d9467); color: #fff; border-color: #0a7d56; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: #f1f5f9; border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f3c9d1; background: #fff7f8; }
.btn-danger:hover { background: var(--danger-soft); border-color: #eeb4bf; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-blue { background: var(--blue-soft); border-color: #c9dcff; color: #1d4ed8; }
.btn-blue:hover { background: #dbe9ff; color: #1e40af; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--line-2); background: #fff; color: var(--text);
  outline: none; transition: border-color .14s, box-shadow .14s;
  font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus { border-color: #6fd3b1; box-shadow: 0 0 0 3px rgba(14, 159, 110, .12); }
.input::placeholder { color: var(--muted-2); }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374849b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: #fff; }
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.input-sm { height: 32px; font-size: 12.5px; border-radius: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.field .hint { font-size: 11px; color: var(--muted-2); }
.field > label.check { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text-2); font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.search-wrap { position: relative; min-width: 220px; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-left: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; }

/* ── badges / pills ───────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid transparent;
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill-green { color: #087a53; background: #e7f8f1; border-color: #c6edde; }
.pill-blue { color: #1d4ed8; background: #eaf2ff; border-color: #cddfff; }
.pill-violet { color: #6d28d9; background: #f3edff; border-color: #e2d4ff; }
.pill-warn { color: #97600b; background: #fff5e2; border-color: #f6dfb4; }
.pill-danger { color: #b4233c; background: #fdeef1; border-color: #f4cbd4; }
.pill-muted { color: #64748b; background: #f4f7fa; border-color: #e2e9f1; }
.pill-gold { color: #8a5a0c; background: #fff8e8; border-color: #f1dfb4; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.dot.warn { background: #e2a21b; }
.dot.danger { background: var(--danger); }
.dot.muted { background: #b4c0ce; }
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.pos-badge {
  display: inline-flex; min-width: 38px; justify-content: center; padding: 3px 7px;
  border-radius: 7px; font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  background: #f4f7fa; border: 1px solid #e2e9f1; color: var(--text-2);
}
.pos-badge.premium { color: #8a5a0c; background: #fff8e8; border-color: #f1dfb4; }
.pos-badge.top { color: #087a53; background: #e7f8f1; border-color: #c6edde; }
.pos-badge.out { color: var(--muted); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; }
.delta.up { color: #0b8a5f; }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.delta svg { width: 12px; height: 12px; }

/* ── cards ────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.card-head h3 { font-size: 13.5px; font-weight: 650; letter-spacing: -.005em; }
.card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 16px 18px 18px; }
.card-pad { padding: 18px; }
.card-hover { transition: border-color .15s, transform .15s; }
.card-hover:hover { border-color: #c8d5e3; transform: translateY(-1px); }

.grid { display: grid; gap: 14px; }
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi {
  position: relative; overflow: hidden; padding: 15px 16px 13px; min-height: 116px;
  border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(165deg, #ffffff, #fbfcfe);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
  transition: border-color .15s, box-shadow .15s;
}
.kpi:hover { border-color: #cdd9e6; box-shadow: 0 4px 18px rgba(16, 24, 40, .06); }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 25px; font-weight: 680; letter-spacing: -.03em; margin-top: 9px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 11px; color: var(--muted); position: relative; z-index: 1; }
.kpi .spark { position: absolute; right: -4px; bottom: -3px; opacity: .38; pointer-events: none; }
.kpi.accent { border-color: #c9eddf; background: linear-gradient(165deg, #f2fbf7, #ffffff); }

/* ── tables ───────────────────────────────────────────────── */
.table-wrap { overflow: auto; border-radius: 11px; border: 1px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
table.data th {
  position: sticky; top: 0; z-index: 2; text-align: left; padding: 10px 12px;
  background: #f7f9fc; color: var(--muted); font-size: 10.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; vertical-align: middle; color: var(--text-2); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover { background: #f8fafc; }
table.data tr.clickable { cursor: pointer; }
table.data .num { text-align: right; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { color: var(--text); font-weight: 600; }
table.data .sub { color: var(--muted-2); font-size: 11px; margin-top: 2px; }
.empty-row { text-align: center; color: var(--muted); padding: 38px 16px; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }

.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .8); margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .02);
}
.toolbar .grow { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 130px; max-width: 230px; flex: 0 1 auto; }
.toolbar .input { width: auto; }
.toolbar .search-wrap { flex: 1 1 280px; }
.toolbar .search-wrap .input { width: 100%; }
.toolbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.toolbar .count { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px 0; color: var(--muted); font-size: 12px; }
.pager .pages { display: flex; gap: 5px; align-items: center; }

.bulkbar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; margin-top: 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .97); border: 1px solid #b9e8d7;
  box-shadow: 0 16px 50px rgba(16, 24, 40, .14); backdrop-filter: blur(12px);
}
.bulkbar .count { font-weight: 650; color: #087a53; font-family: var(--mono); }

/* ── charts ───────────────────────────────────────────────── */
.chart-card .card-body { padding-top: 10px; }
.chart-tabs { display: flex; gap: 4px; background: #f2f6fa; border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.chart-tab { border: none; background: transparent; color: var(--muted); font-size: 11.5px; padding: 5px 9px; border-radius: 6px; }
.chart-tab:hover { color: var(--text-2); }
.chart-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(16, 24, 40, .1); }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { font-family: var(--mono); font-size: 10px; fill: #91a0b3; }
.chart-svg .grid-line { stroke: rgba(23, 32, 51, .07); stroke-width: 1; }
.chart-svg .axis-line { stroke: rgba(23, 32, 51, .12); stroke-width: 1; }
.chart-legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.chart-legend .item { display: flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 16px; height: 3px; border-radius: 3px; }

/* ── radar ────────────────────────────────────────────────── */
.radar { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; align-items: end; height: 128px; margin-top: 10px; }
.radar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.radar-bar {
  width: 100%; border-radius: 5px 5px 2px 2px; min-height: 3px;
  background: linear-gradient(180deg, #7fb0ff, #dbe8ff);
  border: 1px solid #bcd4fb; transition: height .4s ease;
}
.radar-col.premium .radar-bar { background: linear-gradient(180deg, #e7bc63, #fbf0d5); border-color: #eed9a9; }
.radar-col.top .radar-bar { background: linear-gradient(180deg, #35c995, #d9f6eb); border-color: #a9e5d1; }
.radar-label { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.radar-count { font-size: 10px; color: var(--muted-2); }

/* ── progress ring / bars ─────────────────────────────────── */
.progress { height: 7px; border-radius: 99px; background: #edf2f7; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34c795, #0e9f6e); transition: width .4s ease; }
.progress.warn > span { background: linear-gradient(90deg, #e9b44f, #d18d0f); }
.progress.danger > span { background: linear-gradient(90deg, #e86a7e, #d92d48); }
.ring {
  --p: 0; width: 92px; height: 92px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), #e9eff5 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; border: 1px solid var(--line); }
.ring .val { position: relative; font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.ring .val small { display: block; font-size: 9.5px; color: var(--muted); text-align: center; font-weight: 500; letter-spacing: .04em; }

/* ── lists ────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid #eef2f7; }
.feed-item:last-child { border-bottom: none; }
.feed-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
  background: #f4f7fa; color: var(--muted); border: 1px solid var(--line);
}
.feed-icon.success { color: #0b8a5f; background: #e7f8f1; border-color: #c6edde; }
.feed-icon.error { color: var(--danger); background: var(--danger-soft); border-color: #f4cbd4; }
.feed-icon.warning { color: #a86b12; background: #fff5e2; border-color: #f6dfb4; }
.feed-body { min-width: 0; flex: 1; }
.feed-title { font-size: 12.5px; color: var(--text-2); }
.feed-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.feed-time { margin-left: auto; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef2f7; font-size: 12.5px; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .muted { color: var(--muted); font-size: 11px; }

/* ── misc ─────────────────────────────────────────────────── */
.section-head { display: flex; align-items: flex-end; gap: 12px; margin: 28px 0 12px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.section-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.section-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.tag { font-size: 10.5px; color: var(--muted); background: #f6f8fb; border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 14px; }

.onboarding { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 14px; max-width: 1080px; margin: 4vh auto 0; }
.onboarding-main { padding: 30px; }
.onboarding-main h2 { font-size: 26px; letter-spacing: -.03em; margin: 12px 0 8px; }
.onboarding-main .lead { color: var(--text-2); font-size: 13.5px; line-height: 1.6; max-width: 640px; }
.onboarding-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.onboarding-step { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.onboarding-step > span { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: #087a53; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.onboarding-step b { display: block; font-size: 12.5px; }
.onboarding-step small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.onboarding-side { display: flex; flex-direction: column; gap: 14px; }
.onboarding-side h3 { font-size: 13px; }
.onboarding-side .card { min-height: 0; }
.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fbfcfe; font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.notice.warn { border-color: #f0d39a; background: #fffaf0; }
.notice.blue { border-color: #c9dcff; background: #f5f9ff; }
.notice .grow { flex: 1; min-width: 200px; }
.notice b { color: var(--text); }
@media (max-width: 900px) { .onboarding { grid-template-columns: 1fr; margin-top: 1vh; } .onboarding-main { padding: 22px; } }

.empty-state { padding: 54px 24px; text-align: center; border: 1px dashed #cfdae7; border-radius: var(--r); background: rgba(255, 255, 255, .55); }
.empty-state .icon { width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 14px; display: grid; place-items: center; background: #f2f7fb; color: var(--muted); border: 1px solid var(--line); }
.empty-state h3 { font-size: 15px; margin-bottom: 5px; }
.empty-state p { color: var(--muted); font-size: 12.5px; max-width: 460px; margin: 0 auto 16px; }
.error-state { padding: 40px; text-align: center; border: 1px solid #f4cbd4; border-radius: var(--r); background: #fff7f8; }
.error-state h3 { color: #b4233c; margin-bottom: 6px; }
.error-state p { color: #a44a5d; font-size: 12px; margin-bottom: 14px; }

/* ── skeletons ────────────────────────────────────────────── */
.skeleton { position: relative; overflow: hidden; background: #eaf0f6; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-row { height: 14px; margin-bottom: 10px; }
.sk-card { height: 116px; border-radius: var(--r); }

/* ── drawer ───────────────────────────────────────────────── */
#drawer { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
#drawer.open { pointer-events: auto; }
.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(20, 31, 48, .28); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
#drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(590px, 100%);
  background: #fff; border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px rgba(16, 24, 40, .18);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.3,.8,.3,1);
  display: flex; flex-direction: column;
}
#drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; background: #fbfcfe; }
.drawer-head h3 { font-size: 15px; line-height: 1.3; font-weight: 650; }
.drawer-head .sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 18px 20px 40px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: #fbfcfe; }
.drawer-section { margin-bottom: 22px; }
.drawer-section h4 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }

/* ── modal ────────────────────────────────────────────────── */
#modal-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#modal-root.open { pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 31, 48, .32); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: hidden;
  display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-2);
  background: #fff; box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease-out;
}
.modal.wide { width: min(820px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; background: #fbfcfe; }
.modal-head h3 { font-size: 15px; font-weight: 650; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #fbfcfe; }

/* ── toasts ───────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 9px; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 11px;
  background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease-out; font-size: 12.5px; color: var(--text-2);
}
.toast.success { border-color: #b9e8d7; }
.toast.error { border-color: #f0b9c4; }
.toast.warn { border-color: #f0d39a; }
.toast .toast-icon { flex: 0 0 auto; margin-top: 1px; }
.toast.success .toast-icon { color: #0b8a5f; }
.toast.error .toast-icon { color: var(--danger); }
.toast.warn .toast-icon { color: #b8730a; }
.toast .toast-body { flex: 1; min-width: 0; }
.toast .toast-title { font-weight: 650; color: var(--text); margin-bottom: 1px; }
.toast .toast-close { background: none; border: none; color: var(--muted); padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ── auth ─────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-visual {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(14, 159, 110, .14), transparent 62%),
    radial-gradient(700px 500px at 82% 82%, rgba(37, 99, 235, .12), transparent 62%),
    #f7fafc;
  border-right: 1px solid var(--line);
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(23, 32, 51, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 32, 51, .045) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(circle at 50% 45%, black, transparent 78%);
}
.auth-logo { display: flex; align-items: center; gap: 12px; position: relative; }
.auth-copy { position: relative; max-width: 580px; }
.auth-copy h1 { font-size: clamp(34px, 4.2vw, 58px); line-height: 1.04; letter-spacing: -.045em; font-weight: 720; margin-bottom: 20px; color: #101a2b; }
.auth-copy h1 span { color: #0b8a5f; }
.auth-copy p { color: #52627a; font-size: 15px; max-width: 480px; line-height: 1.55; }
.auth-points { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 36px; position: relative; }
.auth-point { display: flex; flex-direction: column; gap: 3px; }
.auth-point b { font-size: 22px; letter-spacing: -.03em; color: #122033; }
.auth-point span { font-size: 11.5px; color: var(--muted); }
.auth-panel { display: grid; place-items: center; padding: 32px; background: #fff; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-primary { width: 100%; height: 42px; margin-top: 8px; }
.auth-hint { margin-top: 18px; padding: 11px 12px; border-radius: 9px; border: 1px dashed var(--line-2); font-size: 11.5px; color: var(--muted); background: #fbfcfe; }
.auth-hint b { color: var(--text-2); font-family: var(--mono); font-weight: 500; }
.auth-foot { margin-top: 28px; font-size: 11px; color: var(--muted-2); }
.auth-mark { display: flex; align-items: center; gap: 10px; }
.auth-mark .brand-name { font-size: 14px; }

/* ── strategy cards ───────────────────────────────────────── */
.strategy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.strategy-card { padding: 17px; display: flex; flex-direction: column; gap: 12px; min-height: 196px; position: relative; overflow: hidden; }
.strategy-card::after { content: ""; position: absolute; top: -60px; right: -50px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(14, 159, 110, .07), transparent 70%); pointer-events: none; }
.strategy-top { display: flex; align-items: flex-start; gap: 11px; }
.strategy-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #f2f8f6; border: 1px solid #d9ece5; color: var(--accent); flex: 0 0 auto; }
.strategy-card h3 { font-size: 13.5px; font-weight: 650; }
.strategy-card .kind { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin-top: 3px; }
.strategy-desc { font-size: 12px; color: var(--muted); line-height: 1.45; min-height: 34px; }
.strategy-params { display: flex; flex-wrap: wrap; gap: 5px; }
.strategy-meta { display: flex; align-items: center; gap: 14px; margin-top: auto; font-size: 11px; color: var(--muted); }
.strategy-actions { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 99px; background: #dbe3ed; border: 1px solid #cfd9e5; transition: background .15s; flex: 0 0 auto; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.18); transition: transform .15s; }
.switch.on { background: #8ddcc0; border-color: #62cdab; }
.switch.on::after { transform: translateX(16px); background: #fff; }

/* ── auction ladder ───────────────────────────────────────── */
.ladder { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.ladder-row { display: grid; grid-template-columns: 52px 1fr 1fr 62px; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid #eef2f7; font-size: 12px; }
.ladder-row:last-child { border-bottom: none; }
.ladder-row.head { background: #f7f9fc; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.ladder-row .p { font-family: var(--mono); font-weight: 700; color: var(--text-2); }
.ladder-row .bid { font-family: var(--mono); text-align: right; color: var(--text); }
.ladder-row .price { font-family: var(--mono); text-align: right; color: var(--muted); }
.ladder-row .traffic { font-family: var(--mono); text-align: right; color: var(--muted-2); font-size: 11px; }
.ladder-row.target { background: #f0faf6; border-left: 2px solid var(--accent); }
.ladder-row.target .p { color: #087a53; }
.ladder-row.current { background: #f2f7ff; }
.ladder-row.current .p { color: var(--blue); }
.ladder-row.unavailable { opacity: .5; }
.ladder-note { font-size: 10.5px; color: var(--muted-2); margin-top: 7px; }

/* ── account cards ────────────────────────────────────────── */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.account-head { display: flex; align-items: flex-start; gap: 12px; }
.account-avatar { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(145deg, #e7f8f1, #e9f1ff); border: 1px solid #d3ebe2; display: grid; place-items: center; color: #0b8a5f; font-weight: 700; }
.account-card h3 { font-size: 14px; }
.account-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.account-stat { background: #f8fafc; border: 1px solid #e8eef5; border-radius: 9px; padding: 8px 9px; }
.account-stat b { display: block; font-family: var(--mono); font-size: 14px; }
.account-stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── rules builder ────────────────────────────────────────── */
.rule-row { display: grid; grid-template-columns: 1.2fr .7fr .8fr 1.1fr .8fr 30px; gap: 7px; align-items: center; margin-bottom: 7px; }
.rule-row .input, .rule-row .select { height: 32px; font-size: 12px; }
.rule-head { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.type-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.type-option { border: 1px solid var(--line); background: #fbfcfe; border-radius: 10px; padding: 10px 8px; text-align: center; cursor: pointer; transition: .14s; }
.type-option:hover { border-color: #c8d5e3; background: #f6f9fc; }
.type-option.active { border-color: #9cdcc5; background: var(--accent-soft); }
.type-option .ti { color: var(--muted); margin-bottom: 5px; }
.type-option.active .ti { color: var(--accent); }
.type-option .tn { font-size: 10.5px; font-weight: 600; line-height: 1.2; }

/* ── switch row ───────────────────────────────────────────── */
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.set-row:last-child { border-bottom: none; }
.set-row .grow { flex: 1; }
.set-row .t { font-size: 13px; font-weight: 550; }
.set-row .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ── responsive ───────────────────────────────────────────── */
@media (max-width: 1380px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .grid-main { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 76px; }
  .brand { padding: 0; justify-content: center; }
  .brand-text, .nav span.nav-text, .nav-label, .side-foot .engine-mini .hint, .side-version, .nav-badge { display: none; }
  .nav { padding: 12px 10px; align-items: center; }
  .nav-item { justify-content: center; width: 46px; height: 44px; padding: 0; }
  .nav-item.active::before { left: -10px; }
  .side-foot { padding: 10px; }
  .engine-mini { padding: 8px; display: grid; place-items: center; }
  .engine-mini .row { justify-content: center; }
  .engine-mini .label, .engine-mini .value { display: none; }
  .mobile-menu { display: inline-flex; }
  .view { padding: 20px 18px 48px; }
  .topbar { padding: 0 18px; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; --topbar-h: 62px; }
  .sidebar { width: 244px; transform: translateX(-100%); transition: transform .2s; background: #fff; }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .sidebar .brand-text, body.menu-open .sidebar .nav-text, body.menu-open .sidebar .nav-label, body.menu-open .sidebar .side-foot .engine-mini .hint, body.menu-open .sidebar .side-version { display: block; }
  body.menu-open .sidebar .nav { align-items: stretch; }
  body.menu-open .sidebar .nav-item { width: auto; height: auto; justify-content: flex-start; padding: 10px 11px; }
  .main-wrap { margin-left: 0; }
  .topbar { gap: 10px; }
  .page-heading h1 { font-size: 16px; }
  .page-heading .crumb { display: none; }
  .top-actions .btn span { display: none; }
  .top-actions .account-select { max-width: 140px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 21px; }
  .strategy-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .table-wrap { border-radius: 10px; }
  .drawer-panel { width: 100%; }
  .rule-row { grid-template-columns: 1fr 1fr; }
  .rule-row .rule-remove { grid-column: 2; justify-self: end; }
  .type-picker { grid-template-columns: repeat(2, 1fr); }
  .radar { gap: 3px; }
}
@media (max-width: 520px) {
  .view { padding: 14px 12px 40px; }
  .topbar { padding: 0 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { min-height: 104px; padding: 12px; }
  .kpi-value { font-size: 19px; }
  .toolbar { padding: 9px; }
  .toolbar .search-wrap { min-width: 100%; }
  .toolbar .select { flex: 1; min-width: 130px; }
  .section-head { flex-wrap: wrap; }
}
