:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --danger: #ef4444;
  --success: #22c55e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  color-scheme: dark;
}

.container { max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-wide { max-width: 1200px; }

header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
header h1 { margin: 0 0 0.25rem; font-size: 1.75rem; }
header p { margin: 0 0 1rem; color: var(--muted); }

.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
header nav .inline-form { margin-left: auto; margin-top: 0; }
header nav .inline-form button { white-space: nowrap; }
.tab-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
}
.tab-btn.active, .tab-btn:hover { background: rgba(20,184,166,0.12); color: var(--text); border-color: var(--border); }
.tab-btn.active { background: var(--accent); color: #042f2e; border-color: var(--accent); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat h3 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.stat-value { margin: 0; font-size: 1.35rem; font-weight: 700; }

h2 { margin: 0 0 1rem; font-size: 1.15rem; }

.form-grid { display: grid; gap: 0.85rem; }
.form-grid label { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
}
.form-grid label > .field-label {
  display: block;
  line-height: 1.3;
  font-size: inherit;
  color: inherit;
}
.form-grid label > .field-label .req {
  color: #fca5a5;
  margin-left: 0.15rem;
}
.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.inline-form { margin-top: 0.75rem; }

input, select, button, textarea {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  padding: 0.6rem 0.75rem;
}

button {
  background: var(--accent);
  color: #042f2e;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); color: white; border: none; }
button:hover { background: var(--accent-hover); color: white; }
button.secondary:hover { background: rgba(255,255,255,0.05); color: var(--text); }
button.danger:hover { background: #dc2626; color: white; }

.checkbox-label { display: flex !important; align-items: center; gap: 0.5rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; }
a { color: #5eead4; }

.badge { padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.78rem; }
.badge.on { background: rgba(34,197,94,0.15); color: var(--success); }
.badge.warn { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge.off { background: rgba(239,68,68,0.15); color: var(--danger); }

.hint, .empty-state { color: var(--muted); font-size: 0.9rem; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }

.alert-success { border-color: var(--success); }
.alert-warn { border-color: #f59e0b; }
.card-danger { border-color: rgba(239,68,68,0.45); }
.key-box { display: block; padding: 0.75rem; background: #111827; border-radius: 8px; word-break: break-all; }

.payer-section {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}
.payer-panel.is-hidden {
  display: none !important;
}

.payer-form { display: flex; flex-direction: column; gap: 0; }
.payer-card .form-title { margin-bottom: 1rem; }
.form-title { display: flex; align-items: center; gap: 0.5rem; }
.form-title-icon { color: #f59e0b; font-size: 1.1rem; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
}
.field-label {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.3;
}
.field-label .req { color: var(--text); margin-left: 0.1rem; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
}
.form-field input:disabled,
.form-field select:disabled {
  opacity: 1;
  cursor: text;
}

.payer-form > .form-field { margin-bottom: 1rem; }

.payer-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.payer-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.25rem;
}
.payer-grid-6 .col-2 { grid-column: span 2; }
.payer-grid-6 .col-3 { grid-column: span 3; }
.payer-grid-6 .col-6 { grid-column: span 6; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}
.btn-cancel {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}
.btn-cancel:hover { background: rgba(255,255,255,0.05); }

@media (max-width: 720px) {
  .payer-grid-6 { grid-template-columns: 1fr; }
  .payer-grid-6 .col-2,
  .payer-grid-6 .col-3,
  .payer-grid-6 .col-6 { grid-column: span 1; }
}

header nav { align-items: center; }

code { font-family: ui-monospace, monospace; }

/* BillManager-style service panel */
.bm-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.bm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(180deg, #243044 0%, #1e2936 100%);
  border-bottom: 1px solid var(--border);
}
.bm-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.bm-panel-meta {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.bm-utils {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.bm-icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}
.bm-icon-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.bm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  background: #1c2633;
  border-bottom: 1px solid var(--border);
}
.bm-toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 74px;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  line-height: 1.15;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #c5d0de;
  cursor: pointer;
  font-weight: 500;
}
.bm-toolbar-btn .bm-icon {
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.95;
}
.bm-toolbar-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.07);
  border-color: var(--border);
  color: var(--text);
}
.bm-toolbar-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.bm-toolbar-btn.btn-instruction .bm-icon { color: #4ade80; }

.bm-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #171f2a;
  border-bottom: 1px solid var(--border);
}
.bm-filter-icon {
  color: var(--muted);
  font-size: 0.9rem;
}
.bm-search {
  flex: 1;
  max-width: 320px;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  border-radius: 4px;
}

.bm-table-wrap { overflow-x: auto; }
.bm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.bm-table th,
.bm-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.bm-table th {
  background: #151c27;
  color: #9fb0c7;
  font-weight: 600;
  font-size: 0.8rem;
}
.bm-table tbody tr { cursor: pointer; }
.bm-table tbody tr:hover { background: rgba(20,184,166,0.05); }
.bm-table tbody tr.selected { background: rgba(20,184,166,0.12); }
#edit-api-key {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}
.copy-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.copy-field-row input {
  flex: 1;
  min-width: 0;
}
.copy-field-row button {
  white-space: nowrap;
  flex-shrink: 0;
}
.bm-table .col-check { width: 32px; text-align: center; }
.bm-table .col-id { width: 48px; color: var(--muted); }
.bm-table .col-name { min-width: 140px; }
.bm-table .col-cost { text-align: right; }

.bm-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.bm-status.active { color: var(--success); }
.bm-status.suspended { color: #f59e0b; }
.bm-status.stopped { color: var(--danger); }
.bm-status-icon { font-size: 0.95rem; }

.bm-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.bm-flash {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.bm-flash.ok { background: rgba(34,197,94,0.12); color: var(--success); border: 1px solid rgba(34,197,94,0.35); }
.bm-flash.err { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }
.bm-flash.warn { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.35); }

.bm-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.bm-modal-backdrop.open { display: flex; }
.bm-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
}
.bm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.bm-modal-head h3 { margin: 0; font-size: 1rem; }
.bm-modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}
.bm-modal-body { padding: 1rem; }
.bm-modal-foot {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
}

.bm-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: #18202c;
  border-bottom: 1px solid var(--border);
}
.bm-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.bm-filter-btn:hover { background: rgba(255,255,255,0.05); }
.bm-filter-bar .bm-search { flex: 1; min-width: 120px; }
.bm-total-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.bm-active-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: rgba(59,130,246,0.12);
  border-bottom: 1px solid rgba(59,130,246,0.25);
  font-size: 0.85rem;
}
.bm-filter-tag {
  color: #93c5fd;
  font-weight: 500;
}
.bm-filter-clear {
  margin-left: auto;
  color: #fca5a5;
  text-decoration: none;
  font-size: 0.82rem;
}
.bm-filter-clear:hover { text-decoration: underline; }
.bm-table .col-cost.danger-text { color: var(--danger); font-weight: 600; }
.bm-table .col-cost.success-text { color: var(--success); font-weight: 600; }

