:root {
  /* Акцент из утверждённого дизайна (2a): зелёный oklch(0.5 0.12 155) и фон панелей */
  --fl-accent: #1e7a4f;
  --fl-accent-dark: #175f3d;
  --fl-bg: #eef1f2;
  --fl-text: #1c2430;
  --fl-muted: #7b8794;
  /* Поверхности и линии — переопределяются тёмной темой */
  --fl-card: #fff;
  --fl-card2: #f6f8f9;
  --fl-soft: #eef1f2;
  --fl-hover: #f3f6f4;
  --fl-line: var(--fl-line);
  --fl-text2: #525f6e;
  --fl-contrast: #1c2430;
  --fl-contrast-text: #fff;
}

/* ===== Тёмная тема (переключатель в навбаре, хранится в localStorage) ===== */
[data-bs-theme="dark"] {
  --fl-bg: #14181d;
  --fl-text: #dee4ea;
  --fl-muted: #8f9aa6;
  --fl-card: #1d242c;
  --fl-card2: #242c35;
  --fl-soft: #2a323c;
  --fl-hover: #262f38;
  --fl-line: #2b343d;
  --fl-text2: #b8c2cc;
  --fl-contrast: #dfe5ea;
  --fl-contrast-text: #14181d;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: var(--fl-bg);
  color: var(--fl-text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--fl-accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.btn-success {
  background-color: var(--fl-accent);
  border-color: var(--fl-accent);
}

.btn-success:hover, .btn-success:focus, .btn-success:active {
  background-color: var(--fl-accent-dark);
  border-color: var(--fl-accent-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--fl-card), 0 0 0 0.25rem var(--fl-accent);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Настройки (дизайн 3b) ===== */

.fl-settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: start;
}

.fl-settings-nav {
  padding: 8px;
  font-weight: 600;
  font-size: 14px;
}

.fl-nav-item {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--fl-text2);
  cursor: pointer;
}

.fl-nav-item:hover { background: var(--fl-hover); }

.fl-nav-item.active {
  background: #e8f5ee;
  color: var(--fl-accent-dark);
}

.fl-card {
  background: var(--fl-card);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.fl-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.fl-badge-green { background: #e8f5ee; color: #1e7a4f; }
.fl-badge-red { background: #fdf0ee; color: #b04a35; }
.fl-badge-blue { background: #eaf1fb; color: #3f6394; }
.fl-badge-teal { background: #dff2ef; color: #1b6d62; }
.fl-badge-purple { background: #ece9f7; color: #6f6694; }
.fl-badge-orange { background: #fef3e2; color: #a9772d; }
.fl-badge-gray { background: var(--fl-soft); color: var(--fl-muted); }

.fl-table { font-size: 13px; }

.fl-table-head {
  color: var(--fl-muted);
  font-size: 10.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--fl-line);
  padding: 0 18px 7px;
}

.fl-accounts-row {
  display: grid;
  grid-template-columns: 26px 1.4fr 110px 60px 130px 150px 80px 55px 80px;
  gap: 0 12px;
  align-items: center;
}

.fl-debts-row {
  display: grid;
  grid-template-columns: 26px 1.2fr 130px 70px 130px 75px 1.3fr 110px;
  gap: 0 12px;
  align-items: center;
}

.fl-debt-hist-row {
  display: grid;
  grid-template-columns: 60px 90px 100px 1.4fr 1fr 30px;
  gap: 0 10px;
  align-items: center;
}

.fl-table-row {
  padding: 9px 18px;
  border-bottom: 1px solid var(--fl-line);
}

.fl-table-row:last-child { border-bottom: 0; }

.fl-drag { color: #c4ccd2; cursor: grab; }
.fl-dragging { opacity: .4; }
.fl-muted { opacity: .55; }
.fl-yes { color: var(--fl-accent); }

.fl-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, .08);
  vertical-align: middle;
}

.fl-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.fl-row-actions a { text-decoration: none; color: var(--fl-muted); }
.fl-row-actions a:hover { color: var(--fl-text); text-decoration: none; }
.fl-row-actions a.fl-danger:hover { color: #c4522e; }

.fl-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
}

.fl-categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.fl-currencies-scroll { max-height: 460px; overflow-y: auto; }

.fl-cur-row {
  display: grid;
  grid-template-columns: 70px 1fr 100px 90px 80px 60px;
  gap: 0 12px;
  align-items: center;
  padding: 7px 18px;
  border-bottom: 1px solid var(--fl-line);
  font-size: 13px;
}

.fl-cur-row:last-child { border-bottom: 0; }

.fl-swatch-pick input { display: none; }
.fl-swatch-pick .fl-swatch { width: 22px; height: 22px; cursor: pointer; }

.fl-swatch-pick input:checked + .fl-swatch {
  outline: 2px solid var(--fl-contrast);
  outline-offset: 1px;
}

.fl-swatch-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px dashed #b3bcc4;
}

/* ===== Дашборд (дизайн 2a) ===== */

.fl-top-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
}

.fl-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
  align-items: start;
}

.fl-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* Карточки счетов: по 2 в строку; при нечётном количестве первая — во всю строку */
.fl-acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fl-acc-card {
  background: var(--fl-card2);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 10px;
  padding: 7px 12px;
}

.fl-acc-wide { grid-column: 1 / -1; }

.fl-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--fl-muted);
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--fl-line);
  margin-bottom: 2px;
}

