:root {
  --accent: #3f3f46;
  --accent-strong: #2a2a30;
  --ok: oklch(0.6 0.15 155);
  --warn: oklch(0.72 0.15 75);
  --danger: oklch(0.58 0.21 25);

  --bg: oklch(0.985 0.004 270);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.004 270);
  --border: oklch(0.92 0.005 270);
  --border-strong: oklch(0.86 0.006 270);

  --text: oklch(0.24 0.015 270);
  --text-muted: oklch(0.52 0.012 270);
  --text-faint: oklch(0.68 0.01 270);

  --shadow-sm: 0 1px 2px oklch(0.4 0.02 270 / 0.05), 0 1px 3px oklch(0.4 0.02 270 / 0.04);
  --shadow-md: 0 4px 12px oklch(0.4 0.02 270 / 0.07), 0 2px 4px oklch(0.4 0.02 270 / 0.04);
  --shadow-lg: 0 16px 48px oklch(0.3 0.03 270 / 0.16), 0 4px 12px oklch(0.3 0.03 270 / 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
::selection { background: color-mix(in oklch, var(--accent) 22%, transparent); }

/* ============ Каркас ============ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0; background: var(--surface);
  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: 11px; padding: 6px 8px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-faint); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border: none; background: none; color: var(--text-muted);
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  text-align: left; width: 100%; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent-strong); }
.nav-item.active svg { color: var(--accent); }
.nav-item span { }
.nav-badge {
  flex: none; font-size: 11px; font-weight: 700; background: var(--surface-2);
  color: var(--text-muted); padding: 1px 7px; border-radius: 20px; font-family: var(--mono);
}
.nav-item.active .nav-badge { background: color-mix(in oklch, var(--accent) 18%, transparent); color: var(--accent-strong); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.balance-mini { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; }
.balance-mini-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.balance-mini-val { font-size: 19px; font-weight: 800; margin: 4px 0 8px; letter-spacing: -0.02em; }
.balance-mini-bar { height: 5px; border-radius: 4px; background: var(--border); overflow: hidden; }
.balance-mini-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); border-radius: 4px; }
.op { display: flex; align-items: center; gap: 10px; padding: 4px 4px; }
.op-name { font-size: 12.5px; font-weight: 700; }
.op-sub { font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

.main { flex: 1; min-width: 0; overflow-x: hidden; }
.page { padding: 30px 36px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { font-size: 25px; font-weight: 800; letter-spacing: -0.025em; }
.page-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }

/* ============ Карточки ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }

/* ============ Кнопки ============ */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 650; font-size: 13.5px; transition: all .13s; white-space: nowrap; }
.btn-md { padding: 9px 15px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-icon { display: inline-flex; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: color-mix(in oklch, var(--accent) 11%, transparent); color: var(--accent-strong); }
.btn-soft:hover { background: color-mix(in oklch, var(--accent) 18%, transparent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); color: var(--text-muted); transition: all .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn-danger:hover { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 40%, var(--border)); background: color-mix(in oklch, var(--danger) 8%, transparent); }

.link-btn { display: inline-flex; align-items: center; gap: 3px; background: none; border: none; color: var(--accent-strong); font-weight: 650; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ============ Бейджи ============ */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px 3px 8px; border-radius: 20px; white-space: nowrap; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.badge-dot.pulse { animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
.chip { font-size: 11px; font-weight: 650; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 20px; }

/* ============ Главная: статы ============ */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { padding: 18px 20px 14px; position: relative; overflow: hidden; }
.accent-card { background: linear-gradient(160deg, color-mix(in oklch, var(--accent) 7%, var(--surface)), var(--surface)); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text-muted); }
.stat-value { font-size: 31px; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 2px; }
.stat-unit { font-size: 15px; font-weight: 600; color: var(--text-faint); letter-spacing: 0; }
.stat-foot { font-size: 12.5px; color: var(--text-muted); }
.stat-foot b { color: var(--text); font-weight: 700; }
.stat-spark { margin: 8px -20px -14px; }

.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.dash-list { padding: 6px; }
.dash-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); transition: background .1s; }
.dash-row:hover { background: var(--surface-2); }
.dash-row-main { flex: 1; min-width: 0; }
.dash-row-name { font-weight: 700; font-size: 13.5px; }
.dash-row-meta { font-size: 11.5px; color: var(--text-faint); }
.dash-row-side { display: flex; align-items: center; gap: 14px; }
.dash-row-price { font-weight: 700; font-size: 13px; }

