/* ============================================================
   Wallet Desk — дизайн-система (product-grade, dark fintech)
   ============================================================ */
:root {
  /* --- поверхности (near-black, лёгкий холодный тон) --- */
  --bg:        oklch(0.165 0.006 265);
  --surface:   oklch(0.205 0.008 265);
  --surface-2: oklch(0.245 0.010 265);
  --surface-3: oklch(0.285 0.011 265);

  /* --- границы --- */
  --line:      oklch(0.30 0.010 265);
  --line-2:    oklch(0.38 0.012 265);

  /* --- текст (высокий контраст к bg) --- */
  --ink:       oklch(0.97 0.004 265);
  --ink-2:     oklch(0.80 0.008 265);
  --ink-mute:  oklch(0.65 0.010 265);

  /* --- акцент (интерактив/выделение) --- */
  --accent:      oklch(0.70 0.15 258);
  --accent-2:    oklch(0.62 0.16 258);
  --accent-soft: oklch(0.70 0.15 258 / 0.14);
  --accent-ink:  oklch(0.18 0.03 265);

  /* --- семантика статусов --- */
  --ok:      oklch(0.76 0.15 158);
  --ok-soft: oklch(0.76 0.15 158 / 0.15);
  --warn:      oklch(0.82 0.13 82);
  --warn-soft: oklch(0.82 0.13 82 / 0.15);
  --danger:      oklch(0.68 0.19 25);
  --danger-soft: oklch(0.68 0.19 25 / 0.15);
  --info:      var(--accent);
  --info-soft: var(--accent-soft);
  --neutral:      oklch(0.66 0.010 265);
  --neutral-soft: oklch(0.66 0.010 265 / 0.14);

  /* --- радиусы / тени --- */
  --r-sm: 7px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px oklch(0 0 0 / 0.28);
  --shadow-lg: 0 24px 60px oklch(0 0 0 / 0.5);
  --ring: 0 0 0 3px var(--accent-soft);

  /* --- z-scale --- */
  --z-sticky: 10; --z-backdrop: 40; --z-drawer: 50; --z-toast: 60;

  /* --- motion --- */
  --dur: 180ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-mute); }
code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color: var(--ink-2); }

/* --- scrollbars --- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }

/* --- brand --- */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }
.brand-mark { color: var(--accent); font-size: 1.1em; }
.brand--lg { font-size: 26px; }

/* ============================================================
   ЛОГИН
   ============================================================ */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-aside {
  padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background:
    radial-gradient(120% 90% at 15% 10%, var(--accent-soft), transparent 55%),
    linear-gradient(160deg, var(--surface), var(--bg));
  border-right: 1px solid var(--line);
}
.login-pitch { max-width: 42ch; color: var(--ink-2); font-size: 16px; line-height: 1.6; margin: 0; }
.login-points { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { position: relative; padding-left: 26px; color: var(--ink-2); }
.login-points li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent);
}
.login-card {
  align-self: center; justify-self: center; width: min(360px, 88vw);
  display: flex; flex-direction: column; gap: 15px; padding: 8px 40px;
}
.login-title { font-size: 22px; margin: 14px 0 0; letter-spacing: -0.02em; }
.login-sub { color: var(--ink-mute); margin: 0 0 6px; font-size: 13px; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-card { padding: 40px 24px; }
}