.fl-acc-sub { font-size: 10.5px; color: rgba(28, 36, 48, .55); }

.fl-income { color: var(--fl-accent); }
.fl-expense { color: #b04a35; }
.fl-saving { color: #3f6394; }

/* Лог колонками: иконка | тип | счёт | категория·комментарий | сумма | дата | действия */
.fl-op-row,
.fl-op-head {
  display: grid;
  grid-template-columns: 30px 92px minmax(0, 1.15fr) minmax(0, 1fr) 100px 40px 44px;
  gap: 0 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
}

.fl-op-head {
  border-top: 0;
  padding-bottom: 2px;
  color: var(--fl-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
}

.fl-op-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.fl-op-income { background: #e8f5ee; color: #1e7a4f; }
.fl-op-expense-i { background: #fdf0ee; color: #b04a35; }
.fl-op-saving { background: #eaf1fb; color: #3f6394; }
.fl-op-transfer { background: var(--fl-soft); color: var(--fl-text2); }
.fl-op-storage { background: #dff2ef; color: #1b6d62; }

.fl-op-date {
  flex: none;
  width: 40px;
  text-align: right;
  font-size: 11px;
  color: #9aa6b2;
}

.fl-log-filter {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--fl-soft);
  color: var(--fl-text2);
  cursor: pointer;
}

.fl-log-filter.active { background: var(--fl-contrast); color: var(--fl-contrast-text); }

.fl-chip-pick input,
.fl-type-pick input { display: none; }

.fl-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid #dbe1e5;
  border-radius: 8px;
  background: var(--fl-card);
  color: var(--fl-text2);
  cursor: pointer;
}

.fl-chip-pick input:checked + .fl-chip {
  border: 1.5px solid var(--fl-accent);
  color: var(--fl-text);
}

.fl-type-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--fl-soft);
  color: var(--fl-muted);
  cursor: pointer;
}

.fl-type-pick input:checked + .fl-type-chip {
  background: var(--fl-card);
  color: var(--fl-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  outline: 1px solid #dbe1e5;
}

/* ===== Этап 3: бюджет, планирование, доходы, статистика трат ===== */

.fl-dash-grid3 {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 14px;
  align-items: start;
}

.fl-mode-switch {
  display: inline-flex;
  background: var(--fl-soft);
  border-radius: 8px;
  padding: 3px;
  font-size: 12px;
  font-weight: 600;
}

.fl-mode-btn {
  padding: 4px 14px;
  border-radius: 6px;
  color: var(--fl-muted);
  cursor: pointer;
}

.fl-mode-btn.active {
  background: var(--fl-card);
  color: var(--fl-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

.fl-budget-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
}

.fl-budget-total { border-top: 1px solid #dbe1e5; }

.fl-dotted { border-bottom: 1px dashed #b3bcc4; }

.fl-budget-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.fl-tile {
  background: var(--fl-soft);
  border-radius: 8px;
  padding: 8px 10px;
}

.fl-tile-accent { background: #fdf6dd; }
.fl-tile-accent .fl-tile-label { color: #8a7a3b; }
.fl-tile-danger { background: #fdf0ee; }
.fl-tile-danger .fl-tile-label { color: #b04a35; }

.fl-tile-label {
  font-size: 10.5px;
  color: var(--fl-muted);
  font-weight: 600;
}

.fl-tile-value {
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
}

/* Планирование колонками: чекбокс | название | «база» | сумма | действия */
.fl-plan-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 52px 105px 44px;
  gap: 0 8px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
}

/* Числа: табличные цифры и без переносов — суммы стоят по одной линии */
.fl-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fl-plan-done { color: #9aa6b2; }

.fl-plan-check {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #cfd6db;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-decoration: none;
  color: transparent;
}

.fl-plan-check.checked {
  background: var(--fl-accent);
  border-color: var(--fl-accent);
  color: #fff;
}

/* Статистика трат: колонки «потрачено | выделено», числа выровнены по левому краю колонок */
.fl-spend-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.2fr) 1fr 96px 96px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  font-size: 12.5px;
}

.fl-spend-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  color: #9aa6b2;
  padding-bottom: 0;
}

.fl-spend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-spend-bar-col { min-width: 0; }

.fl-spend-bar {
  display: block;
  height: 6px;
  background: var(--fl-soft);
  border-radius: 3px;
  overflow: hidden;
}

.fl-spend-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
}

.fl-bar-ok { background: var(--fl-accent); }
.fl-bar-warn { background: #d99a2b; }
.fl-bar-over { background: #c0503a; }

.fl-spend-col {
  text-align: left;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Накопления: настоящая таблица — колонки выравниваются по контенту и не едут */
.fl-sav-table {
  width: 100%;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  border-collapse: collapse;
}

.fl-sav-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  color: #9aa6b2;
  padding: 4px 0 4px 10px;
  text-align: left;
}

.fl-sav-table th:first-child { padding-left: 0; }

.fl-sav-table td {
  padding: 6px 0 6px 10px;
  border-top: 1px solid var(--fl-line);
  vertical-align: baseline;
}

.fl-sav-table td:first-child { padding-left: 0; }

.fl-sav-table .fl-num { white-space: nowrap; }

.fl-sav-table .fl-sav-group td {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--fl-muted);
  border-top: 0;
  border-bottom: 1px solid var(--fl-line);
  padding-top: 10px;
  padding-bottom: 4px;
}

/* Распределение накоплений: колонки как у статистики трат — имя+% | бар | ПЛАН | ФАКТ */
.fl-alloc-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.3fr) 1fr 96px 96px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.fl-alloc-row.fl-spend-head { border-top: 0; }

/* Доходы: колонки ПЛАН | ФАКТ — единый подход со статистикой трат */
.fl-inc-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 96px 96px;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fl-inc-row.fl-spend-head { border-top: 0; padding-bottom: 0; }

/* Цели: строка с прогрессом; чекбоксы счетов в модалке — колонками */
.fl-goal-row {
  padding: 8px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fl-goal-row:first-child { border-top: 0; }

.fl-goal-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 16px;
  padding: 4px 0 8px;
}

/* Пользовательские карточки статистики в «Накоплениях» */
.fl-stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fl-stat-card { position: relative; }

.fl-stat-card-actions {
  position: absolute;
  top: 6px;
  right: 8px;
  display: none;
  gap: 6px;
}

.fl-stat-card:hover .fl-stat-card-actions { display: flex; }

.fl-stat-card-actions a { text-decoration: none; color: var(--fl-muted); font-size: 12px; }
.fl-stat-card-actions a.fl-danger:hover { color: #c4522e; }

.fl-stat-card-add {
  border: 1px dashed #c4ccd2;
  background: transparent;
  border-radius: 8px;
  color: var(--fl-muted);
  font-size: 12px;
  font-weight: 600;
  min-height: 52px;
  cursor: pointer;
}

.fl-stat-card-add:hover { background: var(--fl-hover); color: var(--fl-text); }

/* Эмодзи-пикер */
.fl-emoji-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.fl-emoji-btn {
  border: 1px solid #dbe1e5;
  background: var(--fl-card);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.fl-emoji-btn:hover { background: var(--fl-hover); }

/* Имя счёта в цветной «пилюле» — чтобы цвет не выглядел вторым чекбоксом */
.fl-acc-pill {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--fl-soft);
  border: 1px solid rgba(0, 0, 0, .07);
  font-size: 12px;
  font-weight: 600;
  vertical-align: baseline;
}

/* Burn-бар «Бюджет на траты — сгорание» (дизайн 2a) */
.fl-burn-bar {
  position: relative;
  height: 28px;
  background: var(--fl-soft);
  border-radius: 8px;
  overflow: hidden;
}

.fl-burn-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--fl-accent);
  border-radius: 8px 0 0 8px;
}

.fl-burn-over { background: #c0503a; }

.fl-burn-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--fl-contrast);
}

.fl-burn-label-left,
.fl-burn-label-right {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
}

.fl-burn-label-left { left: 12px; color: #fff; }
.fl-burn-label-right { right: 12px; color: var(--fl-muted); font-weight: 600; }

/* Инлайн-форма операции в логе: визуально отделена панелью быстрого ввода */
.fl-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 16px 12px;
  padding: 10px 12px;
  background: #f4f7f5;
  border: 1px dashed #c4d3c9;
  border-radius: 10px;
}

.fl-inline-form::before {
  content: "Быстрый ввод";
  flex-basis: 100%;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fl-muted);
}

.fl-inline-form select { max-width: 150px; }
.fl-il-amount { width: 110px; }
.fl-il-date { width: 130px; }
.fl-il-comment { flex: 1; min-width: 110px; }

@media (max-width: 1280px) {
  .fl-dash-grid3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .fl-dash-grid,
  .fl-dash-grid3,
  .fl-top-grid { grid-template-columns: 1fr; }
  .fl-stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .fl-settings-grid,
  .fl-categories-grid { grid-template-columns: 1fr; }
}

/* ===== Этап 7: мастер нового периода (дизайн 3c) ===== */
.fl-wiz-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.fl-wiz-step {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9aa6b2;
  user-select: none;
}

.fl-wiz-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fl-soft);
  color: var(--fl-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.fl-wiz-step.active { color: var(--fl-text); }
.fl-wiz-step.active .fl-wiz-dot { background: var(--fl-contrast); color: var(--fl-contrast-text); }
.fl-wiz-step.done { color: var(--fl-accent); cursor: pointer; }
.fl-wiz-step.done .fl-wiz-dot { background: var(--fl-accent); color: #fff; }
.fl-wiz-line { flex: 1; height: 2px; background: var(--fl-line); }

.fl-wiz-band {
  background: #f5f8f6;
  border: 1px solid #e8efe9;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--fl-text2);
}

.fl-wiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

@media (max-width: 800px) {
  .fl-wiz-grid { grid-template-columns: 1fr; }
}

.fl-wiz-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--fl-line);
  font-size: 13px;
}

.fl-acc-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  flex: 0 0 auto;
}

/* ===== Этап 8: сворачивание виджетов ===== */
.fl-collapse-btn {
  cursor: pointer;
  color: #b3bcc4;
  margin-left: 7px;
  font-size: 11px;
  display: inline-block;
  user-select: none;
  transition: transform .15s;
}

.fl-collapse-btn:hover { color: var(--fl-text); }
.fl-card.fl-collapsed > :not(:first-child) { display: none; }
.fl-card.fl-collapsed > :first-child { padding-bottom: 16px !important; }
.fl-card.fl-collapsed .fl-collapse-btn { transform: rotate(-90deg); }

/* ===== Этап 8: плавающая кнопка операции на мобильном (ТЗ 7.2) ===== */
.fl-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--fl-accent);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .35);
  z-index: 1040;
}

