/* UzBot CRM — chap sidebar + to‘lov operatsiyasi */

:root {
  --ink: #101828;
  --ink-soft: #667085;
  --paper: #f2f4f7;
  --paper-2: #f9fafb;
  --card: #ffffff;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #2aabee;          /* Telegram blue */
  --accent-2: #229ed9;
  --accent-soft: #eef7fc;
  --sidebar-bg: #17212b;
  --sidebar-bg-2: #0e1621;
  --sidebar-active: #2b5278;
  --sidebar-text: #a3b3c5;
  --money: #059669;
  --money-soft: #ecfdf5;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --sky: #2aabee;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --radius: 8px;
  --radius-lg: 12px;
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Sora", "Segoe UI", sans-serif;
  --font-num: "IBM Plex Sans", "Sora", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scrollbar-width: thin; scrollbar-color: #d0d5dd transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: #d0d5dd; border-radius: 8px; border: 2px solid transparent;
  background-clip: padding-box;
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--paper-2); color: #344054;
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line);
}

/* Login — quiet pay desk */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    linear-gradient(180deg, #0e1621 0%, #17212b 42%, transparent 42%),
    var(--paper);
}
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: var(--shadow);
  margin-top: 8vh;
}
.login-mark {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: -.04em; color: var(--ink);
}
.login-mark::after {
  content: ""; display: block; width: 28px; height: 3px;
  background: var(--accent); border-radius: 2px; margin-top: 10px;
}
.login-card h1 {
  font-size: 18px; font-weight: 650; letter-spacing: -.02em;
  margin: 14px 0 6px; color: var(--ink);
}
.field { display: grid; gap: 6px; margin: 16px 0 10px; }
.field span {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
}
.field input, .toolbar input, .toolbar select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: #7fd0f6;
  box-shadow: 0 0 0 3px rgba(42, 171, 238, .18);
}

.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 10px 14px;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  background: var(--paper); color: var(--ink);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: #e4e7ec; }
.btn.primary {
  background: var(--accent); color: #fff; width: 100%; margin-top: 8px;
}
.btn.primary:hover { background: var(--accent-2); }
.btn.primary-sm { background: var(--accent); color: #fff; }
.btn.primary-sm:hover { background: var(--accent-2); }
.btn.small { padding: 7px 11px; font-size: 12.5px; }
.btn.ghost { background: #fff; border-color: var(--line); }
.btn.ghost:hover { background: var(--paper-2); border-color: var(--line-strong); }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: #fee2e2; }
.toast {
  margin-top: 12px; padding: 11px 12px; border-radius: 8px;
  background: var(--warn-soft); color: #92400e; font-size: 13px;
  border: 1px solid #fde68a;
}

/* Shell — CRM sidebar layout */
.shell {
  min-height: 100vh; display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--paper);
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg); color: #fff;
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 18px 14px; flex-shrink: 0;
  background: var(--sidebar-bg-2);
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: -.03em; color: #fff;
}
.brand-cap {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 700; color: #7fd0f6;
  background: rgba(42, 171, 238, .14); padding: 3px 7px; border-radius: 5px;
}
.sidebar-close {
  display: none; margin-left: auto;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.08); color: #fff; font-size: 20px; cursor: pointer;
}
.side-nav {
  flex: 1; overflow: auto; padding: 4px 10px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #6d7f8f; padding: 6px 10px 4px;
}
.side-nav .nav-btn {
  width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--sidebar-text); font: inherit; font-weight: 550; font-size: 13.5px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.side-nav .nav-btn::after {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor; transform: rotate(45deg); opacity: .35;
}
.side-nav .nav-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-nav .nav-btn.active {
  color: #fff; background: var(--sidebar-active); font-weight: 650;
}
.side-nav .nav-btn.active::after { opacity: .55; border-color: #fff; }
.sidebar-foot {
  padding: 10px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
  background: var(--sidebar-bg-2);
}
.sidebar-foot .nav-btn {
  width: 100%; text-align: left; border: 0; background: transparent;
  color: #fda4af; font: inherit; font-weight: 600; font-size: 13px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.sidebar-foot .nav-btn:hover { background: rgba(248, 113, 113, .12); color: #fecaca; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 45;
}

.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; min-height: 56px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  font-size: 13px; font-weight: 650; color: var(--ink-soft);
  letter-spacing: -.01em;
}
.menu-btn { display: none; }
.nav-group { position: relative; }
.nav-trigger {
  border: 0; background: transparent; color: var(--ink);
  font: inherit; font-weight: 550; font-size: 13px;
  padding: 7px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.chev {
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid currentColor; opacity: .45;
}
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
  padding: 6px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
  display: none; flex-direction: column; gap: 2px; z-index: 50;
}
.nav-group::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px;
}
@media (hover: hover) {
  .nav-group:hover > .nav-menu { display: flex; }
  .nav-group:hover > .nav-trigger { background: var(--paper); }
  .nav-group:hover > .nav-trigger .chev { transform: rotate(180deg); }
}
.nav-group.nav-closed > .nav-menu { display: none !important; }
@media (hover: none) {
  .nav-group.open > .nav-menu { display: flex; }
  .nav-group.open > .nav-trigger { background: var(--paper); }
  .nav-group.open > .nav-trigger .chev { transform: rotate(180deg); }
}
.nav-menu .nav-btn {
  width: 100%; text-align: left; border: 0; border-radius: 7px; padding: 9px 12px;
  background: transparent; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer;
}
.nav-menu .nav-btn:hover { background: var(--accent-soft); color: var(--accent); }
.nav-menu .nav-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-menu .danger-item { color: var(--bad); }
.nav-menu .danger-item:hover { background: var(--bad-soft); color: var(--bad); }

