/* ============================================================
   AIKOL — дизайн-система кабинета.
   Собственный CSS без сборки и без внешних CDN: тёмная тема,
   один акцент, спокойная типографика.
   ============================================================ */

:root {
  --bg: #0a0c10;
  --bg-soft: #0f1218;
  --surface: #14181f;
  --surface-2: #1a1f28;
  --surface-3: #212734;
  --border: #232a36;
  --border-strong: #2e3646;

  --text: #e8ecf3;
  --text-muted: #98a2b3;
  --text-dim: #6b7688;

  --accent: #6d5ef8;
  --accent-hover: #7f72ff;
  --accent-soft: rgba(109, 94, 248, 0.14);
  --accent-border: rgba(109, 94, 248, 0.35);

  --success: #35d0a5;
  --success-soft: rgba(53, 208, 165, 0.12);
  --warning: #f5b544;
  --warning-soft: rgba(245, 181, 68, 0.12);
  --danger: #f26d6d;
  --danger-soft: rgba(242, 109, 109, 0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);

  --sidebar-w: 248px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

::selection {
  background: var(--accent-soft);
}

/* ------------------------------------------------------------
   Каркас кабинета
   ------------------------------------------------------------ */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, #9b6bff 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex: none;
}

.brand-name {
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 15px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: -3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 16px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.14s, color 0.14s;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.85;
}

.nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.user-chip:hover {
  background: var(--surface);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------
   Контент
   ------------------------------------------------------------ */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 17px;
  font-weight: 600;
}

.topbar-sub {
  font-size: 12.5px;
  color: var(--text-dim);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 26px 32px 56px;
  max-width: 1320px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head p {
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 620px;
}

.page-head .spacer {
  margin-left: auto;
}

/* ------------------------------------------------------------
   Сетки и карточки
   ------------------------------------------------------------ */

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
}

.card-head .spacer {
  margin-left: auto;
}

.card-flat {
  background: transparent;
  border-style: dashed;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -0.03em;
  margin-top: 6px;
  line-height: 1.1;
}

.stat-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ------------------------------------------------------------
   Кнопки
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.06s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(242, 109, 109, 0.3);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   Формы
   ------------------------------------------------------------ */

.field {
  margin-bottom: 16px;
}

.field label,
.label {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.14s, box-shadow 0.14s;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------
   Таблицы
   ------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--surface); }

.td-dim { color: var(--text-dim); }
.td-num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Значки и состояния
   ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  background: var(--surface-3);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: #a99bff; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.alert {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13.5px;
  margin-bottom: 14px;
}

.alert-success { border-color: rgba(53, 208, 165, 0.3); background: var(--success-soft); }
.alert-warning { border-color: rgba(245, 181, 68, 0.3); background: var(--warning-soft); }
.alert-error { border-color: rgba(242, 109, 109, 0.3); background: var(--danger-soft); }

.flash-stack {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.flash-stack .alert {
  margin: 0;
  box-shadow: var(--shadow);
  background: var(--surface-2);
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-dim);
}

.empty h3 {
  color: var(--text);
  margin-bottom: 6px;
}

.empty p {
  max-width: 420px;
  margin: 0 auto 16px;
}

/* ------------------------------------------------------------
   Чек-лист запуска
   ------------------------------------------------------------ */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
}

.check-item:hover { background: var(--surface-2); }

.check-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--text-dim);
  flex: none;
}

.check-item.is-done .check-mark {
  background: var(--success-soft);
  border-color: transparent;
  color: var(--success);
}

.check-item.is-done .check-title {
  color: var(--text-muted);
}

.check-title { font-weight: 550; font-size: 13.5px; }
.check-desc { font-size: 12px; color: var(--text-dim); }

/* ------------------------------------------------------------
   Прочее
   ------------------------------------------------------------ */

.sip-uri {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-soft);
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 14px;
  color: #b3a8ff;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* ------------------------------------------------------------
   Вход и регистрация
   ------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
}

.auth-form-side {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.auth-box {
  width: 100%;
  max-width: 380px;
}

.auth-box h1 {
  margin-bottom: 6px;
}

.auth-box > p {
  color: var(--text-muted);
  margin-bottom: 26px;
}

.auth-aside {
  background:
    radial-gradient(900px 500px at 80% 10%, rgba(109, 94, 248, 0.22), transparent 60%),
    radial-gradient(700px 500px at 20% 90%, rgba(53, 208, 165, 0.12), transparent 60%),
    var(--bg-soft);
  border-left: 1px solid var(--border);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-aside h2 {
  font-size: 27px;
  line-height: 1.28;
  max-width: 460px;
  margin-bottom: 18px;
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
}

.auth-points li {
  display: flex;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-points b {
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Лендинг
   ------------------------------------------------------------ */

.landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
}

.landing-nav .spacer { margin-left: auto; }

.hero {
  padding: 76px 0 64px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -80px -200px auto;
  height: 460px;
  background: radial-gradient(560px 300px at 50% 0%, rgba(109, 94, 248, 0.2), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: 50px;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 800px;
  margin: 0 auto 20px;
  position: relative;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 32px;
  position: relative;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: #b3a8ff;
  font-size: 12.5px;
  font-weight: 550;
  margin-bottom: 22px;
  position: relative;
}

.section {
  padding: 56px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 34px;
}

.section-head h2 {
  font-size: 30px;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.section-head p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.feature {
  padding: 22px;
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #a99bff;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.feature h3 {
  margin-bottom: 7px;
}

.feature p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.step {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #a99bff;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 13px;
  flex: none;
}

.step h3 { margin-bottom: 4px; }
.step p { color: var(--text-muted); font-size: 13.5px; }

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.landing-footer .spacer { margin-left: auto; }

/* ------------------------------------------------------------
   Вкладки
   ------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
}

.tab {
  padding: 9px 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 550;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.14s, border-color 0.14s;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ------------------------------------------------------------
   Список карточек-объектов
   ------------------------------------------------------------ */

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.14s;
}

.tile:hover { border-color: var(--border-strong); }

.tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex: none;
}

.tile-body { min-width: 0; flex: 1; }
.tile-title { font-weight: 600; font-size: 14.5px; }
.tile-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.tile-actions { display: flex; gap: 8px; align-items: center; }

.copy-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
}

.copy-btn:hover { color: var(--text); background: var(--surface-3); }

.instruction {
  counter-reset: instruction;
  display: grid;
  gap: 10px;
}

.instruction > li {
  list-style: none;
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.instruction > li::before {
  counter-increment: instruction;
  content: counter(instruction);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  flex: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-value { font-variant-numeric: tabular-nums; min-width: 58px; text-align: right; }