@media (max-width: 1100px) {
  .fl-fab {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ===== Точечные правила тёмной темы ===== */
[data-bs-theme="dark"] .navbar.bg-white { background: var(--fl-card) !important; }

[data-bs-theme="dark"] .navbar .nav-link.text-dark,
[data-bs-theme="dark"] .navbar .navbar-brand { color: var(--fl-text) !important; }

[data-bs-theme="dark"] .btn-light {
  --bs-btn-bg: var(--fl-soft);
  --bs-btn-color: var(--fl-text);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: #343e49;
  --bs-btn-hover-color: var(--fl-text);
  --bs-btn-active-bg: #343e49;
  --bs-btn-active-color: var(--fl-text);
}

[data-bs-theme="dark"] .fl-nav-item.active { background: rgba(30, 122, 79, .28); color: #86cba8; }
[data-bs-theme="dark"] .fl-tile-accent { background: #38321c; }
[data-bs-theme="dark"] .fl-tile-danger { background: #3b2823; }

[data-bs-theme="dark"] .fl-inline-form {
  background: #20272d;
  border-color: #3b4a42;
}

[data-bs-theme="dark"] .fl-wiz-band {
  background: #20282c;
  border-color: var(--fl-line);
}

[data-bs-theme="dark"] .fl-acc-sub { color: rgba(222, 228, 234, .55); }

/* Пользовательские светлые фоны (цвет счёта/карточки/чипа) остаются светлыми — текст на них тёмный */
[data-bs-theme="dark"] .fl-acc-card[style*="background"],
[data-bs-theme="dark"] .fl-chip[style*="background"],
[data-bs-theme="dark"] .fl-acc-pill[style*="background"],
[data-bs-theme="dark"] .fl-stat-card[style*="background"],
[data-bs-theme="dark"] option[style*="background"] { color: #1c2430; }

[data-bs-theme="dark"] .fl-acc-card[style*="background"] .fl-acc-sub { color: rgba(28, 36, 48, .55); }
