:root {
  --bg:        #1a1d29;
  --card:      #252836;
  --elev:      #1e2130;
  --line:      #2d3044;
  --muted:     #8a8d98;
  --brand:     #ffd700;
  --brand2:    #f5a623;
  --ok:        #4caf50;
  --warn:      #f5a623;
  --err:       #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: #e5e7eb;
  font-size: 14px;
}

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

/* Topbar */
.admin-topbar {
  position: sticky; top: 0; z-index: 50;
  background: #1e2130;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; height: 56px;
}
.topbar-toggle { background: none; border: 0; color: #fff; font-size: 24px; padding: 4px 8px; }
.topbar-title { font-weight: 800; font-size: 18px; flex: 1; }
.brand-k { color: #fff; }
.brand-24 { color: var(--brand); }
.brand-sub { font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 8px; letter-spacing: 2px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; }

/* Shell */
.admin-shell { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar {
  width: 230px; background: #1e2130; border-right: 1px solid var(--line);
  padding: 12px 8px; flex-shrink: 0;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 4px; border-radius: 8px;
  color: #cbd5e1; font-weight: 500; font-size: 13.5px;
}
.admin-sidebar a:hover { background: var(--card); color: #fff; }
.admin-sidebar a.active { background: var(--brand); color: #1a1d29; }
.admin-sidebar a.active i { color: #1a1d29; }
.admin-sidebar a i { font-size: 17px; width: 20px; text-align: center; color: var(--muted); }
.admin-sidebar a:hover i { color: #fff; }

.admin-main { flex: 1; padding: 24px; min-width: 0; }

/* Cards */
.card {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  color: #e5e7eb !important;
  border-radius: 14px !important;
}
.card-header, .card-footer { background: var(--elev) !important; border-color: var(--line) !important; }

/* Stats */
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px;
}
.stat .label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.stat .delta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Tables */
.table { color: #e5e7eb !important; --bs-table-bg: transparent; --bs-table-color: #e5e7eb; }
.table > :not(caption) > * > * { background: transparent !important; color: inherit !important; border-color: var(--line) !important; }
.table thead th { color: var(--muted) !important; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--line) !important; }
.table-hover > tbody > tr:hover > * { background: var(--elev) !important; }

/* Forms */
.form-control, .form-select {
  background: #1e2130 !important; border: 1px solid var(--line) !important; color: #fff !important;
  border-radius: 10px;
}
.form-control:focus, .form-select:focus {
  background: #1e2130 !important; border-color: var(--brand) !important; color: #fff !important;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.15) !important;
}
.form-label { color: #cbd5e1; font-weight: 600; font-size: 12.5px; }

/* Buttons */
.btn-primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%); border: 0; color: #1a1d29 !important; font-weight: 700; }
.btn-primary:hover { color: #1a1d29 !important; transform: translateY(-1px); }
.btn-outline-light { border-color: var(--line); }
.btn-success { background: var(--ok); border-color: var(--ok); }
.btn-danger { background: var(--err); border-color: var(--err); }

/* Badges */
.badge.bg-pending { background: rgba(255,215,0,0.15); color: var(--warn); border: 1px solid rgba(255,215,0,0.3); }
.badge.bg-approved, .badge.bg-completed, .badge.bg-active { background: rgba(76,175,80,0.15); color: var(--ok); border: 1px solid rgba(76,175,80,0.3); }
.badge.bg-rejected, .badge.bg-failed, .badge.bg-blocked { background: rgba(239,68,68,0.15); color: var(--err); border: 1px solid rgba(239,68,68,0.3); }

/* Alerts */
.alert { border-radius: 10px; border: 1px solid; }
.alert-success { background: rgba(76,175,80,0.1); color: #6ee7b7; border-color: rgba(76,175,80,0.3); }
.alert-danger { background: rgba(239,68,68,0.1); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.alert-warning { background: rgba(255,215,0,0.1); color: #fcd34d; border-color: rgba(255,215,0,0.3); }
.alert-info { background: rgba(59,130,246,0.1); color: #93c5fd; border-color: rgba(59,130,246,0.3); }

.text-muted { color: var(--muted) !important; }
hr { border-color: var(--line); opacity: 1; }

/* Modal */
.modal-content { background: var(--card); color: #e5e7eb; border: 1px solid var(--line); }
.modal-header, .modal-footer { border-color: var(--line); }

/* Pagination */
.page-link { background: var(--card); border-color: var(--line); color: #cbd5e1; }
.page-link:hover { background: var(--elev); color: #fff; }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #1a1d29; }
.page-item.disabled .page-link { background: var(--card); color: var(--muted); }

/* Mobile */
@media (max-width: 992px) {
  .admin-sidebar { position: fixed; left: -240px; top: 56px; height: calc(100vh - 56px); transition: left 0.2s ease; z-index: 40; }
  body.sidebar-open .admin-sidebar { left: 0; }
  .admin-main { padding: 14px; }
}

/* ====================================================================
   PAGE-LEVEL OVERRIDES — recolor inline <style> blocks across pages
   Pages had hardcoded teal #10dba3 / cyan #06b6d4 brand colors that
   bypass our :root variables. These rules beat them via !important.
   Affects: dashboard.php, casino-report.php, coins.php, deposits.php,
            user_detail.php, payment-methods.php
   ==================================================================== */

/* Card surfaces (#1a1d26 / #13151e / #0f1117 / #0d0f14 / #22252f) */
.dash-card,
.sc,
.crc,
.ck,
.ctab,
.pm-card,
.sst-shell,
.qa-tile {
  background: #252836 !important;
  border-color: #2d3044 !important;
}
.filter-bar,
.range-bar,
.sst-tabs,
.pm-body {
  background: #1e2130 !important;
  border-color: #2d3044 !important;
}
.pm-header-row:hover { background: #2d3044 !important; }

/* Filter / range pills */
.filter-btn,
.range-pill {
  background: transparent !important;
  border-color: #2d3044 !important;
  color: #8a8d98 !important;
}
.filter-btn.active,
.range-pill.active {
  background: #ffd700 !important;
  border-color: #ffd700 !important;
  color: #1a1d29 !important;
}
.filter-btn:hover,
.range-pill:hover {
  border-color: #ffd700 !important;
  color: #ffd700 !important;
}

/* Tab links (Bootstrap nav-tabs in dashboard / casino-report / user_detail) */
.nav-tabs.dash-tabs .nav-link,
.ctab .nav-link {
  color: #8a8d98 !important;
  background: transparent !important;
  border-bottom-color: transparent !important;
}
.nav-tabs.dash-tabs .nav-link.active,
.ctab .nav-link.active {
  color: #ffd700 !important;
  border-bottom-color: #ffd700 !important;
  background: transparent !important;
}

/* Quick-action tiles */
.qa-tile { color: #cbd5e1 !important; }
.qa-tile i { color: #ffd700 !important; }
.qa-tile:hover {
  border-color: #ffd700 !important;
  color: #ffd700 !important;
}

/* P&L / status colors — keep semantic green/red but standardize values */
.pnl-pos,
.pos,
.game-found {
  color: #4caf50 !important;
}
.pnl-neg,
.neg {
  color: #ef4444 !important;
}
.game-uid {
  color: #8a8d98 !important;
}

/* Status pills */
.status-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 9999px; }
.status-pill.pending {
  background: rgba(245,166,35,0.15) !important;
  color: #f5a623 !important;
}
.status-pill.approved,
.status-pill.completed {
  background: rgba(76,175,80,0.15) !important;
  color: #4caf50 !important;
}
.status-pill.rejected,
.status-pill.failed,
.status-pill.cancelled {
  background: rgba(239,68,68,0.15) !important;
  color: #ef4444 !important;
}

/* Payment method status badges */
.pm-status-active {
  background: rgba(76,175,80,0.15) !important;
  color: #4caf50 !important;
}
.pm-status-inactive {
  background: rgba(239,68,68,0.15) !important;
  color: #ef4444 !important;
}

/* Inline-styled brand teal text on dashboard / coins / casino-report.
   These are PHP-rendered with hardcoded color attributes — override
   via attribute selector. */
[style*="#10dba3"] { color: #ffd700 !important; }
[style*="#06b6d4"] { color: #f5a623 !important; }
/* Keep blue/purple/orange/red accents as-is (they're semantic, not brand) */

/* Labels / muted text */
.lbl, .sc-l, .crc-l, .crc-s, .sc-s,
.recent-table th, .ctab table th, .sst-meta {
  color: #8a8d98 !important;
}

/* User-detail tabs (Account / Casino / Transactions / House Position) */
.sst-tab,
.sst-tab.active {
  border-bottom: 2px solid transparent;
  color: #8a8d98;
}
.sst-tab.active {
  color: #ffd700 !important;
  border-bottom-color: #ffd700 !important;
}

/* Chart.js label/grid color tweaks (overrides for inline JS-rendered) */
canvas[data-chart] { color: #cbd5e1 !important; }

/* Stat-card left-border accents (formerly teal) */
.dash-card.coins,
.crc.ggr,
.sst-c.b-green {
  border-left-color: #ffd700 !important;
}

/* User-detail pills */
.pill.completed,
.pill.approved {
  background: rgba(76,175,80,0.15) !important;
  color: #4caf50 !important;
  border: 1px solid rgba(76,175,80,0.3) !important;
}

/* Backgrounds with rgba(16,219,163,*) — teal alpha */
[style*="rgba(16,219,163"] {
  background-color: rgba(255,215,0,0.15) !important;
}
