:root {
  --bg: #0b0d12;
  --bg2: #10131a;
  --card: #151922;
  --card2: #1a1f2b;
  --line: rgba(255, 255, 255, 0.06);
  --border: transparent;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.22);
  --accent: #ffcc00;
  --accent-dim: #e6b800;
  --text: #eef1f6;
  --muted: #8b93a7;
  --green: #3dd68c;
  --red: #ff6b6b;
  --sidebar-w: 240px;
  --radius: 16px;
}

[data-theme="light"] {
  --bg: #f0f2f6;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #f5f6f9;
  --line: rgba(15, 18, 25, 0.06);
  --border: transparent;
  --shadow: 0 10px 30px rgba(20, 28, 45, 0.08);
  --shadow-sm: 0 2px 8px rgba(20, 28, 45, 0.06);
  --accent: #c99700;
  --accent-dim: #a67d00;
  --text: #0f1219;
  --muted: #4a5568;
  --green: #0f8a4b;
  --red: #c62828;
}

/* Light theme: yellow accents readable on white (use dark amber, not pale yellow). */
[data-theme="light"] .nav a.active {
  background: rgba(201, 151, 0, 0.18);
  color: #8a6a00;
  font-weight: 800;
}
[data-theme="light"] .detail-nav-item.active {
  background: rgba(201, 151, 0, 0.18);
  color: #8a6a00;
}
[data-theme="light"] .nr-bal,
[data-theme="light"] .detail-stat .ds-v.accent,
[data-theme="light"] .detail-msisdn {
  color: #8a6a00;
}

