:root {
  --bg: #090b0f;
  --bg-soft: #11141b;
  --panel: #151820;
  --panel-2: #1c202a;
  --ink: #f2eee6;
  --muted: #9ca4af;
  --line: rgba(196, 166, 108, 0.20);
  --soft-line: rgba(255, 255, 255, 0.08);
  --purple: #7d729f;
  --purple-2: #282436;
  --gold: #c4a66c;
  --gold-soft: rgba(196, 166, 108, 0.12);
  --green: #72b394;
  --rose: #d7748c;
  --blue: #7fa6bd;
  --chart-money: #c4a66c;
  --chart-revenue: #8d97ac;
  --chart-profit: #78aa8d;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.30);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.light {
  --bg: #f6f7f9;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f3f6;
  --ink: #1f2530;
  --muted: #66707e;
  --line: #d9dee7;
  --soft-line: #e9edf3;
  --purple: #7b7398;
  --purple-2: #ece9f4;
  --gold: #a9874d;
  --gold-soft: #f7f0df;
  --chart-money: #a9874d;
  --chart-revenue: #748093;
  --chart-profit: #5f9478;
  --shadow: 0 14px 34px rgba(35, 44, 70, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: linear-gradient(180deg, #0d0f14 0%, #10121a 46%, #090b0f 100%);
}

body.light {
  background:
    linear-gradient(180deg, rgba(109, 79, 211, 0.08), transparent 360px),
    var(--bg);
}

body.auth-only .app-shell {
  grid-template-columns: 1fr;
}

body.auth-only .sidebar,
body.auth-only .topbar,
body.auth-only .page-head,
body.auth-only .sidebar-backdrop {
  display: none;
}

body.auth-only .view {
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 100vh;
  overflow-y: auto;
  padding: 14px 12px;
  background: linear-gradient(180deg, #0c0d12, #11141b 58%, #090b0f);
  border-right: 1px solid var(--line);
  color: #f8f1df;
}

body.light .sidebar {
  background: #ffffff;
  color: #202636;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #0a0810;
  background: linear-gradient(135deg, var(--gold), #ddc895);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(196, 166, 108, 0.28), 0 14px 28px rgba(196, 166, 108, 0.10);
}

.brand-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border-radius: var(--radius);
  color: inherit;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(216, 180, 91, 0.11);
}

body.light .nav-item:hover,
body.light .nav-item.active {
  background: #f1eefc;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--gold);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
}

.soon-dot {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 11px;
}

.manager-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

body.light .manager-box {
  background: #f8f9fc;
}

.manager-label,
.sidebar-footer,
.muted {
  color: var(--muted);
}

.manager-name {
  margin-top: 6px;
  font-weight: 600;
}

.manager-link {
  display: block;
  margin-top: 7px;
  color: var(--gold);
  font-size: 12px;
}

.sidebar-footer {
  margin-top: 18px;
  padding: 8px;
  font-size: 12px;
}

.sidebar-backdrop {
  display: none;
}

.workspace {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 22px;
  background: rgba(8, 7, 13, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

body.light .topbar {
  background: rgba(255, 255, 255, 0.84);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.topbar-left:empty {
  display: none;
}

.notification-btn {
  min-width: 112px;
}

.mobile-menu {
  display: none;
}

.primary-btn,
.purple-btn,
.ghost-btn,
.tool-btn,
.icon-btn {
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  padding: 0 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-btn {
  color: #0b0810;
  background: linear-gradient(135deg, var(--gold), #d9c18a);
}

.purple-btn {
  color: #ffffff;
  background: var(--purple);
}

.ghost-btn,
.tool-btn {
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.icon-btn {
  width: 34px;
  padding: 0;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.impersonation-pill {
  min-height: 34px;
  max-width: 280px;
  padding: 0 12px;
  border: 1px solid rgba(224, 191, 118, 0.35);
  border-radius: var(--radius);
  color: var(--gold);
  background: rgba(224, 191, 118, 0.10);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu {
  display: none;
}

.balance-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: var(--radius);
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--line);
  font-weight: 600;
}

.theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.theme-switch button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.theme-switch button.active {
  color: #0b0810;
  background: var(--gold);
}

.profile-wrap {
  position: relative;
}

.profile-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0b0810;
  background: var(--gold);
  font-size: 11px;
  font-weight: 600;
}

.avatar.big {
  width: 62px;
  height: 62px;
  font-size: 18px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  z-index: 80;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-name {
  font-weight: 600;
}

.profile-email {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.profile-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.profile-menu button:hover {
  background: var(--panel-2);
}

.profile-warning {
  display: block;
  margin: 4px 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 17, 31, 0.96), rgba(14, 11, 23, 0.98));
  box-shadow: var(--shadow);
}

body.light .auth-panel {
  background: #ffffff;
}

.auth-brand {
  margin-bottom: 26px;
}

.auth-panel h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.auth-panel p,
.auth-footnote,
.auth-status {
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-error {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 95, 143, 0.34);
  border-radius: var(--radius);
  color: #ffd4df;
  background: rgba(255, 95, 143, 0.10);
  font-size: 13px;
}

body.light .auth-error {
  color: #9e2145;
}

.auth-footnote {
  margin-top: 16px;
  font-size: 12px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  max-width: 100%;
  gap: 14px;
  padding: 20px 24px 12px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0;
}

.page-head p:not(.eyebrow) {
  max-width: 700px;
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: break-word;
}

.view {
  display: grid;
  max-width: 100%;
  gap: 14px;
  padding: 0 24px 30px;
}

.view > *,
.page-head > div,
.toolbar > * {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.segmented button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: #0b0810;
  background: var(--gold);
}

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

.metric-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
  min-height: 88px;
  display: grid;
  align-content: space-between;
  padding: 13px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.metric-card strong {
  font-size: 21px;
  font-weight: 500;
}

.metric-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.metric-card.gold {
  border-color: var(--line);
  background: linear-gradient(135deg, var(--panel), var(--gold-soft));
}

.metric-card.good em {
  color: var(--green);
}

.metric-nav-card {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.metric-nav-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.metric-nav-card:focus-visible {
  outline: 2px solid rgba(212, 176, 106, 0.45);
  outline-offset: 3px;
}

.panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(20, 17, 31, 0.88);
  box-shadow: var(--shadow);
}

body.light .panel {
  background: var(--panel);
}

.compact-panel {
  margin-bottom: 10px;
}

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

.status-cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(230px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.inline-form label,
.inline-form input,
.inline-form select {
  min-width: 0;
}

.stack-cell {
  display: grid;
  gap: 4px;
}

.stack-cell small,
.danger-text {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.danger-text {
  color: #ff8daa;
}

.json-mini {
  display: block;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  background: transparent;
}

.legal-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.legal-actions,
.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.legal-tabs .active {
  border-color: var(--gold);
  color: var(--gold);
}

.legal-document {
  display: grid;
  gap: 14px;
}

.legal-body {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-2);
  white-space: pre-wrap;
  line-height: 1.55;
}

.alert-list {
  margin-top: 12px;
}

.panel h2,
.modal h2,
.drawer h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
}

.panel h3,
.modal h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.panel p,
.modal-copy,
.drawer p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-note {
  max-width: 270px;
  padding: 10px 12px;
  border: 1px solid rgba(53, 167, 255, 0.26);
  border-radius: var(--radius);
  color: #aee0ff;
  background: rgba(53, 167, 255, 0.10);
  font-size: 12px;
}

body.light .status-note {
  color: #146493;
}

.status-note.danger {
  max-width: none;
  color: #ffd4df;
  border-color: rgba(255, 95, 143, 0.34);
  background: rgba(255, 95, 143, 0.10);
}

body.light .status-note.danger {
  color: #9e2145;
}

.revshare-history-access {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.revshare-history-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.revshare-history-panel article {
  display: grid;
  gap: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
}

.revshare-history-panel article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.revshare-history-panel article > div,
.revshare-history-panel li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.revshare-history-panel strong,
.revshare-history-panel b {
  font-size: 12px;
}

.revshare-history-panel span,
.revshare-history-panel li span {
  color: var(--muted);
  font-size: 12px;
}

.revshare-history-panel ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.payment-history-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.compact-head {
  margin-bottom: 0;
}

.payment-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payment-history-grid h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
}

.payment-history-grid small {
  color: var(--muted);
  font-size: 12px;
}

.danger-action {
  border-color: rgba(255, 95, 143, 0.32);
  color: #ffd4df;
}

body.light .danger-action {
  color: #9e2145;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 500;
}

body.light .data-table th {
  background: #f7f8fb;
}

.data-table tbody tr:hover {
  background: rgba(216, 180, 91, 0.06);
}

.row-title {
  color: var(--ink);
  font-weight: 500;
}

.graph-panel {
  border-color: rgba(196, 166, 108, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--panel);
}

.trend-chart {
  display: grid;
  gap: 12px;
}

.trend-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: stretch;
}

.trend-svg {
  width: 100%;
  min-height: 260px;
  display: block;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.005)),
    var(--panel-2);
}

.chart-grid-line {
  stroke: var(--soft-line);
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.trend-area {
  opacity: 0.72;
}

.trend-area.money {
  fill: rgba(196, 166, 108, 0.14);
}

.trend-area.revenue {
  fill: rgba(141, 151, 172, 0.12);
}

.trend-area.profit {
  fill: rgba(120, 170, 141, 0.12);
}

.trend-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line.money,
.trend-point.money,
.chart-legend i.money {
  stroke: var(--chart-money);
  background: var(--chart-money);
}

.trend-line.revenue,
.trend-point.revenue,
.chart-legend i.revenue {
  stroke: var(--chart-revenue);
  background: var(--chart-revenue);
}

.trend-line.profit,
.trend-point.profit,
.chart-legend i.profit {
  stroke: var(--chart-profit);
  background: var(--chart-profit);
}

.trend-point {
  fill: var(--panel);
  stroke-width: 2;
}

.trend-hit {
  fill: transparent;
  cursor: crosshair;
}

.trend-end-label {
  dominant-baseline: middle;
  fill: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.trend-end-label.money {
  fill: var(--chart-money);
}

.trend-end-label.revenue {
  fill: var(--chart-revenue);
}

.trend-end-label.profit {
  fill: var(--chart-profit);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-summary {
  display: grid;
  align-content: stretch;
  grid-template-columns: 1fr;
  gap: 8px;
}

.chart-summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.chart-summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.chart-summary strong {
  font-size: 15px;
  font-weight: 500;
}

.chart-summary small,
.chart-breakdown em {
  color: var(--muted);
  font-size: 11px;
}

.chart-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.chart-breakdown article {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.chart-breakdown strong {
  font-size: 13px;
  font-weight: 600;
}

.chart-breakdown span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chart-breakdown b {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 500;
}

.chart-breakdown b.money {
  color: var(--chart-money);
}

.chart-breakdown b.revenue {
  color: var(--chart-revenue);
}

.chart-breakdown b.profit {
  color: var(--chart-profit);
}

.bar-chart {
  display: grid;
  gap: 11px;
}

.bar-item {
  display: grid;
  grid-template-columns: 130px minmax(120px, 1fr) 90px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--gold));
}

.two-col {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.format-grid,
.check-grid,
.option-grid,
.method-grid,
.offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-card,
.method-card,
.option-card,
.offer-card,
.preset-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-2);
}

.check-card {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-card input,
.check-row input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--gold);
}

.full {
  width: 100%;
}

.ad-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ad-card {
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.ad-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.ad-card h3 {
  margin: 14px 0 5px;
  font-size: 16px;
  font-weight: 500;
}

.ad-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--line);
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions .tool-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.staff-secret {
  margin-top: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.ad-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.ad-card-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(190px, 0.9fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 13px 14px;
}

.ad-card-row .ad-card-main {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ad-card-row .ad-code-id,
.ad-card-row .ad-card-title,
.ad-card-row .ad-card-formats {
  min-width: 0;
}

.ad-card-row .ad-code-id {
  display: grid;
  gap: 4px;
}

.ad-card-row .ad-code-id strong {
  font-size: 17px;
  line-height: 1.15;
}

.ad-card-row h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.2;
}

.ad-card-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ad-card-row .ad-card-formats {
  display: grid;
  gap: 8px;
}

.ad-card-row .chip-row {
  gap: 6px;
}

.ad-card-row .chip {
  padding: 4px 7px;
}

.ad-card-row .ad-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  min-width: 230px;
  margin-top: 0;
}

.ad-card-row .ad-actions .ghost-btn,
.ad-card-row .ad-actions .tool-btn,
.ad-card-row .ad-actions .purple-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.status {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
}

.status.active,
.status.completed,
.status.approved {
  color: var(--green);
  background: rgba(61, 199, 134, 0.12);
}

.status.review,
.status.in-progress,
.status.pending,
.status.anti-fraud-review,
.status.finance-review {
  color: var(--gold);
  background: var(--gold-soft);
}

.status.rejected {
  color: #ff8daa;
  background: rgba(255, 141, 170, 0.12);
}

.method-card {
  text-align: left;
}

.method-card.active,
.option-card.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.method-card span,
.method-card em,
.offer-card span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.api-panel {
  display: grid;
  gap: 18px;
}

.token-input {
  max-width: 520px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.api-block h3 {
  margin-bottom: 8px;
}

.code-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #07060b;
}

body.light .code-line {
  background: #f6f7fb;
}

code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.doc-details {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 14px;
}

.doc-details summary {
  cursor: pointer;
  color: var(--gold);
}

.doc-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
}

.doc-grid span {
  color: var(--muted);
}

.soon-panel {
  min-height: 420px;
  display: grid;
  align-content: center;
  justify-items: start;
}

.soon-large {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
}

.ai-layout {
  grid-template-columns: 0.78fr 1.22fr;
}

.prompt-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.prompt-list button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-2);
  text-align: left;
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: 12px;
}

.chat-window {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 340px;
  max-height: 480px;
  overflow-y: auto;
}

.message {
  max-width: 82%;
  padding: 12px;
  border-radius: var(--radius);
  line-height: 1.45;
  font-size: 14px;
}

.message.assistant {
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--soft-line);
}

.message.user {
  justify-self: end;
  color: #0b0810;
  background: var(--gold);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.referral-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.referral-steps span {
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
  text-align: center;
}

.manager-card-large {
  display: flex;
  align-items: center;
  gap: 16px;
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.manager-rules {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-line);
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
}

.modal {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-2);
}

.modal-section {
  margin-top: 18px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink);
}

