/* NomadRoute — основной стиль ( html + css + js, без фреймворков ) */
:root {
  --bg: #0b0f17;
  --bg-soft: #111827;
  --card: #151d2b;
  --card-2: #1a2436;
  --border: #263349;
  --text: #e8edf5;
  --muted: #93a1b7;
  --accent: #5b8cff;
  --accent-2: #7c5bff;
  --green: #2fbf71;
  --red: #ff5c6c;
  --yellow: #ffb84d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 6, 17, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* --- шапка --- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 23, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; font-weight: 800;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* --- кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { background: rgba(255, 92, 108, 0.12); border-color: rgba(255, 92, 108, 0.4); color: var(--red); }
.btn-success { background: rgba(47, 191, 113, 0.12); border-color: rgba(47, 191, 113, 0.4); color: var(--green); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- герой --- */
.hero { padding: 88px 0 64px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 20% auto; height: 420px;
  background: radial-gradient(closest-side, rgba(91, 140, 255, 0.25), transparent);
  pointer-events: none;
}
.hero h1 { font-size: 46px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -0.02em; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 760px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-code {
  margin: 40px auto 0; max-width: 720px; text-align: left;
  background: #0d1320; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; font-family: "JetBrains Mono", "Consolas", monospace; font-size: 13px;
  color: #b9c6dd; overflow-x: auto; box-shadow: var(--shadow);
}
.hero-code .k { color: #7c9dff; }
.hero-code .s { color: #8fe3b0; }
.hero-code .c { color: #5d6b85; }

/* --- секции --- */
.section { padding: 56px 0; }
.section h2 { font-size: 30px; margin: 0 0 12px; letter-spacing: -0.01em; }
.section .sub { color: var(--muted); margin: 0 0 36px; font-size: 16px; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } .hero h1 { font-size: 34px; } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: border-color 0.15s ease;
}
.card:hover { border-color: #33456b; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .icon {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px;
  background: rgba(91, 140, 255, 0.12); display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* --- таблицы --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-soft); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(91, 140, 255, 0.05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: "JetBrains Mono", "Consolas", monospace; font-size: 13px; }

/* --- бейджи --- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--muted);
  background: var(--bg-soft);
}
.badge.green { color: var(--green); border-color: rgba(47, 191, 113, 0.4); background: rgba(47, 191, 113, 0.08); }
.badge.red { color: var(--red); border-color: rgba(255, 92, 108, 0.4); background: rgba(255, 92, 108, 0.08); }
.badge.yellow { color: var(--yellow); border-color: rgba(255, 184, 77, 0.4); background: rgba(255, 184, 77, 0.08); }
.badge.blue { color: var(--accent); border-color: rgba(91, 140, 255, 0.4); background: rgba(91, 140, 255, 0.08); }

/* --- формы --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-card { max-width: 420px; margin: 56px auto; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* --- алерты --- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: rgba(255, 92, 108, 0.1); border-color: rgba(255, 92, 108, 0.4); color: #ffb3ba; }
.alert-success { background: rgba(47, 191, 113, 0.1); border-color: rgba(47, 191, 113, 0.4); color: #a9edc6; }
.alert-info { background: rgba(91, 140, 255, 0.1); border-color: rgba(91, 140, 255, 0.4); color: #b9cdff; }

/* --- кабинет --- */
.layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 28px 0 60px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.sidebar { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; position: sticky; top: 84px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: var(--muted); font-size: 14px; font-weight: 500;
}
.sidebar a:hover { background: var(--card-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: rgba(91, 140, 255, 0.14); color: var(--text); }
.sidebar .user-box { padding: 10px 12px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar .user-box .email { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-all; }
.sidebar .user-box .plan { font-size: 12px; color: var(--muted); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; }
.tab { display: none; }
.tab.active { display: block; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* --- график (CSS) --- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart .bar .fill { width: 100%; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.chart .bar .cap { font-size: 10px; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 180px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bar-row .track { background: var(--bg-soft); border-radius: 6px; height: 12px; overflow: hidden; }
.bar-row .track .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-row .amount { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 110px 1fr 70px; } }

/* --- модальное окно --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 8, 16, 0.7); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 560px; padding: 24px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 18px; font-size: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* --- документация --- */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0 64px; align-items: start; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } .docs-nav { position: static !important; } }
.docs-nav { position: sticky; top: 84px; font-size: 13.5px; }
.docs-nav a { display: block; padding: 6px 10px; color: var(--muted); border-radius: 7px; }
.docs-nav a:hover { background: var(--card-2); color: var(--text); text-decoration: none; }
.docs h2 { font-size: 24px; margin: 40px 0 12px; padding-top: 8px; }
.docs h3 { font-size: 17px; margin: 26px 0 8px; }
.docs p, .docs li { color: #c3cddf; }
.docs pre {
  background: #0d1320; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.55;
}
.docs code { font-family: "JetBrains Mono", "Consolas", monospace; }
.docs p code, .docs li code, .docs td code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; color: #9fc0ff; }
.docs table { margin: 14px 0; }
.docs .callout { border-left: 3px solid var(--accent); background: rgba(91, 140, 255, 0.07); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0; font-size: 14px; }

/* --- прочее --- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.muted { color: var(--muted); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.right { text-align: right; }
.secret-box {
  font-family: "JetBrains Mono", "Consolas", monospace; font-size: 13px; word-break: break-all;
  background: var(--bg-soft); border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200; padding: 12px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); font-size: 14px; display: none;
}
.toast.show { display: block; }
.toast.error { border-color: rgba(255, 92, 108, 0.5); }
.toast.success { border-color: rgba(47, 191, 113, 0.5); }