[data-theme="light"] .btn-primary {
  background: #ffcc00;
  color: #111;
  box-shadow: 0 4px 14px rgba(180, 140, 0, 0.35);
}
[data-theme="light"] .btn-secondary {
  background: #fff;
  border-color: #b8c0d0;
  color: #1a2030;
}
[data-theme="light"] .badge {
  background: rgba(15, 138, 75, 0.16);
  color: #0a6b3a;
}
[data-theme="light"] .status-pill { color: #4a5568; border-color: #c8ceda; }
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .ops-stat,
[data-theme="light"] .active-bar,
[data-theme="light"] .number-row,
[data-theme="light"] .detail-panel,
[data-theme="light"] .number-card,
[data-theme="light"] .balance-item {
  border-color: transparent;
  box-shadow: var(--shadow);
}
[data-theme="light"] .btn-secondary {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
  background: #fff;
}
[data-theme="light"] .number-picker,
[data-theme="light"] .status-pill {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .sidebar {
  border-right: none;
  box-shadow: 4px 0 24px rgba(20, 28, 45, 0.06);
}
[data-theme="light"] .table-wrap {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] body {
  background-image:
    radial-gradient(1100px 520px at 100% -10%, rgba(201, 151, 0, 0.1), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(15, 138, 75, 0.06), transparent 55%);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 100% -10%, rgba(255, 204, 0, 0.06), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(61, 214, 140, 0.05), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.mi {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  vertical-align: middle;
  user-select: none;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: none;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  font-weight: 700;
  font-size: 18px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: rgba(255, 204, 0, 0.12); color: var(--accent); font-weight: 700; }
.nav a .mi { font-size: 20px; opacity: 0.95; }
.sidebar-foot { border-top: none; padding-top: 14px; margin-top: 8px; }
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.switch {
  width: 42px; height: 24px; border-radius: 99px; background: var(--line);
  position: relative; cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--text); transition: transform .2s;
}
[data-theme="light"] .switch::after { transform: translateX(18px); }
.profile {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: var(--card);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #ffcc00, #ff9500);
  color: #111; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.profile small { display: block; color: var(--muted); font-size: 11px; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 22px 24px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.topbar-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.number-picker {
  position: relative;
  min-width: 180px; max-width: 260px;
}
.number-picker-trigger {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: var(--card); border: none; border-radius: 12px;
  padding: 8px 10px; cursor: pointer; font-family: inherit; color: var(--text);
  box-shadow: var(--shadow-sm); font-weight: 700; font-size: 14px;
}
.number-picker-trigger .mi:first-child { color: var(--accent); font-size: 20px; flex: none; }
.number-picker-trigger .chev { margin-left: auto; color: var(--muted); font-size: 20px; transition: transform .15s; }
.number-picker.open .number-picker-trigger .chev { transform: rotate(180deg); }
.number-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.number-picker-menu {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 50;
  min-width: 260px; background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; overflow: hidden;
}
.number-picker-menu[hidden] { display: none; }
.number-picker-search {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px;
}
.number-picker-search .mi { color: var(--muted); font-size: 18px; }
.number-picker-search input {
  flex: 1; border: none !important; box-shadow: none !important;
  background: var(--bg2); border-radius: 10px; padding: 9px 10px; font-size: 13px;
}
.number-picker-list { max-height: 240px; overflow: auto; }
.number-picker-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px; background: transparent;
  color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.number-picker-item:hover,
.number-picker-item.active { background: rgba(255, 204, 0, 0.14); color: var(--accent); }
.number-picker-item .meta { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.number-picker-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
[data-theme="light"] .number-picker-item:hover,
[data-theme="light"] .number-picker-item.active {
  background: rgba(201, 151, 0, 0.16); color: #8a6a00;
}
.status-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 99px; background: var(--card);
  border: none; font-size: 13px; color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.btn {
  border: none; border-radius: 10px; padding: 10px 16px;
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn .mi { font-size: 19px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #111; box-shadow: 0 4px 16px rgba(255, 204, 0, 0.28); }
.btn-primary:hover { background: var(--accent-dim); box-shadow: 0 6px 20px rgba(255, 204, 0, 0.4); }
.btn-secondary { background: var(--card2); color: var(--text); border: none; box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--card); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { padding: 10px; }
.icon-btn .mi { font-size: 20px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
}
.card-head .card-title { margin: 0; }

.page { display: none; }
.page.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  min-height: 130px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,.35); }
.stat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-ic {
  font-size: 22px; color: var(--muted);
  width: 38px; height: 38px; border-radius: 10px; background: var(--card2);
  display: grid; place-items: center;
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.stat-value.accent { color: var(--accent); }
.stat-sub { margin-top: 8px; font-size: 12px; color: var(--muted); }
.stat-flows {
  margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700;
}
.stat-flows .flow-in { color: var(--green); }
.stat-flows .flow-out { color: var(--red); }
.stat-bar {
  margin-top: 12px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden;
}
.stat-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.card {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.action-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.action-card .card-title { margin-bottom: 4px; }
.card-title {
  font-size: 15px; font-weight: 600; margin: 0 0 14px;
}
.card-title.muted { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
input, select {
  width: 100%; padding: 11px 12px; border-radius: 12px;
  border: none; background: var(--bg2); color: var(--text); font-size: 14px;
  font-family: inherit; transition: box-shadow .15s;
  box-shadow: inset 0 0 0 1px var(--line);
}
input:focus, select:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 3px rgba(255, 204, 0, 0.14);
}
.nav a.active { box-shadow: inset 2px 0 0 var(--accent); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.row.btns { align-items: flex-end; }
.row.btns .btn { margin-top: 0; white-space: nowrap; }

.alert {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 13px;
  border: 1px solid rgba(61, 214, 140, 0.35); background: rgba(61, 214, 140, 0.08); color: var(--green);
  display: none;
}
.alert.show { display: block; }
.alert.err { border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.08); color: var(--red); }

.active-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 14px 16px; border-radius: 14px; background: var(--card2); border: none;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.active-ic {
  font-size: 22px; color: var(--accent);
  width: 40px; height: 40px; border-radius: 10px; background: rgba(255,204,0,.12); display: grid; place-items: center;
}
.active-number { font-size: 18px; font-weight: 800; color: var(--accent); }
.badge {
  font-size: 11px; padding: 4px 8px; border-radius: 99px;
  background: rgba(61,214,140,.15); color: var(--green); font-weight: 600;
}
.badge.off { background: rgba(139,147,167,.15); color: var(--muted); }
.active-meta { color: var(--muted); font-size: 13px; }
.active-meta strong { color: var(--text); }

.op-ic { font-size: 20px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.op-ic.all { background: rgba(255,204,0,.12); color: var(--accent); }
.op-ic.ok { background: rgba(61,214,140,.14); color: var(--green); }
.op-ic.zero { background: rgba(139,147,167,.14); color: var(--muted); }
.op-ic.err { background: rgba(255,107,107,.14); color: var(--red); }

.stmt-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.stmt-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  margin-bottom: 12px;
}
.stmt-head .left { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; flex: 1; }
.stmt-head .left > div { min-width: 220px; }

.stmt-meta-line {
  display: flex; flex-wrap: wrap; gap: 14px 22px; font-size: 13px; color: var(--muted); margin-bottom: 10px;
}
.stmt-meta-line strong { color: var(--text); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cat-chip {
  font-size: 11px; padding: 5px 10px; border-radius: 99px;
  background: var(--card2); border: none; color: var(--muted);
}

.filters-row {
  display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; margin-bottom: 10px;
}
.filters-row .btn { margin-top: 0; }
.search-input { position: relative; }
.search-input .mi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 19px; pointer-events: none; }
.search-input input { padding-left: 38px; }

.table-wrap {
  overflow: auto; border: none; border-radius: 14px; background: var(--bg2);
  box-shadow: var(--shadow-sm);
}
table.stmt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.stmt th {
  text-align: left; padding: 12px 10px; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: none;
  background: var(--card); white-space: nowrap;
}
table.stmt td { padding: 11px 10px; border-bottom: none; vertical-align: middle; }
table.stmt tbody tr:nth-child(even) td { background: rgba(127,127,127,.04); }
table.stmt tr:hover td { background: rgba(255,255,255,.02); }
table.stmt .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.zero { color: var(--muted); }
.cat-cell { display: flex; align-items: center; gap: 8px; }
.cat-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--card2); color: var(--accent); flex: none;
}
.cat-icon .mi { font-size: 18px; }

.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; font-size: 13px; color: var(--muted);
}
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager button {
  min-width: 34px; height: 34px; border-radius: 8px; border: none;
  background: var(--card); color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.pager button.active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.numbers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 14px;
}
.number-card {
  background: var(--card2); border: none; border-radius: 14px; padding: 14px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
  min-width: 0;
}
.number-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.number-card.active { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.number-card.archived { opacity: 0.78; }
.number-card .msisdn { font-size: 18px; font-weight: 700; }
.number-card .number-balance {
  margin-top: 8px; font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em;
}
.number-card .meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.number-card-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.number-card-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  font-size: 12px;
  gap: 0;
  justify-content: center;
}
.number-card-actions .btn .mi { font-size: 20px; }

.mine-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 4px 0 12px; flex-wrap: nowrap;
}
.mine-head-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  margin-left: auto; min-width: 0;
}
.mine-filter {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 42px; padding: 0 10px 0 12px; border-radius: 12px;
  background: var(--card2); box-shadow: var(--shadow-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.mine-filter:focus-within {
  border-color: rgba(255, 204, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1), var(--shadow-sm);
}
.mine-filter .mi:first-child { font-size: 18px; color: var(--muted); flex: none; }
.mine-filter-chev {
  font-size: 20px; color: var(--muted); flex: none; pointer-events: none;
}
.mine-filter select {
  border: none; background: transparent; color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600;
  min-width: 96px; max-width: 180px; width: auto; flex: 1;
  height: 100%; padding: 0; margin: 0;
  outline: none; cursor: pointer; box-shadow: none !important;
  appearance: none; -webkit-appearance: none;
}
.mine-filter select:focus {
  outline: none; box-shadow: none !important;
}
.mine-toolbar-sep {
  width: 1px; height: 28px; background: var(--line); flex: none;
}
.mine-stats {
  display: inline-flex; align-items: center; flex: none;
  white-space: nowrap; padding: 0 12px; height: 42px;
  border-radius: 10px; background: var(--card2); box-shadow: var(--shadow-sm);
  font-weight: 700;
}
.view-toggle {
  display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px;
  background: var(--card2); box-shadow: var(--shadow-sm); flex: none;
}
.view-toggle-btn {
  width: 36px; height: 36px; border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--muted); display: grid; place-items: center;
}
.view-toggle-btn .mi { font-size: 20px; }
.view-toggle-btn.active { background: var(--accent); color: #111; }
.view-toggle-btn:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.04); }
#archiveCard { margin-top: 8px; }
.section-title {
  margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.02em;
}
.numbers-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 18px;
}
.number-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(88px, 0.7fr)) minmax(140px, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.number-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.number-row.active { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.nr-phone { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nr-msisdn { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.nr-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.nr-k { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.nr-bal { font-size: 18px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.nr-v { font-size: 15px; font-weight: 700; }
.nr-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row-flows { display: flex; flex-direction: column; gap: 2px; }
.row-flows.empty { font-size: 12px; color: var(--muted); }
.row-flow { font-size: 13px; font-weight: 800; }
.row-flow.in { color: var(--green); }
.row-flow.out { color: var(--red); }

.detail-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.detail-panel--inline {
  grid-column: 1 / -1;
  margin-top: -2px;
  margin-bottom: 2px;
}
.numbers-grid .detail-panel--inline .detail-top { display: none; }
.number-card.active:has(+ .detail-panel--inline) {
  border-radius: 14px 14px 0 0;
  margin-bottom: 0;
  box-shadow: 0 0 0 2px var(--accent);
}
.numbers-grid .detail-panel--inline {
  border-radius: 0 0 16px 16px;
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}
.number-row.active:has(+ .detail-panel--inline) {
  border-radius: 16px 16px 0 0;
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
}
.number-row + .detail-panel--inline {
  margin-top: -10px;
  margin-bottom: 10px;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
}
.detail-panel--inline {
  grid-template-columns: 1fr;
}
.detail-panel--inline .detail-nav {
  flex-direction: row;
  flex-wrap: wrap;
  border-right: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  gap: 6px;
}
.detail-panel--inline .detail-nav-item {
  width: auto;
  padding: 8px 12px;
}
.detail-nav {
  background: var(--card2);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line);
}
.detail-nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; border: none; background: transparent; color: var(--muted);
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; text-align: left;
}
.detail-nav-item .mi { font-size: 18px; }
.detail-nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.detail-nav-item.active {
  background: rgba(255, 204, 0, 0.14); color: var(--accent);
}
.detail-body { padding: 18px 20px 20px; }
.detail-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.detail-id { display: flex; align-items: center; gap: 12px; }
.detail-sim {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,204,0,.12); color: var(--accent);
  display: grid; place-items: center; font-size: 22px;
}
.detail-msisdn { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.detail-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.detail-stat {
  background: var(--card2); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.detail-stat .ds-l { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.detail-stat .ds-v { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.detail-stat .ds-v.accent { color: var(--accent); }
.detail-stat .ds-v.pos { color: var(--green); }
.detail-stat .ds-v.neg { color: var(--red); }
.detail-stat .ds-s { margin-top: 2px; font-size: 11px; color: var(--muted); }
.detail-zero { margin-bottom: 14px; }
.detail-proxy {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--card2);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.detail-proxy-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.detail-proxy-head .mi { font-size: 18px; color: var(--accent); }
.detail-proxy-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.detail-proxy-status { margin-left: auto; text-align: right; }
.detail-proxy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.detail-proxy-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.detail-proxy-row .btn { flex-shrink: 0; }
.detail-proxy-msg { margin-top: 6px; min-height: 0; }
.detail-actions-label {
  font-size: 12px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px;
}
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-actions .btn { width: 100%; padding: 12px 10px; }
.btn-sm { padding: 8px 10px; font-size: 13px; }

.history { margin-top: 10px; }
.audit-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 4px 0 10px;
}
.audit-search { flex: 1; min-width: 220px; margin: 0; }
.audit-toolbar-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.audit-type-filters {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--card2); box-shadow: var(--shadow-sm);
}
.audit-type-group-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 6px;
}
.audit-type-group-items { display: flex; flex-wrap: wrap; gap: 6px; }
.audit-type-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px;
  background: var(--bg2); color: var(--text); user-select: none;
  border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.audit-type-chip input { display: none; }
.audit-type-chip .mi { font-size: 16px; color: var(--accent); }
.audit-type-chip:not(:has(input:checked)) { opacity: .45; }
.audit-type-chip:has(input:checked) {
  border-color: rgba(255, 204, 0, 0.35); background: rgba(255, 204, 0, 0.08);
}
.audit-day-group { margin-bottom: 18px; }
.audit-day-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 0 8px 2px;
}
.log-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.log-meta-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  padding: 3px 8px; border-radius: 999px; background: var(--bg2); color: var(--muted);
}
.log-meta-pill strong { color: var(--text); font-weight: 700; }
.log-meta-pill .mi { font-size: 14px; }
.history-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.history-item:last-child { border-bottom: none; }
.history-time { color: var(--muted); min-width: 110px; font-size: 12px; }
.history-detail { color: var(--muted); font-size: 12px; margin-top: 3px; }

.msg { font-size: 13px; margin-top: 8px; min-height: 16px; }
.ok { color: var(--green); }
.warn { color: var(--accent); }
.err { color: var(--red); }
.muted { color: var(--muted); }

.stmt-panel { display: none; }
.stmt-panel.visible { display: block; }

.placeholder {
  padding: 50px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.placeholder .mi { font-size: 42px; opacity: .6; }

.empty-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; }
.empty-ic { font-size: 46px; color: var(--muted); opacity: .7; }

.small { font-size: 12px; }

.balance-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 4px;
}
.balance-item {
  background: var(--card2); border: none; border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow-sm);
}
.balance-item-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.balance-item-head .mi { font-size: 18px; color: var(--accent); }
.balance-item-name { font-weight: 600; color: var(--text); }
.balance-item-val { font-size: 22px; font-weight: 800; margin-top: 8px; letter-spacing: -0.01em; }
.balance-item-meta { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 14px; }

