/* Revenue page (revenue.php). Black/white surfaces from styles/variables.css,
   with Roladel Green as the single accent - scoped to this page through
   --revenue-accent, the same way --home-accent-green is homepage-only,
   so the site-wide --brand-green* aliases stay retired everywhere else. */

.rv {
  --revenue-accent: #085812;
  --revenue-accent-hover: #0a6b17;
  --revenue-accent-pressed: #064514;
  --revenue-accent-soft: #e8f2e9;
  --rv-bg: var(--light-bg, #ffffff);
  --rv-surface: var(--light-surface, #f8f9fa);
  --rv-text: var(--light-text, #222222);
  --rv-muted: var(--light-text-muted, #6c757d);
  --rv-border: #e6e6e6;
  --rv-strong: #000000;
  --rv-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --rv-radius: 16px;
  --rv-radius-sm: 12px;
  color: var(--rv-text);
  padding-top: 28px;
  padding-bottom: 48px;
}

html.dark .rv {
  --revenue-accent: #0e7a1b;
  --revenue-accent-hover: #12902a;
  --revenue-accent-pressed: #0a6116;
  --revenue-accent-soft: rgba(14, 122, 27, 0.18);
  --revenue-accent-text: #4cbb5c; /* green text on dark cards (readable contrast) */
  --rv-bg: var(--dark-surface, #1e1e1e);
  --rv-surface: var(--dark-surface-alt, #2a2a2a);
  --rv-text: var(--dark-text, #ffffff);
  --rv-muted: var(--dark-text-muted, #aaaaaa);
  --rv-border: var(--dark-border, #333333);
  --rv-strong: #ffffff;
  --rv-shadow: none;
}

.rv *,
.rv *::before,
.rv *::after {
  box-sizing: border-box;
}

/* ---------- Header ---------- */
.rv-header {
  margin-bottom: 20px;
}

.rv-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--rv-strong);
}

.rv-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--rv-muted);
}

/* ---------- Cards ---------- */
.rv-card {
  background: var(--rv-bg);
  border: 1px solid var(--rv-border);
  border-radius: var(--rv-radius);
  box-shadow: var(--rv-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* "Withdraw" jumps here - keep it clear of the sticky site header */
#rvWithdraw {
  scroll-margin-top: 140px;
}

.rv-card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--rv-strong);
}

.rv-card-sub {
  font-size: 14px;
  color: var(--rv-muted);
  margin: 0 0 16px;
}

/* ---------- Balance hero ---------- */
.rv-balance {
  padding: 24px;
}

.rv-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rv-muted);
  margin: 0 0 6px;
}

.rv-balance-amount {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--rv-strong);
  margin: 0;
  overflow-wrap: anywhere;
}

.rv-balance-note {
  font-size: 14px;
  color: var(--rv-muted);
  margin: 8px 0 0;
}

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

.rv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--rv-radius-sm);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.rv-btn:active {
  transform: scale(0.98);
}

.rv-btn:focus-visible {
  outline: 3px solid var(--rv-strong);
  outline-offset: 2px;
}

/* Fund wallet - the one green call to action on the page */
.rv-btn-fund {
  background: var(--revenue-accent);
  border-color: var(--revenue-accent);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(8, 88, 18, 0.25);
}

.rv-btn-fund:hover {
  background: var(--revenue-accent-hover);
  border-color: var(--revenue-accent-hover);
}

.rv-btn-fund:active {
  background: var(--revenue-accent-pressed);
  border-color: var(--revenue-accent-pressed);
  box-shadow: none;
}

.rv-btn-fund .fa {
  font-size: 18px;
}

/* Secondary action (scrolls to the withdrawal methods) - outline, never green */
.rv-btn-outline {
  background: transparent;
  border-color: var(--rv-strong);
  color: var(--rv-strong) !important;
}

.rv-btn-outline:hover {
  background: var(--rv-surface);
}

/* ---------- Stat cards ---------- */
.rv-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.rv-stat {
  background: var(--rv-bg);
  border: 1px solid var(--rv-border);
  border-radius: var(--rv-radius);
  padding: 18px;
  min-width: 0;
}

.rv-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--rv-surface);
  color: var(--rv-strong);
  font-size: 16px;
  margin-bottom: 12px;
}

.rv-stat-label {
  font-size: 14px;
  color: var(--rv-muted);
  margin: 0 0 4px;
  line-height: 1.3;
}

.rv-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--rv-strong);
  margin: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* ---------- Withdrawal methods ---------- */
.rv-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rv .rv-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 14px 16px;
  background: var(--rv-bg);
  border: 1px solid var(--rv-border);
  border-radius: var(--rv-radius-sm);
  color: var(--rv-strong);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rv .rv-method:hover {
  border-color: var(--rv-strong);
  background: var(--rv-surface);
}

