@font-face {
  font-family: "OnestRegular";
  src: url("/static/fonts/Onest-Regular.ttf");
}

:root {
  --gp-bg: #030d08;
  --gp-text: #fff;
  --gp-muted: #b3ffd9;
  --gp-brand: #ddffee;
  --gp-primary: #1f945a;
  --gp-primary-hover: #2baa6b;
  --gp-secondary: #123323;
  --gp-secondary-hover: #1a4a32;
  --gp-input: #082617;
  --gp-input-border: #21b66c;
  --gp-line: #1d9559;
  --gp-thead: #10653b;
  --gp-card-solid: #0b2b1b;
  --gp-border: rgba(31, 148, 90, 0.38);
  --gp-radius: 8px;
  --gp-radius-lg: 16px;
  --gp-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 48px rgba(31, 148, 90, 0.10);
  --gp-focus: 0 0 0 3px rgba(31, 148, 90, 0.22);
  --gp-font: "OnestRegular", sans-serif;
}


* {
  padding: 0px;
  margin: 0px;
  border: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a,
a:link,
a:visited {
  text-decoration: none;
  color: white;
}

a:hover {
  text-decoration: none;
}

::-webkit-scrollbar {
  width: 6px;
}

html {
  scrollbar-width: thin;
}

aside,
nav,
footer,
header,
section,
main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  font-size: inherit;
  font-weight: inherit;
}

ul,
ul li {
  list-style: none;
}

img {
  vertical-align: top;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

address {
  font-style: normal;
}

input,
textarea,
button,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background-color: transparent;
}

input::-ms-clear {
  display: none;
}

button,
input[type="submit"] {
  display: inline-block;
  box-shadow: none;
  background-color: transparent;
  background: none;
  cursor: pointer;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus,
input:active,
button:focus,
button:active {
  outline: none;
}

button::-moz-focus-inner {
  padding: 0;
  border: 0;
}

label {
  cursor: pointer;
}

legend {
  display: block;
}

html {
  background: var(--gp-bg);
}

body {
  min-height: 100vh;
  color: var(--gp-text);
  font-family: var(--gp-font);
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(92, 246, 169, 0.22), transparent 60%),
    radial-gradient(ellipse 75% 50% at 15% 110%, rgba(29, 149, 89, 0.45), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(58, 237, 148, 0.12), transparent 65%),
    linear-gradient(180deg, #04140c 0%, #030d08 45%, #05180f 100%);
  padding: 12px 16px 28px;
}

th {
  white-space: nowrap;
}

textarea {
  font-size: 14px;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  background-color: var(--gp-secondary);
  color: white;
}

.invisible {
  display: none !important;
}

.btn-red {
  background: #a30606 !important;
}

.main-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'OnestRegular';
  color: white;
}

.main-table thead {
  background-color: var(--gp-thead);
}

.main-table th,
.main-table td {
  padding: 5px;
  text-align: center;
  border: 1px solid var(--gp-primary);
}

.main-table .col-name {
  width: 1%;
  max-width: 9.5rem;
  white-space: nowrap;
  text-align: left;
  padding-left: 8px;
  padding-right: 8px;
}

.main-table .col-name a {
  display: inline-block;
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.main-table td.cell-net-loss,
.main-table td.cell-net-loss strong {
  color: #ff4d4d;
  font-weight: 700;
}

.main-table td.cell-net-loss,
.main-table td.cell-channel-loss {
  background-color: rgba(163, 6, 6, 0.5);
}

.main-table td.cell-channel-loss a,
.main-table td.cell-channel-loss strong {
  color: #ff6b6b;
}

.main-table td.cell-channel-gain {
  background-color: rgba(61, 255, 106, 0.22);
}

.main-table td.cell-channel-gain a,
.main-table td.cell-channel-gain strong {
  color: #3dff6a;
}

.main-table td.cell-net-gain,
.main-table td.cell-net-gain strong {
  color: #3dff6a;
  font-weight: 700;
}

.main-table td.cell-cr-low {
  background-color: rgba(163, 6, 6, 0.5);
  color: #ff6b6b;
  font-weight: 700;
}

.main-table td.cell-cr-mid {
  background-color: rgba(196, 150, 20, 0.48);
  color: #ffd54a;
  font-weight: 700;
}

.main-table td.cell-cr-high {
  background-color: rgba(61, 255, 106, 0.22);
  color: #3dff6a;
  font-weight: 700;
}

.main-table tbody tr.row-unprofitable td.cell-cr-mid,
.main-table tbody tr:hover td.cell-cr-mid {
  background-color: rgba(196, 150, 20, 0.58);
}

.main-table tbody tr.row-unprofitable td.cell-cr-high,
.main-table tbody tr:hover td.cell-cr-high {
  background-color: rgba(61, 255, 106, 0.32);
}

.main-table tbody tr.row-unprofitable td.cell-cr-low,
.main-table tbody tr:hover td.cell-cr-low {
  background-color: rgba(163, 6, 6, 0.62);
}

.filter-form {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  row-gap: 12px;
  color: white;
  margin-left: 10px;
  font-family: 'OnestRegular';
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.filter-form__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  row-gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  /* дочерние блоки не сжимаем — иначе <select> визуально наезжает на соседей */
  align-content: flex-start;
  order: 1;
}

.filter-form label {
  font-weight: bold;
  flex-shrink: 0;
}

.filter-form__preset-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
}

.filter-form__preset-field select {
  flex-shrink: 0;
  min-width: 9.5em;
  max-width: 16em;
  box-sizing: border-box;
}

.filter-form__date-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-form__date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-form__sort-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
}

.filter-form__sort-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  flex: 0 1 auto;
  min-width: 0;
  box-sizing: border-box;
}

.filter-form__sort-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
}

.filter-form__sort-field select {
  flex-shrink: 0;
  min-width: 10em;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-form input[type="date"],
.filter-form select {
  padding: 5px;
  font-size: 14px;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  background-color: var(--gp-secondary);
  color: white;
  box-sizing: border-box;
  max-width: 100%;
}

.filter-form input[type="date"] {
  flex: 0 1 auto;
  min-width: 8.5rem;
  width: auto;
  max-width: 11.5rem;
}

.filter-form select option {
  background-color: var(--gp-secondary);
  color: white;
}

.channel-label {
  margin-left: 0;
}

.channel {
  background-color: var(--gp-secondary);
  border: 1px solid var(--gp-primary);
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 15px;
}

.filter-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
}

.filter-form__action-button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-primary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

.filter-form__redirect-buttons {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
  order: 0;
}

@media (min-width: 769px) {
  .filter-form__redirect-buttons {
    order: 2;
  }

  /* Сетка вместо flex-wrap: ровные ряды при любой ширине окна */
  .filter-form__primary {
    display: grid;
    align-items: center;
    column-gap: 14px;
    row-gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .filter-form__date-row,
  .filter-form__dropdown-row,
  .filter-form__sort-actions {
    min-width: 0;
  }
}

/* ПК без запаса по ширине: ряды не в одну линию — иначе средняя колонка (канал/гео)
   с flex-shrink: 0 наезжает на сортировку при ~1024–1279px */
@media (min-width: 769px) and (max-width: 1279px) {
  .filter-form__primary {
    grid-template-columns: 1fr 1fr;
  }

  .filter-form__date-row {
    grid-column: 1 / -1;
  }

  .filter-form__dropdown-row {
    grid-column: 1 / -1;
  }

  .filter-form__sort-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
  }
}

/* Достаточно широкий экран: одна строка — даты | канал/гео | сортировка+период+кнопки */
@media (min-width: 1280px) {
  .filter-form__primary {
    grid-template-columns: max-content minmax(0, 1fr) minmax(0, auto);
    grid-template-rows: auto;
  }

  .filter-form__date-row {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .filter-form__dropdown-row {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .filter-form__sort-actions {
    grid-column: 3;
    grid-row: 1;
    flex-wrap: nowrap;
    justify-self: end;
    min-width: 0;
  }
}

.filter-form__redirect-buttons__button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}


.settings-topbar__end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.gohome__button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-secondary);
  color: white;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  cursor: pointer;
  font-family: 'OnestRegular';
  flex-shrink: 0;
  margin-left: 0;
}

.settings-topbar {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

.settings-selector {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  color: #fff;
}

.settings-selector>span,
.settings-tab {
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  font-family: 'OnestRegular';
  color: #fff;
}

.settings-tab {
  padding: 5px 12px;
  background-color: var(--gp-secondary);
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  line-height: 1.2;
}

.settings-tab:hover {
  background-color: var(--gp-secondary-hover);
}

.settings-tab.selected {
  color: #fff;
  text-decoration: none;
  background-color: var(--gp-input-border);
  border-color: #84fcc0;
}

.settings-data {
  color: white;
  font-family: 'OnestRegular';
  width: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.settings-data li {
  margin-bottom: 5px;
  display: flex;
  font-size: 13px;
  align-items: center;
  justify-content: space-between;
}

.settings-data__form {
  white-space: nowrap;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
}

.settings-data__form__input {
  padding: 5px;
  font-size: 14px;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  background-color: var(--gp-secondary);
}

.settings-data__header {
  font-size: 20px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-data__add-button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.settings-data__update-button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.settings-data__delete-button {
  margin-left: 5px;
  padding: 2.5px 10px 2.5px 10px;
  font-size: 11px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.settings-data,
.settings-percent {
  color: white;
  font-family: 'OnestRegular';
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  align-content: center;
  flex-wrap: wrap;
}

.settings-percent form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.settings-percent select {
  padding: 2.5px;
  font-size: 14px;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  background-color: var(--gp-secondary);
  color: white;
  margin-bottom: 10px;
}

.settings-percent div {
  margin-bottom: 10px;
}

.settings-percent input {
  padding: 2.5px;
  font-size: 14px;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  background-color: var(--gp-secondary);
}

.settings-data button,
.settings-percent button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.login-form {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: 'OnestRegular';
  color: white;
  padding: 24px 16px;
  box-sizing: border-box;
}

.login-form--login {
  background:
    radial-gradient(ellipse 80% 50% at 50% 18%, rgba(92, 246, 169, 0.18), transparent 62%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(18, 51, 35, 0.55), transparent 70%),
    #000;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 2rem 1.6rem 1.5rem;
  border: 1px solid rgba(92, 246, 169, 0.38);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.92) 0%, rgba(3, 13, 8, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(92, 246, 169, 0.12);
}

.login-form__logo {
  width: 112px;
  height: 112px;
  margin: 0 auto 10px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(92, 246, 169, 0.35));
}

.app-masthead {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 18px;
  padding: 4px 16px 2px;
  background: none;
  border: none;
  box-shadow: none;
  font-size: 1.35rem;
  position: relative;
}

.app-masthead__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.app-logout,
.app-settings,
.app-masthead__end {
  display: none;
}

.app-masthead__logo {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 0 10px rgba(92, 246, 169, 0.4));
}

.app-masthead__name {
  margin: 0;
  font-family: 'OnestRegular';
  font-size: 1em;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ddffee;
  line-height: 1;
}

.settings-topbar__start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.login-card__brand {
  margin: 0 0 1.35rem;
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ddffee;
}

.login-form__heading {
  margin: 0 0 1rem;
  font-size: 18px;
  font-weight: normal;
  text-align: center;
  color: var(--gp-brand);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #b3ffd9;
}

.login-form input,
.login-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: #fff;
  border: 1px solid var(--gp-input-border);
  border-radius: 8px;
  background-color: var(--gp-input);
}

.login-form input:focus,
.login-field input:focus {
  border-color: var(--gp-primary);
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.22);
}

.login-form__recaptcha {
  margin: 16px 0;
}

.login-form--login .login-form__btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'OnestRegular';
  text-decoration: none;
  line-height: 1.2;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.login-form--login .login-form__btn--enter {
  margin-top: 6px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  background-color: var(--gp-primary);
  box-shadow: 0 6px 18px rgba(31, 148, 90, 0.28);
}

.login-form--login .login-form__btn--enter:hover {
  background-color: var(--gp-primary-hover);
}

.login-form--login .login-form__alt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
}

.login-form--login .login-form__btn--register,
.login-form--login .login-form__btn--collab {
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  background-color: #123323;
  border: 1px solid rgba(92, 246, 169, 0.28);
}

.login-form--login .login-form__btn--register:hover,
.login-form--login .login-form__btn--collab:hover {
  background-color: #1a4a32;
}

.login-form__error,
.login-form__recaptcha-error {
  color: #ff6b6b;
  margin: 0 0 8px;
  font-size: 14px;
  text-align: center;
  max-width: 304px;
}