.spoiler { margin-top: 14px; border: none; border-radius: 12px; background: var(--bg2); overflow: hidden; box-shadow: var(--shadow-sm); }
.spoiler > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.spoiler > summary::-webkit-details-marker { display: none; }
.spoiler > summary:hover { color: var(--text); }
.spoiler > summary .mi { font-size: 18px; transition: transform .15s; }
.spoiler[open] > summary .mi { transform: rotate(90deg); }
.spoiler[open] > summary { border-bottom: 1px solid var(--line); color: var(--text); }
.spoiler .code-block { margin: 0; border: none; border-radius: 0; max-height: 360px; }
.code-block {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  overflow: auto; max-height: 320px; font-size: 12px; white-space: pre-wrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); margin: 12px 0 0;
}
.field { margin-bottom: 12px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,6,10,.66); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  width: 100%; max-width: 460px; background: var(--card); border: none;
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: modalIn .16s ease-out;
}
.modal-wide { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: none;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px;
  display: grid; place-items: center; border-radius: 8px;
}
.modal-close:hover { background: var(--card2); color: var(--text); }
.modal-close .mi { font-size: 22px; }
.modal-body { padding: 20px; }
.modal-body .row.btns { margin-top: 4px; }

/* --- Detailed activity log --- */
.log-item {
  display: flex; gap: 12px; padding: 14px; border: none;
  border-radius: 14px; background: var(--card2); margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.log-item.err { border-color: rgba(255, 107, 107, 0.35); }
.log-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: rgba(255, 204, 0, 0.12); color: var(--accent);
}
.log-item.err .log-icon { background: rgba(255, 107, 107, 0.14); color: var(--red); }
.log-body { flex: 1; min-width: 0; }
.log-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-label { font-weight: 700; }
.log-status { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.log-status.ok { background: rgba(61, 214, 140, 0.15); color: var(--green); }
.log-status.err { background: rgba(255, 107, 107, 0.15); color: var(--red); }
.log-time { margin-left: auto; color: var(--muted); font-size: 12px; }
.log-summary { margin-top: 6px; color: var(--text); font-size: 13px; }
.log-kv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kv {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--bg2); border: none; border-radius: 8px; padding: 3px 8px;
}
.kv-k { color: var(--muted); }
.kv-v { color: var(--text); font-weight: 600; word-break: break-all; }
.log-raw { margin-top: 10px; }
.log-raw > summary {
  list-style: none; cursor: pointer; color: var(--muted); font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.log-raw > summary::-webkit-details-marker { display: none; }
.log-raw > summary:hover { color: var(--text); }
.log-raw .mi { font-size: 16px; }
.log-raw pre {
  margin: 8px 0 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; overflow: auto; max-height: 300px; font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); white-space: pre-wrap;
}