.rv .rv-method:focus-visible {
  outline: 3px solid var(--rv-strong);
  outline-offset: 2px;
}

.rv-method .fa {
  width: 20px;
  text-align: center;
  font-size: 18px;
}

.rv-method-arrow {
  margin-left: auto;
  color: var(--rv-muted);
}

.rv-note {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: var(--rv-radius-sm);
  background: var(--rv-surface);
  color: var(--rv-muted);
  font-size: 14px;
  line-height: 1.55;
}

.rv-note .fa {
  color: var(--rv-strong);
  margin-top: 3px;
}

.rv-note a {
  color: var(--rv-strong);
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Transactions ---------- */
.rv-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.rv-table th {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rv-muted);
  border-bottom: 1px solid var(--rv-border);
  padding: 10px 8px;
  text-align: left;
}

.rv-table td {
  padding: 14px 8px;
  border-top: 1px solid var(--rv-border);
  font-size: 15px;
  color: var(--rv-text);
  vertical-align: middle;
}

.rv-table tbody tr:first-child td {
  border-top: 0;
}

.rv-table td a {
  color: var(--rv-strong);
  text-decoration: underline;
}

.rv-table .rv-amount {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.rv-table th:last-child {
  text-align: right;
}

.rv-table td.rv-credit {
  color: var(--revenue-accent);
}

.rv-table td.rv-debit {
  color: var(--rv-strong);
}

.rv-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--rv-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--rv-muted);
}

.rv-status-done {
  border-color: var(--revenue-accent);
  color: var(--revenue-accent);
}

.rv-status-declined {
  border-style: dashed;
}

/* A declined withdrawal was returned to the balance - shown muted */
.rv-table td.rv-debit-declined {
  color: var(--rv-muted);
  text-decoration: line-through;
  font-weight: 600;
}

.rv-empty {
  text-align: center;
  color: var(--rv-muted);
  padding: 24px 8px !important;
}

/* ---------- Dark mode text ----------
   styles/dark_mode.css forces color: #eaeaea !important on every p, span,
   a and heading. These page-scoped rules (higher specificity, same
   !important) restore this page's muted/strong/accent colours in dark mode
   only; nothing outside .rv is affected. */
html.dark .rv .rv-title,
html.dark .rv .rv-card-title,
html.dark .rv .rv-balance-amount,
html.dark .rv .rv-stat-value,
html.dark .rv .rv-method,
html.dark .rv .rv-btn-outline,
html.dark .rv .rv-note a,
html.dark .rv .rv-table td a,
html.dark .rv .rv-table td.rv-debit {
  color: var(--rv-strong) !important;
}

html.dark .rv .rv-subtitle,
html.dark .rv .rv-label,
html.dark .rv .rv-balance-note,
html.dark .rv .rv-stat-label,
html.dark .rv .rv-card-sub,
html.dark .rv .rv-note,
html.dark .rv .rv-note div,
html.dark .rv .rv-method-arrow,
html.dark .rv .rv-table td.rv-date,
html.dark .rv .rv-table td.rv-debit-declined,
html.dark .rv .rv-status {
  color: var(--rv-muted) !important;
}

html.dark .rv .rv-balance-note strong,
html.dark .rv .rv-table td.rv-for {
  color: var(--rv-text) !important;
}

html.dark .rv .rv-table td.rv-credit,
html.dark .rv .rv-status-done {
  color: var(--revenue-accent-text, #4cbb5c) !important;
}

html.dark .rv .rv-btn-fund {
  color: #ffffff !important;
}

/* ---------- Tablet ---------- */
@media (max-width: 991.98px) {
  .rv-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Phone ---------- */
@media (max-width: 575.98px) {
  .rv {
    padding-top: 18px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .rv-title {
    font-size: 24px;
  }

  .rv-card,
  .rv-balance {
    padding: 18px;
  }

  .rv-balance-amount {
    font-size: 34px;
  }

  .rv-actions .rv-btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .rv-stats {
    gap: 12px;
  }

  .rv-stat {
    padding: 14px;
  }

  .rv-stat-value {
    font-size: 18px;
  }

  .rv-methods {
    grid-template-columns: 1fr;
  }

  /* Transactions become stacked rows - no sideways scrolling */
  .rv-table thead {
    display: none;
  }

  .rv-table,
  .rv-table tbody {
    display: block;
  }

  .rv-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--rv-border);
  }

  .rv-table tbody tr:first-child {
    border-top: 0;
  }

  .rv-table td {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
  }

  .rv-table td.rv-date {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--rv-muted);
    margin-bottom: 2px;
  }

  .rv-table td.rv-for {
    grid-column: 1;
    overflow-wrap: anywhere;
  }

  .rv-table td.rv-amount {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
}
