/* ═══════════════════════════════════════════════
   APEX Terminal — dashboard.css
   Личный кабинет: сетка как в терминале (260 / 1fr / 320).
   Палитра, темы и .btn — из style.css.
   ═══════════════════════════════════════════════ */

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  font-size: 13.5px;
  overflow: hidden;
}

.dash {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  grid-template-rows: 56px minmax(0, 1fr);
  grid-template-areas:
    "top  top     top"
    "nav  main    side";
  height: 100vh;
  height: 100dvh;
}

/* ─── Верхняя панель ────────────────────────── */
.dash-top {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.dt-left, .dt-right { display: flex; align-items: center; gap: 10px; min-width: 0; }

.dt-logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--accent);
  white-space: nowrap;
}

.dt-sep { color: var(--border); }
.dt-page { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.dt-user {
  max-width: 240px;
  overflow: hidden;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.dt-icon-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ─── Левая навигация ───────────────────────── */
.dash-nav {
  grid-area: nav;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}

.dn-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.dn-item:hover { background: var(--surface-hover); color: var(--text); }
.dn-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.dn-ico { width: 18px; text-align: center; font-size: 14px; }

.dn-logout {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.dn-logout:hover {
  border-color: rgba(var(--loss-rgb), 0.5);
  background: rgba(var(--loss-rgb), 0.1);
  color: var(--loss);
}

/* ─── Центр ─────────────────────────────────── */
.dash-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  padding: 20px 22px 40px;
  overflow-y: auto;
  background: var(--bg);
}

.dm-hello { margin-bottom: 20px; }
.dm-hello h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.dm-hello h1 b { color: var(--accent); }
.dm-hello p { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* ─── KPI-карточки ──────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kpi-sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.kpi-value.is-up { color: var(--profit); }
.kpi-value.is-down { color: var(--loss); }

/* ─── Карточки-секции ───────────────────────── */
.card {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-hint { font-size: 11.5px; color: var(--muted); }

.rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }

.row-main { flex: 1 1 auto; min-width: 0; }
.row-title { font-size: 13px; font-weight: 600; }
.row-sub { margin-top: 2px; font-size: 11px; color: var(--muted); }
.row-side { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.tag.is-long { border-color: rgba(var(--profit-rgb), 0.45); color: var(--profit); }
.tag.is-short { border-color: rgba(var(--loss-rgb), 0.45); color: var(--loss); }
.tag.is-live { border-color: rgba(var(--accent-rgb), 0.5); color: var(--accent); }

.bar {
  flex: 0 0 auto;
  width: 74px;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-hover);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

/* ─── Таблицы ───────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.dt th,
table.dt td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

table.dt th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

table.dt tbody tr:hover { background: var(--surface-hover); }
table.dt td.num { font-variant-numeric: tabular-nums; }
table.dt td.up { color: var(--profit); }
table.dt td.down { color: var(--loss); }

/* ─── Фильтры + пагинация ───────────────────── */
.filters { display: flex; gap: 6px; }

.f-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.f-btn:hover { color: var(--text); border-color: var(--accent-line); }
.f-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.pager button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* ─── Мини-календарь ────────────────────────── */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 700;
}
.cal-head button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.cal-head button:hover { color: var(--accent); border-color: var(--accent-line); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.cal-dow {
  padding: 4px 0;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.cal-day {
  position: relative;
  padding: 7px 0;
  border-radius: 8px;
  font-size: 11.5px;
  text-align: center;
  color: var(--text-2);
}
.cal-day.is-mute { color: var(--muted-2); opacity: 0.45; }
.cal-day.is-today {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.cal-day.is-today.has-event::after { background: var(--on-accent); }

.cal-list { margin-top: 12px; }

/* ─── Биржи / API-ключи ─────────────────────── */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ex-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.ex-card.is-on { border-color: rgba(var(--accent-rgb), 0.45); }

.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex-name { font-size: 13.5px; font-weight: 700; }
.ex-status { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.ex-status.is-on { color: var(--profit); }

.api-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.api-field { display: flex; flex-direction: column; gap: 5px; }
.api-field span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.api-field input {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.api-field input:focus { border-color: rgba(var(--accent-rgb), 0.6); }

.api-actions { display: flex; gap: 8px; margin-top: 12px; }
.api-actions .btn { padding: 8px 14px; font-size: 13px; }

.note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.note code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-hover);
  font-size: 11px;
}

/* ─── Настройки: число и чекбокс в строке ───── */
.set-num {
  width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.set-num:focus { border-color: rgba(var(--accent-rgb), 0.6); }

.row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── Правая колонка ────────────────────────── */
.dash-side {
  grid-area: side;
  min-height: 0;
  padding: 16px 14px 30px;
  overflow-y: auto;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
}

.ds-card {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.ds-title {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ds-actions { display: flex; flex-direction: column; gap: 8px; }
.ds-actions .btn { justify-content: flex-start; padding: 9px 12px; font-size: 13px; }

.demo-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-light);
}

/* ─── Настройки: 5 вкладок (профиль / безопасность / …) ─── */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.settings-tab {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.settings-tab:hover { background: var(--accent-soft); color: var(--text); }
.settings-tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.settings-content {
  min-width: 0;
  min-height: 500px;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.settings-pane { display: none; }
.settings-pane.active { display: block; }

.settings-pane > h2 {
  margin: 0 0 22px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pane-lead { margin: -12px 0 20px; font-size: 12.5px; color: var(--muted); }

/* ─── Поля формы ────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group > label {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.form-group input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}
.form-group input:focus { border-color: rgba(var(--accent-rgb), 0.6); }
.form-group input:disabled { cursor: not-allowed; color: var(--muted); }
.form-group small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ─── Аватар ────────────────────────────────── */
.avatar-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }

.avatar-preview {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  background-position: center;
  background-size: cover;
  font-size: 30px;
  font-weight: 800;
  color: var(--on-accent);
}

/* ─── Строки-пункты: безопасность и уведомления ─── */
.security-item,
.notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.security-item:last-of-type,
.notif-item:last-of-type { border-bottom: 0; }

.security-item h3,
.notif-item h3 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.security-item p,
.notif-item p { margin: 0; font-size: 12px; color: var(--muted); }
.security-item .btn,
.notif-item .btn { flex: 0 0 auto; }

.security-item--stack {
  align-items: flex-start;
  flex-direction: column;
}
.security-item__body { width: 100%; }
.security-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.phone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.phone-row input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}
.phone-row input:focus { border-color: rgba(var(--accent-rgb), 0.6); }

.sessions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sessions-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 12.5px;
}
.sessions-list .sess-meta { color: var(--muted); font-size: 11.5px; }
.sessions-list .sess-current {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--profit-rgb), 0.15);
  color: var(--profit);
  font-size: 10.5px;
  font-weight: 600;
}

.form-fb { display: block; margin-top: 5px; font-size: 11px; color: var(--accent-light); }

/* ─── Индикатор надёжности пароля ─── */
.pwd-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.pwd-meter span {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 0.2s ease;
}
.pwd-meter[data-level="1"] span:nth-child(1) { background: var(--loss); }
.pwd-meter[data-level="2"] span:nth-child(1),
.pwd-meter[data-level="2"] span:nth-child(2) { background: #f59e0b; }
.pwd-meter[data-level="3"] span { background: var(--profit); }
.pwd-meter-label {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ─── Glass-модалки ─── */
.apex-modal[hidden] { display: none; }
.apex-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.apex-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.62);
}
.apex-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(20, 24, 36, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.apex-modal__dialog h3 {
  margin: 0 28px 8px 0;
  font-size: 17px;
  font-weight: 700;
}
.apex-modal__hint {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.apex-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.apex-modal__close:hover { color: var(--text); background: var(--accent-soft); }
.apex-modal__form .form-group { margin-bottom: 14px; }
.apex-modal__form .form-group > span {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.apex-modal__form input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 14, 26, 0.55);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}
.apex-modal__form input:focus { border-color: rgba(var(--accent-rgb), 0.6); }
.apex-modal__error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(var(--loss-rgb), 0.45);
  border-radius: 10px;
  background: rgba(var(--loss-rgb), 0.12);
  font-size: 12.5px;
  color: var(--loss);
}
.apex-modal__error[hidden] { display: none; }

.tfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
}
.tfa-secret {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.tfa-secret code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 14, 26, 0.55);
  font-size: 12px;
  word-break: break-all;
  color: var(--text);
}
.btn-sm { padding: 8px 12px; font-size: 12px; }

/* ─── Toast ─── */
.apex-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.apex-toast {
  min-width: 220px;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(20, 24, 36, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: apex-toast-in 0.22s ease;
}
@keyframes apex-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Переключатели: режим / тема / язык ────── */
.mode-switch,
.theme-switch,
.lang-switch { display: flex; flex-wrap: wrap; gap: 8px; }

.mode-btn,
.theme-btn,
.lang-btn {
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.mode-btn:hover,
.theme-btn:hover,
.lang-btn:hover { border-color: var(--accent-line); color: var(--text); }

.mode-btn.is-active, .mode-btn.active,
.theme-btn.is-active, .theme-btn.active,
.lang-btn.is-active, .lang-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* ─── Карточки бирж (вкладка API) ───────────── */
.exchange-card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.exchange-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.exchange-header h3 { margin: 0; font-size: 15px; font-weight: 700; }

.exchange-status { margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.exchange-status.is-on { color: var(--profit); }

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-hover);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.status-badge.active { background: rgba(var(--profit-rgb), 0.15); color: var(--profit); }

/* ─── Кнопки: дополняют системный .btn (style.css) ─── */
.btn-secondary { background: var(--bg-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent-line); color: var(--accent); }
.btn-danger { background: rgba(var(--loss-rgb), 0.15); color: var(--loss); border-color: transparent; }
.btn-danger:hover { background: rgba(var(--loss-rgb), 0.25); }

.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.form-actions .btn { padding: 8px 14px; font-size: 13px; }

.notif-input {
  flex: 0 0 auto;
  width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.notif-input:focus { border-color: rgba(var(--accent-rgb), 0.6); }

/* ─── Адаптив вкладок настроек ──────────────── */
@media (max-width: 767px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { flex-direction: row; overflow-x: auto; }
  .settings-tab { white-space: nowrap; }
  .settings-content { min-height: 0; padding: 18px; }
  .security-item,
  .notif-item { flex-wrap: wrap; align-items: flex-start; }
  .notif-input { width: 100%; }
}

/* ─── Виды (переключение левым меню) ────────── */
.view[hidden] { display: none; }

/* ─── Адаптив ───────────────────────────────── */
@media (max-width: 1279px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .dash {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-areas: "top top" "nav main";
  }
  .dash-side { display: none; }
}

@media (max-width: 767px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "main";
  }
  .dash-nav {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
  }
  .dash.nav-open .dash-nav { transform: none; }
  .ex-grid, .api-form { grid-template-columns: minmax(0, 1fr); }
  .dash-main { padding: 16px 14px 32px; }

  /* Верхняя панель: логотип + крошка + контролы обязаны помещаться
     в 320–767px, иначе чип с e-mail наезжает на крошку «Панель». */
  .dash-top { gap: 10px; padding: 0 12px; }
  .dt-logo { font-size: 14px; }
  /* e-mail из шапки убираем — он и так виден в приветствии */
  .dt-user { display: none; }
  .dt-page {
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  /* совсем узкие экраны: крошку прячем, она дублирует заголовок и меню */
  .dt-sep, .dt-page { display: none; }
}