/* ============================================================
   ФОРМЫ
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--ink-mute); letter-spacing: 0.01em; }
input, select {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 11px; font: inherit; outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
}
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a4' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 32px;
}
input::placeholder { color: var(--ink-mute); }
input:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
input[type="date"] { color-scheme: dark; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
  --bg-btn: var(--surface-2); --fg-btn: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--bg-btn); color: var(--fg-btn);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 8px 14px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { --bg-btn: var(--accent); --fg-btn: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn--primary:hover { --bg-btn: oklch(0.74 0.15 258); }
.btn--success { --bg-btn: var(--ok); --fg-btn: oklch(0.17 0.03 158); border-color: transparent; font-weight: 600; }
.btn--success:hover { filter: brightness(1.06); background: var(--ok); }
.btn--danger { --bg-btn: transparent; --fg-btn: var(--danger); border-color: color-mix(in oklch, var(--danger) 45%, transparent); }
.btn--danger:hover { --bg-btn: var(--danger-soft); border-color: var(--danger); }
.btn--ghost { --bg-btn: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { --bg-btn: var(--surface-2); color: var(--ink); }
.btn--sm { padding: 5px 11px; font-size: 13px; }
.btn--block { width: 100%; }
.btn.is-loading { color: transparent; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: var(--fg-btn);
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 6px 10px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute); padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--ink); }
.nav-item.active .ico { color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 16px; height: 16px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.user { padding: 4px 10px; font-size: 13px; line-height: 1.4; }
.user b { font-weight: 600; }
.user .role { color: var(--ink-mute); font-size: 12px; }

.view { padding: 30px 34px 60px; max-width: 1240px; width: 100%; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .sidebar .brand { padding: 6px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-section { display: none; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; border: 0; padding: 0; align-items: center; }
  .user { display: none; }
  .view { padding: 20px; }
}

/* ============================================================
   ТИПОГРАФИКА СТРАНИЦ
   ============================================================ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
h1 { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.page-sub { color: var(--ink-mute); font-size: 13px; margin: 4px 0 0; }
h2.section { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 12px; letter-spacing: -0.01em; }

/* ============================================================
   KPI / СТАТ-СТРОКА
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px;
  transition: border-color var(--dur) var(--ease);
}
.stat:hover { border-color: var(--line-2); }
.stat-label { font-size: 12.5px; color: var(--ink-mute); display: flex; align-items: center; gap: 7px; }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.stat-value { font-size: 27px; font-weight: 650; letter-spacing: -0.02em; margin: 8px 0 3px; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 12px; color: var(--ink-mute); }
.stat-meta b { color: var(--ok); font-weight: 600; }

/* ============================================================
   КАРТОЧКИ / ПАНЕЛИ
   ============================================================ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.panel-body { padding: 6px 4px; }
.panel--flush .panel-body { padding: 0; }

/* ============================================================
   ТУЛБАР / ФИЛЬТРЫ
   ============================================================ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.toolbar .field { min-width: 150px; }
.toolbar .spacer { flex: 1; }

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: var(--z-sticky);
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-mute); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; transition: background var(--dur) var(--ease); }
tbody tr.clickable:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.amount { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cell-sub { color: var(--ink-mute); font-size: 12px; margin-top: 2px; }
.who { display: flex; flex-direction: column; }
.who .name { font-weight: 500; }

/* ============================================================
   БЕЙДЖИ СТАТУСОВ (точка + подпись)
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px;
  border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--tint, var(--neutral-soft)); color: var(--tone, var(--ink-2));
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone, var(--neutral)); flex: none; }
.badge.solid { background: var(--tone); color: oklch(0.16 0.02 265); font-weight: 600; }
.badge.solid::before { background: oklch(0.16 0.02 265 / 0.7); }
/* заявки */
.b-pending_approval { --tint: var(--warn-soft); --tone: var(--warn); }
.b-issuing, .b-waiting_payment { --tint: var(--info-soft); --tone: var(--info); }
.b-partpaid, .b-paid_unconfirmed, .b-overpaid { --tint: var(--ok-soft); --tone: var(--ok); }
.b-completed { --tint: var(--ok-soft); --tone: var(--ok); }
.b-cancelled, .b-expired { --tint: var(--neutral-soft); --tone: var(--neutral); }
.b-rejected, .b-failed { --tint: var(--danger-soft); --tone: var(--danger); }
/* сотрудники */
.b-active { --tint: var(--ok-soft); --tone: var(--ok); }
.b-blocked { --tint: var(--danger-soft); --tone: var(--danger); }
.b-pending { --tint: var(--warn-soft); --tone: var(--warn); }
/* роли */
.role-tag { font-size: 12px; color: var(--ink-2); }

/* ============================================================
   ПАГИНАЦИЯ
   ============================================================ */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-mute); }
.pager-nav { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   СКЕЛЕТОН
   ============================================================ */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; height: 12px; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.05), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-row td { padding: 14px 16px; }

/* ============================================================
   ПУСТОЕ СОСТОЯНИЕ
   ============================================================ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 52px 24px; }
.empty .ico { width: 34px; height: 34px; stroke-width: 1.5; color: var(--ink-mute); opacity: 0.7; }
.empty-title { font-weight: 600; color: var(--ink-2); }
.empty-hint { color: var(--ink-mute); font-size: 13px; max-width: 42ch; }

/* ============================================================
   ATTENTION-СПИСОК (ждут подтверждения)
   ============================================================ */