.login-form button {
  margin-top: 0;
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-primary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.login-form a,
.login-form .secondary-button {
  margin-top: 15px;
  padding: 3.3px 7.5px;
  font-size: 12px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: inline-block;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal__content {
  position: relative;
  width: 100%;
  max-width: 520px;
  background-color: var(--gp-card-solid);
  border: 1px solid var(--gp-primary);
  border-radius: 8px;
  padding: 28px 24px 20px;
  padding-right: 44px;
  color: white;
  font-family: 'OnestRegular';
  text-align: center;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background-color: var(--gp-secondary);
  color: white;
  font-size: 16px;
  line-height: 1;
}

.modal__text {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.modal__text:first-of-type {
  margin-top: 0;
}

.modal__text a {
  color: white;
  text-decoration: underline;
}

.w-100 {
  width: 100%;
}

.text-bold {
  font-weight: bold;
}

.d-flex {
  display: flex;
}

.justify-space-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.ml-2 {
  margin-left: 2em !important;
}

.mt-2 {
  margin-top: 2em !important;
}

.mt-5 {
  margin-top: 5em !important;
}

.font-11 {
  font-size: 11px !important;
  padding: 2.5px 10px !important;
}

.channel-add-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 24rem;
  margin-bottom: 1rem;
  align-self: center;
}

.channel-add-row input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.stale-channel-row {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto 1.25rem;
  text-align: center;
}

.stale-channel-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #c8c8c8;
  line-height: 1.35;
}

.channel-delete-btn {
  font-size: 0.75rem;
  padding: 4px 8px;
  background: #a30606;
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.channel-delete-btn:hover {
  background: #c20a0a;
}

.geo-channel-empty {
  text-align: center;
  opacity: 0.8;
  margin: 1rem 0;
}

.perc-input {
  max-width: 3.2em;
}

.telegram-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telegram-field {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.telegram-input {
  width: 9.6rem;
  max-width: 42vw;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.telegram-input--ok {
  border-color: #84fcc0;
}

.telegram-input--err {
  border-color: #ff6b6b;
}

.telegram-hint {
  width: 100%;
  max-width: 52rem;
  align-self: center;
  margin: 0 0 0.85rem;
  font-size: 12px;
  line-height: 1.4;
  color: #b3ffd9;
}

.telegram-hint strong {
  color: #fff;
}

.telegram-linked {
  color: #84fcc0;
  font-size: 11px;
  line-height: 1;
}

.telegram-linked--pending {
  color: #ffcc4d;
}

.geo-channel-groups {
  width: 100%;
  max-width: 52rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.geo-channel-group {
  width: 100%;
  border: 1px solid var(--gp-primary);
  border-radius: 8px;
  background-color: var(--gp-card-solid);
  overflow: hidden;
}

.geo-channel-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 1.05rem;
}

.geo-channel-group__summary::-webkit-details-marker {
  display: none;
}

.geo-channel-group__label {
  font-size: 1.25rem;
  line-height: 1;
}

.geo-channel-group__count {
  font-size: 0.8rem;
  opacity: 0.8;
}

.geo-channel-group table {
  width: 100%;
  margin: 0;
}

.geo-channel-group[open] .geo-channel-group__summary {
  border-bottom: 1px solid var(--gp-line);
}

.user-list-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.filter-form__dropdown-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-form__dropdown-wrap {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.dropdown {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.filter-form .dropdown {
  display: block;
}

.dropdown button {
  padding: 5px 10px;
  font-size: 14px;
  background-color: var(--gp-primary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--gp-card-solid);
  min-width: 120px;
  width: max-content;
  overflow-y: auto;
  max-height: 300px;
  border: 1px solid #ddd;
  z-index: 1;
}

.dropdown-content.dropdown-content--channels {
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-width: 220px;
  max-height: 300px;
  padding: 0;
}

.dropdown-content.dropdown-content--channels.show {
  display: flex;
}

.channel-dropdown-sticky {
  flex-shrink: 0;
  border-bottom: 1px solid #333;
}

.channel-dropdown-search-wrap {
  padding: 8px;
  background-color: var(--gp-card-solid);
}

.channel-dropdown-search {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  background-color: var(--gp-input);
}

.channel-dropdown-search::placeholder {
  color: #888;
}

.channel-options-list {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.dropdown-content label {
  display: block;
  padding: 5px 10px;
  cursor: pointer;
}

.dropdown-content label:hover {
  background-color: var(--gp-card-solid);
}

.show {
  display: block;
}

.selected-items {
  width: 100px;
  margin-top: 5px;
  padding: 5px;
}

.selected-items div {
  margin-bottom: 5px;
}

#user-info-note-content {
  resize: none;
  margin-left: 10px;
}

.selected {
  color: #8bfac3;
  text-decoration: underline;
}

.settings-admin-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2rem;
  box-sizing: border-box;
}

.settings-admin-main,
.settings-admin-aside {
  min-width: 0;
  width: 100%;
}

@media (min-width: 960px) {
  .settings-percent:has(.settings-admin-panel:not(.invisible)) {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px 24px;
    flex-wrap: nowrap;
    align-content: stretch;
  }

  .settings-admin-panel:not(.settings-admin-panel--import-only) {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(22rem, 0.95fr);
    align-items: start;
    gap: 1.25rem 1.5rem;
  }

  .settings-admin-main #user_form,
  .settings-admin-main #currency_form {
    width: 100%;
    align-items: stretch;
  }

  .settings-admin-main .user-channel-assign {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .settings-admin-main #user-info-note-content,
  .settings-admin-main .w-100 {
    width: 100%;
    box-sizing: border-box;
  }

  .settings-admin-aside .ads-import,
  .settings-admin-aside .ads-history {
    max-width: none;
    margin: 0 0 1rem;
  }

  .settings-admin-aside .ads-import h3,
  .settings-admin-aside .ads-history h3 {
    font-size: 1.05rem;
  }

  .settings-admin-aside .ads-history__range {
    flex-wrap: nowrap;
  }

  .settings-admin-aside .ads-history__item {
    grid-template-columns: 1fr;
  }

  .settings-admin-aside .ads-history__delete {
    width: 100%;
  }

  .settings-admin-aside .ads-unmatched-name {
    flex: 1 1 100%;
  }
}

.user-channel-assign {
  width: 100%;
  max-width: 32rem;
  margin: 1.25rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-channel-panel {
  width: 100%;
  border: 1px solid var(--gp-primary);
  border-radius: 8px;
  background-color: var(--gp-card-solid);
  overflow: hidden;
}

.user-channel-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--gp-line);
}

.user-channel-panel__list {
  max-height: min(70vh, 28rem);
}

.user-channel-fold {
  width: 100%;
  border: 1px solid var(--gp-primary);
  border-radius: 8px;
  background-color: var(--gp-card-solid);
  overflow: hidden;
}

.user-channel-fold__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
}

.user-channel-fold__summary::-webkit-details-marker {
  display: none;
}

.user-channel-fold__summary::before {
  content: "▸";
  margin-right: 6px;
  opacity: 0.8;
}

.user-channel-fold[open] .user-channel-fold__summary::before {
  content: "▾";
}

.user-channel-fold[open] .user-channel-fold__summary {
  border-bottom: 1px solid var(--gp-line);
}

.user-channel-fold__hint,
.user-channel-fold__count {
  font-size: 0.8rem;
  opacity: 0.8;
}

.user-channel-fold__body {
  padding: 8px 10px 10px;
}

.user-channel-fold__search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.user-channel-fold__list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 14rem;
  overflow-y: auto;
}

.user-channel-panel .user-channel-fold__list {
  max-height: min(70vh, 28rem);
}

.user-channel-fold__list li {
  margin: 0;
}

.user-channel-item__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 3px 0;
  color: #b5fdd9;
}

.user-channel-item--assigned .user_delete_channel {
  width: auto;
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 11px;
  background-color: rgb(90, 18, 18);
  color: #fff;
  border-radius: 4px;
}

.user-channel-fold__empty {
  opacity: 0.7;
  padding: 6px 4px;
  font-size: 0.85rem;
}

.user-channel-fold__list button:not(.user_delete_channel),
.user-channel-fold__pick {
  width: 100%;
  text-align: left;
  margin: 0 0 4px;
  color: #ddffee;
}

.user-admin-actions,
.user-admin-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.user-admin-toolbar #selected_user {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.user-admin-toolbar button,
.settings-percent .user-admin-toolbar button {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.telegram-admin-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0.55rem 0 0;
  font-size: 12px;
  color: #b3ffd9;
}

.telegram-admin-field > span:first-child {
  white-space: nowrap;
}

body.modal-open {
  overflow: hidden;
}

.delete-users-modal {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background-color: rgba(0, 0, 0, 0.72);
  -webkit-overflow-scrolling: touch;
}

.delete-users-modal__dialog {
  width: 100%;
  max-width: 28rem;
  max-height: min(90vh, 40rem);
  display: flex;
  flex-direction: column;
  background-color: var(--gp-card-solid);
  color: white;
  border: 1px solid rgb(30, 160, 95);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  font-family: 'OnestRegular', sans-serif;
}

.delete-users-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--gp-line);
  flex-shrink: 0;
}

.delete-users-modal__header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.delete-users-modal__close {
  background: transparent !important;
  border: none;
  color: #aaa;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0 0.25rem !important;
  cursor: pointer;
  flex-shrink: 0;
}

.delete-users-modal__close:hover {
  color: white;
}

.delete-users-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.delete-users-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--gp-line);
  flex-shrink: 0;
}

.delete-users-modal__footer button,
.delete-users__actions button {
  padding: 0.55rem 0.9rem;
  font-size: 14px;
  background-color: var(--gp-secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.delete-users__toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  flex-shrink: 0;
}

.delete-users__search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  font-size: 16px;
  border: 1px solid var(--gp-primary);
  border-radius: 5px;
  background-color: var(--gp-secondary);
  color: white;
}

.delete-users__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.delete-users__actions button {
  flex: 1 1 auto;
  min-width: 7rem;
}

.delete-users__meta {
  font-size: 13px;
  opacity: 0.9;
  flex-shrink: 0;
}

.delete-users__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 8rem;
  max-height: none;
  overflow-y: auto;
  width: 100%;
  border: 1px solid var(--gp-thead);
  border-radius: 5px;
  -webkit-overflow-scrolling: touch;
}

.delete-users__item {
  margin: 0;
  border-bottom: 1px solid rgb(25, 130, 78);
}

.delete-users__item:last-child {
  border-bottom: none;
}

.delete-users__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  font-size: 14px;
  min-height: 2.75rem;
  box-sizing: border-box;
}

.delete-users__label--locked {
  cursor: default;
  opacity: 0.65;
}

.delete-users__checkbox {
  margin: 0;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
}

.delete-users__name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.delete-users__badge {
  font-size: 11px;
  color: #9ddbbc;
  white-space: nowrap;
}

.delete-users__badge--sub {
  color: #c8c070;
}

#delete_users_btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .delete-users-modal {
    padding: 0;
    align-items: stretch;
  }

  .delete-users-modal__dialog {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border: none;
  }

  .delete-users-modal__footer {
    justify-content: stretch;
  }

  .delete-users-modal__footer button {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .user-admin-toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .filter-form {
    margin-left: 0;
  }

  .filter-form__preset-field,
  .filter-form__sort-field {
    flex-wrap: wrap;
  }

  .filter-form__date-row {
    flex: 1 1 100%;
    width: 100%;
  }

  .filter-form__date-row .filter-form__date-field {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .filter-form__dropdown-row {
    flex: 1 1 100%;
    width: 100%;
  }

  .filter-form__dropdown-row .filter-form__dropdown-wrap {
    flex: 1 1 0;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  body {
    padding: 6px;
  }

  .app-masthead {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 2px 6px;
    gap: 6px;
    font-size: 1.1rem;
  }

  .app-masthead__brand {
    gap: 6px;
  }

  .app-masthead__end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
  }

  .app-masthead__end .app-settings {
    display: none !important;
  }

  .filter-form__redirect-buttons {
    display: none;
  }

  .app-masthead__name {
    letter-spacing: 0.18em;
  }

  .main-table {
    font-size: 11px;
    min-width: 600px;
  }

  .main-table th,
  .main-table td {
    padding: 6px 4px;
    font-size: 10px;
  }

  .main-table th {
    font-size: 9px;
    padding: 5px 3px;
  }

  .filter-form {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    align-content: stretch;
    gap: 8px;
    margin-left: 0;
    margin-bottom: 10px;
    max-width: 100%;
    width: 100%;
    padding-right: 0;
    font-size: 10px;
  }

  .filter-form__primary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .filter-form__sort-stack {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .filter-form input[type="date"] {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
  }

  .filter-form__preset-field,
  .filter-form__date-row,
  .filter-form__dropdown-row,
  .filter-form__date-field,
  .filter-form__sort-field,
  .filter-form__sort-stack,
  .filter-form__sort-actions,
  .filter-form__actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

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

  .filter-form label {
    font-size: 10px;
  }

  .filter-form input[type="date"],
  .filter-form select {
    font-size: 10px;
    padding: 3px 5px;
    border-radius: 4px;
  }

  .filter-form__action-button,
  .filter-form__redirect-buttons__button {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
  }

  .filter-form .dropdown-content label {
    font-size: 10px;
    padding: 4px 8px;
  }

  .filter-form .channel-dropdown-search-wrap {
    padding: 5px;
  }

  .filter-form .channel-dropdown-search {
    padding: 4px 6px;
    font-size: 10px;
  }

  .filter-form__date-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .filter-form__date-row .filter-form__date-field {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .filter-form__dropdown-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 8px;
  }

  .filter-form__dropdown-row .filter-form__dropdown-wrap {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  .filter-form__dropdown-row .dropdown {
    width: 100%;
    max-width: 100%;
  }

  .filter-form__sort-field,
  .filter-form__preset-field {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
  }

  .filter-form__preset-field select,
  .filter-form__sort-field select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  .filter-form .dropdown button {
    width: 100%;
    box-sizing: border-box;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
  }

  .filter-form__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .filter-form__actions .filter-form__action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
  }

  .filter-form__redirect-buttons__button {
    flex: 1 1 auto;
    text-align: center;
    min-width: 0;
  }

  .filter-form .dropdown-content:not(.dropdown-content--channels) {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
    min-width: 0;
  }

  .filter-form .dropdown-content.dropdown-content--channels {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    max-width: 100%;
  }
}

.ads-import,
.ads-history {
  width: 100%;
  max-width: 52rem;
  margin: 0 auto 2rem;
  color: #fff;
  font-family: 'OnestRegular';
}

.ads-import h3,
.ads-history h3 {
  margin: 0 0 0.75rem;
}

.ads-import__hint,
.ads-import__summary p {
  margin: 0.4rem 0;
}

.ads-toolbar,
.ads-import__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  margin: 0.75rem 0;
  width: 100%;
  box-sizing: border-box;
}

.ads-import__file {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 2px 0 0;
  box-sizing: border-box;
}

.ads-import__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ads-import__file-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  color: #fff;
  background-color: var(--gp-secondary);
  border: 1px solid var(--gp-border);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.ads-import__file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #b3ffd9;
}

.ads-toolbar__field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  margin: 0;
  font-size: 12px;
  color: #b3ffd9;
  box-sizing: border-box;
}

.ads-toolbar__field span {
  flex: 0 0 auto;
}

