:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #151820;
  --muted: #69707d;
  --line: #e3e7ef;
  --brand: #3947ff;
  --brand-2: #151047;
  --good: #14885f;
  --warn: #b86b00;
  --bad: #c93434;
  --soft-good: #e8f7f0;
  --soft-warn: #fff3dd;
  --soft-bad: #fdeaea;
  --soft-blue: #e9edff;
  font-family: Arial, "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

body.logged-out {
  display: block;
}

body.logged-out .sidebar,
body.logged-out main {
  display: none;
}

button,
input,
select {
  font: inherit;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #120b3c;
}

.login-panel {
  width: min(460px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 16px;
}

.login-brand {
  color: var(--ink);
}

.login-brand img {
  width: 54px;
  height: 54px;
}

.login-panel h1 {
  margin: 4px 0 0;
}

.login-panel p {
  color: var(--muted);
  margin-bottom: 4px;
}

.login-panel label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.login-panel label span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.login-panel input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
  outline: 0;
}

.login-error {
  border: 1px solid #f0b7b7;
  background: var(--soft-bad);
  color: var(--bad);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.login-hint {
  background: #f1f3fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.login-copy-box {
  width: 100%;
  min-height: 112px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fd;
  color: #293044;
  padding: 10px;
  font-size: 13px;
  line-height: 1.55;
  margin-top: 8px;
}

.topup-inline {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 220px;
}

.topup-inline input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}

.topup-inline button {
  padding: 8px 10px;
}

.sidebar {
  min-height: 100vh;
  background: #120b3c;
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: #b9b7d6;
  font-size: 12px;
  margin-top: 4px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.nav-link {
  border: 0;
  color: #e8e7fb;
  background: transparent;
  padding: 12px 14px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

.nav-item:hover,
.nav-item.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sync-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 14px;
  border-radius: 8px;
  display: grid;
  gap: 10px;
}

.session-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 14px;
  border-radius: 8px;
  display: grid;
  gap: 10px;
}

.sync-card.hidden + .session-card {
  margin-top: auto;
}

.session-card span {
  color: #c7c4e8;
  font-size: 12px;
}

.session-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-card span {
  color: #c7c4e8;
  font-size: 12px;
}

main {
  padding: 26px;
  min-width: 0;
}

.topbar,
.section-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.search span {
  color: var(--muted);
  font-size: 12px;
}

.search input {
  border: 0;
  outline: 0;
  min-width: 230px;
}

.download-link {
  color: #fff;
  background: #151820;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.download-link.hidden {
  display: none;
}

.actions.reports-only .download-link {
  display: none;
}

.actions.reports-only.show-downloads .download-link:not(.hidden) {
  display: inline-flex;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button {
  background: #eef1f8;
  color: #192033;
}

.sidebar .secondary-button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics-grid.hidden {
  display: none;
}

.client-focus {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(20, 28, 45, 0.06);
}

.weekly-referral {
  background: #10133f;
  color: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  animation: referralPulse 1.8s ease-in-out 0s 4;
}

.weekly-referral::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.16) 42%, transparent 72%);
  transform: translateX(-120%);
  animation: referralShine 2.4s ease-in-out 0.2s 3;
  pointer-events: none;
}

@keyframes referralPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(67, 62, 255, 0);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(67, 62, 255, 0.24);
  }
}

@keyframes referralShine {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.weekly-referral.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.weekly-referral strong,
.weekly-referral span {
  display: block;
}

.weekly-referral span {
  color: #c8cdfc;
  margin-top: 4px;
  font-size: 13px;
}

.weekly-referral button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

.client-focus.hidden {
  display: none;
}

.focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.focus-title h2 {
  margin: 0;
  font-size: 28px;
}

.focus-title span {
  color: var(--muted);
  font-size: 13px;
}

.focus-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.client-alert-banner {
  border: 1px solid #ffd1d1;
  background: #fff2f2;
  color: #a42626;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 700;
}

.client-alert-banner.ok {
  border-color: #bce8d5;
  background: #effaf5;
  color: var(--good);
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.executive-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.compact-client-stats {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  margin-bottom: 14px;
}

.period-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.focus-stat {
  background: #f7f8fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.focus-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.focus-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.focus-stat input {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
}

.account-spend-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.chart-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.client-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 12px;
}

.inline-link {
  color: var(--brand);
  text-decoration: none;
}

.group-editor {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.group-editor span {
  color: var(--muted);
  font-size: 12px;
}

.group-editor input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.client-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.client-admin-grid label {
  display: grid;
  gap: 5px;
}

.client-admin-grid span {
  color: var(--muted);
  font-size: 12px;
}

.client-admin-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.danger-button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--soft-bad);
  color: var(--bad);
  font-weight: 700;
}

