/* ============================================================================
   Polished Production — Partner Portal
   Matches the landing & dashboard design system: Core Black + Red
   ============================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base: #050506;
  --bg-raised: #0a0a0c;
  --bg-overlay: #131315;
  --bg-subtle: rgba(255,255,255,0.03);
  --bg-muted: rgba(255,255,255,0.06);

  --border-subtle: rgba(255,255,255,0.04);
  --border-default: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);
  --border-focus: rgba(200,16,46,0.4);

  --text-primary: #ededf0;
  --text-secondary: rgba(255,255,255,0.62);
  --text-tertiary: rgba(255,255,255,0.35);

  --red: #c8102e;
  --red-hover: #a50d24;
  --red-text: #f0566a;
  --red-surface: rgba(200,16,46,0.08);
  --red-border: rgba(200,16,46,0.25);

  --green: #3ec76a;
  --green-text: #4ade80;
  --green-surface: rgba(62,199,106,0.08);

  --yellow: #c7a33e;
  --yellow-text: #fbbf24;
  --yellow-surface: rgba(199,163,62,0.08);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);

  --transition-fast: 0.12s ease;
  --transition-base: 0.15s ease;
}

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red-text); text-decoration: none; }
a:hover { color: var(--red); }

/* ── Layout ── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-raised);
}
.topbar .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.topbar .brand .accent { color: var(--red-text); }
.topbar .actions { display: flex; gap: 12px; align-items: center; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}
.container.wide { max-width: 880px; }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }

/* ── Forms ── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition-base);
}
.field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--red-surface);
}
.field .hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover:not(:disabled) { background: var(--red-hover); border-color: var(--red-hover); color: #fff; }

.btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-muted); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-block { width: 100%; }

/* ── Messages ── */
.msg {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
}
.msg-error { background: var(--red-surface); border-color: var(--red-border); color: var(--red-text); }
.msg-success { background: var(--green-surface); border-color: rgba(62,199,106,0.25); color: var(--green-text); }
.msg-warn { background: var(--yellow-surface); border-color: rgba(199,163,62,0.25); color: var(--yellow-text); }
.hidden { display: none; }

/* ── Dashboard-specific ── */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.stat .label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; }
.stat .value.earning { color: var(--green-text); }

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

.referral-box {
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.referral-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.referral-box input:focus { outline: none; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { background: var(--yellow-surface); border-color: rgba(199,163,62,0.25); color: var(--yellow-text); }
.status-active { background: var(--green-surface); border-color: rgba(62,199,106,0.25); color: var(--green-text); }
.status-inactive { background: var(--bg-muted); border-color: var(--border-strong); color: var(--text-tertiary); }
.status-verifying { background: var(--yellow-surface); border-color: rgba(199,163,62,0.25); color: var(--yellow-text); }

table.commissions { width: 100%; border-collapse: collapse; }
table.commissions th, table.commissions td {
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-default);
}
table.commissions th { color: var(--text-tertiary); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
table.commissions td.amount { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-tertiary);
  font-size: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.footer { text-align: center; padding: 24px; color: var(--text-tertiary); font-size: 12px; margin-top: auto; }
.footer a { color: var(--red-text); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--red); }

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
  .container { padding: 32px 16px; }
  .card { padding: 24px; }
  .topbar { padding: 16px 20px; }
}