.ads-toolbar__btn,
.settings-apply-btn {
  flex: 0 0 auto;
}

.ads-toolbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9.5rem;
  min-width: 9.5rem;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

.settings-apply-btn {
  margin-left: auto;
}

#percentage_form {
  align-items: stretch;
}

.settings-apply-btn {
  align-self: flex-end;
}

.settings-admin-main #user_form {
  align-items: stretch;
  width: 100%;
}

#user_info_container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.user-show-web,
.user-password {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.user-show-web .font-11,
.user-password .font-11 {
  padding-left: 0 !important;
  padding-right: 8px !important;
  white-space: nowrap;
}

.user-password__value {
  color: #b3ffd9;
  font-size: 13px;
  word-break: break-all;
}

.user-password--edit input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0 8px;
  box-sizing: border-box;
}

.user-password--edit button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
}

.currency-form {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin-top: 0.75rem;
}

.settings-percent .currency-form {
  align-items: stretch;
}

.settings-percent .currency-form select,
.settings-percent .currency-form input {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0 8px;
  box-sizing: border-box;
}

.settings-percent .currency-form #currency_btn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
}

.settings-percent .ads-import,
.settings-percent .ads-history {
  margin-bottom: 1rem;
}

.settings-percent .ads-toolbar {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

@media (max-width: 640px) {
  .ads-toolbar {
    flex-wrap: wrap;
  }

  .ads-import__file {
    flex: 1 1 100%;
    width: 100%;
  }

  .ads-toolbar__field {
    flex: 1 1 calc(50% - 4px);
  }

  .ads-toolbar__btn {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .currency-form {
    flex-wrap: wrap;
  }

  .settings-percent .currency-form select,
  .settings-percent .currency-form input {
    flex: 1 1 calc(50% - 4px);
  }

  .settings-percent .currency-form #currency_btn {
    flex: 1 1 100%;
    width: 100%;
  }
}

.ads-history__range {
  font-size: 12px;
  color: #b3ffd9;
}

.ads-history__range input[type="date"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  font-size: 12px;
  color: #fff;
  background-color: var(--gp-input);
  border: 1px solid var(--gp-line);
  border-radius: 4px;
  box-sizing: border-box;
}

.ads-history__list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ads-history__empty {
  margin: 0;
  padding: 8px 2px;
  font-size: 12px;
  color: #b3ffd9;
}

.ads-history__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--gp-primary);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--gp-card-solid);
}

.ads-history__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: #fff;
}

.ads-history__date {
  font-weight: 700;
  color: #b3ffd9;
}

.ads-history__who {
  color: #b3ffd9;
  opacity: 0.85;
}

.ads-history__delete {
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.ads-import__error,
.ads-import__warn {
  color: #ffb4b4;
  font-weight: 600;
}

.ads-import__summary,
.ads-import__unmatched,
.ads-import__overlap {
  border: 1px solid var(--gp-primary);
  border-radius: 8px;
  padding: 12px;
  background: var(--gp-card-solid);
  margin: 12px 0;
}

.ads-unmatched-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.ads-unmatched-name {
  flex: 1 1 16rem;
}

body:has(.login-form) {
  padding: 0;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.page-card {
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.92) 0%, rgba(3, 13, 8, 0.96) 100%);
  box-shadow: var(--gp-shadow);
}

.dialogs-jump {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  padding: 14px 16px;
  text-decoration: none;
  color: #ddffee;
}
.dialogs-jump strong {
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dialogs-jump span {
  color: #b3ffd9;
  font-size: 13px;
  line-height: 1.4;
}
.dialogs-jump:hover {
  border-color: #8bfac3;
}

.filter-form.page-card {
  padding: 14px 16px;
  margin: 0 0 16px;
}

.table-card {
  overflow-x: auto;
}

.table-card .main-table {
  margin: 0;
}

.main-table th,
.main-table td {
  border-color: var(--gp-border);
}

.main-table thead th {
  color: var(--gp-brand);
  font-weight: 600;
}

.main-table tbody tr:hover td {
  background-color: rgba(92, 246, 169, 0.08);
}

.main-table tbody tr:hover td.cell-net-loss,
.main-table tbody tr:hover td.cell-channel-loss {
  background-color: rgba(163, 6, 6, 0.62);
}

.main-table tbody tr:hover td.cell-channel-gain {
  background-color: rgba(61, 255, 106, 0.32);
}

.main-table tbody tr:hover td.cell-cr-low,
.main-table tbody tr.row-unprofitable td.cell-cr-low,
.main-table tbody tr.row-unprofitable:hover td.cell-cr-low {
  background-color: rgba(163, 6, 6, 0.62);
}

.main-table tbody tr:hover td.cell-cr-mid,
.main-table tbody tr.row-unprofitable td.cell-cr-mid,
.main-table tbody tr.row-unprofitable:hover td.cell-cr-mid {
  background-color: rgba(196, 150, 20, 0.58);
}

.main-table tbody tr:hover td.cell-cr-high,
.main-table tbody tr.row-unprofitable td.cell-cr-high,
.main-table tbody tr.row-unprofitable:hover td.cell-cr-high {
  background-color: rgba(61, 255, 106, 0.32);
}

.main-table tfoot td {
  background-color: rgba(92, 246, 169, 0.12);
}

.main-table tfoot td.cell-net-loss,
.main-table tfoot td.cell-channel-loss {
  background-color: rgba(163, 6, 6, 0.5);
}

.main-table tfoot td.cell-channel-gain {
  background-color: rgba(61, 255, 106, 0.22);
}

.main-table tfoot td.cell-cr-high {
  background-color: rgba(61, 255, 106, 0.22);
}

textarea,
.filter-form input[type="date"],
.filter-form select,
.settings-percent select,
.settings-percent input,
.settings-data__form__input {
  border-radius: var(--gp-radius);
  background-color: var(--gp-input);
  border-color: var(--gp-input-border);
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--gp-primary);
  box-shadow: var(--gp-focus);
}

.filter-form__action-button,
.dropdown button {
  background-color: var(--gp-primary);
  border-radius: var(--gp-radius);
}

.filter-form__action-button:hover,
.dropdown button:hover {
  background-color: var(--gp-primary-hover);
}

.filter-form__redirect-buttons__button,
.gohome__button,
.settings-data__add-button,
.settings-percent button,
.login-form a,
.login-form .secondary-button {
  background-color: var(--gp-secondary);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
}

.filter-form__redirect-buttons__button:hover,
.gohome__button:hover,
.settings-tab:hover,
.app-logout:hover,
.app-settings:hover,
.ads-import__file:hover .ads-import__file-btn {
  background-color: var(--gp-secondary-hover);
}

.settings-topbar.page-card {
  margin-bottom: 16px;
  padding: 12px 16px;
}

#percentage_form {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.1rem 1.4rem;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.92) 0%, rgba(3, 13, 8, 0.96) 100%);
  box-shadow: var(--gp-shadow);
  box-sizing: border-box;
  align-items: stretch;
}

.settings-admin-main,
.settings-admin-aside {
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.92) 0%, rgba(3, 13, 8, 0.96) 100%);
  box-shadow: var(--gp-shadow);
  padding: 1rem 1.1rem 1.15rem;
  box-sizing: border-box;
}

.ads-import,
.ads-history,
.user-channel-fold,
.geo-channel-group,
.delete-users-modal__dialog,
.modal__content {
  border-color: var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: var(--gp-card-solid);
}

.dropdown-content {
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  background-color: var(--gp-card-solid);
  box-shadow: var(--gp-shadow);
}

.dropdown-content label:hover {
  background-color: var(--gp-secondary);
}

.channel-dropdown-search {
  border: 1px solid var(--gp-input-border);
  background-color: var(--gp-input);
  border-radius: var(--gp-radius);
}

.login-form--register .login-form__btn--enter {
  margin-top: 8px;
}

.login-form--register .login-form__alt {
  margin-top: 12px;
}



/* ТЗ: кнопка AI на главной — статичная радужная обводка (без анимации) */
.ai-glow {
  position: relative;
  border: 2px solid transparent !important;
  background:
    linear-gradient(var(--gp-secondary), var(--gp-secondary)) padding-box,
    linear-gradient(90deg, #ff4d4d, #ff9f43, #ffd93d, #8bfac3, #4d96ff, #59ffac, #ff4d4d) border-box !important;
  color: #fff !important;
  font-weight: 700;
}
.ai-glow:hover {
  background:
    linear-gradient(var(--gp-secondary-hover), var(--gp-secondary-hover)) padding-box,
    linear-gradient(90deg, #ff4d4d, #ff9f43, #ffd93d, #8bfac3, #4d96ff, #59ffac, #ff4d4d) border-box !important;
  color: #fff !important;
}

/* ============================================================
   🏦 Банки / Выводы — банк-панель (в стиле gypno)
   ============================================================ */
.bank-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  color: #fff;
  font-family: var(--gp-font);
}

.bank-card {
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.92) 0%, rgba(3, 13, 8, 0.96) 100%);
  box-shadow: var(--gp-shadow);
  padding: 1.1rem 1.25rem 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.bank-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--gp-line);
}

.bank-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gp-brand);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bank-card__sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gp-muted);
  opacity: 0.85;
}

/* --- формы --- */
.bank-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.75rem;
  width: 100%;
  margin-bottom: 0.9rem;
}

.bank-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 9rem;
  flex: 1 1 10rem;
}

.bank-field--sm {
  flex: 0 1 8rem;
  min-width: 7rem;
}

.bank-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gp-muted);
  opacity: 0.9;
}

.bank-field input,
.bank-field select {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  color: #fff;
  background-color: var(--gp-input);
  border: 1px solid var(--gp-primary);
  border-radius: 6px;
  box-sizing: border-box;
  width: 100%;
}

.bank-field input::placeholder {
  color: rgba(179, 255, 217, 0.45);
}

.bank-field input:focus,
.bank-field select:focus {
  border-color: #84fcc0;
  box-shadow: var(--gp-focus);
}

.bank-field select option {
  background-color: var(--gp-input);
  color: #fff;
}

/* --- кнопки --- */
.bank-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  background-color: var(--gp-secondary);
  border: 1px solid var(--gp-primary);
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bank-btn:hover {
  background-color: var(--gp-secondary-hover);
  border-color: #84fcc0;
}

.bank-btn--primary {
  background-color: var(--gp-primary);
  border-color: var(--gp-primary);
  font-weight: 600;
}

.bank-btn--primary:hover {
  background-color: var(--gp-primary-hover);
  border-color: #84fcc0;
}

.bank-btn--danger {
  background-color: rgba(163, 6, 6, 0.85);
  border-color: #c20a0a;
}

.bank-btn--danger:hover {
  background-color: #c20a0a;
  border-color: #ff6b6b;
}

.bank-btn--ghost {
  background-color: transparent;
  border-color: var(--gp-border);
}

.bank-btn--ghost:hover {
  border-color: #84fcc0;
  background-color: var(--gp-secondary);
}

.bank-btn--sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.bank-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- бейджи статусов --- */
.bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.bank-badge--ok {
  color: #b5fdd9;
  background: rgba(92, 246, 169, 0.18);
  border-color: rgba(92, 246, 169, 0.55);
}

.bank-badge--debt {
  color: #ffb35c;
  background: rgba(255, 159, 67, 0.12);
  border-color: rgba(255, 159, 67, 0.55);
}

.bank-badge--warn {
  color: #ffd93d;
  background: rgba(255, 217, 61, 0.1);
  border-color: rgba(255, 217, 61, 0.5);
}

.bank-badge--credit {
  color: #6fb6ff;
  background: rgba(77, 150, 255, 0.12);
  border-color: rgba(77, 150, 255, 0.5);
}

.bank-badge--off {
  color: #ff8f8f;
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.45);
}

.bank-badge--muted {
  color: var(--gp-muted);
  background: rgba(179, 255, 217, 0.08);
  border-color: var(--gp-border);
}

/* --- списки (профили, коды) --- */
.bank-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  padding: 0.65rem 0.85rem;
  background: var(--gp-card-solid);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
}

.bank-row__info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  min-width: 0;
  font-size: 13px;
}

.bank-row__name {
  font-weight: 700;
  color: var(--gp-brand);
}

.bank-row__meta {
  color: var(--gp-muted);
  opacity: 0.85;
  font-size: 12px;
}

.bank-row__geo-tags {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.bank-geo-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ddffee;
  background: rgba(92, 246, 169, 0.22);
  border: 1px solid rgba(92, 246, 169, 0.5);
  border-radius: 6px;
}

.bank-geo-tag--muted {
  color: var(--gp-muted);
  background: rgba(179, 255, 217, 0.07);
  border-color: var(--gp-border);
}

.bank-row__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.bank-code {
  font-family: "OnestRegular", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #84fcc0;
  background: rgba(8, 38, 23, 0.9);
  border: 1px dashed rgba(139, 250, 195, 0.45);
  border-radius: 6px;
  padding: 3px 10px;
  user-select: all;
}

/* --- таблицы --- */
.bank-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.35rem;
}

.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: #fff;
  font-family: var(--gp-font);
}

.bank-table thead th {
  background-color: var(--gp-thead);
  color: var(--gp-brand);
  font-weight: 700;
  text-align: left;
  padding: 7px 10px;
  border: 1px solid var(--gp-line);
  white-space: nowrap;
}

.bank-table tbody td {
  padding: 6px 10px;
  border: 1px solid var(--gp-line);
  vertical-align: top;
}

.bank-table tbody tr:nth-child(even) {
  background: rgba(92, 246, 169, 0.05);
}

.bank-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bank-empty {
  padding: 0.9rem 0.4rem;
  text-align: center;
  color: var(--gp-muted);
  opacity: 0.8;
  font-size: 13px;
}

.bank-note {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--gp-muted);
  opacity: 0.85;
  line-height: 1.45;
}

/* --- выход reconciliation --- */
.bank-recon-out {
  margin: 0.5rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--gp-input);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  font-family: "OnestRegular", ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #ddffee;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 26rem;
  overflow-y: auto;
}

