*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:#f4f6f8;color:#1f2937}.layout{display:flex;min-height:100vh}.sidebar{width:250px;background:#111827;color:#fff;padding:22px 16px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.brand{font-size:24px;font-weight:700;margin-bottom:24px}.nav-title{font-size:12px;text-transform:uppercase;color:#9ca3af;margin:12px 8px}.top-gap{margin-top:24px}.sidebar a,.sidebar summary{color:#d1d5db;text-decoration:none;display:block;padding:9px 12px;border-radius:7px;cursor:pointer}.sidebar a:hover,.sidebar a.active{background:#2563eb;color:white}.submenu{padding-left:12px}.sidebar details{margin-bottom:4px}.sidebar-footer{margin-top:auto;color:#9ca3af;font-size:13px}.link-button,.danger-link{border:0;background:none;padding:0;color:#93c5fd;cursor:pointer}.content{margin-left:250px;padding:32px;width:calc(100% - 250px)}h1{margin-top:0}.page-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.page-head p{color:#6b7280}.actions{display:flex;gap:8px;flex-wrap:wrap}.button,button{display:inline-block;border:1px solid #d1d5db;border-radius:7px;background:#fff;padding:9px 14px;color:#111827;text-decoration:none;cursor:pointer}.primary{background:#2563eb!important;color:#fff!important;border-color:#2563eb!important}.search{display:flex;gap:8px;margin-bottom:16px}.search input{max-width:360px}.table-wrap{overflow:auto;background:white;border-radius:10px;box-shadow:0 1px 3px #0001}table{width:100%;border-collapse:collapse;background:white}th,td{text-align:left;padding:12px;border-bottom:1px solid #e5e7eb;vertical-align:top}th{background:#f9fafb}.row-actions{white-space:nowrap;display:flex;gap:10px}.danger-link{color:#dc2626}.empty{text-align:center;color:#6b7280}.form-card,.login-card{max-width:650px;background:white;border-radius:12px;padding:28px;box-shadow:0 4px 20px #0001}.auth-content{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(420px,100%)}label{display:block;margin-bottom:16px;font-weight:600}input,textarea,select{display:block;width:100%;padding:10px;margin-top:6px;border:1px solid #d1d5db;border-radius:7px;font:inherit}textarea{min-height:110px}.checkbox{display:flex;gap:8px;align-items:center}.checkbox input{width:auto;margin:0}.alert{padding:12px 14px;border-radius:8px;margin-bottom:18px}.alert.success{background:#dcfce7}.alert.danger{background:#fee2e2}.alert.warning{background:#fef3c7}.field-error{color:#dc2626;font-size:13px;margin-top:-10px;margin-bottom:12px}small{display:block;color:#6b7280;margin-top:4px}@media(max-width:800px){.sidebar{position:static;width:100%}.layout{display:block}.content{margin:0;width:100%;padding:18px}.page-head{align-items:flex-start;flex-direction:column}}


/* ===== Dark theme and inline editing ===== */

:root {
  color-scheme: dark;
  --dark-bg: #0b1120;
  --dark-panel: #111827;
  --dark-panel-2: #172033;
  --dark-border: #2b3850;
  --dark-text: #e6edf7;
  --dark-muted: #94a3b8;
  --dark-accent: #60a5fa;
  --dark-accent-hover: #93c5fd;
  --dark-success: #22c55e;
  --dark-danger: #f87171;
}

html,
body {
  background: var(--dark-bg);
  color: var(--dark-text);
}

.content,
.auth-content {
  background: var(--dark-bg);
  color: var(--dark-text);
}

.sidebar {
  background: #090f1c;
  border-right: 1px solid var(--dark-border);
  color: var(--dark-text);
}

.sidebar a,
.sidebar summary,
.sidebar .brand,
.sidebar-footer {
  color: var(--dark-text);
}

.sidebar a:hover,
.sidebar a.active {
  background: var(--dark-panel-2);
  color: #fff;
}

h1,
h2,
h3,
p,
label {
  color: var(--dark-text);
}

.page-head p,
.nav-title,
small {
  color: var(--dark-muted);
}

input,
select,
textarea,
button {
  background: var(--dark-panel-2);
  color: var(--dark-text);
  border-color: var(--dark-border);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--dark-accent);
  outline: 2px solid rgb(96 165 250 / 20%);
}

button,
.button {
  background: #1e3a5f;
  color: #fff;
  border: 1px solid #315b8a;
}

button:hover,
.button:hover {
  background: #294d78;
}

.button.primary,
button.primary {
  background: #2563eb;
  border-color: #3b82f6;
}

.table-wrap,
.form-card,
.login-card {
  background: var(--dark-panel);
  border-color: var(--dark-border);
  box-shadow: 0 12px 30px rgb(0 0 0 / 22%);
}

.accounts-table {
  min-width: 1450px;
  background: var(--dark-panel);
}

.accounts-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151f31;
  color: #f8fafc;
  border-color: var(--dark-border);
}

.accounts-table td {
  background: var(--dark-panel);
  color: var(--dark-text);
  border-color: var(--dark-border);
  vertical-align: top;
}

.accounts-table tbody tr:nth-child(even) td {
  background: #0f1929;
}

.accounts-table tbody tr:hover td {
  background: #17243a;
}

.editable-cell {
  min-width: 115px;
  max-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: text;
  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease;
}

.editable-cell[contenteditable="true"]:hover {
  background: #1b2b45 !important;
  box-shadow: inset 0 0 0 1px #3b5274;
}

.editable-cell.editing {
  background: #1d3150 !important;
  box-shadow: inset 0 0 0 2px var(--dark-accent);
  outline: none;
}

.editable-cell.saving {
  opacity: 0.65;
  cursor: wait;
}

.editable-cell.saved {
  background: rgb(34 197 94 / 18%) !important;
  box-shadow: inset 0 0 0 2px var(--dark-success);
}

.editable-cell.save-error {
  background: rgb(248 113 113 / 20%) !important;
  box-shadow: inset 0 0 0 2px var(--dark-danger);
}

.save-status {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: 420px;
  padding: 11px 16px;
  border-radius: 9px;
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--dark-border);
  box-shadow: 0 12px 30px rgb(0 0 0 / 35%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.save-status.visible {
  opacity: 1;
  transform: translateY(0);
}

.save-status.success {
  border-color: var(--dark-success);
}

.save-status.error {
  border-color: var(--dark-danger);
  color: #fecaca;
}

.danger-link {
  color: var(--dark-danger);
  background: transparent;
  border: 0;
}

.alert {
  background: var(--dark-panel-2);
  color: var(--dark-text);
  border-color: var(--dark-border);
}

.alert.success {
  border-color: var(--dark-success);
}

.alert.danger,
.alert.error {
  border-color: var(--dark-danger);
}


/* ===== Stable table layout, themes and account borders ===== */

:root,
html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f3f6fa;
  --panel-bg: #ffffff;
  --panel-alt: #f8fafc;
  --sidebar-bg: #ffffff;
  --text-main: #172033;
  --text-muted: #64748b;
  --border-main: #cbd5e1;
  --border-strong: #94a3b8;
  --hover-bg: #eef4fb;
  --edit-bg: #e0efff;
  --button-bg: #e2e8f0;
  --button-text: #172033;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0b1120;
  --panel-bg: #111827;
  --panel-alt: #0f1929;
  --sidebar-bg: #090f1c;
  --text-main: #e6edf7;
  --text-muted: #94a3b8;
  --border-main: #344158;
  --border-strong: #52627b;
  --hover-bg: #17243a;
  --edit-bg: #1d3150;
  --button-bg: #1e293b;
  --button-text: #e6edf7;
}

html,
body,
.content,
.auth-content {
  background: var(--page-bg);
  color: var(--text-main);
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--text-main);
  border-right: 1px solid var(--border-main);
}

.sidebar a,
.sidebar summary,
.sidebar .brand,
.sidebar-footer,
h1,
h2,
h3,
p,
label {
  color: var(--text-main);
}

.page-head p,
.nav-title,
small {
  color: var(--text-muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}

.accounts-table {
  width: 100%;
  min-width: 1450px;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--panel-bg);
}

.accounts-table th,
.accounts-table td {
  box-sizing: border-box;
  padding: 12px 9px;
  text-align: center;
  vertical-align: middle;
  color: var(--text-main);
  border-right: 1px solid var(--border-main);
  border-bottom: 2px solid var(--border-strong);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
}

