:root {
  color-scheme: light;
  --bg: #000000;
  --surface: #ffffff;
  --surface-muted: #f4f1ea;
  --line: #e5dccb;
  --line-strong: #cdbb98;
  --text: #111111;
  --muted: #5f5a51;
  --gold: #c59b3b;
  --gold-dark: #9f7621;
  --icon-orange: #e3a23a;
  --icon-bg: #031126;
  --teal: #c59b3b;
  --teal-dark: #9f7621;
  --blue: #c59b3b;
  --amber: #a66f00;
  --rose: #be123c;
  --green: #147a3f;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

textarea {
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
  padding: 14px 12px calc(88px + env(safe-area-inset-bottom));
}

.admin-app {
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #f6df99);
  color: #111111;
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  color: var(--gold);
  font-weight: 500;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: #f1eadb;
  font-size: 12px;
}

.account-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-switch select,
.field input,
.field select,
.field textarea,
.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  padding: 10px 12px;
  min-height: 42px;
}

.account-switch select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.page {
  max-width: 100%;
  margin: 0 auto;
}

.section {
  margin-top: 16px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.panel,
.metric,
.list-row,
.admin-list,
.admin-editor,
.empty-state,
.mini-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  color: var(--gold);
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.2;
  color: var(--gold);
}

h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.25;
  color: var(--text);
}

p {
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status.approved {
  background: #e7f6ed;
  color: var(--green);
  border-color: #b7e1c5;
}

.status.active {
  background: #e7f6ed;
  color: var(--green);
  border-color: #b7e1c5;
}

.status.review {
  background: #fff7ed;
  color: var(--amber);
  border-color: #fed7aa;
}

.status.blocked {
  background: #fff1f2;
  color: var(--rose);
  border-color: #fecdd3;
}

.code-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed #d8b451;
  border-radius: 12px;
  background: #fff7dc;
}

.code {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  word-break: break-all;
  color: var(--gold-dark);
}

.link-line {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--gold), #f2d47b);
  color: #111111;
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  flex: 1 1 auto;
}

.btn:hover {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn.secondary:hover {
  background: var(--surface-muted);
}

.btn.warn {
  background: var(--amber);
}

.btn.danger {
  background: var(--rose);
}

.btn.icon-only {
  width: 42px;
  padding: 0;
}

.icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-weight: 900;
  line-height: 1;
}

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

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

.metric,
.home-stats .metric {
  border-color: #ead69b;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(197, 155, 59, 0.22);
}

.home-stats .metric-label,
.home-stats .metric-note {
  color: var(--text);
}

.home-stats .metric-value {
  color: var(--gold-dark);
}

.metric {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  min-height: 108px;
  padding: 12px;
}

.metric-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: start;
}

.metric-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--icon-bg);
  color: var(--icon-orange);
}

.metric-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-label {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: normal;
}

.metric-value {
  margin: 0;
  font-size: clamp(18px, 5.8vw, 22px);
  font-weight: 800;
  line-height: 1.12;
  color: var(--gold-dark);
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.metric-note {
  margin: 0;
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: normal;
}

.status-metric .metric-label {
  color: var(--text);
}

.status-metric .metric-value {
  color: var(--gold-dark);
}

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

.section-head h2 {
  margin: 0;
}

.compact-btn {
  min-height: 36px;
  width: auto;
  padding: 8px 12px;
  flex: 0 0 auto;
}

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

.two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  box-shadow: none;
}

.row-title {
  margin: 0 0 3px;
  font-weight: 800;
}

.row-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.income-pill {
  display: inline-flex;
  min-width: 86px;
  justify-content: center;
  border-radius: 999px;
  background: #fff7dc;
  color: var(--gold-dark);
  padding: 8px 10px;
  font-weight: 850;
  white-space: nowrap;
}

.info-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 16px;
}

.rich-text {
  white-space: pre-wrap;
}

.project-highlight {
  border: 1px solid #ead69b;
  border-radius: 14px;
  background: #fff8e5;
  padding: 14px;
}

.project-highlight h2 {
  margin-bottom: 8px;
}

.app-shell.page-info .panel,
.app-shell.page-info .metric,
.app-shell.page-info .list-row,
.app-shell.page-info .empty-state,
.app-shell.page-info .project-highlight {
  border-color: #ead69b;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 42px rgba(197, 155, 59, 0.2);
}

.app-shell.page-info .project-highlight {
  border-color: var(--gold);
  background: var(--surface);
}