.bank-recon-out .bank-recon-geo {
  color: #84fcc0;
  font-weight: 700;
}

.bank-recon-out .bank-recon-muted {
  color: var(--gp-muted);
  opacity: 0.8;
}

/* копирование кода — лёгкий фидбек */
.bank-copied {
  color: #84fcc0;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .bank-card {
    padding: 0.9rem 0.9rem 1rem;
  }

  .bank-form {
    flex-direction: column;
    align-items: stretch;
  }

  .bank-field {
    min-width: 0;
    flex: 1 1 auto;
  }

  .bank-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .bank-row__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* --- модалка подключения аккаунта ассистента --- */
.hidden {
  display: none !important;
}

.bank-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 8, 0.72);
  backdrop-filter: blur(3px);
  padding: 1rem;
}

.bank-modal__box {
  width: min(440px, 100%);
  background: var(--gp-card-solid, #0b2b1b);
  border: 1px solid var(--gp-border, rgba(92, 246, 169, 0.35));
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.bank-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--gp-border, rgba(92, 246, 169, 0.3));
}

.bank-modal__head h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--gp-text, #ecfcf4);
}

.bank-modal__close {
  background: none;
  border: none;
  color: var(--gp-muted, #8bb8a2);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

.bank-modal__close:hover {
  color: var(--gp-text, #ecfcf4);
  background: rgba(92, 246, 169, 0.15);
}

.bank-modal__body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bank-modal__body .bank-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  background: var(--gp-input-bg, #082617);
  border: 1px solid var(--gp-border, rgba(92, 246, 169, 0.35));
  border-radius: 10px;
  color: var(--gp-text, #ecfcf4);
  font-size: 0.95rem;
}

.bank-modal__body .bank-input:focus {
  outline: none;
  border-color: var(--gp-accent, #5cf6a9);
  box-shadow: 0 0 0 3px rgba(92, 246, 169, 0.18);
}

.bank-modal__body .bank-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.bank-error {
  color: #ff9d9d;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* --- селект привязки аккаунта к каналу ассистента --- */
.bank-select {
  padding: 0.35rem 0.5rem;
  background: var(--gp-input-bg, #082617);
  border: 1px solid var(--gp-border, rgba(92, 246, 169, 0.35));
  border-radius: 8px;
  color: var(--gp-text, #ecfcf4);
  font-size: 0.8rem;
  max-width: 190px;
  cursor: pointer;
}

.bank-select:focus {
  outline: none;
  border-color: var(--gp-accent, #5cf6a9);
}

/* ============================================================
   Пурпурная тема: анимированная кнопка AI + выдвижное меню + мобилка
   ============================================================ */

/* --- Кнопка AI: анимированная пурпурная обводка --- */
@property --ai-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.ai-glow {
  position: relative;
  z-index: 0;
  border: 2px solid transparent !important;
  background:
    linear-gradient(var(--gp-secondary), var(--gp-secondary)) padding-box,
    conic-gradient(from var(--ai-angle, 0deg),
      #8bfac3, #28d981, #48ec9a, #8bfac3, #3aed94, #84fcc0, #8bfac3) border-box !important;
  color: #fff !important;
  font-weight: 700;
  animation: aiGlowSpin 5s linear infinite, aiGlowPulse 2.6s ease-in-out infinite;
}
.ai-glow:hover {
  background:
    linear-gradient(var(--gp-secondary-hover), var(--gp-secondary-hover)) padding-box,
    conic-gradient(from var(--ai-angle, 0deg),
      #b5fdd9, #3aed94, #72f4b3, #b5fdd9, #5cf6a9, #b4fed9, #b5fdd9) border-box !important;
}
@keyframes aiGlowSpin { to { --ai-angle: 360deg; } }
@keyframes aiGlowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(92, 246, 169, 0.45), 0 0 12px rgba(92, 246, 169, 0.18); }
  50% { box-shadow: 0 0 14px rgba(92, 246, 169, 0.9), 0 0 30px rgba(58, 237, 148, 0.45); }
}

/* --- Главная: аккуратные кнопки --- */
.filter-form__action-button {
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #2f9a68, #1f8a58);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(31, 138, 88, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}
.filter-form__action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(31, 138, 88, 0.35);
  filter: brightness(1.04);
}
.filter-form__action-button:active { transform: translateY(0); }

/* ROMA toggle: активное состояние кнопки */
.filter-form__action-button.is-on {
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45);
    opacity: 0.92;
}

#channel_selector_btn,
#geo_selector_btn,
.filter-form__sort-field select,
.filter-form__preset-field select,
.filter-form__date-field input[type="date"] {
  background: var(--gp-input);
  border: 1px solid var(--gp-input-border);
  color: var(--gp-text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#channel_selector_btn:hover,
#geo_selector_btn:hover,
.filter-form__sort-field select:hover,
.filter-form__preset-field select:hover {
  border-color: var(--gp-primary);
  box-shadow: 0 0 0 3px rgba(92, 246, 169, 0.18);
}
.app-masthead__end .app-settings {
  border-radius: 10px;
  font-weight: 600;
}
.app-masthead__end .app-settings:last-child {
  color: #ffb3b3;
  border-color: rgba(255, 107, 107, 0.4);
}
.app-masthead__end .app-settings:last-child:hover {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.65);
}

/* ===========================================================================
   Выдвижное меню (гамбургер) — одинаково работает на мобильном и десктопе.
   Палитра строго из токенов :root (тёмно-зелёная гамма GYPNO).
   =========================================================================== */
.gp-drawer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gp-border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 51, 35, 0.9), rgba(8, 38, 23, 0.9));
  color: var(--gp-brand);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease,
    transform 0.16s ease;
}
.gp-drawer-btn:hover {
  border-color: var(--gp-primary);
  background: var(--gp-secondary-hover);
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.16);
}
.gp-drawer-btn:active { transform: scale(0.95); }
.gp-drawer-btn:focus-visible {
  outline: none;
  border-color: var(--gp-input-border);
  box-shadow: var(--gp-focus);
}

.gp-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(1, 8, 5, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.gp-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.gp-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: min(312px, 86vw);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(31, 148, 90, 0.16) 0%, transparent 62%),
    linear-gradient(180deg, #0b2b1b 0%, #061c11 62%, #030d08 100%);
  border-right: 1px solid var(--gp-border);
  box-shadow: 26px 0 70px rgba(0, 0, 0, 0.6), inset -1px 0 0 rgba(31, 148, 90, 0.16);
  transform: translateX(-105%);
  transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.32, 1);
  overflow: hidden;
  padding: 0;
  font-family: var(--gp-font);
}
.gp-drawer.is-open { transform: translateX(0); }

/* --- шапка меню --- */
.gp-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex: 0 0 auto;
  padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(31, 148, 90, 0.22);
}
.gp-drawer__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.gp-drawer__logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex: 0 0 auto;
}
.gp-drawer__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.gp-drawer__brand-text strong {
  color: var(--gp-brand);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.gp-drawer__brand-text small {
  color: var(--gp-muted);
  font-size: 0.7rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
}
.gp-drawer__head strong { color: var(--gp-text); font-size: 1.02rem; }

.gp-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: none;
  border: 1px solid transparent;
  color: var(--gp-muted);
  line-height: 1;
  cursor: pointer;
  border-radius: 9px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.gp-drawer__close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}
.gp-drawer__close:hover {
  color: var(--gp-text);
  background: var(--gp-secondary);
  border-color: var(--gp-border);
}
.gp-drawer__close:focus-visible { outline: none; box-shadow: var(--gp-focus); }

/* --- прокручиваемое тело --- */
.gp-drawer__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.7rem 0.6rem 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 148, 90, 0.45) transparent;
}
.gp-drawer__scroll::-webkit-scrollbar { width: 5px; }
.gp-drawer__scroll::-webkit-scrollbar-thumb {
  background: rgba(31, 148, 90, 0.4);
  border-radius: 4px;
}

.gp-drawer__group { margin-bottom: 0.75rem; }
.gp-drawer__group:last-child { margin-bottom: 0; }
.gp-drawer__label {
  padding: 0 0.55rem 0.32rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gp-muted);
  opacity: 0.55;
}

/* --- пункт меню --- */
.gp-drawer__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.52rem 0.6rem;
  margin-bottom: 0.15rem;
  color: var(--gp-text);
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.25;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.gp-drawer__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 0 2px 2px 0;
  background: var(--gp-input-border);
  transform: translateY(-50%);
  transition: height 0.18s ease;
}
.gp-drawer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(31, 148, 90, 0.12);
  border: 1px solid rgba(31, 148, 90, 0.2);
  color: var(--gp-muted);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.gp-drawer__icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gp-drawer__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gp-drawer__ext {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--gp-muted);
  opacity: 0.45;
}

.gp-drawer__item:hover {
  background: rgba(31, 148, 90, 0.11);
  border-color: rgba(31, 148, 90, 0.26);
}
.gp-drawer__item:hover .gp-drawer__icon {
  background: rgba(31, 148, 90, 0.2);
  border-color: rgba(31, 148, 90, 0.4);
  color: var(--gp-brand);
}
.gp-drawer__item:focus-visible { outline: none; box-shadow: var(--gp-focus); }

.gp-drawer__item.is-on {
  background: linear-gradient(90deg, rgba(31, 148, 90, 0.26) 0%, rgba(31, 148, 90, 0.08) 100%);
  border-color: rgba(33, 182, 108, 0.45);
  color: var(--gp-brand);
  font-weight: 600;
}
.gp-drawer__item.is-on::before { height: 60%; }
.gp-drawer__item.is-on .gp-drawer__icon {
  background: rgba(33, 182, 108, 0.26);
  border-color: rgba(33, 182, 108, 0.5);
  color: var(--gp-brand);
}

.gp-drawer__item--ai .gp-drawer__icon {
  background: rgba(132, 252, 192, 0.14);
  border-color: rgba(132, 252, 192, 0.28);
  color: #84fcc0;
}

/* --- подвал: выход --- */
.gp-drawer__foot {
  flex: 0 0 auto;
  padding: 0.5rem 0.6rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(31, 148, 90, 0.2);
}
.gp-drawer__item--muted {
  color: #ffbcbc;
  margin-bottom: 0;
}
.gp-drawer__item--muted .gp-drawer__icon {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.24);
  color: #ffbcbc;
}
.gp-drawer__item--muted:hover {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.42);
}
.gp-drawer__item--muted:hover .gp-drawer__icon {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffd4d4;
}

/* Фон не прокручивается, пока меню открыто. */
body.gp-drawer-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .gp-drawer,
  .gp-drawer-overlay,
  .gp-drawer__item,
  .gp-drawer__item::before { transition: none; }
}

/* --- Подтверждение опасных кнопок (2 шага) --- */
.bank-btn.is-armed {
  background: #b91c1c !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  animation: armedBlink 1.1s ease-in-out infinite;
}
@keyframes armedBlink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.22); }
}

/* --- Мобильная адаптация: главная таблица и фильтры --- */
@media (max-width: 768px) {
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .main-table { min-width: 860px; }
  .filter-form__primary { flex-direction: column; align-items: stretch; }
  .filter-form__date-row { flex-wrap: wrap; }
  .filter-form__dropdown-row { flex-wrap: wrap; }
  .filter-form__sort-actions { flex-wrap: wrap; }
  .filter-form__actions { width: 100%; justify-content: stretch; }
  .filter-form__actions .filter-form__action-button { flex: 1 1 auto; text-align: center; }
  .app-masthead { flex-wrap: wrap; gap: 0.5rem; }
}

/* --- Мобильная адаптация: банк/настройки/ai --- */
@media (max-width: 640px) {
  .bank-form__actions { width: 100%; }
  .bank-modal__box { width: 100%; }
  .bank-select { max-width: 100%; width: 100%; }
  .bank-row__actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .settings-topbar { flex-wrap: wrap; gap: 0.6rem; }
  .settings-topbar__start { flex-wrap: wrap; }
  .bank-form .bank-field { flex: 1 1 100%; }
}

/* --- Главная: шапка — бренд слева, AI/Настройки/Выход справа в одну строку --- */
@media (min-width: 769px) {
  /* Десктоп: выдвижное меню не нужно — разделы стоят кнопками в одну линию
     с вкладками (.settings-ailinks). Меню остаётся мобильным. */
  .gp-mast-drawer-btn { display: none; }

  .app-masthead {
    margin-bottom: 12px;
    padding: 2px 0;
    gap: 6px;
    font-size: 1.1rem;
  }

  .app-masthead__end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .app-logout,
  .app-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    height: auto;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
    color: #fff;
    text-decoration: none;
    background-color: var(--gp-secondary);
    border: 1px solid var(--gp-border);
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
  }
}
@media (max-width: 768px) {
  .filter-form__redirect-buttons { display: none !important; }
}

/* --- Настройки: на мобильных табы заменяются выдвижным меню --- */
@media (max-width: 768px) {
  .settings-selector { display: none !important; }
}
@media (min-width: 769px) {
  .settings-drawer-btn { display: none !important; }
}


/* ===========================================================================
   UI-АПГРЕЙД 2026-09-11 — общий аудит панели.
   Задачи: единая высота контролов, аккуратные вложенные карточки («окна
   внутри окон»), нормальные модалки со скроллом, тот же тёмно-зелёный
   бренд-цвет из :root. Секция идёт последней — правит только оформление.
   =========================================================================== */

:root {
  /* Единая сетка размеров контролов, чтобы кнопки/инпуты/табы совпадали. */
  --gp-control-h: 34px;
  --gp-control-h-sm: 28px;
  --gp-control-px: 14px;
  --gp-radius-sm: 8px;
  --gp-ease: cubic-bezier(0.22, 0.9, 0.32, 1);
}

/* --- 1. Контролы одной высоты ------------------------------------------- */
.gohome__button,
.settings-tab,
.settings-data__add-button,
.filter-form__action-button,
.filter-form__redirect-buttons__button,
.delete-users-modal__footer button,
.delete-users__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* .app-settings / .app-logout намеренно без display — их показ/скрытие
   по ширине экрана остаётся на прежних media-правилах шапки. */