.filter-list,
.preset-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.preset-row {
  width: 100%;
  text-align: left;
}

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

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}

.empty-state {
  margin-top: 16px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.drawer-backdrop {
  place-items: stretch end;
  padding: 0;
}

.drawer {
  position: relative;
  width: min(460px, 100%);
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.drawer-meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.drawer-meta span {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: 180ms ease;
}

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

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

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: min(248px, calc(100vw - 28px));
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    background: rgba(0, 0, 0, 0.45);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .mobile-menu {
    display: inline-flex;
  }
}

@media (max-width: 880px) {
  .topbar,
  .page-head,
  .view {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .metric-grid,
  .metric-grid.compact,
  .trend-layout,
  .chart-summary,
  .two-col,
  .ad-card-list,
  .format-grid,
  .method-grid,
  .ad-request-grid,
  .offer-grid,
  .referral-steps,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .topbar-left,
  .topbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .metric-card {
    min-height: 82px;
  }

  .data-table {
    min-width: 620px;
  }

  .chat-form,
  .copy-field,
  .inline-form,
  .bar-item {
    grid-template-columns: 1fr;
  }

  .status-cluster {
    justify-content: flex-start;
  }
}

.brand strong {
  display: block;
  font-weight: 600;
}

.brand span,
.manager-mini span {
  color: var(--muted);
  font-size: 12px;
}

.soon-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 11px;
}

.manager-mini {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

body.light .manager-mini {
  background: #f8f9fc;
}

.terms-link {
  margin-top: 14px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.role-switch button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.role-switch button.active {
  color: #0b0810;
  background: var(--gold);
}

.profile-btn span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0b0810;
  background: var(--gold);
  font-size: 11px;
  font-weight: 600;
}

.profile-menu > strong,
.profile-menu > span {
  display: block;
}

.profile-menu > span {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.info-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(53, 167, 255, 0.26);
  border-radius: var(--radius);
  color: #aee0ff;
  background: rgba(53, 167, 255, 0.10);
  font-size: 12px;
  white-space: nowrap;
}

body.light .info-pill {
  color: #146493;
}

.link-btn {
  padding: 0;
  color: var(--gold);
  background: transparent;
  text-align: left;
  font-weight: 500;
}

.link-btn:hover {
  text-decoration: underline;
}

.user-login-cell {
  display: flex;
  align-items: center;
  min-width: 190px;
  gap: 8px;
}

.user-login-cell .link-btn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-btn.tiny,
.ghost-btn.tiny {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.good {
  color: var(--green);
}

.bad {
  color: var(--rose);
}

.metric-card.warn em {
  color: var(--gold);
}

.payment-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.payment-summary-grid .metric-card {
  min-height: 68px;
  padding: 10px 12px;
  box-shadow: none;
}

.payment-summary-grid .metric-card strong {
  font-size: 18px;
  line-height: 1.12;
}

.payment-summary-grid .metric-card span,
.payment-summary-grid .metric-card em {
  font-size: 11px;
}

.payment-method-panel {
  padding: 12px;
}

.payment-method-panel .panel-head {
  align-items: center;
  margin-bottom: 8px;
}

.payment-method-panel h2,
.payout-panel h2,
.ad-request-panel h2 {
  font-size: 16px;
}

.payment-method-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.payment-method-grid .method-card {
  min-height: 62px;
  gap: 3px;
  padding: 8px 10px;
}

.payment-method-grid .method-card strong {
  font-size: 14px;
}

.payment-method-grid .method-card span,
.payment-method-grid .method-card em {
  font-size: 11px;
}

.payout-panel {
  padding: 14px;
}

.payout-panel .panel-head {
  margin-bottom: 8px;
}

.payout-form {
  margin-bottom: 10px;
}

.admin-toolbar {
  align-items: end;
}

.search-field {
  min-width: min(420px, 100%);
  flex: 0 1 420px;
}

.panel-head .info-pill {
  max-width: 280px;
  white-space: normal;
  text-align: left;
}

.admin-grid,
.ad-layout,
.api-layout,
.ai-layout,
.security-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
}

.ad-codes-admin-grid {
  grid-template-columns: 1fr;
}

.ad-code-requests-panel {
  width: 100%;
  min-width: 0;
}

.ad-code-requests-wrap {
  overflow-x: hidden;
}

.ad-code-requests-table {
  min-width: 0;
  table-layout: fixed;
}

.ad-code-requests-table th,
.ad-code-requests-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.ad-code-requests-table .link-btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.ad-code-requests-table td:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ad-code-user-col {
  width: 28%;
}

.ad-code-domain-col {
  width: 19%;
}

.ad-code-vertical-col {
  width: 12%;
}

.ad-code-format-col {
  width: 13%;
}

.ad-code-status-col {
  width: 10%;
}

.ad-code-action-col {
  width: 18%;
}

.request-form {
  display: grid;
  gap: 14px;
}

.ad-request-panel {
  padding: 12px;
}

.ad-request-panel .panel-head {
  align-items: center;
  margin-bottom: 8px;
}

.ad-request-form {
  gap: 10px;
}

.ad-request-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ad-formats-section {
  margin-top: 0;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.ad-formats-section h3 {
  margin-bottom: 6px;
  font-size: 13px;
}

.ad-formats-section .check-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 4px 8px;
}

.ad-formats-section .check-row {
  min-height: 26px;
  gap: 6px;
  font-size: 12px;
}

.ad-formats-section .check-row input {
  width: 14px;
  min-height: 14px;
}

.ad-request-form textarea {
  min-height: 64px;
}

.route-list,
.crm-grid,
.endpoint-list,
.mini-list {
  display: grid;
  gap: 10px;
}

.route-card,
.crm-card,
.endpoint-list article,
.mini-list article,
.formula-card,
.copy-box {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.route-card span,
.route-card em,
.crm-card span,
.crm-card em,
.endpoint-list span,
.formula-card span,
.copy-box span,
.mini-list span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.route-card b,
.formula-card b {
  color: var(--gold);
  font-weight: 600;
}

.copy-box {
  margin-top: 14px;
}

.copy-box code {
  color: var(--ink);
  line-height: 1.45;
}

.formula-card {
  margin-top: 14px;
}

.single-soon {
  min-height: 300px;
  justify-items: start;
}

.single-soon p {
  color: var(--gold);
  font-size: 42px;
  line-height: 1;
}

.quick-prompts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.quick-prompts button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-2);
  text-align: left;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px minmax(160px, 1fr) 100px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-row > div {
  display: grid;
  gap: 4px;
  min-height: 10px;
}

.bar-row i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
}

.bar-row i.revenue {
  background: linear-gradient(90deg, #7258dd, #b9a7ff);
}

.bar-row i.money {
  background: linear-gradient(90deg, var(--gold), #ffe59a);
}

.bar-row i.profit {
  background: linear-gradient(90deg, var(--green), #9ef0c7);
}

.code-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #07060b;
}

body.light .code-block {
  background: #f6f7fb;
}

.code-block pre {
  margin: 0;
  min-width: 0;
  overflow-x: auto;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.token-box {
  margin: 14px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  background: var(--gold-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.revshare-slider {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.revshare-slider-head,
.revshare-slider-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.revshare-slider-head span,
.revshare-slider-meta {
  color: var(--muted);
  font-size: 12px;
}

.revshare-slider-head output {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
}

.revshare-range-wrap {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 28px;
}

.revshare-range {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.revshare-range:focus {
  border-color: transparent;
  box-shadow: none;
}

.revshare-range:focus-visible {
  outline: 2px solid rgba(212, 176, 106, 0.45);
  outline-offset: 3px;
  border-radius: 999px;
}

.revshare-range::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) 0 var(--revshare-value), rgba(255, 255, 255, 0.10) var(--revshare-value) 100%);
}

.revshare-range::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  appearance: none;
}

.revshare-range::-moz-range-track {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.revshare-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
}

.revshare-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.revshare-range:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.revshare-current-marker {
  position: absolute;
  left: var(--revshare-current);
  top: 50%;
  width: 2px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body.light .revshare-current-marker {
  background: rgba(20, 28, 42, 0.45);
}

.wide-drawer {
  width: min(720px, 100%);
}

.mini-table {
  min-width: 480px;
}

.fraud-score {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at center, var(--gold-soft), transparent 72%);
}

.fraud-score strong {
  color: var(--gold);
  font-size: 54px;
  font-weight: 500;
}

.fraud-score span {
  color: var(--muted);
}

.crm-card {
  border-left: 3px solid var(--gold);
}

.crm-card.high {
  border-left-color: var(--rose);
}

.crm-card.medium {
  border-left-color: var(--gold);
}

.crm-card.low {
  border-left-color: var(--green);
}

.crm-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-card strong {
  color: var(--gold);
  font-weight: 600;
}

.crm-card p {
  margin: 0;
}

@media (max-width: 1100px) {
  .admin-grid,
  .ad-layout,
  .api-layout,
  .ai-layout,
  .security-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .ad-card-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ad-card-row .ad-card-main {
    grid-template-columns: 1fr;
  }

  .ad-card-row .ad-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .role-switch,
  .theme-switch {
    width: 100%;
  }

  .topbar-left {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  .topbar-left > .primary-btn {
    min-width: 0;
    padding: 0 9px;
    font-size: 13px;
  }

  .topbar-left > .balance-pill {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .topbar-right {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  .role-switch,
  .theme-switch {
    grid-column: 1 / -1;
  }

  .profile-wrap,
  .profile-btn {
    min-width: 0;
  }

  .profile-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-btn strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .copy-row,
  .code-block,
  .settings-grid,
  .bar-row {
    grid-template-columns: 1fr;
  }

  .ad-actions {
    grid-template-columns: 1fr;
  }

  .panel-head {
    display: grid;
  }

  .drawer,
  .wide-drawer {
    width: 100%;
    max-width: 100vw;
  }
}

@media (max-width: 420px) {
  .topbar,
  .page-head,
  .view {
    padding-left: 10px;
    padding-right: 10px;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .segmented,
  .toolbar {
    width: 100%;
  }

  .segmented button,
  .toolbar .tool-btn,
  .toolbar .ghost-btn {
    flex: 1 1 auto;
  }

  .data-table {
    min-width: 560px;
  }
}