.app-shell.page-info h1,
.app-shell.page-info h2,
.app-shell.page-info .eyebrow,
.app-shell.page-info .metric-value,
.app-shell.page-info .code {
  color: var(--gold-dark);
}

.app-shell.page-info h3,
.app-shell.page-info p,
.app-shell.page-info .row-title {
  color: var(--text);
}

.app-shell.page-info .brand-title {
  color: var(--gold);
}

.app-shell.page-info .brand-subtitle {
  color: #f1eadb;
}

.app-shell .status-metric .metric-label {
  color: var(--text);
}

.app-shell .status-metric .metric-value {
  color: var(--gold-dark);
}

.app-shell.page-info .muted,
.app-shell.page-info .metric-label,
.app-shell.page-info .metric-note,
.app-shell.page-info .row-meta {
  color: var(--text);
}

.app-shell.page-info .project-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 30px 0;
  gap: 18px;
}

.app-shell.page-info .project-cards .metric {
  min-height: 132px;
  padding: 12px;
}

.app-shell.page-info .project-cards .metric-value {
  font-size: clamp(18px, 5.4vw, 21px);
  line-height: 1.16;
  white-space: pre-line;
}

.project-payout-card .metric-value {
  display: grid;
  gap: 2px;
}

.project-payout-card .metric-line {
  display: block;
  white-space: nowrap;
}

.project-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.project-promo-section {
  margin-top: 30px;
}

.steps {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.step-num {
  display: grid;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #fff1bf;
  color: var(--gold-dark);
  font-weight: 900;
}

.progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-fill {
  height: 100%;
  width: var(--value, 0%);
  max-width: 100%;
  background: linear-gradient(90deg, var(--gold-dark), #f2d47b);
}

.payout-panel {
  display: grid;
  gap: 12px;
}

.payout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff8e5;
}

.payout-summary span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.payout-summary strong,
.payout-readiness {
  color: var(--gold-dark);
  font-weight: 900;
}

.client-chart-panel .income-pill {
  min-width: 0;
}

.client-chart {
  min-width: 0;
  overflow: hidden;
}

.client-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
}

.chart-axis-line {
  stroke: var(--gold-dark);
  stroke-width: 2;
  stroke-linecap: round;
}

.chart-grid-line {
  stroke: rgba(159, 118, 33, 0.22);
  stroke-width: 1;
}

.chart-axis-label,
.chart-count-label,
.chart-date-label {
  fill: var(--gold-dark);
  font-weight: 900;
  text-anchor: middle;
}

.chart-axis-label {
  font-size: 10px;
}

.chart-count-label {
  font-size: 12px;
}