.dash-side { display: flex; flex-direction: column; gap: 16px; }
.alert-card { padding: 16px 18px; }
.alert-card .card-title { margin-bottom: 12px; }
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.alert-item b { font-weight: 700; }
.alert-sub { font-size: 11.5px; color: var(--text-muted); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.alert-item.danger .alert-dot { background: var(--danger); }
.alert-item.warn .alert-dot { background: var(--warn); }
.empty-note { display: flex; align-items: center; gap: 7px; color: var(--ok); font-size: 13px; font-weight: 600; }
.mini-stats { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.mini-stat { display: flex; align-items: center; justify-content: space-between; }
.mini-stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.mini-stat-val { font-size: 16px; font-weight: 700; }

/* ============ Toolbar / фильтры / поиск ============ */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.filter-tab { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; color: var(--text-muted); padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 650; }
.filter-tab:hover { color: var(--text); }
.filter-tab.active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
.filter-count { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.filter-tab.active .filter-count { color: var(--accent-strong); }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text-faint); min-width: 240px; }
.search-box input { border: none; outline: none; background: none; color: var(--text); font-size: 13px; width: 100%; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent); }

/* ============ Таблица ============ */
.table-card { overflow: hidden; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.row-dim { opacity: 0.62; }
.table-empty { padding: 40px; text-align: center; color: var(--text-faint); font-size: 13px; }

.cell-client { display: flex; align-items: center; gap: 11px; }
.cell-client-name { font-weight: 700; font-size: 13.5px; }
.cell-client-id { font-size: 11px; color: var(--text-faint); }
.ip-cell { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; font-size: 12.5px; color: var(--text); transition: all .1s; }
.ip-cell:hover { border-color: var(--accent); color: var(--accent-strong); }
.ip-cell svg { color: var(--text-faint); }
.ip-cell:hover svg { color: var(--accent); }
.cell-tariff { font-weight: 650; font-size: 13px; }
.cell-tariff-sub { font-size: 11px; color: var(--text-faint); }
.cell-days { font-size: 11px; color: var(--text-faint); }
.cell-days.warn { color: var(--warn); font-weight: 650; }
.cell-days.neg { color: var(--danger); font-weight: 650; }
.cell-price { font-weight: 700; font-size: 13.5px; }
.cell-price-sub { font-size: 10.5px; color: var(--text-faint); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* mini load */
.miniload { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.miniload-row { display: flex; align-items: center; gap: 7px; }
.miniload-k { font-size: 9.5px; color: var(--text-faint); width: 24px; font-weight: 700; }
.miniload-track { flex: 1; height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.miniload-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.miniload-v { font-size: 10px; color: var(--text-muted); width: 18px; text-align: right; }

/* ============ Модалки ============ */
.modal-overlay { position: fixed; inset: 0; background: oklch(0.3 0.02 270 / 0.4); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 24px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-height: 90vh; overflow-y: auto; animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }

/* форма */
.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; }
.field { flex: 1; }
.field-row { display: flex; gap: 14px; margin-top: 18px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text); background: var(--surface); outline: none; transition: all .12s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input-affix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 12px; transition: all .12s; }
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent); }
.input-affix span { color: var(--text-faint); font-size: 13.5px; }
.input-affix .input { border: none; box-shadow: none; padding: 10px 6px; }
.affix-suf { font-size: 12px; }

.tariff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tariff-opt { text-align: left; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: all .12s; }
.tariff-opt:hover { border-color: var(--border-strong); }
.tariff-opt.active { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, transparent); }
.tariff-opt-name { font-weight: 750; font-size: 14px; }
.tariff-opt-spec { font-size: 11px; color: var(--text-muted); margin: 3px 0; }
.tariff-opt-cap { font-size: 11px; color: var(--accent-strong); font-weight: 650; margin-bottom: 4px; }
.tariff-opt-cost { font-size: 11px; color: var(--text-faint); }
.margin-note { margin-top: 16px; padding: 11px 14px; background: color-mix(in oklch, var(--ok) 8%, transparent); border: 1px solid color-mix(in oklch, var(--ok) 25%, transparent); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text); }