.accounts-table th:last-child,
.accounts-table td:last-child {
  border-right: 0;
}

.accounts-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-alt);
  font-weight: 700;
}

.accounts-table tbody tr:last-child td {
  border-bottom: 0;
}

.accounts-table tbody tr:hover td {
  background: var(--hover-bg);
}

.accounts-table .col-account {
  width: 180px;
}

.accounts-table .col-money {
  width: 125px;
}

.accounts-table .col-coupon {
  width: 140px;
}

.accounts-table .col-transport-coupon {
  width: 175px;
}

.accounts-table .col-donation {
  width: 110px;
}

.accounts-table .col-transport {
  width: 270px;
}

.accounts-table .col-business {
  width: 220px;
}

.accounts-table .col-house {
  width: 170px;
}

.accounts-table .col-sim {
  width: 125px;
}

.accounts-table .col-actions {
  width: 105px;
}

.editable-cell {
  cursor: text;
  min-width: 0;
  max-width: none;
}

.editable-cell[contenteditable="true"]:hover {
  background: var(--hover-bg) !important;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.editable-cell.editing {
  background: var(--edit-bg) !important;
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}

.row-actions {
  min-width: 100px;
  text-align: center;
}

.order-buttons {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 7px;
}

.move-button {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-main);
  border-radius: 5px;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
}

.move-button:hover {
  border-color: #60a5fa;
}

.move-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.theme-toggle {
  width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border-main);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
}

input,
select,
textarea,
button {
  background: var(--button-bg);
  color: var(--button-text);
  border-color: var(--border-main);
}

.form-card,
.login-card {
  background: var(--panel-bg);
  color: var(--text-main);
  border-color: var(--border-main);
}

@media (max-width: 900px) {
  .accounts-table {
    min-width: 1350px;
  }

  .accounts-table th,
  .accounts-table td {
    padding: 9px 7px;
  }
}


/* ===== Theme fix and compact table ===== */

html[data-theme="light"] .accounts-table,
html[data-theme="light"] .accounts-table tbody,
html[data-theme="light"] .accounts-table tr,
html[data-theme="light"] .accounts-table td {
  background: #ffffff !important;
  color: #172033 !important;
}

html[data-theme="light"] .accounts-table thead th {
  background: #eef2f7 !important;
  color: #172033 !important;
}

html[data-theme="light"] .accounts-table tbody tr:nth-child(even) td {
  background: #f8fafc !important;
}

html[data-theme="light"] .accounts-table tbody tr:hover td {
  background: #edf4fb !important;
}

html[data-theme="dark"] .accounts-table,
html[data-theme="dark"] .accounts-table tbody,
html[data-theme="dark"] .accounts-table tr,
html[data-theme="dark"] .accounts-table td {
  background: #111827 !important;
  color: #e5edf7 !important;
}

html[data-theme="dark"] .accounts-table thead th {
  background: #0f1a2b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .accounts-table tbody tr:nth-child(even) td {
  background: #0d1726 !important;
}

html[data-theme="dark"] .accounts-table tbody tr:hover td {
  background: #17243a !important;
}

.accounts-table {
  font-size: 13px !important;
  font-weight: 400 !important;
}

.accounts-table th {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 8px 6px !important;
  line-height: 1.2 !important;
}

.accounts-table td {
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 7px 6px !important;
  line-height: 1.25 !important;
  min-height: 34px !important;
}

.editable-cell {
  font-weight: 400 !important;
}

.accounts-table .col-account {
  width: 150px !important;
}

.accounts-table .col-money {
  width: 105px !important;
}

.accounts-table .col-coupon {
  width: 115px !important;
}

.accounts-table .col-transport-coupon {
  width: 145px !important;
}

.accounts-table .col-donation {
  width: 90px !important;
}

.accounts-table .col-transport {
  width: 225px !important;
}

.accounts-table .col-business {
  width: 180px !important;
}

.accounts-table .col-house {
  width: 140px !important;
}

.accounts-table .col-sim {
  width: 105px !important;
}

.accounts-table .col-actions {
  width: 90px !important;
}

.row-actions {
  min-width: 90px !important;
  padding: 5px 4px !important;
}

.order-buttons {
  gap: 3px !important;
  margin-bottom: 3px !important;
}

.move-button {
  width: 24px !important;
  height: 22px !important;
  font-size: 11px !important;
  line-height: 1 !important;
}

.danger-link {
  font-size: 11px !important;
  padding: 0 !important;
}

.table-wrap {
  box-shadow: 0 4px 14px rgb(0 0 0 / 12%) !important;
}

html[data-theme="light"] .table-wrap {
  background: #ffffff !important;
  border-color: #b8c2cf !important;
}

html[data-theme="dark"] .table-wrap {
  background: #111827 !important;
  border-color: #344158 !important;
}


/* ===== Drag sorting and final table alignment ===== */

.accounts-table {
  width: 100% !important;
  min-width: 1460px !important;
  table-layout: fixed !important;
  border-spacing: 0 !important;
  border-collapse: collapse !important;
}

.accounts-table col.col-drag {
  width: 42px !important;
}

.accounts-table col.col-account {
  width: 165px !important;
}

.accounts-table col.col-money {
  width: 110px !important;
}

.accounts-table col.col-coupon {
  width: 125px !important;
}

.accounts-table col.col-transport-coupon {
  width: 165px !important;
}

.accounts-table col.col-donation {
  width: 100px !important;
}

.accounts-table col.col-transport {
  width: 245px !important;
}

.accounts-table col.col-business {
  width: 200px !important;
}

.accounts-table col.col-house {
  width: 155px !important;
}

.accounts-table col.col-sim {
  width: 115px !important;
}

.accounts-table col.col-actions {
  width: 88px !important;
}

.accounts-table th,
.accounts-table td {
  height: 42px !important;
  min-height: 42px !important;
  padding: 6px 7px !important;
  text-align: center !important;
  vertical-align: middle !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
  border-right: 1px solid var(--border-main) !important;
  border-bottom: 1px solid var(--border-strong) !important;
  overflow-wrap: anywhere !important;
}

.accounts-table th {
  font-size: 12px !important;
  font-weight: 600 !important;
}

.accounts-table th:last-child,
.accounts-table td:last-child {
  border-right: 0 !important;
}

.accounts-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.drag-heading,
.drag-cell {
  padding: 0 !important;
  text-align: center !important;
}

.drag-handle {
  display: inline-flex !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--border-main) !important;
  border-radius: 5px !important;
  background: var(--button-bg) !important;
  color: var(--button-text) !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: grab !important;
  user-select: none !important;
}

.drag-handle:active {
  cursor: grabbing !important;
}

.account-row.dragging {
  opacity: 0.45 !important;
}

.account-row.dragging td {
  background: var(--edit-bg) !important;
}

.account-row.drag-over td {
  border-top: 3px solid #3b82f6 !important;
}

.row-actions {
  width: 88px !important;
  min-width: 88px !important;
  padding: 4px !important;
  white-space: nowrap !important;
}

.row-actions form {
  display: flex !important;
  justify-content: center !important;
  margin: 0 !important;
}

.danger-link {
  display: inline-block !important;
  width: auto !important;
  padding: 3px 5px !important;
  white-space: nowrap !important;
  word-break: normal !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  color: #ef4444 !important;
}

.reorder-hint {
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid #f59e0b;
  border-radius: 7px;
  color: var(--text-main);
  background: rgb(245 158 11 / 10%);
  font-size: 13px;
}


/* ===== Bulk delete mode ===== */

.account-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.delete-mode-button,
.delete-selected-button {
  min-width: 130px;
}