.gohome__button,
.settings-tab,
.app-settings,
.app-logout,
.settings-data__add-button,
.filter-form__action-button,
.filter-form__redirect-buttons__button,
.delete-users-modal__footer button,
.delete-users__actions button {
  align-items: center;
  justify-content: center;
  min-height: var(--gp-control-h);
  padding: 0 var(--gp-control-px);
  font-family: var(--gp-font);
  font-size: 13px;
  line-height: 1.2;
  border-radius: var(--gp-radius-sm);
  box-sizing: border-box;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
}

.gohome__button:active,
.settings-tab:active,
.app-settings:active,
.bank-btn:active,
.filter-form__action-button:active,
.delete-users-modal__footer button:active {
  transform: translateY(1px);
}

/* Видимый фокус с клавиатуры — раньше его не было нигде. */
.gohome__button:focus-visible,
.settings-tab:focus-visible,
.app-settings:focus-visible,
.bank-btn:focus-visible,
.bank-modal__close:focus-visible,
.filter-form__action-button:focus-visible,
.dropdown button:focus-visible,
.delete-users-modal__footer button:focus-visible {
  outline: none;
  box-shadow: var(--gp-focus);
  border-color: var(--gp-input-border);
}

.settings-tab {
  border-radius: var(--gp-radius-sm);
  border-color: var(--gp-border);
  background: linear-gradient(180deg, rgba(18, 51, 35, 0.85), rgba(8, 38, 23, 0.85));
}
.settings-tab.selected {
  background: linear-gradient(180deg, var(--gp-primary), #197a4a);
  border-color: #84fcc0;
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.16);
}

.gp-drawer-btn { height: var(--gp-control-h); width: var(--gp-control-h); }

/* Кнопки в карточках: чуть компактнее, но с сохранением зоны нажатия. */
.bank-btn {
  height: var(--gp-control-h);
  padding: 0 var(--gp-control-px);
  border-radius: var(--gp-radius-sm);
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
}
.bank-btn--sm { height: var(--gp-control-h-sm); padding: 0 10px; border-radius: 7px; }
.bank-btn--primary { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset; }
.bank-btn:disabled { opacity: 0.45; transform: none; }

.bank-field input,
.bank-field select {
  height: var(--gp-control-h);
  border-radius: var(--gp-radius-sm);
  border-color: var(--gp-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bank-field input:hover,
.bank-field select:hover { border-color: rgba(33, 182, 108, 0.6); }

/* Ряд действий не слипается и переносится вместо горизонтального скролла. */
.bank-row__actions,
.bank-form__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* --- 2. Окна внутри окон ------------------------------------------------- */
/* Вложенная карточка не повторяет тень и толстый бордер родителя —
   иначе получается «рамка в рамке» и визуальный шум. */
.bank-card .bank-card,
.page-card .bank-card,
.bank-modal__box .bank-card,
.delete-users-modal__dialog .bank-card {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(31, 148, 90, 0.22);
  border-radius: 12px;
  box-shadow: none;
  padding: 0.85rem 0.95rem 0.95rem;
}
.bank-card .bank-card__head,
.page-card .bank-card .bank-card__head {
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom-color: rgba(31, 148, 90, 0.2);
}
.bank-card .bank-card .bank-card__title { font-size: 0.94rem; }

/* Секции внутри карточки (details/сводки) — та же «вторая ступень». */
.wa-advanced,
.wa-webhook,
.wa-kv {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(31, 148, 90, 0.14);
}
.wa-advanced { padding: 0.7rem 0.8rem; }

.bank-panel { display: flex; flex-direction: column; gap: 1rem; }

/* --- 3. Модальные окна --------------------------------------------------- */
.bank-modal { z-index: 1300; padding: 1rem; }
.bank-modal:not(.hidden) { animation: gpFade 0.18s ease both; }

.bank-modal__box {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 46rem);
  border-radius: var(--gp-radius-lg);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(31, 148, 90, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, #0d2a1b 0%, #061c11 100%);
  border-color: rgba(33, 182, 108, 0.34);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(31, 148, 90, 0.1);
  animation: gpRise 0.22s var(--gp-ease) both;
}

.bank-modal__head {
  flex: 0 0 auto;
  padding: 0.8rem 1rem;
  border-bottom-color: rgba(31, 148, 90, 0.22);
}
.bank-modal__head h3 { font-size: 0.98rem; font-weight: 600; color: var(--gp-brand); }

/* Тело модалки прокручивается само — раньше overflow:hidden на боксе резал
   длинные формы (например «Подключение WhatsApp Cloud API»). */
.bank-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.95rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 148, 90, 0.45) transparent;
}
.bank-modal__body::-webkit-scrollbar { width: 5px; }
.bank-modal__body::-webkit-scrollbar-thumb {
  background: rgba(31, 148, 90, 0.4);
  border-radius: 4px;
}
.bank-modal__body .bank-input { border-radius: var(--gp-radius-sm); }

.bank-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  border: 1px solid transparent;
  border-radius: 9px;
}
.bank-modal__close:hover { border-color: var(--gp-border); }

/* Кнопки в подвале модалки — одна строка справа, но переносятся на узком. */
.bank-modal__body .bank-form__actions { gap: 0.5rem; flex-wrap: wrap; }

/* Модалка удаления аккаунтов — тот же язык. */
.delete-users-modal { z-index: 1300; }
.delete-users-modal__dialog {
  border-radius: var(--gp-radius-lg);
  border-color: rgba(33, 182, 108, 0.34);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(31, 148, 90, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, #0d2a1b 0%, #061c11 100%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.62);
  animation: gpRise 0.22s var(--gp-ease) both;
}
.delete-users-modal__header h3 { color: var(--gp-brand); font-size: 0.98rem; }
.delete-users-modal__close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border-radius: 9px;
}
.delete-users-modal__footer button { border: 1px solid var(--gp-border); }
.delete-users-modal__footer .btn-red { border-color: rgba(255, 107, 107, 0.5); }

@keyframes gpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gpRise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* --- 4. Шапка и топбар --------------------------------------------------- */
.app-masthead__end { gap: 8px; }
.app-masthead__end .app-settings { border-radius: var(--gp-radius-sm); }
.app-masthead__end .ai-glow { font-weight: 600; letter-spacing: 0.04em; }

.settings-topbar.page-card {
  padding: 10px 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.settings-topbar__start { gap: 10px; flex-wrap: wrap; }

/* --- 5. Мобильные уточнения --------------------------------------------- */
@media (max-width: 640px) {
  :root { --gp-control-h: 38px; --gp-control-h-sm: 32px; }

  /* Модалка ведёт себя как нижний лист — привычнее на телефоне. */
  .bank-modal { padding: 0; align-items: flex-end; }
  .bank-modal__box {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    border-radius: var(--gp-radius-lg) var(--gp-radius-lg) 0 0;
    border-bottom: none;
    animation: gpSheet 0.24s var(--gp-ease) both;
  }
  .bank-modal__body { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .bank-modal__body .bank-form__actions .bank-btn { flex: 1 1 auto; }

  .delete-users-modal { padding: 0; align-items: flex-end; }
  .delete-users-modal__dialog {
    max-width: none;
    max-height: 92dvh;
    border-radius: var(--gp-radius-lg) var(--gp-radius-lg) 0 0;
    animation: gpSheet 0.24s var(--gp-ease) both;
  }
  .delete-users-modal__footer { padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)); }
  .delete-users-modal__footer button { flex: 1 1 auto; }
}

@keyframes gpSheet {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bank-modal__box,
  .delete-users-modal__dialog,
  .bank-modal:not(.hidden) { animation: none; }
  .gohome__button,
  .settings-tab,
  .app-settings,
  .bank-btn { transition: none; }
}


/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 2 (2026-09-11, по правкам владельца).
   =========================================================================== */

/* --- Временно скрытые элементы (Банки) ---------------------------------- */
/* Остаются в DOM: selectSettingsTab адресует вкладки по индексу детей. */
.settings-tab--hidden { display: none !important; }

/* --- Разделы AI кнопками в линию с вкладками (только десктоп) ------------ */
.settings-ailinks {
  display: none;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid rgba(31, 148, 90, 0.28);
}
@media (min-width: 769px) {
  .settings-ailinks { display: inline-flex; flex-wrap: wrap; }
}

.settings-ailink {
  display: inline-flex;
  align-items: center;
  min-height: var(--gp-control-h);
  padding: 0 var(--gp-control-px);
  font-family: var(--gp-font);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--gp-brand);
  border: 1px solid rgba(132, 252, 192, 0.26);
  border-radius: var(--gp-radius-sm);
  background: linear-gradient(180deg, rgba(31, 148, 90, 0.2), rgba(31, 148, 90, 0.07));
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease,
    transform 0.12s ease;
}
.settings-ailink:hover {
  border-color: #84fcc0;
  background: linear-gradient(180deg, rgba(31, 148, 90, 0.34), rgba(31, 148, 90, 0.14));
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.14);
}
.settings-ailink:active { transform: translateY(1px); }
.settings-ailink:focus-visible { outline: none; box-shadow: var(--gp-focus); }

/* --- Каналы: списки по центру, ввод и поиск слева, «Применить» по центру -- */
#percentage_form .channel-add-row {
  align-self: flex-start;
  margin-bottom: 0.5rem;
}
#percentage_form .channel-search-row {
  width: 100%;
  max-width: 24rem;
  margin-bottom: 0.6rem;
  align-self: flex-start;
}
#percentage_form .telegram-hint { align-self: stretch; }

#percentage_form .geo-channel-groups {
  align-self: center;
  margin-inline: auto;
}

#percentage_form .settings-apply-btn {
  align-self: center;
  margin-left: 0;
  margin-right: 0;
  min-width: 220px;
  justify-content: center;
}
#percentage_form #success-text,
#percentage_form #failure-text {
  align-self: center;
  text-align: center;
}

@media (max-width: 640px) {
  #percentage_form .channel-add-row,
  #percentage_form .channel-search-row { max-width: 100%; }
}


/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 3 (2026-09-11).
   Шапка страницы «AI · Подключения»: логотип, название и раздел в одну строку.
   =========================================================================== */
.app-masthead__brand {
  min-width: 0;
  flex-wrap: wrap;
}

.app-masthead__sep {
  width: 1px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0 4px;
  background: linear-gradient(180deg, transparent, rgba(31, 148, 90, 0.55), transparent);
}

.app-masthead__section {
  font-family: var(--gp-font);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gp-muted);
  white-space: nowrap;
}

.ai-page-sub {
  width: 100%;
  max-width: 1280px;
  margin: -6px auto 16px;
  padding: 0 16px;
}

@media (max-width: 640px) {
  .app-masthead__sep { display: none; }
  .app-masthead__section { font-size: 0.82rem; }
}


/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 4 (2026-09-13).
   Выдвижное меню убрано совсем — на телефоне оно ломалось и подтягивало
   старые страницы. Вместо него: шестерёнка на главной, квадратный домик в
   разделах и все разделы кнопками в один ряд.
   =========================================================================== */

/* --- квадратные кнопки-иконки (шестерёнка, домик) --- */
.app-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--gp-control-h);
  height: var(--gp-control-h);
  flex: 0 0 auto;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background: linear-gradient(180deg, rgba(18, 51, 35, 0.9), rgba(8, 38, 23, 0.9));
  color: var(--gp-brand);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease,
    transform .12s ease;
}
.app-iconbtn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-iconbtn:hover {
  border-color: var(--gp-primary);
  background: var(--gp-secondary-hover);
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.16);
}
.app-iconbtn:active { transform: translateY(1px); }
.app-iconbtn:focus-visible { outline: none; box-shadow: var(--gp-focus); }
/* Шестерёнка — единственный вход в настройки с телефона, показываем всегда */
.app-masthead__end .app-iconbtn { display: inline-flex !important; }

/* --- разделы одним рядом, в том числе на телефоне --- */
.settings-topbar__start { flex-wrap: wrap; row-gap: 8px; }
.settings-selector { display: flex !important; flex-wrap: wrap; }
.settings-ailinks {
  display: inline-flex !important;
  flex-wrap: wrap;
  border-left: 1px solid rgba(31, 148, 90, 0.28);
}

/* --- УБТ: компактная, цвет по состоянию --- */
/* is-on ставится, когда строки ROMA СКРЫТЫ, поэтому жёлтый — именно на нём. */
#roma-toggle,
#ai-toggle {
  min-height: 26px !important;
  height: 26px;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 7px !important;
  border: 1px solid rgba(31, 148, 90, 0.5) !important;
  background: linear-gradient(180deg, #1f945a, #177546) !important;
  color: #eafff4 !important;
}
#roma-toggle:hover, #ai-toggle:hover { border-color: #84fcc0 !important; }
#roma-toggle.is-on, #ai-toggle.is-on {
  background: linear-gradient(180deg, #d3a017, #a87c0c) !important;
  border-color: rgba(255, 214, 102, 0.6) !important;
  color: #fffaf0 !important;
}

/* --- период: обе даты в одной компактной ячейке --- */
.filter-form__date-row {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px 4px;
  border: 1px solid var(--gp-border);
  border-radius: 10px;
  background: rgba(8, 38, 23, 0.55);
  flex-wrap: nowrap;
}
.filter-form__date-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}
.filter-form__date-field label {
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gp-muted);
  opacity: .75;
  padding-left: 6px;
}
.filter-form__date-row input[type="date"] {
  height: 28px;
  padding: 0 6px;
  font-size: 12.5px;
  border: none !important;
  background: transparent !important;
  color: var(--gp-text);
  border-radius: 7px;
  min-width: 0;
  width: auto;
}
.filter-form__date-row input[type="date"]:hover { background: rgba(31, 148, 90, 0.12) !important; }
.filter-form__date-row input[type="date"]:focus {
  background: rgba(31, 148, 90, 0.16) !important;
  box-shadow: none;
  outline: none;
}
/* разделитель между «от» и «до» */
.filter-form__date-field + .filter-form__date-field::before {
  content: "";
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: rgba(31, 148, 90, 0.35);
}
::-webkit-calendar-picker-indicator { filter: invert(76%) sepia(24%) saturate(600%) hue-rotate(88deg); cursor: pointer; }