.topbar-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto;
}
.stream-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--accent-soft); color: #0b6fa4;
  font-size: 11px; font-weight: 650; border: 1px solid #b6e3f8;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft); cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line-strong); }
.icon-btn .ico { width: 15px; height: 15px; }

.account-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 10px 3px 3px !important;
  border: 1px solid var(--line) !important;
  background: #fff !important; border-radius: 999px !important;
  max-width: 220px; color: var(--ink) !important;
}
.account-chip:hover { background: var(--paper-2) !important; }
.account-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: #2aabee;
  color: #fff; font-size: 11px; font-weight: 700;
}
.who {
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.account-menu { right: 0; left: auto; min-width: 180px; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #94a3b8;
}
.live-dot.on {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .22);
}

.main { padding: 20px 22px 44px; width: min(1320px, 100%); }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.page-head h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15;
}
.page-head .muted { margin-top: 3px; }
.back-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 600;
  cursor: pointer; margin-top: 2px;
}
.back-btn:hover { border-color: #7fd0f6; background: var(--accent-soft); color: var(--accent-2); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.dash-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.chart.dual {
  display: flex; align-items: flex-end; gap: 6px;
  min-height: 160px; padding: 16px 14px 8px; overflow-x: auto;
}
.chart-col {
  flex: 1 0 28px; min-width: 28px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; height: 140px;
}
.chart-pair {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px;
}
.chart-pair.single { justify-content: center; }
.chart-bar {
  width: 10px; border-radius: 4px 4px 1px 1px; min-height: 3px; background: var(--accent);
}
.chart-bar.dep { background: #0284c7; }
.chart-bar.wd { background: #dc2626; }
.chart-bar.user { background: #2b5278; width: 14px; }
.chart-col > span {
  font-size: 9px; color: var(--ink-soft); font-family: var(--font-num); white-space: nowrap;
}
.chart-legend {
  display: flex; gap: 14px; padding: 0 14px 12px; font-size: 12px; color: var(--ink-soft);
}
.chart-legend .lg::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  margin-right: 6px; vertical-align: 0;
}
.chart-legend .lg.dep::before { background: #0284c7; }
.chart-legend .lg.wd::before { background: #dc2626; }
.chart-legend .lg.user::before { background: #2b5278; }
.grain-select {
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
  font: inherit; font-size: 12px; background: #fff; color: var(--ink);
}
.alert-row {
  padding: 8px 10px; border-radius: 8px; margin-bottom: 6px;
  background: var(--warn-soft); color: #92400e; font-size: 13px; font-weight: 550;
  border: 1px solid #fde68a;
}
.alert-row.danger {
  background: var(--bad-soft); color: #991b1b; border-color: #fecaca;
}
.settings-card .head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 11px; color: var(--ink-soft); font-weight: 600;
}
.stat .value {
  font-size: 22px; font-weight: 700; letter-spacing: -.03em;
  margin-top: 4px; line-height: 1.15; color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
}

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden; min-width: 0;
}
.page-panel { padding: 16px 18px 20px; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid #eef1f6;
  background: linear-gradient(180deg, #fff, #f7f9fc);
}
.panel-head h3 {
  font-size: 13.5px; font-weight: 700; letter-spacing: -.015em; color: var(--ink);
}
.pill {
  background: linear-gradient(180deg, #eef7fc, #e3f2fb);
  color: #0b6fa4; border: 1px solid #c5e5f7;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; font-family: var(--font-num);
}

.detail-kv {
  display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px;
  font-size: 14px; margin: 8px 0 16px;
}
.detail-kv .k { color: var(--ink-soft); font-size: 12px; font-weight: 550; }
.detail-kv .v { font-weight: 600; word-break: break-word; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.page-section-title {
  font-size: 12px; font-weight: 700; margin: 8px 0 10px; color: var(--ink-soft);
  letter-spacing: .04em;
}

.detail-shell { display: grid; gap: 14px; }
.detail-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end;
  border-radius: 18px; padding: 22px 24px 20px;
  color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 220px at 100% -20%, rgba(42,171,238,.35), transparent 55%),
    linear-gradient(135deg, #0a121c 0%, #152233 48%, #1e3a5f 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}
.detail-hero::after {
  content: ""; position: absolute; inset: auto -40px -60px auto;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.04); pointer-events: none;
}
.detail-hero.wd {
  background:
    radial-gradient(900px 220px at 100% -20%, rgba(249,115,22,.35), transparent 55%),
    linear-gradient(135deg, #4a1808 0%, #9a3412 55%, #c2410c 100%);
}
.detail-hero-kicker {
  font-size: 12px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; opacity: .72; margin-bottom: 6px;
}
.detail-amount {
  font-family: var(--font-num); font-size: clamp(28px, 4vw, 40px);
  font-weight: 700; letter-spacing: -.04em; line-height: 1.05;
  font-variant-numeric: tabular-nums; margin-bottom: 12px;
}
.detail-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-hero-side {
  display: grid; gap: 12px; text-align: right; min-width: 160px;
}
.sidelabel {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; opacity: .55; margin-bottom: 3px;
}
.sideval {
  font-size: 14px; font-weight: 700; letter-spacing: -.01em;
}
.sideval code {
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14);
  color: #fff; font-size: 12px;
}
.detail-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px;
  align-items: start;
}
.detail-grid > .detail-card.span-2 { grid-column: 1 / -1; }
.detail-card, .detail-footer, .detail-activity {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.detail-card > h4 {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 12px 16px;
  font-size: 12.5px; font-weight: 700; letter-spacing: -.01em;
  border-bottom: 1px solid #eef1f6;
  background: linear-gradient(180deg, #fff, #f7f9fc);
  color: var(--ink);
}
.detail-card > h4 .ico { color: var(--accent); width: 15px; height: 15px; }
.detail-card .meta-list { padding: 4px 6px 8px; }

.meta-row {
  display: grid; grid-template-columns: 28px 110px 1fr;
  gap: 10px; align-items: center;
  padding: 10px 10px; border-radius: 10px;
  border-bottom: 1px solid #f1f4f8;
}
.meta-row:last-child { border-bottom: 0; }
.meta-row:hover { background: #f7fbfe; }
.meta-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid #cfe9f8;
}
.meta-ico .ico { width: 14px; height: 14px; }
.meta-k {
  font-size: 11px; font-weight: 650; color: #8090a3;
  letter-spacing: .02em;
}
.meta-v {
  font-size: 13.5px; font-weight: 650; color: var(--ink);
  word-break: break-word; justify-self: end; text-align: right;
}
.meta-v .badge { vertical-align: middle; }
.meta-v code, .meta-v .card-mono { font-size: 12px; }

.pay-card-visual {
  margin: 12px 14px 6px;
  border-radius: 14px; padding: 16px 16px 14px;
  background:
    radial-gradient(120px 80px at 90% 10%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, #0e1621, #1b3a57 70%, #2aabee);
  color: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.18);
}
.pay-card-visual .pc-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  opacity: .75; margin-bottom: 18px;
}
.pay-card-visual .pc-num {
  font-family: var(--font-mono); font-size: 18px; font-weight: 600;
  letter-spacing: .14em; margin-bottom: 12px;
}
.pay-card-visual .pc-bot {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; opacity: .9;
}
.pay-card-visual .pc-bot strong {
  display: block; font-size: 10px; opacity: .55; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px;
}
.pay-card-visual .linkish { color: #b7e4fb; }
.pay-card-visual .badge {
  background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2);
}
.pay-card-visual .badge .ico { color: #fff; }

.spec-table {
  width: 100%; border-collapse: collapse;
}
.spec-table td {
  padding: 11px 16px; border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
}
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table tr:nth-child(even) td { background: #fafbfd; }
.spec-table .sk {
  width: 34%; color: #8090a3; font-size: 12px; font-weight: 650;
}
.spec-table .sv {
  text-align: right; font-weight: 650; font-size: 13.5px;
}
.spec-table .sv code {
  background: #f4f7fb; border-color: #e4e9f0;
}

.user-wallet-strip {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.wallet-tile {
  border-radius: var(--radius-lg); padding: 14px 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #eef7fc, #fff); box-shadow: var(--shadow-sm);
}
.wallet-tile.ref { background: linear-gradient(160deg, #fff7ed, #fff); }
.wallet-tile .t {
  font-size: 11px; color: var(--ink-soft); font-weight: 600;
}
.wallet-tile .n {
  font-size: 22px; letter-spacing: -.03em; margin-top: 4px;
  color: var(--ink); font-weight: 700; font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.linkish {
  color: var(--accent); text-decoration: none; font-weight: 650; cursor: pointer;
}
.linkish:hover { text-decoration: underline; }

.table-wrap {
  overflow: auto; max-height: min(62vh, 720px);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .03), transparent 28px),
    #fff;
}
.table-wrap.tall { max-height: min(72vh, 860px); }
table, .data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
th, td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid #eef1f6;
  white-space: normal; word-break: break-word; vertical-align: middle;
}
th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: #8090a3; background: rgba(247, 249, 252, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap; font-weight: 700;
  border-bottom: 1px solid #e4e9f0;
}
th:first-child { padding-left: 16px; }
td:first-child { padding-left: 16px; }
td.num {
  color: #b0bac8; font-variant-numeric: tabular-nums;
  width: 40px; white-space: nowrap;
  font-family: var(--font-num); font-size: 11px; font-weight: 600;
}
td .money, .money, .money-cell {
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700;
  letter-spacing: -.025em; color: var(--ink); white-space: nowrap;
}
.money-cell { text-align: right; font-size: 13.5px; }
th.money-head { text-align: right; }

/* Ledger rows */
.data-table tbody tr,
table tbody tr {
  transition: background .14s ease, box-shadow .14s ease;
}
.data-table tbody tr td:first-child,
table tbody tr td:first-child {
  box-shadow: inset 3px 0 0 transparent;
  transition: box-shadow .14s ease;
}
.data-table tbody tr.st-ok td:first-child,
tr.st-ok td:first-child { box-shadow: inset 3px 0 0 #34d399; }
.data-table tbody tr.st-pending td:first-child,
tr.st-pending td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.data-table tbody tr.st-process td:first-child,
tr.st-process td:first-child { box-shadow: inset 3px 0 0 #06b6d4; }
.data-table tbody tr.st-bad td:first-child,
tr.st-bad td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.data-table tbody tr.st-timeout td:first-child,
.data-table tbody tr.st-cancel td:first-child,
tr.st-timeout td:first-child,
tr.st-cancel td:first-child { box-shadow: inset 3px 0 0 #94a3b8; }

.data-table tbody tr:nth-child(even) td,
table tbody tr:nth-child(even) td {
  background: #fafbfd;
}
tr.clickable { cursor: pointer; }
tr.clickable:hover td {
  background: #eef7fc !important;
}
tr.clickable:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
tr.new-row td {
  background: #d7effc !important;
  animation: flash-row 1.8s ease forwards;
}
@keyframes flash-row {
  from { background: #9ad4f5; }
  to { background: transparent; }
}

/* Stacked cells */
.cell-stack {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.cell-primary {
  font-weight: 650; color: var(--ink); line-height: 1.25;
  letter-spacing: -.01em;
}
.cell-sub {
  font-size: 11px; color: #8b97a8; line-height: 1.3;
  font-family: var(--font-mono); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.cell-user {
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
}
.avatar-sm {
  width: 28px; height: 28px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 10px; font-weight: 700;
  color: #0b6fa4; background: linear-gradient(145deg, #e8f5fd, #d5edfa);
  border: 1px solid #c5e5f7; letter-spacing: -.02em;
}
.kassa-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 7px;
  background: #f4f7fb; border: 1px solid #e4e9f0;
  font-weight: 650; font-size: 12.5px; color: #344054;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kassa-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(42,171,238,.15);
}
.card-mono {
  font-family: var(--font-mono); font-size: 12px; font-weight: 550;
  letter-spacing: .04em; color: #475569;
  background: #f8fafc; border: 1px solid #e8edf3;
  padding: 4px 8px; border-radius: 6px; display: inline-block;
}

.ico {
  width: 14px; height: 14px; display: inline-block; vertical-align: -2px;
  flex: 0 0 auto;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 4px 10px; font-size: 11.5px; font-weight: 650; white-space: nowrap;
  border: 1px solid transparent; letter-spacing: -.01em;
}
.badge .ico { width: 12px; height: 12px; }
.badge.dep { background: var(--ok-soft); color: #047857; border-color: #a7f3d0; }
.badge.wd { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge.st-pending { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.badge.st-warn { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.badge.st-process { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.badge.st-ok { background: var(--ok-soft); color: #047857; border-color: #a7f3d0; }
.badge.st-bad { background: var(--bad-soft); color: #b91c1c; border-color: #fecaca; }
.badge.st-timeout { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge.st-cancel { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

.form-grid {
  display: grid; grid-template-columns: 140px 1fr; gap: 10px 12px; align-items: start;
  margin: 12px 0 18px;
}
.form-grid label { color: var(--ink-soft); font-size: 13px; font-weight: 550; padding-top: 12px; }
.form-grid input, .form-grid select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: inherit; background: #fff;
}
.secret-field { display: grid; gap: 4px; }
.secret-field input { font-family: var(--font-mono); letter-spacing: .04em; }
.secret-hint { font-size: 11px !important; }
.bal-ok { color: var(--ok); font-weight: 700; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.bal-bad { color: var(--bad); font-weight: 650; }

.cards-grid {
  display: grid; gap: 10px; padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card-item {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px;
  background: #fff; display: grid; gap: 8px; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.card-item:hover { border-color: #7fd0f6; box-shadow: 0 8px 20px rgba(42,171,238,.1); }
.card-item .name { font-weight: 700; font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.kassa-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
.kassa-summary .chip {
  border-radius: var(--radius-lg); padding: 12px 14px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm);
}
.kassa-summary .chip .t {
  font-size: 11px; color: var(--ink-soft); font-weight: 600;
}
.kassa-summary .chip .n {
  font-size: 20px; letter-spacing: -.03em; margin-top: 4px; font-weight: 700;
  font-family: var(--font-mono);
}

.kassa-table td { vertical-align: middle; }
.kassa-table tbody tr { border-left: 3px solid transparent; }
.kassa-table tbody tr.kassa-row-on { border-left-color: #34d399; }
.kassa-table tbody tr.kassa-row-off {
  border-left-color: #f87171; opacity: .88;
  background: linear-gradient(90deg, rgba(254,242,242,.55), transparent 45%);
}
.kassa-table tbody tr.kassa-row-on:hover {
  background: linear-gradient(90deg, rgba(240,253,250,.8), transparent 50%);
}
.kassa-table .kassa-name {
  font-weight: 700; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.kassa-table .kassa-name .rank {
  width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  display: inline-grid; place-items: center; font-size: 10px; font-weight: 700;
}
.kassa-actions {
  display: inline-flex; flex-wrap: nowrap; gap: 4px; align-items: center;
}
.kassa-actions .btn.icon {
  width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center;
  border-radius: 8px;
}
.kassa-actions .btn.soft-on { background: var(--ok-soft); color: #047857; border-color: #a7f3d0; }
.kassa-actions .btn.soft-off { background: var(--bad-soft); color: #b91c1c; border-color: #fecaca; }
.kassa-actions .btn.soft-zap { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.kassa-actions .btn.soft-zap.on { background: #fef3c7; color: #92400e; }
.kassa-row-off .kassa-name { color: var(--ink-soft); }

.switch {
  width: 42px; height: 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: #cbd5e1; position: relative;
}
.switch.on { background: var(--accent); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch.on::after { transform: translateX(18px); }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }

.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
}
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(16, 24, 40, .45);
}
.modal-card {
  position: relative; width: min(420px, 100%);
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(16,24,40,.18); padding: 20px 18px 14px;
}
.modal-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  font: inherit; background: #fff; resize: vertical; min-height: 110px;
}
.chart {
  display: flex; align-items: flex-end; gap: 6px; height: 140px;
  padding: 16px 16px 8px; border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.chart-bar {
  flex: 1; min-width: 10px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #7fd0f6, #2aabee);
  position: relative;
}
.chart-bar span {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--ink-soft); white-space: nowrap; margin-bottom: 4px;
  opacity: 0; pointer-events: none;
}
.chart-bar:hover span { opacity: 1; }

.sla-age {
  display: inline-flex; align-items: center;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-mono);
}
.sla-age.ok { background: var(--ok-soft); color: #047857; }
.sla-age.warn { background: var(--warn-soft); color: #b45309; }
.sla-age.bad { background: var(--bad-soft); color: #b91c1c; }
.sla-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sla-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; box-shadow: var(--shadow-sm); font-size: 13px; cursor: pointer;
}
.sla-chip:hover { border-color: #7fd0f6; background: var(--accent-soft); }
.sla-chip .ago.bad { color: var(--bad); font-weight: 700; }
.sla-chip .ago.warn { color: var(--warn); font-weight: 700; }

.risk-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.risk-flag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa;
}
.risk-flag.danger { background: var(--bad-soft); color: #b91c1c; border-color: #fecaca; }
.risk-inline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.risk-inline .risk-flag { font-size: 10px; padding: 2px 6px; }

.timeline { display: grid; gap: 0; padding: 10px 16px 14px; }
.timeline-item {
  display: grid; grid-template-columns: 16px 1fr; gap: 12px;
  position: relative; padding: 0 0 16px;
}
.timeline-item:last-child { padding-bottom: 2px; }
.timeline-item::before {
  content: ""; position: absolute; left: 7px; top: 16px; bottom: 0;
  width: 2px; background: linear-gradient(180deg, #7fd0f6, #e4e9f0);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(42,171,238,.12); margin-top: 1px;
}
.timeline-item.done .timeline-dot {
  border-color: #10b981; background: #10b981;
  box-shadow: 0 0 0 4px rgba(16,185,129,.15);
}
.timeline-at { font-size: 11px; color: #8090a3; margin-bottom: 3px; font-family: var(--font-mono); font-weight: 550; }
.timeline-title { font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; }
.timeline-detail { font-size: 12px; color: var(--ink-soft); word-break: break-word; margin-top: 2px; }
.detail-footer { padding: 12px 14px; }
.detail-actions { margin: 0; }

.toast-stack {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  background: #17212b; color: #e8f4fc; border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 14px 36px rgba(11, 59, 54, .35);
  font-size: 13px; border-left: 3px solid #2dd4bf;
}
.toast-item.clickable { cursor: pointer; }
.toast-item .t { font-weight: 700; margin-bottom: 2px; font-size: 13.5px; }
.toast-item .d { opacity: .85; font-size: 12.5px; }
.toast-item.ok { border-left-color: #34d399; }
.toast-item.warn { border-left-color: #f59e0b; }

.settings-shell { display: grid; gap: 12px; }
.settings-hero {
  border-radius: 14px; padding: 20px 22px; color: #fff;
  background: linear-gradient(135deg, #0e1621 0%, #17212b 55%, #2b5278 100%);
  box-shadow: var(--shadow);
}
.settings-hero h3 {
  font-size: 20px; letter-spacing: -.02em; margin-bottom: 4px; font-weight: 700;
}
.settings-hero p { opacity: .85; font-size: 13px; }
.settings-groups {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.settings-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.settings-card .head {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  display: flex; align-items: center; gap: 8px;
}
.settings-card .head h4 { font-size: 13.5px; font-weight: 700; }
.settings-card .head .ico { color: var(--accent); }
.settings-card .body { padding: 6px 10px 10px; }
.set-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 8px;
}
.set-item:hover { background: var(--paper-2); }
.set-item strong { font-size: 13.5px; }
.set-item .muted { font-size: 11px; }
.val-form { display: inline-flex; gap: 6px; align-items: center; }
.val-form input {
  width: 110px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff;
}

.yechim-acts { flex-wrap: wrap; max-width: 240px; }

/* SweetAlert2 */
.uz-swal {
  border-radius: 14px !important;
  font-family: var(--font-body) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .16) !important;
  padding: 1.4rem !important;
}
.uz-swal .swal2-title {
  font-size: 1.2rem !important; font-weight: 700 !important;
  letter-spacing: -.02em; color: var(--ink) !important;
}
.uz-swal .swal2-html-container {
  font-size: .95rem !important; color: var(--ink-soft) !important;
}
.uz-swal-ok {
  background: var(--accent) !important; border-radius: 8px !important;
  font-weight: 650 !important; padding: .6rem 1.1rem !important;
}
.uz-swal-ok:hover { background: var(--accent-2) !important; }
.uz-swal-cancel {
  background: #fff !important; color: var(--ink) !important;
  border: 1px solid var(--line) !important; border-radius: 8px !important;
  font-weight: 600 !important; padding: .6rem 1.1rem !important;
}
.uz-swal-cancel:hover { background: var(--paper) !important; }
.uz-swal-danger {
  background: var(--bad) !important; border-radius: 8px !important;
  font-weight: 650 !important; padding: .6rem 1.1rem !important;
}
.uz-swal-toast {
  border-radius: 10px !important; font-family: var(--font-body) !important;
  box-shadow: 0 12px 32px rgba(16,24,40,.16) !important;
}

/* Dark */
body.dark {
  --ink: #e4e7ec;
  --ink-soft: #98a2b3;
  --paper: #0c111b;
  --paper-2: #161b26;
  --card: #161b26;
  --line: #2a3344;
  --line-strong: #3a4558;
  --accent: #64b5ef;
  --accent-2: #2aabee;
  --accent-soft: rgba(42, 171, 238, .14);
  --sidebar-bg: #0e1621;
  --sidebar-bg-2: #0a1018;
  --sidebar-active: #2b5278;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  background: #0c111b;
}
body.dark .sidebar { background: var(--sidebar-bg); }
body.dark .sidebar-brand, body.dark .sidebar-foot { background: var(--sidebar-bg-2); }
body.dark .topbar { background: rgba(22, 27, 38, .92); }
body.dark .stream-pill { background: rgba(42,171,238,.14); border-color: rgba(42,171,238,.28); color: #7fd0f6; }
body.dark .icon-btn, body.dark .account-chip {
  background: #161b26 !important; border-color: var(--line) !important; color: var(--ink-soft);
}
body.dark .who { color: var(--ink); }
body.dark .topbar-title { color: var(--ink-soft); }
body.dark .btn { background: #161b26; color: var(--ink); border-color: var(--line); }
body.dark .btn.primary, body.dark .btn.primary-sm { background: #2aabee; color: #fff; }
body.dark .field input, body.dark .toolbar input, body.dark .toolbar select,
body.dark textarea, body.dark .form-grid input, body.dark .form-grid select {
  background: #0c111b; color: var(--ink); border-color: var(--line);
}
body.dark .panel-head, body.dark th { background: #121821; }
body.dark .modal-card { background: var(--card); }
body.dark tr.clickable:hover { background: rgba(42,171,238,.1); }
body.dark .detail-card, body.dark .detail-footer, body.dark .detail-activity { background: var(--card); }
body.dark .wallet-tile { background: linear-gradient(160deg, rgba(42,171,238,.12), #161b26); }
body.dark .settings-card .head { background: #121821; }
body.dark .toast-item { background: #0e1621; }
body.dark .login-card { background: var(--card); }
body.dark .uz-swal { background: #161b26 !important; }
body.dark .uz-swal .swal2-title { color: #e4e7ec !important; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: min(280px, 86vw);
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .28);
  }
  .shell.sidebar-open .sidebar { transform: translateX(0); }
  .shell.sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-close, .menu-btn { display: grid; place-items: center; }
  .who { max-width: 80px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .split-2 { grid-template-columns: 1fr; }
  .kassa-summary { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .user-wallet-strip { grid-template-columns: 1fr; }
  .settings-groups { grid-template-columns: 1fr; }
  .detail-hero-side { text-align: left; }
  .main { padding: 14px; }
  .detail-kv { grid-template-columns: 110px 1fr; }
}

@media (max-width: 720px) {
  .stream-pill span:last-child { display: none; }
  .topbar-title { display: none; }
  .page-head { flex-wrap: wrap; gap: 8px; }
  .page-head h2 { font-size: 20px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar select, .toolbar input { min-width: 0; flex: 1 1 140px; }
  .table-wrap { font-size: 12px; }
  .yechim-table th:nth-child(3),
  .yechim-table td:nth-child(3) { display: none; }
  .yechim-acts { max-width: none; }
  .yechim-acts .btn { min-height: 38px; min-width: 38px; }
  .toast-stack { left: 10px; right: 10px; bottom: 10px; }
  .nav-menu { max-height: 70vh; overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  tr.new-row { animation: none; }
}