.delete-mode-button {
  background: #7f1d1d !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}

.delete-selected-button {
  background: #dc2626 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

.accounts-table col.col-select {
  width: 0 !important;
}

.select-heading,
.select-cell {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  transition:
    width 160ms ease,
    opacity 160ms ease;
}

.delete-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

body.delete-mode .accounts-table col.col-select {
  width: 44px !important;
}

body.delete-mode .select-heading,
body.delete-mode .select-cell {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 6px !important;
  border-right: 1px solid var(--border-main) !important;
  border-bottom: 1px solid var(--border-strong) !important;
  opacity: 1;
}

body.delete-mode .editable-cell {
  cursor: default !important;
}

body.delete-mode .drag-handle {
  opacity: 0.35;
  pointer-events: none;
}

body.delete-mode .account-row:has(.delete-checkbox:checked) td {
  background: rgb(220 38 38 / 14%) !important;
}

/* ===== Action buttons alignment and delete visibility ===== */

.account-actions .button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 156px !important;
  min-height: 42px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.delete-selected-button[hidden] {
  display: none !important;
}

/* Одинаковый текст у кнопок Добавить и Удаление */
.account-actions .button,
.account-actions button {
  font-family: Arial, sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

/* Одинаковый текст у кнопок Добавить и Удаление */
.account-actions .button,
.account-actions button {
  font-family: Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

/* Одинаковый текст у кнопок Добавить и Удаление */
.account-actions .button,
.account-actions button {
  font-family: Arial, sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

/* ===== Compact account creation form ===== */

.compact-account-form {
  width: min(1100px, 100%);
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px !important;
}

.compact-account-form h1 {
  margin: 0 0 18px !important;
  font-size: 26px !important;
}

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

.compact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 !important;
}

.compact-field span {
  font-size: 13px;
  font-weight: 600;
}

.compact-field input,
.compact-field textarea {
  width: 100%;
  min-height: 38px !important;
  padding: 8px 10px !important;
  box-sizing: border-box;
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.compact-field textarea {
  height: 64px !important;
  min-height: 64px !important;
  max-height: 130px;
}

.compact-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.compact-form-actions button,
.compact-form-actions .button {
  min-width: 120px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1000px) {
  .compact-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .compact-account-form {
    padding: 16px !important;
  }

  .compact-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Account form like main table ===== */

.table-style-form {
  width: 100%;
  max-width: none !important;
  padding: 18px !important;
  box-sizing: border-box;
}

.table-style-form h1 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 24px;
}

.account-form-table {
  display: grid;
  grid-template-columns:
    165px
    110px
    125px
    165px
    100px
    245px
    200px
    155px
    115px;
  width: max-content;
  min-width: 1380px;
  margin: 0 auto;
  border-top: 1px solid var(--border-main);
  border-left: 1px solid var(--border-main);
}

.form-head,
.form-cell {
  box-sizing: border-box;
  border-right: 1px solid var(--border-main);
  border-bottom: 1px solid var(--border-main);
}

.form-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-alt);
  color: var(--text-main);
}

.form-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 5px;
  background: var(--panel-bg);
}

.form-cell input,
.form-cell textarea {
  width: 100%;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 6px 8px !important;
  margin: 0 !important;
  resize: none !important;
  box-sizing: border-box;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 4px;
}

.table-form-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.table-form-actions button,
.table-form-actions .button {
  min-width: 130px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 1500px) {
  .table-style-form {
    overflow-x: auto;
  }
}

/* ===== Одинаковые кнопки Сохранить и Отмена ===== */

.table-form-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
  margin-top: 20px !important;
}

.table-form-actions .form-action-button,
.table-form-actions input.form-action-button {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;

  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;

  padding: 0 !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 150px !important;
  box-sizing: border-box !important;

  border-radius: 8px !important;
  font-family: Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.table-form-actions .save-button {
  background: #2563eb !important;
  border: 1px solid #3b82f6 !important;
  color: #ffffff !important;
}

.table-form-actions .cancel-button {
  background: #24344d !important;
  border: 1px solid #3f5c85 !important;
  color: #ffffff !important;
}

.table-form-actions .save-button:hover {
  background: #3b72ed !important;
}

.table-form-actions .cancel-button:hover {
  background: #304765 !important;
}

/* ===== Страница Бизнесы ===== */

.businesses-nav-link {
    display: block;
    margin-top: 4px;
}

.businesses-page {
    width: 100%;
}

.businesses-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.businesses-header h1 {
    margin: 0;
    color: #f4f7ff;
    font-size: 28px;
    font-weight: 700;
}

.businesses-header p {
    margin: 6px 0 0;
    color: #8fa2bd;
    font-size: 14px;
}

.businesses-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #2f415c;
    border-radius: 10px;
    background: #111c2d;
}

.businesses-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
}

.businesses-table th,
.businesses-table td {
    height: 42px;
    padding: 8px 12px;
    border-right: 1px solid #344861;
    border-bottom: 1px solid #344861;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
}

.businesses-table th:last-child,
.businesses-table td:last-child {
    border-right: 0;
}

.businesses-table tbody tr:last-child td {
    border-bottom: 0;
}

.businesses-table thead th {
    background: #e8edf4;
    color: #05070b;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.businesses-table tbody td {
    background: #101b2c;
    color: #eef4ff;
    font-size: 14px;
}

.businesses-table tbody tr:hover td {
    background: #15243a;
}

.business-column-number {
    width: 29%;
}

.business-column-owner {
    width: 29%;
}

.business-column-account {
    width: 29%;
}

.business-column-extra {
    width: 13%;
}

@media (max-width: 800px) {
    .businesses-header h1 {
        font-size: 23px;
    }
}

/* ===== Businesses complete interface ===== */

.businesses-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.businesses-title h1 {
    margin: 0;
}

.businesses-title p {
    margin: 6px 0 0;
    color: #91a4bf;
    font-size: 14px;
}

.businesses-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.businesses-actions form {
    margin: 0;
}

.businesses-actions button {
    min-height: 40px;
    white-space: nowrap;
}

.business-save-status {
    min-height: 24px;
    margin-bottom: 7px;
    color: #91a4bf;
    font-size: 13px;
    text-align: right;
}

.business-save-status[data-state="saving"] {
    color: #77a8ff;
}

.business-save-status[data-state="success"] {
    color: #55d38c;
}

.business-save-status[data-state="error"] {
    color: #ff7d88;
}

.businesses-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.businesses-table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
    table-layout: fixed;
}

.businesses-table th,
.businesses-table td {
    height: 44px;
    padding: 9px 12px;
    border-right: 1px solid #344861;
    border-bottom: 1px solid #344861;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
}

.businesses-table thead th {
    background: #e8edf4;
    color: #05070b;
    font-weight: 700;
}

.businesses-table tbody td {
    background: #101b2c;
    color: #eef4ff;
}

.business-column-select {
    width: 48px;
}

.business-column-number {
    width: 29%;
}

.business-column-owner {
    width: 29%;
}

.business-column-account {
    width: 29%;
}

.business-column-extra {
    width: 13%;
}

.business-select-cell {
    display: none;
}

.business-delete-mode-enabled .business-select-cell {
    display: table-cell;
}

.business-delete-actions {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.business-delete-mode-enabled .business-delete-actions {
    display: flex;
}

.editable-business-cell[contenteditable="true"] {
    cursor: text;
}

.editable-business-cell[contenteditable="true"]:hover {
    background: #172941;
}

.editable-business-cell[contenteditable="true"]:focus {
    position: relative;
    z-index: 1;
    outline: none;
    background: #1a2f4b;
    box-shadow: inset 0 0 0 2px #3975ee;
}

.editable-business-cell.saving {
    opacity: 0.65;
}

.editable-business-cell.saved {
    background: rgba(49, 173, 98, 0.25);
}

.editable-business-cell.save-error {
    background: rgba(205, 62, 75, 0.25);
    box-shadow: inset 0 0 0 2px #d44a58;
}

.businesses-empty {
    padding: 28px !important;
    color: #91a4bf !important;
}

.button.danger {
    background: #b93443;
    border-color: #d14857;
    color: #ffffff;
}

.button.danger:hover {
    background: #ce4050;
}

@media (max-width: 900px) {
    .businesses-toolbar {
        flex-direction: column;
    }

    .businesses-actions {
        justify-content: flex-start;
    }
}


/* ===== Исправление ширины таблицы Бизнесы ===== */

.businesses-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
}