/* срок оплаты / месяцы */
.month-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.month-tab { padding: 9px 0; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 700; transition: all .12s; }
.month-tab:hover { border-color: var(--border-strong); color: var(--text); }
.month-tab.active { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, transparent); color: var(--accent-strong); }

/* тип системы — чип в таблице/карточках */
.type-chip { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 7px; font-size: 10.5px; font-weight: 700; border-radius: 999px; color: var(--accent-strong); background: color-mix(in oklch, var(--accent) 12%, transparent); letter-spacing: 0.01em; }

/* продление */
.extend-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.extend-row > span { color: var(--text-muted); }
.extend-summary { margin-top: 16px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.extend-rate { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--text-faint); font-weight: 500; }

/* прогресс */
.prov-spinner { width: 16px; height: 16px; border: 2.5px solid color-mix(in oklch, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prov-steps { display: flex; flex-direction: column; gap: 4px; }
.prov-step { display: flex; gap: 12px; align-items: flex-start; padding: 8px 6px; border-radius: var(--radius-sm); transition: all .25s; opacity: .5; }
.prov-step.prov-run { opacity: 1; background: color-mix(in oklch, var(--accent) 6%, transparent); }
.prov-step.prov-ok { opacity: 1; }
.prov-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.prov-ok .prov-icon { background: var(--ok); color: #fff; }
.prov-run .prov-icon { background: color-mix(in oklch, var(--accent) 16%, transparent); }
.prov-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.prov-dot-spin { width: 13px; height: 13px; border: 2px solid color-mix(in oklch, var(--accent) 30%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.prov-label { font-weight: 650; font-size: 13.5px; }
.prov-detail { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.prov-console { margin-top: 16px; background: oklch(0.22 0.015 270); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 11.5px; color: oklch(0.85 0.02 155); max-height: 120px; overflow-y: auto; }
.prov-line { white-space: nowrap; opacity: 0; animation: fadein .2s forwards; }
@keyframes fadein { to { opacity: 1; } }
.prov-prompt { color: var(--accent); }

/* готово */
.done-hero { text-align: center; padding: 30px 22px 6px; }
.done-check { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 8px color-mix(in oklch, var(--ok) 14%, transparent); animation: pop .35s cubic-bezier(.2,.9,.3,1.4); }
.done-title { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.done-sub { color: var(--text-muted); font-size: 13px; margin-top: 5px; max-width: 340px; margin-inline: auto; }
.done-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.done-cell { background: var(--surface); padding: 11px 14px; }
.done-cell span { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 2px; }
.done-cell b { font-size: 13.5px; font-weight: 700; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 12px; background: var(--surface-2); color: var(--text-muted); outline: none; }
.link-copy { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 650; font-size: 12.5px; white-space: nowrap; }
.link-copy:hover { background: var(--accent-strong); }

/* ============ Клиенты ============ */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.client-card { padding: 18px; }
.client-card-head { display: flex; align-items: center; gap: 12px; }
.client-card-id { flex: 1; min-width: 0; }
.client-card-name { font-weight: 750; font-size: 15px; }
.client-card-contact { font-size: 12px; color: var(--accent-strong); text-decoration: none; font-family: var(--mono); }
.client-card-contact:hover { text-decoration: underline; }
.pay-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.client-card-rows { margin: 16px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.ccrow { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.ccrow span { color: var(--text-muted); }
.ccrow b { font-weight: 700; }
.txt-danger { color: var(--danger); } .txt-warn { color: var(--warn); }
.client-card-foot { display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.cc-metric { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--text-muted); }
.cc-metric svg { color: var(--text-faint); }
.cc-spacer { flex: 1; }

/* ============ Базы данных ============ */
.db-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.db-sum-card { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.db-sum-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.db-sum-val { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.db-sum-lbl { font-size: 12px; color: var(--text-muted); }
.db-count { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.db-modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.db-dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-dl-opt { text-align: center; padding: 20px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: all .12s; }
.db-dl-opt:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 5%, transparent); transform: translateY(-2px); }
.db-dl-opt:disabled { opacity: .7; cursor: default; }
.db-dl-icon { display: inline-flex; }
.db-dl-name { font-weight: 750; font-size: 14.5px; margin: 8px 0 3px; }
.db-dl-count { font-size: 12px; color: var(--text-faint); margin-bottom: 12px; }
.db-dl-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent-strong); }
.db-dl-loading { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text-muted); }

/* avatar */
.avatar { border-radius: 9px; display: grid; place-items: center; font-weight: 750; flex: none; }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { display: flex; align-items: center; gap: 9px; background: oklch(0.24 0.015 270); color: #fff; padding: 11px 18px; border-radius: 30px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastin .25s cubic-bezier(.2,.9,.3,1.3); }
.toast svg { color: var(--ok); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } }

.op-logout { width: 28px; height: 28px; border: none; background: none; color: var(--text-faint); border-radius: 6px; display: grid; place-items: center; flex: none; margin-left: auto; }
.op-logout:hover { background: color-mix(in oklch, var(--danger) 10%, transparent); color: var(--danger); }

/* ============ Авторизация (центрированная карточка) ============ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 40px 38px 32px; box-shadow: var(--shadow-md); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.auth-brand-sub { font-size: 11.5px; color: var(--text-faint); }
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.auth-sub { color: var(--text-muted); font-size: 13.5px; margin: 6px 0 26px; }
.auth-fields { display: flex; flex-direction: column; gap: 16px; }
.pass-affix { padding-right: 6px; }
.pass-toggle { background: none; border: none; color: var(--text-faint); font-size: 11.5px; font-weight: 650; padding: 4px 8px; border-radius: 6px; }
.pass-toggle:hover { color: var(--accent-strong); }
.auth-row { display: flex; align-items: center; justify-content: space-between; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; }
.check input { display: none; }
.check-box { width: 17px; height: 17px; border: 1.5px solid var(--border-strong); border-radius: 5px; display: grid; place-items: center; color: transparent; transition: all .12s; }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.auth-link { font-size: 12.5px; color: var(--accent-strong); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-err { font-size: 12.5px; color: var(--danger); background: color-mix(in oklch, var(--danger) 8%, transparent); border: 1px solid color-mix(in oklch, var(--danger) 22%, transparent); padding: 9px 12px; border-radius: var(--radius-sm); }
.auth-hint { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); margin-top: 18px; justify-content: center; }
.auth-foot { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--text-faint); }

.cell-contact-inline { color: var(--accent); font-weight: 600; }
.row-main { background: color-mix(in oklch, oklch(0.7 0.18 270) 6%, transparent) !important; }
.row-main td:first-child { border-left: 3px solid oklch(0.55 0.18 270); }
.main-badge { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: color-mix(in oklch, oklch(0.55 0.18 270) 14%, transparent); color: oklch(0.45 0.18 270); vertical-align: middle; letter-spacing: .3px; }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.toggle-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ip-cell-wrap { display: flex; align-items: center; gap: 4px; }
.ip-link { color: var(--text); text-decoration: none; font-size: 13px; padding: 2px 4px; border-radius: 4px; transition: background .12s; }
.ip-link:hover { background: color-mix(in oklch, var(--accent) 10%, transparent); color: var(--accent-strong); }
.cell-price-mo { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.users-count-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: all .12s; }
.users-count-btn:hover { border-color: var(--accent); color: var(--accent-strong); background: color-mix(in oklch, var(--accent) 8%, transparent); }
.slot-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.slot-row .input { flex: 1; }
.add-slot-btn { background: none; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 7px 14px; font-size: 12px; color: var(--text-faint); cursor: pointer; transition: all .12s; width: 100%; text-align: left; }
.add-slot-btn:hover { border-color: var(--accent); color: var(--accent); }
.upd-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.upd-name { font-weight: 650; font-size: 13px; min-width: 120px; }
.upd-step { flex: 1; font-size: 12px; color: var(--text-muted); }
.upd-icon { font-size: 15px; font-weight: 800; min-width: 18px; text-align: center; }
.user-plan-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.user-plan-info { flex: 1; min-width: 0; }
.user-plan-name { font-size: 13px; font-weight: 650; }
.user-plan-id { font-size: 11px; color: var(--text-faint); }
.user-plan-select { width: 100px !important; font-size: 12px !important; padding: 4px 8px !important; }