/* --- Transfer modal --- */
.transfer-from {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px;
  background: var(--card2); border: none; border-radius: 14px;
}
.transfer-from .mi { font-size: 22px; color: var(--accent); width: 40px; height: 40px; border-radius: 10px; background: rgba(255,204,0,.12); display: grid; place-items: center; }
.transfer-from-num { font-weight: 800; font-size: 16px; }
.transfer-from-bal { margin-left: auto; font-weight: 800; color: var(--accent); }
.transfer-result { margin-top: 14px; }

/* --- Tariff modal --- */
.modal-tariff {
  max-width: 520px;
  --tariff-gap: 16px;
  --tariff-field-gap: 6px;
  --tariff-inline-gap: 12px;
}
.tariff-body {
  display: flex; flex-direction: column; gap: var(--tariff-gap);
}
.tariff-body .field { margin-bottom: 0; display: flex; flex-direction: column; gap: var(--tariff-field-gap); }
.tariff-body .field > label { margin: 0; }
.tariff-body .msg { margin: 0; min-height: 0; }
#tariffForm,
#tariffFormBody:not([hidden]) {
  display: flex; flex-direction: column; gap: var(--tariff-gap);
}
.tariff-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--card2); box-shadow: var(--shadow-sm);
}
.tariff-hero-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.tariff-hero-ic {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: rgba(255,204,0,.12); color: var(--accent);
  display: grid; place-items: center; font-size: 22px;
}
.tariff-hero-msisdn { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.tariff-hero-plan { font-size: 13px; margin-top: 2px; }
.tariff-hero-price {
  font-size: 20px; font-weight: 800; color: var(--accent);
  white-space: nowrap; flex-shrink: 0;
}
.tariff-hero--success {
  box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.45), var(--shadow-sm);
}
.tariff-hero--success .tariff-hero-ic {
  background: rgba(61, 214, 140, 0.14);
  color: var(--green);
}
.tariff-success {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(61, 214, 140, 0.12) 0%, var(--card2) 100%);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.28), var(--shadow-sm);
}
.tariff-success[hidden] { display: none !important; }
.tariff-success-head {
  display: flex; align-items: flex-start; gap: 12px;
}
.tariff-success-head.warn {
  background: transparent;
}
.tariff-success-head.warn + .tariff-success-note,
.tariff-success-head.warn ~ .tariff-success-note { border-color: rgba(255, 204, 0, 0.35); }
.tariff-success-ic {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 28px;
  background: rgba(61, 214, 140, 0.16); color: var(--green);
}
.tariff-success-head.warn .tariff-success-ic {
  background: rgba(255, 204, 0, 0.16); color: var(--accent);
}
.tariff-success-copy { min-width: 0; }
.tariff-success-title {
  font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--green);
}
.tariff-success-head.warn .tariff-success-title { color: var(--accent); }
.tariff-success-sub {
  margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.35;
}
.tariff-success-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(61, 214, 140, 0.24);
  background: rgba(61, 214, 140, 0.08);
  font-size: 13px; line-height: 1.4;
}
.tariff-success-note .mi { font-size: 18px; color: var(--green); flex-shrink: 0; margin-top: 1px; }
.tariff-success-actions { display: flex; justify-content: flex-end; }
.tariff-success-raw { margin-top: 0; }
.tariff-state {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--card2); color: var(--muted); font-size: 14px;
}
.tariff-state-err { color: var(--red); background: rgba(255,80,80,.08); }
.tariff-state-err .mi { font-size: 22px; flex-shrink: 0; }
.tariff-spin { animation: tariff-spin 1s linear infinite; }
@keyframes tariff-spin { to { transform: rotate(360deg); } }
.tariff-retry {
  align-self: flex-start; width: auto; margin: 0;
  padding: 7px 11px; font-size: 12px; border-radius: 10px;
}
.tariff-plan-picker { position: relative; }
.tariff-plan-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--card2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; font-family: inherit; color: var(--text);
  box-shadow: var(--shadow-sm); text-align: left; transition: border-color .15s, box-shadow .15s;
}
.tariff-plan-trigger:hover:not(:disabled) {
  border-color: rgba(255, 204, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.08);
}
.tariff-plan-trigger:disabled { cursor: default; opacity: 0.92; }
.tariff-plan-trigger.is-loading { border-color: rgba(255, 204, 0, 0.25); }
.tariff-plan-trigger.is-error { border-color: rgba(255, 80, 80, 0.45); }
.tariff-plan-trigger-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,204,0,.12); color: var(--accent);
  display: grid; place-items: center; font-size: 20px;
}
.tariff-plan-trigger-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tariff-plan-trigger-title {
  font-size: 15px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tariff-plan-trigger-sub {
  font-size: 12px; color: var(--muted); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tariff-plan-trigger-sub.err { color: var(--red); }
.tariff-plan-trigger .chev {
  margin-left: auto; color: var(--muted); font-size: 22px; flex-shrink: 0;
  transition: transform .15s;
}
.tariff-plan-picker.open .tariff-plan-trigger .chev { transform: rotate(180deg); }
.tariff-plan-trigger-spin {
  margin-left: auto; color: var(--accent); font-size: 22px; flex-shrink: 0;
}
.tariff-plan-trigger-spin[hidden], .tariff-plan-trigger .chev[hidden] { display: none !important; }
.tariff-plan-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; overflow: hidden;
}
.tariff-plan-menu[hidden] { display: none; }
.tariff-plan-search {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px;
}
.tariff-plan-search .mi { color: var(--muted); font-size: 18px; flex-shrink: 0; }
.tariff-plan-search input {
  flex: 1; border: none !important; box-shadow: none !important;
  background: var(--bg2); border-radius: 10px; padding: 9px 10px; font-size: 13px;
}
.tariff-plan-list { max-height: 260px; overflow: auto; }
.tariff-plan-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px; background: transparent;
  color: var(--text); font-family: inherit; cursor: pointer; text-align: left;
}
.tariff-plan-item:hover,
.tariff-plan-item.active { background: rgba(255, 204, 0, 0.14); }
.tariff-plan-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tariff-plan-item-name { font-size: 14px; font-weight: 700; line-height: 1.25; }
.tariff-plan-item-soc { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.tariff-plan-item-badge {
  flex-shrink: 0; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 7px; border-radius: 999px;
  background: rgba(255, 204, 0, 0.16); color: var(--accent);
}
.tariff-plan-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.tariff-packs {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--tariff-inline-gap);
}
.tariff-meta { font-size: 13px; color: var(--muted); margin: 0; }
.tariff-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tariff-inline-gap);
}
.tariff-actions .btn { width: 100%; padding: 11px 8px; font-size: 13px; margin: 0; }
.tariff-confirm {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 12px 14px; border-radius: 12px; background: var(--card2);
  font-size: 13px; color: var(--text); cursor: pointer; user-select: none;
}
.tariff-confirm input {
  flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent);
}
.tariff-confirm span { flex: 1; line-height: 1.35; }
.tariff-preview {
  margin: 0; padding: 12px 14px; border-radius: 12px;
  background: var(--card2); font-size: 13px; display: none;
}
.tariff-preview.visible { display: block; }
.tariff-preview h4 { margin: 0 0 8px; font-size: 14px; }
.tariff-preview ul { margin: 8px 0 0; padding-left: 18px; }
.tr-head { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 12px; }
.tr-head.ok { color: var(--green); }
.tr-head.warn { color: var(--accent); }
.tr-head.err { color: var(--red); }
.tr-head.muted { color: var(--muted); }
.tr-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px;
  background: var(--card2); border: none; border-radius: 14px; padding: 14px;
}
.tr-grid .kv-k { color: var(--muted); }
.tr-grid .kv-v { text-align: right; font-weight: 700; }
.tr-note {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; font-size: 13px;
  border: 1px solid rgba(255, 204, 0, 0.35); background: rgba(255, 204, 0, 0.08); color: var(--accent); border-radius: 10px;
}
.tr-note .mi { font-size: 18px; }