/* ===========================================================================
   Телефон: органы управления компактнее — они занимали пол-экрана.
   =========================================================================== */
@media (max-width: 768px) {
  :root { --gp-control-h: 32px; --gp-control-h-sm: 27px; --gp-control-px: 11px; }

  .filter-form.page-card { padding: 10px 10px; }
  .filter-form__actions { gap: 6px; }
  .filter-form__action-button,
  .dropdown button,
  .filter-form__sort-field select,
  .filter-form__preset-field select {
    min-height: 32px !important;
    height: 32px;
    padding: 0 10px !important;
    font-size: 12.5px !important;
  }
  .settings-tab,
  .settings-ailink,
  .gohome__button,
  .settings-data__add-button,
  .bank-btn { min-height: 30px !important; font-size: 12px !important; padding: 0 10px !important; }
  .bank-btn--sm { min-height: 26px !important; font-size: 11.5px !important; }
  .app-iconbtn { width: 32px; height: 32px; }
  .app-iconbtn svg { width: 15px; height: 15px; }

  /* период на телефоне — та же одна ячейка, во всю ширину */
  .filter-form__date-row { width: 100%; justify-content: space-between; }
  .filter-form__date-row input[type="date"] { flex: 1 1 0; width: 100%; }
  .filter-form__date-field { flex: 1 1 0; }

  .settings-topbar.page-card { padding: 8px 10px; gap: 8px; }
  .settings-ailinks { padding-left: 8px; }
  .bank-card { padding: 12px !important; }
  .bank-card__title { font-size: .95rem; }
}

@media (max-width: 420px) {
  .filter-form__date-field label { display: none; }
  .settings-ailinks { border-left: none; padding-left: 0; }
}


/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 5 (2026-09-13).
   =========================================================================== */

/* --- iOS зумит страницу при фокусе в поле со шрифтом меньше 16px. Это и
   давало «масштаб» при нажатии на «Канал»: фокус уходил в поиск по списку.
   Лечим размером шрифта, а не запретом масштабирования — запрет отнимал бы
   у людей возможность увеличить страницу вообще. --- */
@media (max-width: 900px) {
  input[type="text"], input[type="search"], input[type="password"],
  input[type="url"], input[type="number"], input[type="date"],
  select, textarea,
  .channel-dropdown-search, .perc-input, .telegram-input, .bank-input { font-size: 16px !important; }
}
.channel-dropdown-search {
  font-size: 14px;
  height: 32px;
  border: 1px solid var(--gp-border) !important;
  border-radius: 8px !important;
}
.channel-dropdown-search:focus { border-color: var(--gp-primary) !important; box-shadow: var(--gp-focus); }

/* --- УБТ, Сбросить, Применить — одной строкой, без переносов --- */
.filter-form__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.filter-form__actions .filter-form__action-button { flex: 0 0 auto; }
#roma-toggle, #ai-toggle { order: -1; }

/* --- галочки: свои, вместо системных серых квадратов --- */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(31, 148, 90, 0.5);
  border-radius: 5px;
  background: rgba(8, 38, 23, 0.85);
  cursor: pointer;
  position: relative;
  vertical-align: -3px;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: #84fcc0; }
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: linear-gradient(180deg, #2baa6b, #1a7d4c);
  border-color: #84fcc0;
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #eafff4;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #eafff4;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.25);
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }

/* строки списка каналов — кликабельные целиком, с подсветкой */
.channel-option, .delete-users__label, .user-channel-fold__list label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .13s ease;
}
.channel-option:hover, .delete-users__label:hover, .user-channel-fold__list label:hover {
  background: rgba(31, 148, 90, 0.12);
}
.channel-option input[style] { margin-right: 0 !important; }

/* выпадающий список каналов — аккуратнее */
.dropdown-content--channels { border-radius: 12px; overflow: hidden; }
.channel-options-list { padding: 4px; }


/* --- Врезки разделов ассистента внутри админки (вкладки Чаты/Мосты/База) --- */
.settings-embed {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.92) 0%, rgba(3, 13, 8, 0.96) 100%);
  box-shadow: var(--gp-shadow);
  overflow: hidden;
}
.settings-embed.invisible { display: none !important; }
.settings-embed__frame {
  display: block;
  width: 100%;
  height: calc(100dvh - 150px);
  min-height: 520px;
  border: 0;
  background: transparent;
}
@media (max-width: 768px) {
  .settings-embed { border-radius: 12px; }
  .settings-embed__frame { height: calc(100dvh - 128px); min-height: 420px; }
}


/* --- Индикатор загрузки врезки: раздел живёт в отдельном приложении и
   грузится не мгновенно, без этого видно пустой прямоугольник --- */
.settings-embed { position: relative; }
.settings-embed__loader {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gp-muted);
  font-size: 13px;
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.96), rgba(3, 13, 8, 0.98));
}
.settings-embed.is-loading .settings-embed__loader { display: flex; }
.settings-embed__spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(31, 148, 90, 0.35);
  border-top-color: #84fcc0;
  border-radius: 50%;
  animation: gpSpin .7s linear infinite;
}
@keyframes gpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .settings-embed__spin { animation: none; } }

/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 6 (2026-09-13).
   Единая высота всего ряда фильтров — вровень с окном выбора даты (28px):
   Канал/Гео, селекты сортировки и периода (теперь той же формы, что Канал/
   Гео — см. ЧАСТЬ 7 про их перенос в тот же ряд), Сбросить/Применить/УБТ.
   =========================================================================== */
#channel_selector_btn,
#geo_selector_btn,
.filter-form__sort-field select,
.filter-form__preset-field select {
  height: 28px;
  min-height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
  line-height: 26px;
  box-sizing: border-box;
}

.filter-form__action-button {
  height: 28px;
  min-height: 28px;
  padding: 0 14px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#roma-toggle,
#ai-toggle {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 12px !important;
}

/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 7 (2026-09-13).
   Сортировка и период переехали из отдельного блока в ряд с Канал/Гео —
   визуально те же элементы группы (.filter-form__dropdown-wrap), поэтому
   форма (радиус, фон, бордер) у них уже общая через правило выше и через
   #channel_selector_btn/#geo_selector_btn... селектор здесь не нужен: они
   попадают под общий .filter-form__dropdown-wrap flex-item и под правило
   .filter-form__sort-field select / .filter-form__preset-field select.
   =========================================================================== */
.filter-form__dropdown-wrap--select {
  display: flex;
  align-items: center;
}
.filter-form__dropdown-wrap--select .filter-form__sort-field,
.filter-form__dropdown-wrap--select .filter-form__preset-field {
  display: flex;
}

@media (max-width: 768px) {
  .filter-form__dropdown-row { flex-wrap: wrap; }
}

/* ===========================================================================
   UI-АПГРЕЙД, ЧАСТЬ 8 (2026-09-13).
   Селекты «По странам»/«Период» рендерились с нативной стрелкой браузера
   поверх нашего фона/радиуса — форма визуально плыла и не совпадала с
   Канал/Гео. Снимаем нативный вид и рисуем одну и ту же стрелку-шеврон на
   всех четырёх элементах, чтобы Канал/Гео тоже читались как «это список».
   =========================================================================== */
.filter-form__sort-field select,
.filter-form__preset-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#channel_selector_btn,
#geo_selector_btn,
.filter-form__sort-field select,
.filter-form__preset-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b3ffd9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 9px 6px;
  padding-right: 26px;
  text-align: left;
}


/* ===========================================================================
   ЗП воркеров (/payroll).
   =========================================================================== */
.payroll-nav { flex-wrap: wrap; gap: 10px; align-items: center; }
.payroll-period {
  font-size: 14px;
  color: var(--gp-brand);
  padding: 0 6px;
  white-space: nowrap;
}
.payroll-period em { color: var(--gp-muted); font-style: normal; opacity: .75; }
.payroll-table td, .payroll-table th { text-align: right; }
.payroll-table .col-name { text-align: left; }
.payroll-zero { opacity: .35; }
.payroll-total { font-weight: 700; color: var(--gp-brand); }
.payroll-grand td {
  border-top: 2px solid var(--gp-primary);
  font-weight: 700;
  background: rgba(31, 148, 90, 0.10);
}
.payroll-note {
  margin: 12px 4px 2px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--gp-muted);
  opacity: .8;
}
.payroll-empty { padding: 18px 6px; color: var(--gp-muted); }

.payroll-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.payroll-range .filter-form__date-row { margin: 0; }
@media (max-width: 768px) {
  .payroll-nav { width: 100%; }
  .payroll-range { width: 100%; }
  .payroll-range .filter-form__date-row { flex: 1 1 auto; }
}


/* ===========================================================================
   Спорные чеки (/receipts).
   =========================================================================== */
