/* main.css — общие стили кабинета ROOMbe: цвета и шрифты, каркас страницы, кнопки, поля,
   таблицы, окна, меню и уведомления. Подключается на каждой странице после fonts.css.
   Идея вёрстки: спокойная боковая панель слева и одна колонка с воздухом справа;
   нейтральные серые поверхности, мятный цвет бренда — только на главных действиях и состояниях.
   Тёмная тема включается сама по настройке устройства; принудительно — <html data-theme="dark"> или "light". */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --side: #f6f7f6;
  --surface: #ffffff;
  --surface-2: #f1f3f2;
  --surface-3: #e6e9e7;
  --line: #e2e5e3;
  --line-strong: #c9cecb;
  --text: #0e1110;
  --text-2: #5a615d;
  --text-3: #6f7772;
  --accent: #2ee59d;
  --on-accent: #06160f;
  --accent-ink: #0a7f55;
  --accent-soft: rgba(46, 229, 157, .18);
  --logo-be: #1fc98a;
  --ok-dot: #19b97c;
  --warn: #9a5800;
  --warn-fill: #f2a630;
  --warn-soft: rgba(255, 181, 71, .2);
  --bad: #c62f2f;
  --bad-fill: #e5484d;
  --on-bad: #ffffff;
  --bad-soft: rgba(229, 72, 77, .1);
  --shadow: 0 12px 32px rgba(14, 17, 16, .14);
  --seg-on: #ffffff;
  --s1: #257de0;
  --s2: #f47230;
  --s3: #00b894;
  --grid: #e7e7e7;
  --axis: #c2c2c2;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Montserrat', 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121413; --side: #0c0e0d; --surface: #181b19; --surface-2: #1f2321; --surface-3: #2a2f2c;
    --line: #2a2f2c; --line-strong: #3a403c; --text: #f2f4f1; --text-2: #a2a9a5; --text-3: #858c88;
    --accent-ink: #2ee59d; --accent-soft: rgba(46, 229, 157, .14); --logo-be: #2ee59d; --ok-dot: #2ee59d;
    --warn: #ffb547; --warn-fill: #ffb547; --warn-soft: rgba(255, 181, 71, .14);
    --bad: #ff6b6b; --bad-fill: #ff6b6b; --on-bad: #1a0606; --bad-soft: rgba(255, 107, 107, .14);
    --shadow: 0 12px 32px rgba(0, 0, 0, .5); --seg-on: #2f3531;
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --grid: #2b302d; --axis: #474d49;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121413; --side: #0c0e0d; --surface: #181b19; --surface-2: #1f2321; --surface-3: #2a2f2c;
  --line: #2a2f2c; --line-strong: #3a403c; --text: #f2f4f1; --text-2: #a2a9a5; --text-3: #858c88;
  --accent-ink: #2ee59d; --accent-soft: rgba(46, 229, 157, .14); --logo-be: #2ee59d; --ok-dot: #2ee59d;
  --warn: #ffb547; --warn-fill: #ffb547; --warn-soft: rgba(255, 181, 71, .14);
  --bad: #ff6b6b; --bad-fill: #ff6b6b; --on-bad: #1a0606; --bad-soft: rgba(255, 107, 107, .14);
  --shadow: 0 12px 32px rgba(0, 0, 0, .5); --seg-on: #2f3531;
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --grid: #2b302d; --axis: #474d49;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
a { color: var(--accent-ink); }
button, input { font-family: inherit; }
/* Значки: контурные, цвет берут у текста. Сами рисунки — в наборе <svg class="sprite"> в начале страницы */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { flex: none; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.ic:not([stroke-width]) { stroke-width: 1.8; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.pad { padding: 16px; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Логотип из приложения: Montserrat Black, «be» — мятный */
.logo { font: 900 22px/1 var(--font-display); letter-spacing: -.5px; color: var(--text); }
.logo-be { color: var(--logo-be); }
.logo-xl { font-size: 46px; letter-spacing: -1.3px; }

/* ---------- Каркас: боковая панель и область страницы ---------- */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); height: 100%; }
.sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 12px; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 16px; }
.sb-logo { text-decoration: none; display: inline-flex; border-radius: 6px; }
.sb-tag { font: 600 11px/1 var(--font); letter-spacing: .02em; padding: 5px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.sidebar .sb-close { display: none; margin-left: auto; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.sb-item .ic { color: var(--text-2); }
.sb-item:hover, .sb-tour:hover, .sb-account:hover, .sb-app:hover { background: var(--surface-3); }
.sb-item.is-on { background: var(--surface-3); }
.sb-item.is-on .ic { color: var(--text); }
.sb-section { font: 600 12px/1 var(--font); color: var(--text-3); padding: 20px 10px 8px; }
.sb-list { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.sb-tour { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; color: var(--text); text-decoration: none; }
.sb-tour.is-on { background: var(--surface-3); }
.sb-tour-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.sb-account { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; width: 100%; }
.sb-account > .ic { color: var(--text-3); }
.sb-account-text, .sb-app-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.sb-account-text b, .sb-app-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-account-text small, .sb-app-text small { font-size: 12px; color: var(--text-2); }
/* Ссылка на приложение, в котором снимают туры — над кнопкой аккаунта */
.sb-app { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.sb-app-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.sb-app > .ic { color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.avatar-lg { width: 52px; height: 52px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot-ok { background: var(--ok-dot); } .dot-warn { background: var(--warn-fill); } .dot-bad { background: var(--bad-fill); }
.scrim { display: none; }
.main { min-width: 0; height: 100%; overflow-y: auto; position: relative; }
.topbar { display: none; }
.page { max-width: 900px; margin: 0 auto; padding: 36px 28px 96px; }
.page-wide { max-width: none; padding-left: 30px; padding-right: 30px; }
.as-bar { position: sticky; top: 0; z-index: 15; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 28px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 14px; }
.as-bar span { flex: 1; min-width: 200px; }

/* ---------- Кнопки, поля, чипы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 0; font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .12s, background-color .12s; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(.95); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: var(--bad-fill); color: var(--on-bad); }
.btn-danger:hover { filter: brightness(.94); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 54px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; filter: none; }
.btn-more { margin-top: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.link-btn { border: 0; background: none; padding: 0; font: 600 14px/1.4 var(--font); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font: 500 14px/1 var(--font); margin: 0 0 14px -4px; background: none; border: 0; padding: 6px 8px 6px 2px; border-radius: 8px; cursor: pointer; }
.back:hover { color: var(--text); background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); font: 600 14px/1 var(--font); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--surface-3); }
.chip.is-on { background: var(--text); color: var(--bg); }
.chip-n { font-weight: 500; opacity: .6; }
.chip-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--font); white-space: nowrap; background: var(--surface-2); color: var(--text); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pill-ok .pill-dot { background: var(--ok-dot); } .pill-warn .pill-dot { background: var(--warn-fill); } .pill-bad .pill-dot { background: var(--bad-fill); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font: 500 13px/1.3 var(--font); color: var(--text-2); }
.input-wrap { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text-3); }
.input-wrap:focus-within { border-color: var(--accent-ink); }
.input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0; font: 500 15px/1 var(--font); color: var(--text); }
.input::placeholder, .phone-input::placeholder, .search input::placeholder { color: var(--text-3); opacity: 1; }
.input:disabled { color: var(--text-2); }
.input-wrap:has(.input-lg) { height: 56px; }
.input-lg { font-size: 22px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--text-2); margin-top: 10px; min-height: 19px; }
.field-hint.is-error, .field-error { color: var(--bad); }
.field-error { font-size: 13px; margin-top: 8px; }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line-strong); position: relative; cursor: pointer; flex: none; margin: 0; transition: background-color .15s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; cursor: pointer; }
.switch-row b { font-weight: 600; display: block; }
.switch-row small { display: block; color: var(--text-2); font-size: 13px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); flex: 1 1 280px; max-width: 380px; color: var(--text-3); border: 1.5px solid transparent; }
.search:focus-within { border-color: var(--accent-ink); }
.search input { border: 0; background: none; outline: 0; font: 500 14px/1 var(--font); color: var(--text); flex: 1; min-width: 0; height: 100%; }
.seg-ctl { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg-ctl-block { display: flex; margin-bottom: 16px; }
.seg-ctl-block .seg-btn { flex: 1; height: 36px; }
.seg-btn { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 8px; font: 600 13px/1 var(--font); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg-btn.is-on { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }

/* ---------- Страница ---------- */
.page-head { margin-bottom: 20px; }
.page-head h1 { font: 800 30px/1.2 var(--font-display); letter-spacing: -.5px; text-wrap: balance; }
.page-sub { color: var(--text-2); margin-top: 6px; }
.page-head-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card + .card { margin-top: 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card-list { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2, .sec-head h2 { font: 600 18px/1.3 var(--font); }
.card-head p, .sec-head p { color: var(--text-2); font-size: 14px; margin-top: 4px; max-width: 68ch; }
.ed-section { margin-top: 36px; }
.sec-head { margin-bottom: 14px; }
.sec-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin: 16px 0; font-size: 14px; background: var(--surface-2); }
.notice > div { flex: 1; min-width: 0; }
.notice b { font-weight: 600; }
.notice .btn { align-self: center; }
.notice-warn { background: var(--warn-soft); } .notice-warn > .ic { color: var(--warn); }
.notice-bad { background: var(--bad-soft); } .notice-bad > .ic { color: var(--bad); }
.notice-info > .ic { color: var(--text-2); }
.notice a { color: var(--text); }
.foot-note { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13px; margin-top: 20px; }
.empty { text-align: center; padding: 56px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-ic { width: 96px; height: 96px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.empty h2 { font: 800 24px/1.25 var(--font-display); letter-spacing: -.3px; text-wrap: balance; }
.empty p { color: var(--text-2); max-width: 46ch; }
.empty .empty-note { font-size: 13px; margin-top: -6px; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font: 600 12px/1.3 var(--font); color: var(--text-2); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.tbl a:hover { text-decoration-color: currentColor; }
.tbl-click tbody tr { cursor: pointer; }
.tbl-click tbody tr:hover { background: var(--surface-2); }
.tbl-sm th, .tbl-sm td { padding: 6px 10px; }
.th-sort { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; }
.th-sort.is-on { color: var(--text); }
.th-arrow { width: 10px; display: inline-block; }
th.num .th-sort { flex-direction: row-reverse; }
.cell-main { display: flex; flex-direction: column; text-decoration: none; min-width: 170px; }
.cell-main b { font-weight: 600; }
.cell-main small { color: var(--text-2); font-size: 12px; }
.cell-act { text-align: right; width: 1%; }
.amt-in { color: var(--accent-ink); font-weight: 600; }
.tbl .of { color: var(--text-2); font-size: 12px; }
.op-type { font-weight: 600; }
.table-note { padding: 12px 16px; color: var(--text-2); font-size: 13px; border-bottom: 1px solid var(--line); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

/* ---------- Окна, меню, уведомления ---------- */
/* Пометка «это вёрстка, а не настоящая оплата» внутри окон */
.demo-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 14px; }
.demo-note .ic { margin-top: 1px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; z-index: 100; }
.modal { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; max-height: 100%; overflow: auto; box-shadow: var(--shadow); }
.modal-sm { width: min(400px, 100%); }
.modal-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 14px; }
.modal-icon.is-danger { background: var(--bad-soft); color: var(--bad); }
.modal-title { font: 800 22px/1.25 var(--font-display); letter-spacing: -.3px; margin-bottom: 8px; text-wrap: balance; }
.modal-text { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.modal .field { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.menu { position: fixed; z-index: 120; min-width: 230px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.menu-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px; font: 500 14px/1.3 var(--font); color: var(--text); cursor: pointer; text-decoration: none; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { color: var(--text-2); }
.menu-item.is-danger, .menu-item.is-danger .ic { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.toasts { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font: 500 14px/1.35 var(--font); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast .ic { color: #2ee59d; }
.toast-bad .ic { color: #ffb547; }
.toast .ic-bad, .toast-bad .ic-ok { display: none; }
.toast-bad .ic-bad { display: block; }
.toast.is-out { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.tip { position: fixed; z-index: 150; background: var(--text); color: var(--bg); font: 500 12px/1.3 var(--font); padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; }

/* ---------- Телефон и планшет ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease-out; z-index: 60; }
  .is-nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .is-nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; }
  .sidebar .sb-close { display: inline-grid; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .topbar .logo { flex: 1; }
  .topbar .sb-tag { margin-right: 4px; }
  .topbar-balance { font: 600 14px/1 var(--font); color: var(--text); text-decoration: none; padding: 9px 12px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
  .page { padding: 20px 16px 96px; }
  .as-bar { top: 56px; padding: 10px 16px; }
  .page-head h1 { font-size: 24px; }
}
@media (max-width: 640px) {
  .modal-actions .btn { flex: 1; }
  .notice { flex-wrap: wrap; }
  .notice .btn { margin-left: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