.businesses-table {
    width: 100% !important;
    min-width: 1100px !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

.businesses-table col.business-column-select {
    width: 48px !important;
}

.businesses-table col.business-column-number {
    width: 31% !important;
}

.businesses-table col.business-column-owner {
    width: 28% !important;
}

.businesses-table col.business-column-account {
    width: 28% !important;
}

.businesses-table col.business-column-extra {
    width: 13% !important;
}

.businesses-table th,
.businesses-table td {
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

.businesses-table thead th {
    min-height: 48px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

.businesses-table tbody td {
    min-height: 44px !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
}

/* Чекбокс скрыт, пока не включён режим удаления */

.businesses-page:not(.business-delete-mode-enabled)
.business-select-cell {
    display: none !important;
}

/* При обычном режиме таблица состоит ровно из 4 колонок */

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-number {
    width: 31% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-owner {
    width: 28% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-account {
    width: 28% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-extra {
    width: 13% !important;
}

@media (max-width: 900px) {
    .businesses-table {
        min-width: 950px !important;
    }

    .businesses-table th,
    .businesses-table td {
        padding: 9px 10px !important;
    }
}


/* ===== Финальное исправление колонок Бизнесы ===== */

/*
Колонку выбора нельзя удалять через display:none,
иначе остальные заголовки сдвигаются на одну колонку.
*/

.businesses-table .business-select-cell {
    display: table-cell !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 0 !important;
    visibility: hidden !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table .business-select-cell {
    visibility: visible !important;
}

/* Фиксированные размеры всех пяти колонок */

.businesses-table {
    width: 100% !important;
    min-width: 1050px !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

.businesses-table col.business-column-select {
    width: 48px !important;
}

.businesses-table col.business-column-number {
    width: 31% !important;
}

.businesses-table col.business-column-owner {
    width: 27% !important;
}

.businesses-table col.business-column-account {
    width: 27% !important;
}

.businesses-table col.business-column-extra {
    width: 15% !important;
}

.businesses-table thead th,
.businesses-table tbody td {
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.businesses-table thead th {
    height: 48px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
}

/* Отменяем старые правила, скрывающие ячейку полностью */

.businesses-page:not(.business-delete-mode-enabled)
.business-select-cell {
    display: table-cell !important;
    visibility: hidden !important;
}


/* ===== Колонка удаления только в режиме удаления ===== */

.businesses-table .business-select-cell {
    display: none !important;
}

.businesses-table col.business-column-select {
    display: none !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table .business-select-cell {
    display: table-cell !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table col.business-column-select {
    display: table-column !important;
    width: 48px !important;
}

/* Обычный режим: четыре полноценные колонки */

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-number {
    width: 31% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-owner {
    width: 28% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-account {
    width: 28% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table col.business-column-extra {
    width: 13% !important;
}

/* Режим удаления: добавляется узкая колонка слева */

.businesses-page.business-delete-mode-enabled
.businesses-table col.business-column-number {
    width: 30% !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table col.business-column-owner {
    width: 27% !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table col.business-column-account {
    width: 27% !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table col.business-column-extra {
    width: 16% !important;
}


/* ===== Окончательное исправление колонок Бизнесы ===== */

.businesses-table {
    width: 100% !important;
    min-width: 1000px !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

/* Обычный режим: колонка чекбоксов полностью отсутствует */

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table .business-select-cell {
    display: none !important;
}

/* Ширина четырёх обычных колонок */

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table th:nth-child(2),
.businesses-page:not(.business-delete-mode-enabled)
.businesses-table td:nth-child(2) {
    width: 31% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table th:nth-child(3),
.businesses-page:not(.business-delete-mode-enabled)
.businesses-table td:nth-child(3) {
    width: 28% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table th:nth-child(4),
.businesses-page:not(.business-delete-mode-enabled)
.businesses-table td:nth-child(4) {
    width: 28% !important;
}

.businesses-page:not(.business-delete-mode-enabled)
.businesses-table th:nth-child(5),
.businesses-page:not(.business-delete-mode-enabled)
.businesses-table td:nth-child(5) {
    width: 13% !important;
}

/* Режим удаления: показываем узкую колонку чекбоксов */

.businesses-page.business-delete-mode-enabled
.businesses-table .business-select-cell {
    display: table-cell !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 0 !important;
}

/* Ширина колонок при включённом удалении */

.businesses-page.business-delete-mode-enabled
.businesses-table th:nth-child(2),
.businesses-page.business-delete-mode-enabled
.businesses-table td:nth-child(2) {
    width: 30% !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table th:nth-child(3),
.businesses-page.business-delete-mode-enabled
.businesses-table td:nth-child(3) {
    width: 27% !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table th:nth-child(4),
.businesses-page.business-delete-mode-enabled
.businesses-table td:nth-child(4) {
    width: 27% !important;
}

.businesses-page.business-delete-mode-enabled
.businesses-table th:nth-child(5),
.businesses-page.business-delete-mode-enabled
.businesses-table td:nth-child(5) {
    width: 16% !important;
}

.businesses-table th,
.businesses-table td {
    box-sizing: border-box !important;
    text-align: center !important;
    vertical-align: middle !important;
}


/* =======================================================
   Businesses table - Light / Dark theme
   ======================================================= */

/* Светлая тема: тёмный заголовок, светлые строки */

html[data-theme="light"] .businesses-table,
html[data-theme="light"] .businesses-table tbody,
html[data-theme="light"] .businesses-table tr,
html[data-theme="light"] .businesses-table td {
    background: #ffffff !important;
    color: #1b1b1b !important;
}

html[data-theme="light"] .businesses-table thead th {
    background: #16263d !important;
    color: #ffffff !important;
}

html[data-theme="light"] .businesses-table tbody tr:nth-child(even) td {
    background: #f5f8fc !important;
}

html[data-theme="light"] .businesses-table tbody tr:hover td {
    background: #e8f1ff !important;
}


/* Тёмная тема: светлый заголовок, тёмные строки */

html[data-theme="dark"] .businesses-table,
html[data-theme="dark"] .businesses-table tbody,
html[data-theme="dark"] .businesses-table tr,
html[data-theme="dark"] .businesses-table td {
    background: #172335 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .businesses-table thead th {
    background: #eef2f7 !important;
    color: #111111 !important;
}

html[data-theme="dark"] .businesses-table tbody tr:nth-child(even) td {
    background: #1b2a40 !important;
}

html[data-theme="dark"] .businesses-table tbody tr:hover td {
    background: #243651 !important;
}

/* ===== Business row colors fixed ===== */

.business-color-palette {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #405473;
    border-radius: 9px;
    background: rgba(22, 38, 61, 0.08);
}

html[data-theme="dark"] .business-color-palette {
    background: #132035;
}

.business-color-palette[hidden] {
    display: none !important;
}

.business-color-label {
    font-size: 13px;
    font-weight: 600;
}

.business-color-option {
    min-height: 36px;
    padding: 7px 13px;
    border: 2px solid transparent;
    border-radius: 7px;
    color: #111111 !important;
    font-weight: 600;
    cursor: pointer;
}

.business-color-option.selected {
    border-color: #2463eb !important;
    box-shadow:
        0 0 0 2px rgba(36, 99, 235, 0.25);
}

.business-color-option.color-default {
    background: #dbe5f2 !important;
}

.business-color-option.color-white {
    background: #ffffff !important;
}

.business-color-option.color-green {
    background: #c6dfa0 !important;
}

.business-color-option.color-red {
    background: #ffc7c7 !important;
}

.business-color-option.color-yellow {
    background: #fff3a6 !important;
}

#business-color-mode.active {
    background: #3975ee !important;
    border-color: #5a8fff !important;
    color: #ffffff !important;
}

.business-color-row.business-color-target {
    cursor: pointer !important;
}

.business-color-row.business-color-target td {
    transition:
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

.business-color-row.business-color-target:hover td {
    box-shadow:
        inset 0 0 0 2px #3274ef !important;
    filter: brightness(1.04);
}


/* =======================================================
   Обычный цвет — следует текущей теме
   ======================================================= */

html[data-theme="light"]
.businesses-table tbody
.business-color-row.row-color-default td {
    background: #ffffff !important;
    color: #151515 !important;
}

html[data-theme="light"]
.businesses-table tbody
.business-color-row.row-color-default:nth-child(even) td {
    background: #f5f8fc !important;
    color: #151515 !important;
}

html[data-theme="dark"]
.businesses-table tbody
.business-color-row.row-color-default td {
    background: #172335 !important;
    color: #ffffff !important;
}

html[data-theme="dark"]
.businesses-table tbody
.business-color-row.row-color-default:nth-child(even) td {
    background: #1b2a40 !important;
    color: #ffffff !important;
}


/* =======================================================
   Явно выбранные цвета — одинаковые в обеих темах
   ======================================================= */

.businesses-table tbody
.business-color-row.row-color-white td {
    background: #ffffff !important;
    color: #151515 !important;
}

.businesses-table tbody
.business-color-row.row-color-green td {
    background: #c6dfa0 !important;
    color: #15200f !important;
}

.businesses-table tbody
.business-color-row.row-color-red td {
    background: #ffc7c7 !important;
    color: #321313 !important;
}

.businesses-table tbody
.business-color-row.row-color-yellow td {
    background: #fff3a6 !important;
    color: #30290b !important;
}

/* Hover не должен заменять выбранный цвет */

.businesses-table tbody
.business-color-row.row-color-white:hover td {
    background: #ffffff !important;
}

.businesses-table tbody
.business-color-row.row-color-green:hover td {
    background: #c6dfa0 !important;
}

.businesses-table tbody
.business-color-row.row-color-red:hover td {
    background: #ffc7c7 !important;
}

.businesses-table tbody
.business-color-row.row-color-yellow:hover td {
    background: #fff3a6 !important;
}


/* ===== Исправление цвета каждой второй строки Бизнесы ===== */

/* Белый */

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-white td,
html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-white:nth-child(even) td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-white td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-white:nth-child(even) td {
    background: #ffffff !important;
    color: #151515 !important;
}

/* Салатовый */

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-green td,
html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-green:nth-child(even) td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-green td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-green:nth-child(even) td {
    background: #c6dfa0 !important;
    color: #15200f !important;
}

/* Светло-красный */

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-red td,
html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-red:nth-child(even) td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-red td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-red:nth-child(even) td {
    background: #ffc7c7 !important;
    color: #321313 !important;
}

/* Светло-жёлтый */

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-yellow td,
html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-yellow:nth-child(even) td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-yellow td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-yellow:nth-child(even) td {
    background: #fff3a6 !important;
    color: #30290b !important;
}

/* Наведение не должно возвращать цвет темы */

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-white:hover td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-white:hover td {
    background: #ffffff !important;
}

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-green:hover td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-green:hover td {
    background: #c6dfa0 !important;
}

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-red:hover td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-red:hover td {
    background: #ffc7c7 !important;
}

html[data-theme="light"]
.businesses-table tbody tr.business-color-row.row-color-yellow:hover td,
html[data-theme="dark"]
.businesses-table tbody tr.business-color-row.row-color-yellow:hover td {
    background: #fff3a6 !important;
}


/* =======================================================
   Плавающий выбор цвета строк таблицы Бизнесы
   ======================================================= */

/* Кнопка всегда видна в правом нижнем углу */

#business-color-mode {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;
    z-index: 1002 !important;

    min-width: 140px !important;
    height: 44px !important;
    margin: 0 !important;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28) !important;
}

/* Палитра открывается над плавающей кнопкой */

#business-color-palette {
    position: fixed !important;
    right: 24px !important;
    bottom: 80px !important;
    z-index: 1001 !important;

    width: min(620px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;

    margin: 0 !important;
    padding: 12px !important;

    box-sizing: border-box !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32) !important;
}

/* Светлая тема */

html[data-theme="light"] #business-color-palette {
    background: #eef3f9 !important;
    border: 1px solid #aebdd0 !important;
    color: #182235 !important;
}

/* Тёмная тема */

html[data-theme="dark"] #business-color-palette {
    background: #132035 !important;
    border: 1px solid #405473 !important;
    color: #ffffff !important;
}

/* Активная плавающая кнопка */

#business-color-mode.active {
    background: #3975ee !important;
    border-color: #5a8fff !important;
    color: #ffffff !important;
}

/* Телефон и узкий экран */

@media (max-width: 700px) {
    #business-color-mode {
        right: 12px !important;
        bottom: 12px !important;
        min-width: 125px !important;
    }

    #business-color-palette {
        right: 12px !important;
        bottom: 68px !important;
        width: calc(100vw - 24px) !important;
    }
}


/* =======================================================
   Таблица Пользователи — поддержка светлой и тёмной темы
   ======================================================= */

.users-theme-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.users-theme-table th,
.users-theme-table td {
    padding: 10px 12px !important;
    border-bottom: 1px solid !important;
    text-align: left !important;
    vertical-align: middle !important;
}

/* ---------- Светлая тема ---------- */

html[data-theme="light"] .users-theme-table {
    background: #ffffff !important;
    color: #162033 !important;
}

html[data-theme="light"] .users-theme-table thead th {
    background: #16263d !important;
    color: #ffffff !important;
    border-color: #31445f !important;
}

html[data-theme="light"] .users-theme-table tbody td {
    background: #ffffff !important;
    color: #162033 !important;
    border-color: #d6deea !important;
}

html[data-theme="light"]
.users-theme-table tbody tr:nth-child(even) td {
    background: #f4f7fb !important;
}

html[data-theme="light"]
.users-theme-table tbody tr:hover td {
    background: #e7f0ff !important;
}

html[data-theme="light"] .users-theme-table a {
    color: #2563eb !important;
}

/* ---------- Тёмная тема ---------- */

html[data-theme="dark"] .users-theme-table {
    background: #111d2f !important;
    color: #eef4ff !important;
}

html[data-theme="dark"] .users-theme-table thead th {
    background: #e8edf5 !important;
    color: #101827 !important;
    border-color: #43546d !important;
}

html[data-theme="dark"] .users-theme-table tbody td {
    background: #142136 !important;
    color: #eef4ff !important;
    border-color: #344861 !important;
}

html[data-theme="dark"]
.users-theme-table tbody tr:nth-child(even) td {
    background: #192940 !important;
}

html[data-theme="dark"]
.users-theme-table tbody tr:hover td {
    background: #223753 !important;
}

html[data-theme="dark"] .users-theme-table a {
    color: #87adff !important;
}

/* Кнопка Добавить */

html[data-theme="light"] .users-theme-table + *,
html[data-theme="dark"] .users-theme-table + * {
    box-sizing: border-box;
}

/* ===== Users delete controls ===== */

.users-actions-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.users-delete-form {
    display: inline;
    margin: 0;
}

.users-edit-link {
    text-decoration: none;
    font-weight: 600;
}

.users-edit-link:hover {
    text-decoration: underline;
}

.users-delete-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #d33f4f;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.users-delete-button:hover {
    color: #ef5a69;
    text-decoration: underline;
}

.users-current-user {
    color: #8393aa;
    font-size: 13px;
}

html[data-theme="dark"] .users-delete-button {
    color: #ff7c88;
}

html[data-theme="dark"] .users-delete-button:hover {
    color: #ffabb3;
}

html[data-theme="light"] .users-current-user {
    color: #68758a;
}

html[data-theme="dark"] .users-current-user {
    color: #9aabc2;
}


/* =====================================================
   Пользователи - красивые кнопки действий
   ===================================================== */

.users-actions-cell{
    display:flex;
    align-items:center;
    gap:12px;
    white-space:nowrap;
}

.users-edit-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    width:120px;
    height:38px;

    border:1px solid #3b82f6;
    border-radius:8px;

    background:transparent;
    color:#3b82f6 !important;

    text-decoration:none;
    font-weight:600;
    transition:.15s;
}

.users-edit-link:hover{
    background:#3b82f6;
    color:#fff !important;
}

.users-delete-form{
    margin:0;
}

.users-delete-button{

    width:120px;
    height:38px;

    border:1px solid #ef4444;
    border-radius:8px;

    background:transparent;
    color:#ef4444;

    font-size:15px;
    font-weight:600;

    cursor:pointer;
    transition:.15s;
}

.users-delete-button:hover{
    background:#ef4444;
    color:#fff;
}

.users-current-user{
    color:#8ea2bc;
    font-size:13px;
    font-style:italic;
}


/* =====================================================
   Финальный вид кнопок пользователей
   ===================================================== */

.users-theme-table .users-actions-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    white-space: nowrap !important;
}

.users-theme-table .users-delete-form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

.users-theme-table .users-edit-link,
.users-theme-table .users-delete-button {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;

    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;

    border-radius: 7px !important;

    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;

    cursor: pointer !important;
}

/* Изменить */

.users-theme-table .users-edit-link {
    background: transparent !important;
    border: 1px solid #3b82f6 !important;
    color: #3b82f6 !important;
}

.users-theme-table .users-edit-link:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Удалить */

.users-theme-table .users-delete-button {
    background: transparent !important;
    border: 1px solid #ef4444 !important;
    color: #ef4444 !important;
    font-family: inherit !important;
}

.users-theme-table .users-delete-button:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Текущий пользователь */

.users-theme-table .users-current-user {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 38px !important;
    color: #8ea2bc !important;
    font-size: 13px !important;
    font-style: italic !important;
}


/* =====================================================
   Финальный вид кнопок пользователей
   ===================================================== */

.users-theme-table .users-actions-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    white-space: nowrap !important;
}

.users-theme-table .users-delete-form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

.users-theme-table .users-edit-link,
.users-theme-table .users-delete-button {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;

    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;

    border-radius: 7px !important;

    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;

    cursor: pointer !important;
}

/* Изменить */

.users-theme-table .users-edit-link {
    background: transparent !important;
    border: 1px solid #3b82f6 !important;
    color: #3b82f6 !important;
}

.users-theme-table .users-edit-link:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Удалить */

.users-theme-table .users-delete-button {
    background: transparent !important;
    border: 1px solid #ef4444 !important;
    color: #ef4444 !important;
    font-family: inherit !important;
}

.users-theme-table .users-delete-button:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Текущий пользователь */

.users-theme-table .users-current-user {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 38px !important;
    color: #8ea2bc !important;
    font-size: 13px !important;
    font-style: italic !important;
}


/* =====================================================
   Уведомления flash — читаемый текст в обеих темах
   ===================================================== */

/* Общий вид */

.flash,
.alert,
.flash-message {
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
}

/* Успешное действие */

html[data-theme="light"] .flash.success,
html[data-theme="light"] .alert-success,
html[data-theme="light"] .flash-message.success {
    background: #d9f7e5 !important;
    color: #14532d !important;
    border: 1px solid #86d7a7 !important;
}

html[data-theme="dark"] .flash.success,
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .flash-message.success {
    background: #183c2a !important;
    color: #d8ffe7 !important;
    border: 1px solid #2f7a52 !important;
}

/* Ошибка */

html[data-theme="light"] .flash.danger,
html[data-theme="light"] .alert-danger,
html[data-theme="light"] .flash-message.danger {
    background: #ffe0e0 !important;
    color:#7a0000 !important;
    border: 1px solid #e7a1a1 !important;
}

html[data-theme="dark"] .flash.danger,
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .flash-message.danger {
    background: #4a2025 !important;
    color:#7a0000 !important;
    border: 1px solid #9f4651 !important;
}

/* Предупреждение */

html[data-theme="light"] .flash.warning,
html[data-theme="light"] .alert-warning,
html[data-theme="light"] .flash-message.warning {
    background: #fff3cd !important;
    color: #664d03 !important;
    border: 1px solid #e5cf83 !important;
}

html[data-theme="dark"] .flash.warning,
html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .flash-message.warning {
    background: #493f1d !important;
    color: #fff3bd !important;
    border: 1px solid #8f7b32 !important;
}


/* ===== Финальное исправление текста уведомлений ===== */

/* Успешное уведомление — светлый фон и очень тёмный текст */

.flash.success,
.flash-success,
.alert-success,
.flash-message.success,
.flashes .success,
.flash.success *,
.flash-success *,
.alert-success *,
.flash-message.success *,
.flashes .success * {
    background-color: #d7f5e2 !important;
    color: #0b3d22 !important;
    border-color: #79c99a !important;

    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #0b3d22 !important;

    font-weight: 700 !important;
}

/* На случай, если категория записана отдельным классом */

.success,
.success *,
.message-success,
.message-success * {
    color: #0b3d22 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #0b3d22 !important;
}

/* Не разрешаем ссылкам внутри уведомления становиться белыми */

.flash.success a,
.flash-success a,
.alert-success a,
.flash-message.success a {
    color: #064e2b !important;
    text-decoration: underline !important;
}


/* ===== Раскрывающееся меню Администрирование ===== */

.sidebar .admin-nav-menu {
    margin-top: 18px;
}

.sidebar .admin-nav-menu > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 10px;
    border-radius: 7px;

    color: #8fa6c7;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;

    cursor: pointer;
    user-select: none;
    list-style: none;
}

.sidebar .admin-nav-menu > summary::-webkit-details-marker {
    display: none;
}

.sidebar .admin-nav-menu > summary::after {
    content: "›";
    margin-left: 10px;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s ease;
}

.sidebar .admin-nav-menu[open] > summary::after {
    transform: rotate(90deg);
}

.sidebar .admin-nav-menu > summary:hover {
    background: rgba(67, 104, 160, 0.15);
    color: #ffffff;
}

.sidebar .admin-nav-menu .submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 8px;
}

.sidebar .admin-nav-menu .submenu a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
}

.sidebar .admin-nav-menu .submenu a.active {
    background: rgba(55, 111, 225, 0.22);
    color: #ffffff;
}


/* ===== Заголовок раздела "Таблицы" ===== */

.sidebar .nav-title{
    font-size:14px !important;
    font-weight:700 !important;
    letter-spacing:.4px !important;
    text-transform:uppercase !important;
}


/* ===== "Таблицы" как "Администрирование" ===== */

.sidebar .nav-title{
    font-size:12px !important;
    font-weight:600 !important;
    color:#8fa6c7 !important;
    text-transform:uppercase !important;
    letter-spacing:.4px !important;
    padding:8px 10px !important;
    margin:0 0 4px 0 !important;
}


/* Бизнесы — как остальные разделы меню */
.sidebar .businesses-nav-link {
    display: block !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #8fa6c7 !important;
    text-transform: uppercase !important;
    letter-spacing: .4px !important;
    text-decoration: none !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.sidebar .businesses-nav-link:hover,
.sidebar .businesses-nav-link.active {
    color: #ffffff !important;
    background: transparent !important;
}


/* Выравнивание пункта "Бизнесы" */
.sidebar .businesses-nav-link{
    display:block !important;
    padding:10px 0 10px 20px !important;
    margin:0 !important;
    text-align:left !important;
    text-indent:0 !important;
}


/* Точное выравнивание "Бизнесы" с заголовками разделов */
.sidebar .businesses-nav-link {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
}


/* Финальное выравнивание "Бизнесы" */
.sidebar .businesses-nav-link {
    padding-left: 8px !important;
    padding-right: 8px !important;
    margin-left: 0 !important;
}


/* Единое выравнивание всех разделов меню */
.sidebar .admin-nav-menu > summary,
.sidebar .businesses-nav-link {
    padding-left: 12px !important;
    margin-left: 0 !important;
}


/* ===== ABSpass Jasper ===== */

.abspass-add-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 650px;
    margin-bottom: 18px;
}

.abspass-add-form input {
    margin: 0;
}

.abspass-add-form button {
    white-space: nowrap;
}

.abspass-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    background: var(--table-bg, #fff);
    border-radius: 10px;
}

.abspass-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.abspass-table th,
.abspass-table td {
    min-width: 115px;
    padding: 6px;
    text-align: center;
    white-space: nowrap;
}

.abspass-table th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.abspass-table input {
    width: 105px;
    min-width: 105px;
    margin: 0;
    padding: 7px;
}

.abspass-table .abspass-account-column {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 190px;
}

.abspass-table td.abspass-account-column {
    background: var(--table-bg, #fff);
}

.abspass-table .abspass-account-column input {
    width: 180px;
    min-width: 180px;
}

.abspass-actions-column {
    min-width: 105px !important;
}

.abspass-save-row {
    margin-top: 18px;
}

.danger-button {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

@media (max-width: 800px) {
    .abspass-add-form {
        display: block;
    }

    .abspass-add-form button {
        margin-top: 10px;
    }
}


/* ===== ABSpass Jasper: исправление цветов ===== */

.abspass-table-wrap {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    border-radius: 10px !important;
}

.abspass-table {
    background: #0f172a !important;
    color: #e5e7eb !important;
}

.abspass-table thead,
.abspass-table thead tr,
.abspass-table thead th {
    background: #111827 !important;
    color: #93c5fd !important;
}

.abspass-table th {
    border-bottom: 1px solid #334155 !important;
    font-weight: 700 !important;
}

.abspass-table tbody,
.abspass-table tbody tr,
.abspass-table tbody td {
    background: #0f172a !important;
    color: #e5e7eb !important;
}

.abspass-table td {
    border-bottom: 1px solid #243244 !important;
}

.abspass-table input {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
    border-radius: 7px !important;
}

.abspass-table input:focus {
    border-color: #3b82f6 !important;
    outline: 2px solid rgba(59, 130, 246, .25) !important;
}

.abspass-table input::placeholder,
.abspass-add-form input::placeholder {
    color: #94a3b8 !important;
}

.abspass-table td.abspass-account-column,
.abspass-table th.abspass-account-column {
    background: #111827 !important;
}

.abspass-table .empty {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

.abspass-add-form input {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}

.abspass-add-form input:focus {
    border-color: #3b82f6 !important;
    outline: 2px solid rgba(59, 130, 246, .25) !important;
}

/* Светлая тема */
html[data-theme="light"] .abspass-table-wrap,
html[data-theme="light"] .abspass-table,
html[data-theme="light"] .abspass-table tbody,
html[data-theme="light"] .abspass-table tbody tr,
html[data-theme="light"] .abspass-table tbody td {
    background: #ffffff !important;
    color: #111827 !important;
}

html[data-theme="light"] .abspass-table thead,
html[data-theme="light"] .abspass-table thead tr,
html[data-theme="light"] .abspass-table thead th,
html[data-theme="light"] .abspass-table td.abspass-account-column,
html[data-theme="light"] .abspass-table th.abspass-account-column {
    background: #f8fafc !important;
    color: #1d4ed8 !important;
}

html[data-theme="light"] .abspass-table input,
html[data-theme="light"] .abspass-add-form input {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
}


/* ===== ABSpass: добавление и удаление аккаунтов ===== */

.abspass-account-actions {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.abspass-account-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.abspass-account-form input,
.abspass-account-form select {
    width: 280px;
    min-width: 220px;
    margin: 0;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
}

.abspass-account-form button {
    white-space: nowrap;
}

.abspass-delete-form {
    padding-left: 14px;
    border-left: 1px solid #334155;
}

.abspass-points-column {
    min-width: 145px !important;
    position: sticky;
    right: 0;
    z-index: 3;
    background: #111827 !important;
}

.abspass-table td.abspass-points-column {
    background: #0f172a !important;
}

.abspass-points-column input[readonly] {
    width: 125px;
    min-width: 125px;
    text-align: center;
    font-weight: 700;
    cursor: default;
    background: #172033 !important;
    color: #93c5fd !important;
}

html[data-theme="light"] .abspass-account-form input,
html[data-theme="light"] .abspass-account-form select {
    background: #ffffff;
    color: #111827;
    border-color: #cbd5e1;
}

html[data-theme="light"] .abspass-delete-form {
    border-left-color: #d1d5db;
}

html[data-theme="light"] .abspass-points-column,
html[data-theme="light"] .abspass-table td.abspass-points-column {
    background: #f8fafc !important;
}

html[data-theme="light"] .abspass-points-column input[readonly] {
    background: #eef2ff !important;
    color: #1d4ed8 !important;
}

@media (max-width: 900px) {
    .abspass-account-actions,
    .abspass-account-form {
        align-items: stretch;
        flex-direction: column;
    }

    .abspass-account-form input,
    .abspass-account-form select {
        width: 100%;
    }

    .abspass-delete-form {
        width: 100%;
        padding-left: 0;
        padding-top: 14px;
        border-left: 0;
        border-top: 1px solid #334155;
    }
}


/* ===== ABSpass: списки Pass и Day ===== */

.abspass-table th,
.abspass-table td {
    min-width: 145px;
}

.abspass-day-cell {
    padding: 6px !important;
}

.abspass-day-cell select {
    display: block;
    width: 132px;
    min-width: 132px;
    margin: 0;
    padding: 7px 28px 7px 8px;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 7px;
    font: inherit;
}

.abspass-day-cell select + select {
    margin-top: 6px;
}

.abspass-day-cell select:focus {
    border-color: #3b82f6;
    outline: 2px solid rgba(59, 130, 246, .25);
}

html[data-theme="light"] .abspass-day-cell select {
    background: #ffffff;
    color: #111827;
    border-color: #cbd5e1;
}


/* ===== Исправление читаемости сообщений ===== */

.alert.danger,
.alert.danger *,
.flash.danger,
.flash.danger *{
    background:#fee2e2 !important;
    color:#7a0000 !important;
    border:1px solid #e7a1a1 !important;
    text-shadow:none !important;
    opacity:1 !important;
    -webkit-text-fill-color:#7a0000 !important;
}

html[data-theme="dark"] .alert.danger,
html[data-theme="dark"] .alert.danger *,
html[data-theme="dark"] .flash.danger,
html[data-theme="dark"] .flash.danger *{
    background:#4a2025 !important;
    color:#ffd9d9 !important;
    border:1px solid #9f4651 !important;
    text-shadow:none !important;
    opacity:1 !important;
    -webkit-text-fill-color:#ffd9d9 !important;
}

/* ===== Окончательное исправление ошибки на странице входа ===== */

body .auth-content .alert.danger,
body .auth-content .alert.error,
body .auth-content [class~="alert"][class~="danger"],
body .auth-content [class~="alert"][class~="error"] {
    background-color: #fee2e2 !important;
    color: #7f1d1d !important;
    border: 1px solid #f87171 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #7f1d1d !important;
}

body .auth-content .alert.danger *,
body .auth-content .alert.error *,
body .auth-content [class~="alert"][class~="danger"] *,
body .auth-content [class~="alert"][class~="error"] * {
    color: #7f1d1d !important;
    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #7f1d1d !important;
}

html[data-theme="dark"] body .auth-content .alert.danger,
html[data-theme="dark"] body .auth-content .alert.error,
html[data-theme="dark"] body .auth-content [class~="alert"][class~="danger"],
html[data-theme="dark"] body .auth-content [class~="alert"][class~="error"] {
    background-color: #4c1d24 !important;
    color: #fecaca !important;
    border-color: #ef4444 !important;
    -webkit-text-fill-color: #fecaca !important;
}

html[data-theme="dark"] body .auth-content .alert.danger *,
html[data-theme="dark"] body .auth-content .alert.error *,
html[data-theme="dark"] body .auth-content [class~="alert"][class~="danger"] *,
html[data-theme="dark"] body .auth-content [class~="alert"][class~="error"] * {
    color: #fecaca !important;
    -webkit-text-fill-color: #fecaca !important;
}

/* =====================================================
   AURUM private — современная страница авторизации
   ===================================================== */

html,
body {
    min-height: 100%;
}

/* Основной фон страницы входа */
body > .auth-content,
.auth-content {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    min-height: 100vh !important;
    padding: 32px 20px !important;

    background-color: #070b16 !important;
    background-image:
        radial-gradient(
            circle at 15% 15%,
            rgba(37, 99, 235, 0.32) 0,
            rgba(37, 99, 235, 0.12) 22%,
            transparent 43%
        ),
        radial-gradient(
            circle at 87% 20%,
            rgba(124, 58, 237, 0.27) 0,
            rgba(124, 58, 237, 0.10) 23%,
            transparent 43%
        ),
        radial-gradient(
            circle at 52% 105%,
            rgba(14, 165, 233, 0.20) 0,
            transparent 44%
        ),
        linear-gradient(
            135deg,
            #050816 0%,
            #0b1224 48%,
            #080d1a 100%
        ) !important;
}

/* Тонкая современная сетка */
body > .auth-content::before,
.auth-content::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: -2 !important;
    pointer-events: none !important;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.035) 1px,
            transparent 1px
        ) !important;

    background-size: 48px 48px !important;
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.8),
        transparent 92%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.8),
        transparent 92%
    );
}

/* Дополнительное мягкое свечение около формы */
body > .auth-content::after,
.auth-content::after {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    pointer-events: none !important;

    width: 620px !important;
    height: 620px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    border-radius: 50% !important;
    background: rgba(37, 99, 235, 0.10) !important;
    filter: blur(110px) !important;
}

/* Стеклянная карточка входа */
.auth-content .login-card {
    position: relative !important;
    z-index: 2 !important;

    width: min(430px, 100%) !important;
    padding: 32px !important;

    background:
        linear-gradient(
            145deg,
            rgba(23, 32, 51, 0.88),
            rgba(12, 19, 34, 0.82)
        ) !important;

    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 18px !important;

    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset,
        0 12px 35px rgba(37, 99, 235, 0.08) !important;

    backdrop-filter: blur(22px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(135%) !important;
}

/* Заголовок */
.auth-content .login-card h1 {
    margin-bottom: 24px !important;
    font-size: 30px !important;
    letter-spacing: -0.035em !important;
}

/* Поля */
.auth-content .login-card input[type="text"],
.auth-content .login-card input[type="password"] {
    min-height: 46px !important;
    background: rgba(30, 41, 59, 0.78) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease !important;
}

.auth-content .login-card input[type="text"]:focus,
.auth-content .login-card input[type="password"]:focus {
    outline: none !important;
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: #3b82f6 !important;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.16) !important;
}

/* Кнопка */
.auth-content .login-card button[type="submit"] {
    min-height: 44px !important;
    border-radius: 9px !important;
    background:
        linear-gradient(
            135deg,
            #2563eb,
            #3b82f6
        ) !important;

    border-color: rgba(96, 165, 250, 0.5) !important;

    box-shadow:
        0 10px 28px rgba(37, 99, 235, 0.25) !important;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease !important;
}

.auth-content .login-card button[type="submit"]:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.08) !important;
    box-shadow:
        0 14px 34px rgba(37, 99, 235, 0.34) !important;
}

/* Мобильная версия */
@media (max-width: 600px) {
    .auth-content {
        padding: 20px 14px !important;
    }

    .auth-content .login-card {
        padding: 25px 20px !important;
        border-radius: 15px !important;
    }
}


/* =====================================================
   AURUM private — логотип страницы входа
   ===================================================== */

.auth-content .auth-brand {
    position: absolute !important;
    z-index: 3 !important;

    top: clamp(42px, 8vh, 90px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    display: flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 12px !important;

    width: max-content !important;
    max-width: calc(100vw - 32px) !important;

    text-align: center !important;
    user-select: none !important;
}

.auth-content .auth-brand::before {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;

    width: 160% !important;
    height: 180% !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    background: radial-gradient(
        circle,
        rgba(59, 130, 246, 0.22) 0%,
        rgba(124, 58, 237, 0.10) 42%,
        transparent 72%
    ) !important;

    filter: blur(24px) !important;
    pointer-events: none !important;
}

.auth-content .auth-brand-main {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif !important;

    font-size: clamp(42px, 5.2vw, 76px) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.14em !important;

    color: #f8fafc !important;

    text-shadow:
        0 0 20px rgba(96, 165, 250, 0.25),
        0 8px 30px rgba(0, 0, 0, 0.35) !important;
}

.auth-content .auth-brand-private {
    font-family:
        Georgia,
        "Times New Roman",
        serif !important;

    font-size: clamp(20px, 2vw, 31px) !important;
    font-weight: 500 !important;
    font-style: italic !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;

    background: linear-gradient(
        135deg,
        #93c5fd 0%,
        #c4b5fd 52%,
        #e9d5ff 100%
    ) !important;

    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;

    text-shadow:
        0 0 18px rgba(167, 139, 250, 0.20) !important;
}

@media (max-width: 600px) {
    .auth-content .auth-brand {
        top: 34px !important;
        gap: 7px !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .auth-content .auth-brand-main {
        font-size: 38px !important;
        letter-spacing: 0.10em !important;
    }

    .auth-content .auth-brand-private {
        font-size: 19px !important;
        margin-top: -2px !important;
    }
}


/* =====================================================
   GitHub-style сообщение об ошибке авторизации
   ===================================================== */

.auth-content .alert,
.auth-content .flash,
.auth-content .flash-message{
    position: static !important;

    width: min(430px,100%) !important;

    margin:0 auto 18px auto !important;

    border-radius:10px !important;

    display:block !important;

    text-align:left !important;

    padding:14px 16px !important;

    box-sizing:border-box !important;
}

.auth-content .login-card{
    margin-top:0 !important;
}

.auth-content{
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    align-items:center !important;
    gap:18px !important;
}


/* =====================================================
   AURUM private — светлая тема страницы входа
   ===================================================== */

html[data-theme="light"] .auth-content {
    background-color: #f4f7fb !important;
    background-image:
        radial-gradient(
            circle at 15% 15%,
            rgba(59, 130, 246, 0.16) 0,
            rgba(59, 130, 246, 0.07) 24%,
            transparent 45%
        ),
        radial-gradient(
            circle at 88% 18%,
            rgba(124, 58, 237, 0.13) 0,
            rgba(124, 58, 237, 0.05) 26%,
            transparent 46%
        ),
        radial-gradient(
            circle at 50% 105%,
            rgba(14, 165, 233, 0.12) 0,
            transparent 44%
        ),
        linear-gradient(
            135deg,
            #f8fafc 0%,
            #eef4ff 48%,
            #f7f3ff 100%
        ) !important;
}

html[data-theme="light"] .auth-content::before {
    background-image:
        linear-gradient(
            rgba(15, 23, 42, 0.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(15, 23, 42, 0.045) 1px,
            transparent 1px
        ) !important;
}

html[data-theme="light"] .auth-content::after {
    background: rgba(59, 130, 246, 0.10) !important;
}

/* Логотип */
html[data-theme="light"] .auth-brand-main {
    color: #0f172a !important;

    text-shadow:
        0 0 20px rgba(59, 130, 246, 0.12),
        0 6px 20px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .auth-brand-private {
    background: linear-gradient(
        135deg,
        #2563eb 0%,
        #7c3aed 55%,
        #9333ea 100%
    ) !important;

    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;

    text-shadow:
        0 0 16px rgba(124, 58, 237, 0.10) !important;
}

/* Карточка входа */
html[data-theme="light"] .auth-content .login-card {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.94),
            rgba(248, 250, 252, 0.90)
        ) !important;

    border: 1px solid rgba(148, 163, 184, 0.35) !important;

    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 10px 28px rgba(37, 99, 235, 0.08) !important;

    color: #0f172a !important;
}

html[data-theme="light"] .auth-content .login-card h1,
html[data-theme="light"] .auth-content .login-card label,
html[data-theme="light"] .auth-content .login-card .checkbox,
html[data-theme="light"] .auth-content .login-card .checkbox span {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

/* Поля ввода */
html[data-theme="light"] .auth-content .login-card input[type="text"],
html[data-theme="light"] .auth-content .login-card input[type="password"] {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

html[data-theme="light"] .auth-content .login-card input[type="text"]:focus,
html[data-theme="light"] .auth-content .login-card input[type="password"]:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.13) !important;
}

/* Чекбокс */
html[data-theme="light"] .auth-content .login-card input[type="checkbox"] {
    accent-color: #2563eb !important;
}

/* GitHub-style ошибка */
html[data-theme="light"] .auth-content .alert.danger,
html[data-theme="light"] .auth-content .alert.error,
html[data-theme="light"] .auth-content .flash.danger,
html[data-theme="light"] .auth-content .flash.error {
    background: #ffebe9 !important;
    color: #82071e !important;
    border: 1px solid #ff8182 !important;

    box-shadow:
        0 8px 24px rgba(130, 7, 30, 0.08) !important;

    -webkit-text-fill-color: #82071e !important;
}

html[data-theme="light"] .auth-content .alert.danger *,
html[data-theme="light"] .auth-content .alert.error *,
html[data-theme="light"] .auth-content .flash.danger *,
html[data-theme="light"] .auth-content .flash.error * {
    color: #82071e !important;
    -webkit-text-fill-color: #82071e !important;
}

/* =====================================================
   AURUM private — логотип боковой панели
   ===================================================== */

.sidebar .sidebar-brand {
    display: flex !important;
    align-items: baseline !important;
    gap: 7px !important;

    margin: 0 8px 26px !important;
    padding: 2px 0 4px !important;

    width: max-content !important;
    max-width: 100% !important;

    white-space: nowrap !important;
    user-select: none !important;
}

.sidebar .sidebar-brand-main {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif !important;

    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.08em !important;

    color: #f8fafc !important;

    text-shadow:
        0 0 14px rgba(96, 165, 250, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.28) !important;
}

.sidebar .sidebar-brand-private {
    font-family:
        Georgia,
        "Times New Roman",
        serif !important;

    font-size: 15px !important;
    font-weight: 500 !important;
    font-style: italic !important;
    line-height: 1 !important;
    letter-spacing: 0.02em !important;

    background: linear-gradient(
        135deg,
        #93c5fd 0%,
        #c4b5fd 55%,
        #e9d5ff 100%
    ) !important;

    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;

    text-shadow:
        0 0 12px rgba(167, 139, 250, 0.15) !important;
}

/* Светлая тема */
html[data-theme="light"] .sidebar .sidebar-brand-main {
    color: #0f172a !important;
    text-shadow:
        0 0 12px rgba(59, 130, 246, 0.10),
        0 3px 12px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .sidebar .sidebar-brand-private {
    background: linear-gradient(
        135deg,
        #2563eb 0%,
        #7c3aed 55%,
        #9333ea 100%
    ) !important;

    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
}

/* Узкий экран */
@media (max-width: 800px) {
    .sidebar .sidebar-brand {
        margin-bottom: 20px !important;
    }

    .sidebar .sidebar-brand-main {
        font-size: 20px !important;
    }

    .sidebar .sidebar-brand-private {
        font-size: 14px !important;
    }
}