.attn { display: flex; flex-direction: column; }
.attn-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line);
  transition: background var(--dur) var(--ease);
}
.attn-item:last-child { border-bottom: 0; }
.attn-item:hover { background: var(--surface-2); }
.attn-main { flex: 1; min-width: 0; cursor: pointer; }
.attn-title { font-weight: 500; }
.attn-amount { font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.attn-actions { display: flex; gap: 8px; }

/* ============================================================
   ЛЕНТА СОБЫТИЙ (аудит на дашборде)
   ============================================================ */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.feed-item:last-child { border-bottom: 0; }
.feed-time { color: var(--ink-mute); font-size: 12px; white-space: nowrap; }
.feed-act code { background: transparent; padding: 0; color: var(--accent); }

/* ============================================================
   ДРАВЕР (детали заявки)
   ============================================================ */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer-backdrop { position: absolute; inset: 0; background: oklch(0 0 0 / 0.5); backdrop-filter: blur(2px); z-index: var(--z-backdrop);
  opacity: 0; transition: opacity var(--dur) var(--ease); }
.drawer:not(.hidden) .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(480px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  overflow-y: auto; z-index: var(--z-drawer);
  transform: translateX(100%); transition: transform 240ms var(--ease);
}
.drawer:not(.hidden) .drawer-panel { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); z-index: 1; }
.drawer-head h2 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -0.02em; }
.drawer-close { background: transparent; border: 0; color: var(--ink-mute); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; }
.drawer-close:hover { background: var(--surface-2); color: var(--ink); }
.drawer-body { padding: 20px 22px; }
.drawer-foot { position: sticky; bottom: 0; background: var(--surface); display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); }

/* пары ключ-значение */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--ink-mute); font-size: 12.5px; }
.kv-val { word-break: break-word; }
.kv-val.mono { word-break: break-all; }
.copy { cursor: pointer; border-bottom: 1px dotted var(--line-2); }
.copy:hover { color: var(--accent); border-color: var(--accent); }

.mini-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); margin: 22px 0 8px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 11px 18px; z-index: var(--z-toast); font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 9px; max-width: 90vw;
  opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast:not(.hidden) { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.bad { border-color: color-mix(in oklch, var(--danger) 40%, var(--line-2)); }
.toast.bad::before { background: var(--danger); }

/* ============================================================
   ДАШБОРД: сегмент-контрол / пикер диапазона
   ============================================================ */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg-btn {
  appearance: none; background: transparent; border: 0; color: var(--ink-mute);
  font: inherit; font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: 5px;
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.on { background: var(--surface-3); color: var(--ink); box-shadow: 0 1px 2px oklch(0 0 0 / 0.25); }

.range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.range-dates { display: flex; align-items: center; gap: 8px; }
.range-dates input[type="date"] { width: auto; padding: 6px 9px; font-size: 13px; }
.range-sep { color: var(--ink-mute); }

/* KPI-карточка со встроенным тогглом */
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }

/* ============================================================
   ДАШБОРД: тренд-график (инлайн-SVG)
   ============================================================ */
.trend-legend { display: flex; align-items: center; gap: 12px; }
.delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; }
.delta--up { background: var(--ok-soft); color: var(--ok); }
.delta--down { background: var(--danger-soft); color: var(--danger); }
.delta--flat { background: var(--neutral-soft); color: var(--ink-mute); }

.trend-body { padding: 16px 18px 8px; }
.tg { width: 100%; height: auto; display: block; overflow: visible; }
.tg-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.tg-axis { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tg-bar { fill: var(--accent); transition: fill var(--dur) var(--ease); }
.tg-hit { fill: transparent; }
.tg-col:hover .tg-hit { fill: var(--accent-soft); }
.tg-col:hover .tg-bar { fill: oklch(0.79 0.15 258); }
.tg-xlab, .tg-ylab { fill: var(--ink-mute); font-size: 11px; font-family: var(--font); }
.tg-ylab { font-variant-numeric: tabular-nums; }

/* ============================================================
   ДАШБОРД: недоплаты / переплаты
   ============================================================ */
.mismatch { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.mm-side { background: var(--surface); padding: 16px 18px; min-width: 0; }
.mm-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mm-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mm-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mm-total { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mm-side--under .mm-total { color: var(--danger); }
.mm-side--over .mm-total { color: var(--warn); }
.mm-under { color: var(--danger); }
.mm-over { color: var(--warn); }
.mm-count { font-size: 12.5px; margin-top: 3px; }
.mm-none { padding: 14px 0 2px; font-size: 13px; }

/* раскрывающийся список расхождений */
.disc { margin-top: 12px; border-top: 1px solid var(--line); }
.disc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 0 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.disc > summary::-webkit-details-marker { display: none; }
.disc > summary:hover { color: var(--ink); }
.disc-chev { color: var(--ink-mute); transition: transform var(--dur) var(--ease); }
.disc[open] .disc-chev { transform: rotate(180deg); }
.disc table { margin-top: 4px; font-size: 13px; }
.disc th, .disc td { padding: 8px 10px; }
.disc th:first-child, .disc td:first-child { padding-left: 0; }
.disc th:last-child, .disc td:last-child { padding-right: 0; }

@media (max-width: 640px) {
  .mismatch { grid-template-columns: 1fr; }
}

/* ============================================================
   ДОСТУПНОСТЬ / MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .drawer-panel { transition: none; }
}