/* Desktop: sidebar always visible. Burger only on mobile. */
.menu-toggle { display: none; }
.sidebar {
  transition: transform .22s ease;
}
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 15;
  background: rgba(4, 6, 10, 0.55); backdrop-filter: blur(2px);
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .filters-row { grid-template-columns: 1fr; }
  .stmt-head .left > div { min-width: 0; flex: 1; }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    transform: translateX(-100%);
    width: 84%; max-width: 300px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
  }
  .sidebar.open {
    transform: none;
    pointer-events: auto;
  }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; padding: 16px 16px 40px; }

  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-title { flex: 1; min-width: 0; }
  .topbar h1 { font-size: 21px; }
  .topbar-sub { display: none; }
  .topbar-right { gap: 8px; }
  .status-pill { display: none; }
  .number-picker { min-width: 0; max-width: 150px; flex: 1; }
  .btn-primary#btnAddNumber { padding: 10px 12px; }

  .number-row {
    grid-template-columns: 1fr 1fr;
  }
  .nr-actions { grid-column: 1 / -1; }
  .detail-panel { grid-template-columns: 1fr; }
  .detail-nav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-panel--inline .detail-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-proxy-row { flex-wrap: wrap; }
  .detail-proxy-row input { flex: 1 1 100%; }
  .detail-proxy-row .btn { flex: 1; }
  .tariff-actions { grid-template-columns: 1fr; }
  .tariff-packs { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .action-card { flex-direction: column; align-items: stretch; }
  .action-card .btn { width: 100%; }
  .card { padding: 16px; }
  .card-head { flex-wrap: wrap; }
  .stmt-tools { width: 100%; }
  .stmt-head .left { flex-direction: column; align-items: stretch; }
  .stmt-head .left .btn { width: 100%; }
  .row { flex-direction: column; }
  .log-time { margin-left: 0; width: 100%; }
  .mine-head { flex-wrap: wrap; }
  .mine-head-toolbar { flex-wrap: wrap; width: 100%; margin-left: 0; }
}