.bm-status.payment-pending { color: #f59e0b; }
.bm-status.payment-completed { color: var(--success); }
.bm-status.payment-failed { color: var(--danger); }
.bm-status.payment-cancelled { color: var(--muted); }
.bm-status.payment-partially_refunded { color: #d97706; }
.bm-status.payment-refunded { color: #b45309; }

.bm-status.doc-new { color: #f59e0b; }
.bm-status.doc-sent { color: #60a5fa; }
.bm-status.doc-signed { color: var(--success); }
.bm-status.doc-rejected { color: var(--danger); }

.bm-client-picker {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem;
  background: #111827;
}
.bm-client-option {
  text-align: left;
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-weight: 400;
}
.bm-client-option:hover,
.bm-client-option.active {
  background: rgba(20,184,166,0.12);
  border-color: rgba(20,184,166,0.25);
}
.bm-client-select {
  width: 100%;
  min-height: 180px;
  margin-top: 0.35rem;
}
.bm-table tbody tr.non-accounting { opacity: 0.82; }
.req { color: #fca5a5; margin-left: 0.15rem; }

.subscription-detail-body { padding: 0 1rem 1rem; }
.sub-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: #171f2a;
  border-bottom: 1px solid var(--border);
}
.sub-detail-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.sub-detail-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.sub-detail-stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.sub-detail-stat-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.sub-detail-stat-wide {
  grid-column: 1 / -1;
}
.sub-detail-stat-wide .copy-field-row {
  margin-top: 0.35rem;
}
.sub-detail-form-wrap {
  padding: 1rem;
}
.sub-detail-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  max-width: 920px;
  margin: 0;
}
.sub-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
}
.sub-detail-field-wide {
  grid-column: 1 / -1;
  max-width: 520px;
}
.sub-detail-field .field-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.sub-detail-field input,
.sub-detail-field select {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
}
.sub-detail-field-check {
  justify-content: flex-end;
}
.sub-detail-field-check .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.9rem;
  min-height: 38px;
}
@media (max-width: 900px) {
  .sub-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-detail-form { grid-template-columns: 1fr 1fr; }
  .sub-detail-field-wide { max-width: none; }
}
@media (max-width: 560px) {
  .sub-detail-summary { grid-template-columns: 1fr; }
  .sub-detail-form { grid-template-columns: 1fr; }
}

.cabinet-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0;
  border-bottom: none;
}
.cabinet-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 0.75rem;
}
.cabinet-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.cabinet-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
.cabinet-brand-text h1 {
  margin: 0 0 0.15rem;
  font-size: 1.5rem;
}
.cabinet-brand-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.cabinet-header .tabs {
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}
.cabinet-account-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
  text-align: right;
  min-width: 0;
}
.cabinet-currency-form {
  margin: 0 0 0.2rem;
  display: block;
}
.cabinet-currency-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.cabinet-currency-caption {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted, #888);
  line-height: 1;
}
.cabinet-currency-select {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  height: 1.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35rem;
  padding: 0 1.05rem 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b9cb3' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  color: var(--text);
  color-scheme: dark;
  cursor: pointer;
}
.cabinet-currency-select option {
  background-color: var(--surface);
  color: var(--text);
}
.cabinet-currency-select:hover,
.cabinet-currency-select:focus {
  border-color: var(--accent, #5b8def);
  outline: none;
}
.cabinet-balance-label {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted, #888);
  opacity: 0.9;
}
.cabinet-balance-value {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
}
.cabinet-fx-hint {
  font-size: 0.65rem;
  color: var(--muted, #888);
  line-height: 1.3;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .cabinet-balance-value {
    font-size: 0.95rem;
    white-space: normal;
    max-width: 12.5rem;
  }
  .cabinet-fx-hint {
    white-space: normal;
    max-width: 12.5rem;
  }
}
.topup-detail-page {
  max-width: 720px;
  margin: 0 auto;
}
.topup-detail-flash {
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
.topup-detail-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: none;
}
.topup-detail-amount {
  font-size: 1.1rem;
}
.topup-detail-ref .sub-detail-stat-value {
  font-weight: 600;
}
.topup-detail-ref-row {
  margin-top: 0.2rem;
}
.topup-detail-ref-code {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.05rem;
  color: var(--text);
}
.topup-detail-copy {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}
.topup-detail-body {
  padding: 1rem;
}
.topup-detail-callout {
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 6px;
}
.topup-detail-callout p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}
.topup-detail-callout code {
  color: #99f6e4;
}
.topup-detail-note {
  padding: 0;
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.topup-detail-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.topup-detail-footer a {
  color: var(--muted);
  text-decoration: none;
}
.topup-detail-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.topup-detail-footer-sep {
  color: var(--border);
  user-select: none;
}
.topup-form-body {
  padding: 1rem;
  max-width: 680px;
}
.topup-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.topup-form-hint {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
}
.topup-form-foot {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
}
.topup-requisites {
  padding: 0 0 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.topup-requisites h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.topup-requisites-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.topup-requisites-list div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}
.topup-requisites-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.topup-requisites-list dd {
  margin: 0;
}
@media (max-width: 700px) {
  .topup-form-grid { grid-template-columns: 1fr; }
  .topup-detail-summary { grid-template-columns: 1fr; }
  .topup-requisites-list div { grid-template-columns: 1fr; }
}

.cabinet-tabs {
  align-items: center;
}
.cabinet-user-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.cabinet-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}
.cabinet-user-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.cabinet-user-icon {
  width: 20px;
  height: 20px;
  display: block;
}
.cabinet-user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 50;
}
.cabinet-user-menu.open .cabinet-user-dropdown {
  display: block;
}
.cabinet-user-dropdown-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.cabinet-user-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.cabinet-user-login {
  font-size: 0.78rem;
  color: var(--muted);
}
.cabinet-user-item {
  display: block;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.cabinet-user-item:last-child,
.cabinet-user-logout-form .cabinet-user-item {
  border-bottom: none;
}
.cabinet-user-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.cabinet-user-logout-form {
  margin: 0;
}
.cabinet-user-logout {
  color: #fca5a5;
}
.cabinet-user-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

body.cabinet-login {
  min-height: 100vh;
}
.cabinet-login-wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cabinet-login-card {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.cabinet-login-brand {
  text-align: center;
  padding: 1.75rem 1.5rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.cabinet-login-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin: 0 auto 0.9rem;
  display: block;
  object-fit: cover;
}
.cabinet-login-brand h1 {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 600;
}
.cabinet-login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.cabinet-login-body {
  padding: 1.35rem 1.5rem 1.5rem;
}
.cabinet-login-body h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.cabinet-login-error {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.88rem;
  text-align: center;
}
.cabinet-login-form {
  margin-bottom: 0.75rem;
}
.cabinet-login-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
}
.cabinet-login-hint {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.45;
}
.cabinet-login-hint a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.cabinet-login-hint a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