.rv-head { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rv-stats { font-size: 13.5px; color: var(--gp-muted); }
.rv-stats b { color: var(--gp-brand); font-size: 15px; }
.rv-geos { display: flex; gap: 6px; flex-wrap: wrap; }
.rv-flash { padding: 10px 14px; color: var(--gp-brand); font-size: 14px; }

.rv-bulk {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; padding: 4px 2px 14px;
  border-bottom: 1px solid var(--gp-border); margin-bottom: 16px;
}
.rv-all { font-size: 13.5px; color: var(--gp-muted); display: flex; align-items: center; gap: 7px; }
.rv-danger { background: linear-gradient(135deg, #a8452f, #8c3524) !important; }

.rv-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.rv-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--gp-border); border-radius: 12px;
  background: rgba(8, 38, 23, 0.45); overflow: hidden;
}
.rv-shot { display: block; background: #000; line-height: 0; }
.rv-shot img {
  width: 100%; height: 190px; object-fit: cover; opacity: .92;
  transition: opacity .15s ease;
}
.rv-shot:hover img { opacity: 1; }
.rv-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 9px; }
.rv-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.rv-flag {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(216, 164, 65, .16); color: #e8c37a;
  border: 1px solid rgba(216, 164, 65, .45);
}
.rv-tag { margin: 0; font-size: 14px; font-weight: 600; color: var(--gp-brand); }
.rv-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.rv-facts dt { color: var(--gp-muted); opacity: .8; }
.rv-facts dd { margin: 0; }
.rv-amount { font-weight: 700; color: var(--gp-brand); }
.rv-actions, .rv-move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-pick { font-size: 12.5px; color: var(--gp-muted); display: flex; align-items: center; gap: 6px; margin-right: auto; }
.rv-mini {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--gp-border); background: var(--gp-input);
  color: var(--gp-text); cursor: pointer;
}
.rv-mini:hover { border-color: var(--gp-primary); }
.rv-ok { background: linear-gradient(135deg, #2f9a68, #1f8a58); color: #fff; border-color: transparent; }
.rv-move input[type="date"] {
  font-size: 12px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--gp-border); background: var(--gp-input); color: var(--gp-text);
}
@media (max-width: 520px) { .rv-grid { grid-template-columns: 1fr; } }

.rv-pending {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; font-size: 14px; color: var(--gp-text);
  border-left: 3px solid #d8a441;
}
.rv-pending b { color: var(--gp-brand); }
.rv-plus { color: #84fcc0; }
.rv-minus { color: #ffb3b3; }


/* ===========================================================================
   Сверка с выпиской (/statements).
   =========================================================================== */
.st-form { align-items: center; gap: 12px; flex-wrap: wrap; }
.st-file input[type="file"] { font-size: 13px; color: var(--gp-muted); max-width: 100%; }
.st-geo { font-size: 13.5px; color: var(--gp-muted); display: flex; align-items: center; gap: 8px; }
.st-hint { margin: 8px 2px 0; font-size: 12.5px; color: var(--gp-muted); opacity: .8; }
.st-error { padding: 12px 16px; color: #ffb3b3; border-left: 3px solid #a8452f; }

.st-summary { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.st-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border: 1px solid var(--gp-border); border-radius: 10px;
  background: rgba(8, 38, 23, 0.45);
}
.st-tile--warn { border-color: rgba(216, 164, 65, .5); }
.st-num { font-size: 26px; font-weight: 700; color: var(--gp-brand); font-variant-numeric: tabular-nums; }
.st-tile--warn .st-num { color: #e8c37a; }
.st-cap { font-size: 12.5px; color: var(--gp-muted); }
.st-period { margin: 14px 2px 0; font-size: 13px; color: var(--gp-muted); }
.st-h { margin: 0 0 6px; font-size: 16px; color: var(--gp-brand); }
.st-note { margin: 0 0 14px; font-size: 12.5px; color: var(--gp-muted); opacity: .85; line-height: 1.5; }
.st-miss { font-weight: 700; color: #e8c37a; }
.st-typical {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: rgba(216, 164, 65, .16); color: #e8c37a;
  border: 1px solid rgba(216, 164, 65, .45); white-space: nowrap;
}
.tbl-scroll { overflow-x: auto; }


/* ===========================================================================
   Раздел «Финансы»: ЗП, чеки и выписка вкладками в одном окне.
   =========================================================================== */
.fin-topbar { padding: 10px 12px; }
.fin-topbar .settings-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-tab--active {
  background: linear-gradient(135deg, #2f9a68, #1f8a58) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.fin-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 20px; font-size: 11px; line-height: 17px;
  background: #d8a441; color: #1b1206;
}
.settings-tab--active .fin-badge { background: #fff3d6; }
.fin-pane { display: block; }


/* ===========================================================================
   Finance Control Center — owner dashboard.
   =========================================================================== */
.fin-shell { max-width: 1540px; }
.fin-topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  margin-bottom: 16px;
  background: rgba(4, 18, 11, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.fin-nav { width: 100%; }
.fin-nav .settings-tab {
  min-width: 132px;
  border-radius: 10px;
  letter-spacing: .01em;
}
.fin-overview { display: grid; gap: 16px; }

.fin-hero {
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    radial-gradient(circle at 92% 12%, rgba(43, 170, 107, .17), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(31, 148, 90, .08), transparent 38%),
    linear-gradient(180deg, rgba(13, 40, 27, .96), rgba(3, 13, 8, .98));
}
.fin-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -120px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(179, 255, 217, .06);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(179, 255, 217, .018), 0 0 0 90px rgba(179, 255, 217, .012);
  pointer-events: none;
}
.fin-hero__copy { position: relative; z-index: 1; min-width: 0; }
.fin-eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .18em;
  font-weight: 700;
  color: rgba(179, 255, 217, .62);
}
.fin-hero__title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fin-hero h1 { margin: 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.05; font-weight: 650; color: #f0fff7; }
.fin-hero p { margin: 9px 0 0; color: rgba(179, 255, 217, .67); font-size: 13px; }
.fin-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--gp-border);
  background: rgba(7, 29, 18, .82);
  color: var(--gp-muted);
  font-size: 11px;
  white-space: nowrap;
}
.fin-state i { width: 7px; height: 7px; border-radius: 50%; background: #57e69a; box-shadow: 0 0 11px rgba(87, 230, 154, .8); }
.fin-state--attention i, .fin-state--waiting i { background: #e4b65d; box-shadow: 0 0 11px rgba(228, 182, 93, .72); }
.fin-state--closed i, .fin-state--ready i { background: #77ffc0; }
.fin-hero__actions { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.fin-primary-action, .fin-ghost-action, .fin-icon-action, .fin-link-action, .fin-attention__action, .fin-diagnostic-link {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--gp-font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
}
.fin-primary-action {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  color: #fff;
  background: linear-gradient(135deg, #2baa6b, #1f8454);
  box-shadow: 0 7px 22px rgba(31, 148, 90, .22);
  font-size: 12.5px;
  font-weight: 650;
}
.fin-primary-action:hover { transform: translateY(-1px); background: linear-gradient(135deg, #36be7b, #218b59); }
.fin-ghost-action, .fin-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--gp-border);
  background: rgba(5, 25, 15, .7);
  color: var(--gp-muted);
  border-radius: 10px;
  font-size: 12px;
}
.fin-ghost-action { padding: 0 11px; }
.fin-icon-action { width: 36px; font-size: 18px; }
.fin-ghost-action:hover, .fin-icon-action:hover { color: #fff; border-color: rgba(111, 255, 184, .55); }

.fin-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.fin-kpi {
  position: relative;
  min-height: 126px;
  padding: 17px 18px;
  border: 1px solid rgba(31, 148, 90, .34);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 43, 27, .83), rgba(4, 17, 10, .94));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  overflow: hidden;
}
.fin-kpi::after {
  content: "";
  position: absolute;
  inset: auto -20% -70% 36%;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 170, 107, .14), transparent 68%);
  pointer-events: none;
}
.fin-kpi--primary { border-color: rgba(72, 216, 142, .56); }
.fin-kpi--net.is-positive { border-color: rgba(103, 255, 183, .58); background: linear-gradient(180deg, rgba(16, 58, 37, .92), rgba(5, 21, 13, .96)); }
.fin-kpi--net.is-negative { border-color: rgba(208, 91, 74, .56); }
.fin-kpi__label { display: block; color: rgba(179, 255, 217, .64); font-size: 11.5px; margin-bottom: 10px; }
.fin-kpi strong { display: block; position: relative; z-index: 1; font-size: clamp(24px, 2.15vw, 34px); line-height: 1; font-weight: 650; letter-spacing: -.035em; color: #f4fff9; font-variant-numeric: tabular-nums; }
.fin-kpi strong.is-muted { color: rgba(221, 255, 238, .28); }
.fin-kpi__meta { display: block; position: relative; z-index: 1; margin-top: 11px; font-size: 10.8px; line-height: 1.35; color: rgba(179, 255, 217, .52); }
.fin-kpi__meta em { margin-left: 6px; font-style: normal; font-weight: 650; }
.is-up { color: #7ef0b4 !important; }
.is-down { color: #ff9c91 !important; }

.fin-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1.18fr;
  align-items: center;
  padding: 13px 18px;
  gap: 9px;
  box-shadow: none;
  background: rgba(5, 23, 14, .77);
}
.fin-flow__item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 8px; }
.fin-flow__item span { font-size: 10.5px; color: rgba(179, 255, 217, .48); }
.fin-flow__item b { font-size: 14px; font-weight: 650; color: var(--gp-brand); font-variant-numeric: tabular-nums; }
.fin-flow__item--result { border-radius: 9px; background: rgba(31, 148, 90, .12); }
.fin-flow__item--result b { color: #81f7ba; }
.fin-flow__op { color: rgba(179, 255, 217, .28); font-size: 15px; text-align: center; }

.fin-owner-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .75fr); gap: 16px; }
.fin-panel { padding: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.fin-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fin-panel__head h2 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 600; color: #edfff6; }
.fin-panel__counter { font-size: 10.5px; color: rgba(179,255,217,.56); border: 1px solid rgba(31,148,90,.28); border-radius: 999px; padding: 5px 9px; white-space: nowrap; }
.fin-alert-count { min-width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(228,182,93,.14); border: 1px solid rgba(228,182,93,.35); color: #eccb8c; font-size: 11px; font-weight: 700; }

.fin-geo-list { display: grid; gap: 4px; }
.fin-geo-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) minmax(78px, .7fr) minmax(78px, .7fr) 60px 104px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.fin-geo-row:hover { background: rgba(31,148,90,.075); border-color: rgba(31,148,90,.24); transform: translateX(2px); }
.fin-geo-row + .fin-geo-row { border-top-color: rgba(31,148,90,.13); }
.fin-geo-row__name { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fin-geo-row__name b { font-size: 13px; font-weight: 600; color: #effff7; }
.fin-geo-row__name span { font-size: 10.5px; color: rgba(179,255,217,.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-geo-row__money { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.fin-geo-row__money span { font-size: 9.5px; color: rgba(179,255,217,.38); }
.fin-geo-row__money b { font-size: 12.5px; font-weight: 600; color: #dcffed; font-variant-numeric: tabular-nums; }
.fin-geo-row__delta { text-align: right; font-size: 11px; font-weight: 650; color: rgba(179,255,217,.45); font-variant-numeric: tabular-nums; }
.fin-geo-row__delta.is-bad { color: #ff9e94; }
.fin-geo-row__delta.is-warn { color: #eac57e; }
.fin-geo-status { justify-self: end; min-width: 94px; text-align: center; padding: 5px 7px; border-radius: 999px; font-size: 9.8px; white-space: nowrap; border: 1px solid rgba(31,148,90,.25); color: rgba(179,255,217,.62); background: rgba(9,33,21,.65); }
.fin-geo-status--closed, .fin-geo-status--ready { color: #8af5bd; background: rgba(31,148,90,.10); border-color: rgba(72,216,142,.28); }
.fin-geo-status--attention { color: #f0cb87; background: rgba(216,164,65,.10); border-color: rgba(216,164,65,.3); }
.fin-geo-status--waiting { color: rgba(179,255,217,.45); }

.fin-attention-list { display: grid; gap: 8px; }
.fin-attention { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: rgba(6,28,17,.62); border: 1px solid rgba(31,148,90,.18); }
.fin-attention__dot { width: 7px; height: 7px; border-radius: 50%; background: #82efb7; }
.fin-attention--warn .fin-attention__dot { background: #e4b65d; box-shadow: 0 0 9px rgba(228,182,93,.46); }
.fin-attention--danger .fin-attention__dot { background: #e87667; box-shadow: 0 0 9px rgba(232,118,103,.45); }
.fin-attention__copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-attention__copy b { font-size: 11.5px; font-weight: 600; color: #edfff6; }
.fin-attention__copy span { font-size: 10.5px; line-height: 1.35; color: rgba(179,255,217,.48); }
.fin-attention__action, .fin-link-action, .fin-diagnostic-link { border: 0; background: transparent; color: #76e9ac; font-size: 10.5px; padding: 4px; }
.fin-attention__action:hover, .fin-link-action:hover, .fin-diagnostic-link:hover { color: #b5ffd8; }
.fin-diagnostic-link { display: block; margin: 13px 0 -2px auto; color: rgba(179,255,217,.44); }
.fin-all-good { min-height: 118px; display: flex; align-items: center; gap: 13px; padding: 10px; }
.fin-all-good > span { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; color: #77f2b0; background: rgba(31,148,90,.12); border: 1px solid rgba(72,216,142,.25); font-size: 18px; }
.fin-all-good b { display: block; color: #effff7; font-size: 12px; }
.fin-all-good p { margin: 4px 0 0; color: rgba(179,255,217,.45); font-size: 10.5px; line-height: 1.45; }

.fin-pay-preview { margin-bottom: 4px; }
.fin-worker-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.fin-worker-card { min-width: 0; padding: 12px; border-radius: 10px; background: rgba(7,31,19,.62); border: 1px solid rgba(31,148,90,.18); }
.fin-worker-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: rgba(179,255,217,.5); }
.fin-worker-card b { display: block; margin-top: 5px; font-size: 18px; line-height: 1; color: #eafff4; font-weight: 650; font-variant-numeric: tabular-nums; }
.fin-worker-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 7px; font-size: 9.5px; color: rgba(179,255,217,.36); }
.fin-empty { margin: 0; padding: 18px 4px; color: rgba(179,255,217,.48); font-size: 12px; }

@media (max-width: 1180px) {
  .fin-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fin-owner-grid { grid-template-columns: 1fr; }
  .fin-worker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .fin-hero { align-items: flex-start; flex-direction: column; padding: 20px; }
  .fin-hero__actions { justify-content: flex-start; }
  .fin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-flow { grid-template-columns: repeat(2, 1fr); }
  .fin-flow__op { display: none; }
  .fin-flow__item--result { grid-column: 1 / -1; }
  .fin-geo-row { grid-template-columns: minmax(140px, 1.5fr) 80px 80px 94px; }
  .fin-geo-row__delta { display: none; }
}
@media (max-width: 620px) {
  .fin-shell { width: 100%; }
  .fin-topbar { position: static; }
  .fin-nav { display: grid !important; grid-template-columns: 1fr 1fr 1fr; }
  .fin-nav .settings-tab { min-width: 0; padding-inline: 8px; font-size: 11px; }
  .fin-kpi-grid { grid-template-columns: 1fr; }
  .fin-kpi { min-height: 108px; }
  .fin-owner-grid { grid-template-columns: minmax(0, 1fr); }
  .fin-panel { padding: 14px; }
  .fin-geo-row { grid-template-columns: minmax(120px, 1.4fr) 72px 94px; }
  .fin-geo-row__money:nth-of-type(3) { display: none; }
  .fin-worker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-flow { grid-template-columns: 1fr; }
  .fin-flow__item { border-bottom: 1px solid rgba(31,148,90,.12); }
  .fin-flow__item--result { grid-column: auto; border-bottom: 0; }
}


/* ===========================================================================
   Reconciliation workspace v2 — compact, strict and interactive.
   =========================================================================== */
.recon-pane {
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.recon-pane .page-card {
  box-shadow: none;
  background: #06150e;
  border-color: rgba(49, 157, 99, .30);
}
.recon-upload { padding: 15px 17px; }
.recon-upload__head,
.recon-summary-head,
.recon-section-head,
.recon-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.recon-upload__head { margin-bottom: 12px; }
.recon-upload__head h2,
.recon-summary-head h2,
.recon-section-head h3,
.recon-close h3 {
  margin: 0;
  color: #eefbf4;
  font-weight: 600;
}
.recon-upload__head h2 { font-size: 15px; }
.recon-upload__hint { color: rgba(179,255,217,.43); font-size: 10.5px; }
.recon-upload__controls {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(190px, .85fr) 170px 112px;
  gap: 10px;
  align-items: end;
}
.recon-field { min-width: 0; display: grid; gap: 5px; }
.recon-field > span {
  color: rgba(179,255,217,.50);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.recon-field input,
.recon-field select {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid rgba(49,157,99,.38);
  border-radius: 8px;
  background: #081d13;
  color: #e9fff4;
  font: 12px var(--gp-font);
  padding: 0 10px;
  outline: none;
}
.recon-field input:focus,
.recon-field select:focus { border-color: rgba(87,230,154,.72); box-shadow: 0 0 0 2px rgba(49,157,99,.12); }
.recon-field--file input[type="file"] { padding: 6px 8px; line-height: 20px; }
.recon-field--file input[type="file"]::file-selector-button {
  margin-right: 9px;
  border: 0;
  border-radius: 6px;
  padding: 4px 9px;
  background: rgba(49,157,99,.18);
  color: #dff8eb;
  font: 11px var(--gp-font);
  cursor: pointer;
}
.recon-submit {
  height: 36px;
  border: 1px solid #2aa96b;
  border-radius: 8px;
  background: #238f5b;
  color: #fff;
  font: 600 11.5px var(--gp-font);
  padding: 0 13px;
  cursor: pointer;
}
.recon-submit:hover:not(:disabled) { background: #2aa96b; }
.recon-submit:disabled { opacity: .35; cursor: not-allowed; }
.recon-error { padding: 11px 14px; }

.recon-summary-card { padding: 17px; }
.recon-summary-head { align-items: flex-start; }
.recon-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.recon-summary-head h2 { font-size: 17px; letter-spacing: -.01em; }
.recon-summary-head p { margin: 4px 0 0; color: rgba(179,255,217,.40); font-size: 10.5px; }
.recon-status {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid rgba(49,157,99,.28);
  border-radius: 999px;
  color: rgba(179,255,217,.58);
  font-size: 9.5px;
}
.recon-status--closed { color: #7fe5ad; border-color: rgba(87,230,154,.34); }
.recon-status--superseded { opacity: .52; }
.recon-delta { text-align: right; }
.recon-delta span { display: block; color: rgba(179,255,217,.38); font-size: 9.5px; }
.recon-delta b { display: block; margin-top: 2px; color: #e9fff4; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recon-delta.is-bad b { color: #e7bf72; }
.recon-delta.is-ok b { color: #77e6aa; }

.recon-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 15px;
  border-top: 1px solid rgba(49,157,99,.16);
  border-bottom: 1px solid rgba(49,157,99,.16);
}
.recon-metric {
  min-width: 0;
  padding: 13px 14px;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid rgba(49,157,99,.16);
  transition: background .12s ease;
}
.recon-metric:last-child { border-right: 0; }
.recon-metric--link:hover { background: rgba(49,157,99,.07); }
.recon-metric > span { display: block; color: rgba(179,255,217,.48); font-size: 10px; }
.recon-metric > b { display: block; margin-top: 5px; color: #edfdf5; font-size: 22px; line-height: 1; font-weight: 610; font-variant-numeric: tabular-nums; }
.recon-metric > small { display: block; margin-top: 5px; color: rgba(179,255,217,.33); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recon-metric.is-warning > b { color: #e6bd70; }
.recon-metric.is-warning > small { color: rgba(230,189,112,.72); }
.recon-ledger-line { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 11px; }
.recon-ledger-line span { color: rgba(179,255,217,.42); font-size: 10.5px; }
.recon-ledger-line b { color: #dff8eb; font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }

.recon-workspace { display: grid; gap: 12px; }
.recon-issues { padding: 15px 16px; scroll-margin-top: 78px; }
.recon-section-head { margin-bottom: 10px; }
.recon-section-head h3 { font-size: 14px; }
.recon-count {
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(49,157,99,.25);
  border-radius: 7px;
  color: rgba(179,255,217,.64);
  font-size: 10.5px;
  font-weight: 600;
}
.recon-count.is-warning { border-color: rgba(218,171,81,.38); color: #e6bd70; background: rgba(218,171,81,.07); }
.recon-explain { margin: -1px 0 11px; max-width: 800px; color: rgba(179,255,217,.40); font-size: 10.5px; line-height: 1.45; }
.recon-list { display: grid; gap: 5px; }
.recon-item {
  display: grid;
  grid-template-columns: 48px minmax(180px, 1fr) minmax(110px, auto) auto;
  gap: 11px;
  align-items: center;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid rgba(49,157,99,.15);
  border-radius: 8px;
  background: #071a11;
}
.recon-item.is-resolved { opacity: .68; }
.recon-item--bank { grid-template-columns: 34px minmax(180px, 1fr) minmax(110px, auto) auto; }
.recon-receipt-thumb { width: 46px; height: 46px; border-radius: 6px; overflow: hidden; background: #020806; border: 1px solid rgba(49,157,99,.18); }
.recon-receipt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recon-bank-mark { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #7de4aa; background: rgba(49,157,99,.10); font-size: 14px; }
.recon-item__main { min-width: 0; }
.recon-item__title { display: flex; align-items: baseline; gap: 9px; }
.recon-item__title b { color: #f0fff7; font-size: 13px; font-weight: 610; font-variant-numeric: tabular-nums; }
.recon-item__title span { color: rgba(179,255,217,.38); font-size: 9.5px; }
.recon-item__main p { margin: 3px 0 0; color: rgba(179,255,217,.58); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recon-item__main small { display: block; margin-top: 3px; color: rgba(230,189,112,.62); font-size: 9px; }
.recon-item__state { justify-self: end; }
.recon-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 999px; border: 1px solid rgba(49,157,99,.22); color: rgba(179,255,217,.52); font-size: 9px; white-space: nowrap; }
.recon-pill.is-ok { color: #79e7aa; border-color: rgba(87,230,154,.28); background: rgba(49,157,99,.07); }
.recon-pill.is-warn { color: #e3bb70; border-color: rgba(218,171,81,.30); background: rgba(218,171,81,.06); }
.recon-pill.is-muted { color: rgba(205,222,213,.46); border-color: rgba(205,222,213,.16); }
.recon-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.recon-btn {
  height: 28px;
  border: 1px solid rgba(49,157,99,.27);
  border-radius: 7px;
  background: #0a2116;
  color: rgba(225,250,237,.78);
  font: 500 9.5px var(--gp-font);
  padding: 0 9px;
  cursor: pointer;
}
.recon-btn:hover:not(:disabled) { border-color: rgba(87,230,154,.50); color: #fff; }
.recon-btn--primary { background: rgba(35,143,91,.80); border-color: rgba(42,169,107,.72); color: #fff; }
.recon-btn--icon { width: 28px; padding: 0; font-size: 14px; }
.recon-btn:disabled { opacity: .34; cursor: default; }
.recon-empty { min-height: 54px; display: flex; align-items: center; gap: 10px; color: rgba(179,255,217,.42); font-size: 10.5px; }
.recon-empty > span { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(49,157,99,.09); color: #78dfaa; }
.recon-empty p { margin: 0; }

.recon-close { padding: 13px 16px; }
.recon-close h3 { font-size: 13px; }
.recon-close p { margin: 3px 0 0; color: rgba(179,255,217,.40); font-size: 10px; }
.recon-history { padding: 0; overflow: hidden; }
.recon-history summary { list-style: none; cursor: pointer; padding: 11px 14px; color: rgba(179,255,217,.56); font-size: 10.5px; }
.recon-history summary::-webkit-details-marker { display: none; }
.recon-history summary span { margin-left: 5px; color: rgba(179,255,217,.30); }
.recon-history-list { border-top: 1px solid rgba(49,157,99,.15); }
.recon-history-row { display: grid; grid-template-columns: 48px 1.4fr .8fr 80px; gap: 10px; padding: 8px 14px; color: rgba(179,255,217,.55); text-decoration: none; font-size: 10px; border-bottom: 1px solid rgba(49,157,99,.10); }
.recon-history-row:last-child { border-bottom: 0; }
.recon-history-row:hover { background: rgba(49,157,99,.05); }
.recon-history-row b { color: #ddffee; }

@media (max-width: 940px) {
  .recon-upload__controls { grid-template-columns: 1fr 1fr; }
  .recon-metrics { grid-template-columns: 1fr 1fr; }
  .recon-metric:nth-child(2) { border-right: 0; }
  .recon-metric:nth-child(-n+2) { border-bottom: 1px solid rgba(49,157,99,.16); }
  .recon-item, .recon-item--bank { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .recon-actions { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .recon-pane { gap: 9px; }
  .recon-upload__head, .recon-summary-head, .recon-close { align-items: flex-start; flex-direction: column; }
  .recon-upload__controls { grid-template-columns: 1fr; }
  .recon-metrics { grid-template-columns: 1fr; }
  .recon-metric { border-right: 0; border-bottom: 1px solid rgba(49,157,99,.16); }
  .recon-metric:last-child { border-bottom: 0; }
  .recon-item, .recon-item--bank { grid-template-columns: 38px minmax(0,1fr); }
  .recon-item__state { grid-column: 2; justify-self: start; }
  .recon-actions { grid-column: 2; flex-wrap: wrap; }
  .recon-history-row { grid-template-columns: 42px 1fr; }
  .recon-history-row span:nth-child(n+3) { display: none; }
}


/* Finance control simplification — main table remains the owner dashboard. */
.fin-nav--simple {
  width: auto;
  min-width: 310px;
}
.fin-nav--simple .settings-tab {
  min-width: 150px;
}
.control-purpose {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px 16px;
  background: #071810 !important;
  border-color: rgba(70, 158, 111, .26) !important;
}
.control-purpose__icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(52, 160, 103, .10);
  border: 1px solid rgba(74, 190, 128, .24);
  color: #83dfae;
  font-size: 13px;
}
.control-purpose h2 {
  margin: 0;
  color: #eef9f3;
  font-size: 13px;
  font-weight: 600;
}
.control-purpose p {
  margin: 4px 0 0;
  max-width: 760px;
  color: rgba(208, 235, 221, .52);
  font-size: 10.5px;
  line-height: 1.45;
}
.control-purpose p b {
  color: rgba(226, 246, 235, .82);
  font-weight: 600;
}
.control-purpose__legend {
  display: grid;
  gap: 5px;
  justify-items: start;
  color: rgba(200, 229, 214, .44);
  font-size: 9.5px;
  white-space: nowrap;
}
.control-purpose__legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.control-purpose__legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #70d9a1;
}
.control-purpose__legend i.is-warn {
  background: #d8ad62;
}
.recon-metrics--simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.recon-metrics--simple .recon-metric:nth-child(3) {
  border-right: 0;
}
.recon-totals-line {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 2px 0;
  color: rgba(199, 228, 213, .42);
  font-size: 10px;
}
.recon-totals-line b {
  margin-left: 4px;
  color: #dcefe5;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.recon-totals-line b.is-warn { color: #ddb66e; }
.recon-totals-line b.is-ok { color: #79dca7; }
.recon-explain b {
  color: rgba(225, 244, 234, .76);
  font-weight: 600;
}
@media (max-width: 820px) {
  .control-purpose {
    grid-template-columns: 30px minmax(0,1fr);
  }
  .control-purpose__legend {
    grid-column: 2;
  }
  .recon-metrics--simple {
    grid-template-columns: 1fr;
  }
  .recon-metrics--simple .recon-metric {
    border-right: 0;
    border-bottom: 1px solid rgba(49,157,99,.16);
  }
  .recon-metrics--simple .recon-metric:last-child {
    border-bottom: 0;
  }
}


/* ===========================================================================
   НАСТРОЙКИ: редизайн оболочки (2026-09-15).

   Разметку форм не трогаем — там живые POST'ы по 2000+ строк, и переписывать
   их ради внешнего вида означало бы менять работающее на красивое. Меняем
   только оболочку: панель вкладок, карточки секций, поля и таблицы.
   =========================================================================== */

/* --- Панель вкладок: липкая, с явным активным состоянием --------------- */
.settings-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(12, 44, 28, 0.96), rgba(6, 26, 16, 0.96));
  backdrop-filter: blur(10px);
  border: 1px solid var(--gp-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.settings-selector {
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 6px;
}
.settings-tab {
  position: relative;
  padding: 8px 15px !important;
  border-radius: 999px !important;
  border: 1px solid transparent !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: var(--gp-muted) !important;
  font-size: 13.5px !important;
  font-weight: 600;
  letter-spacing: .005em;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.settings-tab:hover {
  background: rgba(31, 148, 90, 0.18) !important;
  color: var(--gp-brand) !important;
}
.settings-tab.selected,
.settings-tab--active {
  background: linear-gradient(135deg, #2f9a68, #1b7d4e) !important;
  border-color: rgba(132, 252, 192, 0.35) !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(31, 138, 88, 0.35);
}
.settings-tab:focus-visible { outline: none; box-shadow: var(--gp-focus); }

/* --- Секции как карточки с воздухом ------------------------------------ */
#admin_panel,
#percentage_form,
#bank_panel {
  padding: 20px;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  background: linear-gradient(180deg, rgba(13, 40, 27, 0.55), rgba(4, 18, 11, 0.55));
  box-sizing: border-box;
}

/* --- Поля: единая высота, заметный фокус ------------------------------- */
#admin_panel input[type="text"],
#admin_panel input[type="password"],
#admin_panel select,
#percentage_form input[type="text"],
#percentage_form input[type="search"],
#percentage_form input[type="number"],
#bank_panel input,
#bank_panel select {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--gp-input-border);
  background: rgba(3, 14, 8, 0.6);
  color: var(--gp-text);
  transition: border-color .14s ease, box-shadow .14s ease;
}
#admin_panel input:focus,
#admin_panel select:focus,
#percentage_form input:focus,
#bank_panel input:focus {
  outline: none;
  border-color: var(--gp-primary);
  box-shadow: 0 0 0 3px rgba(31, 148, 90, 0.2);
}

/* --- Строка добавления канала: выглядит как единый блок ---------------- */
.channel-add-row,
.channel-search-row {
  gap: 8px;
  margin-bottom: 12px;
}
.channel-search-row input[type="search"] {
  min-height: 36px;
  padding-left: 12px;
}

/* --- Группы каналов по гео: аккуратная гармошка ------------------------ */
.geo-channel-groups { display: flex; flex-direction: column; gap: 10px; }
.geo-channel-group {
  border-color: var(--gp-border);
  border-radius: 12px;
  background: rgba(8, 38, 23, 0.5);
  transition: border-color .15s ease;
}
.geo-channel-group:hover { border-color: rgba(132, 252, 192, 0.35); }
.geo-channel-group__summary {
  padding: 12px 14px;
  font-weight: 600;
}
.geo-channel-group__summary::after {
  content: "▾";
  margin-left: auto;
  opacity: .5;
  transition: transform .18s ease;
}
.geo-channel-group[open] .geo-channel-group__summary::after { transform: rotate(180deg); }
.geo-channel-group__count {
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(31, 148, 90, 0.2);
  color: var(--gp-brand);
  font-size: .75rem;
  font-weight: 700;
  opacity: 1;
}
.geo-channel-group table th {
  position: sticky;
  top: 0;
  background: rgba(6, 26, 16, 0.96);
  font-size: .72rem !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gp-muted);
}
.geo-channel-group table td,
.geo-channel-group table th { padding: 9px 10px; }
.geo-channel-group table tbody tr:hover { background: rgba(31, 148, 90, 0.08); }

/* --- Тулбар пользователей ---------------------------------------------- */
.user-admin-toolbar {
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(3, 14, 8, 0.45);
  border: 1px solid var(--gp-border);
  margin-bottom: 14px;
}
.user-admin-toolbar button { border-radius: 9px !important; }

/* --- Подсказки читаемее ------------------------------------------------- */
.telegram-hint {
  padding: 10px 12px;
  border-left: 2px solid var(--gp-primary);
  border-radius: 0 8px 8px 0;
  background: rgba(31, 148, 90, 0.08);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--gp-muted);
}

@media (max-width: 768px) {
  .settings-topbar { position: static; padding: 8px 10px; }
  #admin_panel, #percentage_form, #bank_panel { padding: 14px; }
}