.history-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--soft-blue);
  color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.daily-spend-ledger {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.daily-spend-row {
  display: grid;
  grid-template-columns: 52px 1fr 68px;
  align-items: center;
  gap: 10px;
  color: #f4f6ff;
  font-size: 12px;
}

.daily-spend-row i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.daily-spend-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4b46ff;
}

.daily-spend-row strong {
  text-align: right;
}

.report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
}

.report-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.report-tabs button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.mini-chart {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.chart-bar {
  height: 10px;
  background: #edf0f6;
  border-radius: 999px;
  overflow: hidden;
}

.chart-bar i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.metric,
.panel,
.client-card,
.account-card,
.rule-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.trend-panel {
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: #0f1230;
  color: #fff;
}

.trend-tabs,
.platform-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.platform-tabs {
  margin-bottom: 10px;
}

.trend-tabs button,
.platform-tabs button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  color: #dfe1ff;
  font-size: 12px;
  cursor: pointer;
}

.trend-tabs button.active,
.platform-tabs button.active {
  background: var(--brand);
  color: #fff;
}

.trend-platform-select {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  max-width: 420px;
}

.trend-platform-select span {
  align-items: center;
  background: var(--brand);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.trend-platform-select select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #dfe1ff 50%) right 14px center / 6px 6px no-repeat,
    linear-gradient(135deg, #dfe1ff 50%, transparent 50%) right 9px center / 6px 6px no-repeat,
    #202347;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 34px 8px 10px;
  width: 100%;
}

.trend-platform-select option {
  background: #161837;
  color: #fff;
}

.trend-line-chart {
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(255, 255, 255, 0.02);
  padding: 12px;
  margin-bottom: 14px;
}

.trend-line-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trend-comparison {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.spend-gauge {
  --gauge: 0%;
  --gauge-color: var(--brand);
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #0f1230 0 58%, transparent 59%),
    conic-gradient(var(--gauge-color) var(--gauge), rgba(255,255,255,0.18) 0);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spend-gauge.up {
  --gauge-color: #31d18b;
}

.spend-gauge.down {
  --gauge-color: #ff5b6e;
}

.spend-gauge.flat {
  --gauge-color: #6c63ff;
}

.spend-gauge strong,
.spend-gauge span,
.spend-gauge em {
  display: block;
  text-align: center;
}

.spend-gauge strong {
  font-size: 24px;
}

.spend-gauge span {
  color: #aeb4d8;
  font-size: 11px;
  margin-top: 2px;
}

.spend-gauge em {
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  margin-top: 5px;
}

.spend-gauge.up em {
  color: #31d18b;
}

.spend-gauge.down em {
  color: #ff8b98;
}

.trend-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.trend-summary div {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
}

.trend-summary span {
  display: block;
  color: #aeb4d8;
  font-size: 12px;
}

.trend-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: #fff;
}

.metric {
  padding: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.admin-client-overview {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.client-overview-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(90px, 1fr));
  gap: 10px;
  align-items: center;
  background: #fff;
}

.client-overview-row strong,
.client-overview-row span {
  display: block;
}

.client-overview-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.dashboard-account-table {
  display: none;
}

.dashboard-account-table.show {
  display: block;
}

.dashboard-client-panel:not(.client-focused) .panel-head select {
  display: none;
}

.panel {
  padding: 18px;
}

.table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.table-filters select {
  min-width: 150px;
}

.wide {
  min-width: 0;
}

select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 10px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.table-money-input {
  width: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-active {
  background: var(--soft-good);
  color: var(--good);
}

.status-empty,
.status-need-top-up,
.status-not-spending {
  background: var(--soft-warn);
  color: var(--warn);
}

.status-suspended,
.status-under-review,
.status-refund-required {
  background: var(--soft-bad);
  color: var(--bad);
}

.platform {
  color: var(--brand-2);
  font-weight: 700;
}

.alert-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.alert-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fffaf1;
}

.alert-item.high,
.alert-item.refund,
.alert-item.suspended {
  border-left-color: var(--bad);
  background: #fff5f5;
}

.alert-item.empty,
.alert-item.low {
  border-left-color: #d99a00;
  background: #fff8e6;
}

.alert-item.not-spending {
  border-left-color: #e07b00;
  background: #fff3e6;
}

.alert-item strong,
.alert-item span {
  display: block;
}

.alert-item span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.client-grid,
.account-cards,
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.alerts-center {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.alert-banner {
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.alert-banner.refund,
.alert-banner.suspended {
  border-left-color: var(--bad);
  background: #fff5f5;
}

.alert-banner.empty,
.alert-banner.low {
  border-left-color: #d99a00;
  background: #fff8e6;
}

.alert-banner.not-spending {
  border-left-color: #e07b00;
  background: #fff3e6;
}

.alert-banner strong,
.alert-banner span {
  display: block;
}

.alert-banner span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.client-card,
.account-card,
.rule-card {
  padding: 16px;
}

.client-card h3,
.account-card h3,
.rule-card h3 {
  margin-bottom: 8px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.mini-stats div {
  background: #f4f6fb;
  border-radius: 8px;
  padding: 10px;
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-stats strong {
  display: block;
  margin-top: 4px;
}

.progress {
  height: 8px;
  background: #edf0f6;
  border-radius: 999px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.account-card {
  display: grid;
  gap: 12px;
}

.account-form {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.account-form label,
.account-card label {
  display: grid;
  gap: 6px;
}

.account-form input,
.account-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.account-form .form-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.account-card .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.account-card select,
.account-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.report-preview {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.report-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.report-client-picker {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.report-client-picker span {
  color: var(--muted);
  font-size: 12px;
}

.report-client-picker select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.account-check-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
}

.report-account-toolbar {
  grid-column: 1 / -1;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.report-account-toolbar button {
  background: #eef1ff;
  border: 1px solid #dce2ff;
  border-radius: 8px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 11px;
}

.report-account-toolbar button.active {
  background: var(--brand);
  color: #fff;
}

.report-account-toolbar strong {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.account-check-item {
  align-items: center;
  background: #fbfcff;
  border: 1px solid #dfe5f2;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 12px;
  transition: 140ms ease;
}

.account-check-item:hover {
  background: #f3f6ff;
  border-color: var(--brand);
}

.account-check-item input {
  accent-color: var(--brand);
  min-height: 18px;
  min-width: 18px;
  width: auto;
}

.account-check-item span {
  color: var(--text);
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.account-check-item strong {
  color: var(--text);
  font-size: 13px;
}

.account-check-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.report-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.upload-box {
  margin-top: 16px;
  border: 1px dashed #b8c0d1;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 12px;
  background: #fbfcff;
}

.upload-box span {
  color: var(--muted);
}

.real-file-input {
  display: none;
}

.client-action-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.client-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.client-action.refund-action {
  background: #fff5f5;
  border-color: #ffd0d0;
  border-left: 4px solid var(--bad);
}

.client-action.refund-action select {
  border: 1px solid #ffd0d0;
  border-radius: 8px;
  padding: 9px 10px;
  min-width: 150px;
}

.client-action strong,
.client-action span {
  display: block;
}

.client-action span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.icon-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft-warn);
  color: var(--warn);
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 22px;
  bottom: 22px;
  background: #151820;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: 160ms ease;
  pointer-events: none;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .metrics-grid,
  .executive-grid,
  .period-grid,
  .client-grid,
  .account-cards,
  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .report-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  main {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .search {
    width: 100%;
  }

  .search input {
    min-width: 0;
    width: 100%;
  }

  nav,
  .metrics-grid,
  .focus-grid,
  .executive-grid,
  .period-grid,
  .client-grid,
  .account-cards,
  .rules-grid {
    grid-template-columns: 1fr;
  }
}