.chart-date-label {
  fill: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.chart-bar-bg {
  fill: rgba(197, 155, 59, 0.1);
}

.chart-bar {
  fill: url("#chartGold");
  fill: var(--icon-orange);
}

.chart-trend-line {
  fill: none;
  stroke: var(--gold-dark);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.bar-fill {
  height: 100%;
  width: var(--value, 0%);
  background: var(--blue);
}

.admin-shell {
  display: grid;
  gap: 10px;
}

.admin-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
}

.admin-nav-link.active {
  background: var(--gold);
  color: #111111;
}

.admin-screen {
  display: grid;
  gap: 10px;
}

.admin-screen-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.admin-screen-head p {
  margin: 4px 0 0;
}

.admin-screen-head .eyebrow,
.admin-screen-head .muted {
  color: #d8d0bd;
}

.admin-notifications {
  display: grid;
}

.admin-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.admin-notice strong {
  color: var(--amber);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.admin-list,
.admin-editor,
.mini-panel {
  padding: 14px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.search {
  min-width: 0;
}

.user-table {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.user-row > div:first-child {
  grid-column: 1 / -1;
}

.user-row .income-pill {
  justify-self: end;
}

.user-row:last-child {
  border-bottom: 1px solid var(--line);
}

.user-row.header {
  display: none;
}

.user-row:not(.header):hover,
.user-row.active {
  background: #fff8e5;
}

.compact-code {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  background: #fff7dc;
  color: var(--gold-dark);
  padding: 4px 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.settings-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.settings-section + .settings-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-page-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
}

.settings-page-block + .settings-page-block {
  margin-top: 14px;
}

.settings-page-block h3 {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1bf;
  color: var(--gold-dark);
}

.manual-income-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  align-items: center;
}

.manual-income-actions.full,
.full {
  grid-column: 1 / -1;
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-summary .mini-panel {
  border-color: transparent;
  background: var(--surface-muted);
  box-shadow: none;
}

.invitees-list {
  display: grid;
  gap: 8px;
}

.invitee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.invitee-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 800;
}

.sticky-actions {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 2;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 34%);
}

.empty-state.compact {
  padding: 14px;
}

.commission-preview {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  box-shadow: none;
}

.commission-preview p {
  margin: 0;
}

.commission-result,
.commission-note {
  color: var(--gold-dark);
  font-weight: 850;
}

.commission-note {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff8e5;
}

.purchase-list {
  display: grid;
  gap: 8px;
}

.purchase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.activity-list,
.payout-list {
  display: grid;
  gap: 10px;
}

.activity-row,
.payout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.activity-side,
.payout-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.activity-side strong,
.positive {
  color: var(--green);
}

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

.status.pending {
  background: #fff7ed;
  color: var(--amber);
  border-color: #fed7aa;
}

.status.paid,
.status.credited {
  background: #e7f6ed;
  color: var(--green);
  border-color: #b7e1c5;
}

.status-line {
  margin: 10px 0 0;
  font-weight: 850;
}

.status-line.pending {
  color: var(--amber);
}

.status-line.paid {
  color: var(--green);
}

.activity-row.payout .status.pending,
.payout-row.pending .status.pending {
  background: #fff7ed;
  color: var(--amber);
  border-color: #fed7aa;
}

.activity-row.payout .status.paid,
.payout-row.paid .status.paid {
  background: #e7f6ed;
  color: var(--green);
  border-color: #b7e1c5;
}

.calculator-panel,
.payout-form {
  display: grid;
  gap: 12px;
}

.calculator-panel .muted,
.calculator-panel label,
.calculator-result span {
  color: var(--text);
}

.calculator-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff8e5;
  color: var(--text);
  font-weight: 800;
}

.calculator-result strong {
  color: var(--gold-dark);
  font-size: 22px;
}

.payout-row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.requisites-box {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fff8e5;
  color: var(--text);
  white-space: pre-wrap;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.tab-btn {
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab-btn.active {
  background: var(--text);
  color: #ffffff;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  justify-content: center;
  width: calc(100vw - 16px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.nav-btn {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 56px;
  padding: 6px 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  flex: 1 1 0;
}

.nav-btn .icon {
  font-size: 18px;
}

.nav-btn.active {
  color: var(--gold-dark);
  background: #fff7dc;
}

.empty-state {
  padding: 22px;
  text-align: center;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(420px, calc(100vw - 24px));
  transform: translate(-50%, 12px);
  border-radius: var(--radius);
  background: #111827;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  padding: 11px 14px;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
  font-weight: 750;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.support-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lock {
  max-width: 430px;
  margin: 56px auto 0;
}

.hidden {
  display: none !important;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 16px 16px calc(88px + env(safe-area-inset-bottom));
  }

  .admin-app {
    padding-bottom: 24px;
  }

  .page {
    max-width: 1120px;
  }

  .topbar {
    max-width: 1120px;
    margin: 0 auto 16px;
  }

  h1 {
    font-size: 30px;
  }

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

  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 14px;
  }

  .two-column {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 14px;
  }

  .info-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
    gap: 14px;
  }

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

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

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

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

  .admin-shell {
    gap: 14px;
  }

  .admin-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-screen {
    gap: 14px;
  }

  .admin-screen-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .admin-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .activity-row,
  .payout-row {
    grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  }

  .activity-side,
  .payout-actions {
    justify-items: end;
  }

  .admin-grid {
    grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.25fr);
    gap: 14px;
  }

  .user-table {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .user-row {
    grid-template-columns: minmax(150px, 1.1fr) minmax(110px, 0.8fr) 90px 104px;
    min-height: 54px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  .user-row:last-child {
    border-bottom: 0;
  }

  .user-row > div:first-child {
    grid-column: auto;
  }

  .user-row.header {
    display: grid;
    min-height: 42px;
    background: #f3f6fa;
    color: var(--muted);
    cursor: default;
    font-size: 12px;
    font-weight: 800;
  }

  .metric {
    min-height: 104px;
    padding: 14px;
  }

  .metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .metric-icon svg {
    width: 23px;
    height: 23px;
  }

  .metric-value {
    font-size: 22px;
  }

  .code-box {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .code {
    font-size: 24px;
  }

  .panel {
    padding: 16px;
  }

  .bottom-nav {
    width: min(420px, calc(100vw - 24px));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .nav-btn {
    min-height: 60px;
    font-size: 11px;
  }
}