@media (max-width: 520px) {
  .stat-value { font-size: 24px; }
  .number-row { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .balance-grid { grid-template-columns: 1fr; }
  .modal { border-radius: 14px; }
  .tr-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .tr-grid .kv-v { text-align: left; margin-bottom: 8px; }
  .numbers-grid { grid-template-columns: 1fr; }
}


/* --- Login page (standalone; no app shell in DOM) --- */
body.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255, 204, 0, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 110%, rgba(80, 120, 255, 0.08), transparent 50%),
    var(--bg);
}
.login-gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 18px;
  padding: 28px 26px; box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.profile { gap: 10px; }


/* --- Multi category filter (checkboxes) --- */
.cat-filter { position: relative; }
.cat-filter-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px; border: none; border-radius: 12px; background: var(--bg2); color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.cat-filter-btn .chev { color: var(--muted); transition: transform .15s; }
.cat-filter.open .cat-filter-btn .chev { transform: rotate(180deg); }
.cat-filter-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 8px; max-height: 280px; overflow: auto;
}
.cat-filter-menu[hidden] { display: none; }
.cat-check {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); margin: 0;
}
.cat-check:hover { background: rgba(255, 204, 0, 0.1); }
.cat-check.all { border-bottom: none; margin-bottom: 4px; color: var(--muted); }
.cat-check input {
  width: 18px; height: 18px; margin: 0; accent-color: var(--accent);
  box-shadow: none !important; flex: none; cursor: pointer;
}
