/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0d0d;
  --surface:   #141414;
  --surface2:  #1a1a1a;
  --border:    #242424;
  --border2:   #2e2e2e;
  --text:      #e8e8e8;
  --muted:     #6b7280;
  --green:     #22c55e;
  --green-dim: #15803d;
  --green-bg:  #052e16;
  --red:       #ef4444;
  --red-bg:    #450a0a;
  --accent:    #22c55e;
  --sidebar-w: 220px;
}

/* Light Mode */
html.light-mode {
  --bg:        #ffffff;
  --surface:   #f8f9fa;
  --surface2:  #f0f1f3;
  --border:    #e5e7eb;
  --border2:   #d1d5db;
  --text:      #1f2937;
  --muted:     #6b7280;
  --green:     #16a34a;
  --green-dim: #15803d;
  --green-bg:  #f0fdf4;
  --red:       #dc2626;
  --red-bg:    #fef2f2;
  --accent:    #16a34a;
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo span {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--green);
}
.sidebar-logo small {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  margin-top: 3px;
  letter-spacing: .04em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav a.active { background: var(--green-bg); color: var(--green); }
.sidebar-nav .nav-icon { font-size: 1rem; width: 18px; text-align: center; }

.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 14px 12px 6px;
}

.sidebar-bottom {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--green-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.sidebar-username { font-size: .85rem; font-weight: 600; color: var(--text); }
.sidebar-role { font-size: .72rem; color: var(--muted); }
#theme-toggle {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
#theme-toggle:hover {
  background: var(--border);
  border-color: var(--accent);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  transition: background .15s, color .15s;
}
.sidebar-logout:hover { background: var(--red-bg); color: var(--red); }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════ */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

html.dark-mode .main-wrap {
  background: #0d0d0d;
}

html.light-mode .main-wrap {
  background: #ffffff;
}

.main-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

html.dark-mode .main-topbar {
  background: #141414;
  border-bottom-color: #242424;
}

html.light-mode .main-topbar {
  background: #ffffff;
  border-bottom-color: #d1d5db;
}
.main-topbar h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.topbar-badge {
  background: var(--green-bg);
  color: var(--green);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
}

.page-content {
  padding: 24px 28px 48px;
  flex: 1;
  background: var(--bg);
}

html.dark-mode .page-content {
  background: #0d0d0d;
}

html.light-mode .page-content {
  background: #ffffff;
}

.footer {
  padding: 16px 28px;
  color: var(--muted);
  font-size: .78rem;
  border-top: 1px solid var(--border);
  text-align: center;
  background: var(--surface);
}

html.dark-mode .footer {
  background: #141414;
  border-top-color: #242424;
  color: #6b7280;
}

html.light-mode .footer {
  background: #ffffff;
  border-top-color: #d1d5db;
  color: #6b7280;
}

/* ═══════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: .88rem;
}
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-dim); }
.alert-error, .alert-danger { background: var(--red-bg); color: var(--red); border: 1px solid #7f1d1d; }

/* ═══════════════════════════════════════════════
   CARDS & PANELS
═══════════════════════════════════════════════ */
.ap-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

html.dark-mode .ap-panel {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #2d3561;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.light-mode .ap-panel {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.dark-mode .ap-table tbody tr:hover td {
  background: rgba(102, 126, 234, 0.1) !important;
}

.ap-section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 18px;
}

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

/* ═══════════════════════════════════════════════
   BOSS ROW
═══════════════════════════════════════════════ */
.ap-boss-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.ap-boss-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.ap-boss-card span {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ap-boss-card strong { font-size: 1.6rem; font-weight: 700; }

/* ═══════════════════════════════════════════════
   2-COL GRID
═══════════════════════════════════════════════ */
.ap-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════
   SOURCE GRID
═══════════════════════════════════════════════ */
.ap-source-grid {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.ap-source-grid > div { flex: 1; min-width: 120px; }

/* ═══════════════════════════════════════════════
   ARBİTRAJ
═══════════════════════════════════════════════ */
.ap-arb-body { display: flex; gap: 28px; }
.ap-arb-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 28px;
  border-right: 1px solid var(--border);
  min-width: 150px;
}
.ap-arb-stat span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ap-arb-stat strong { font-size: 2rem; font-weight: 700; }
.ap-arb-right { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.ap-arb-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.ap-arb-line:last-child { border-bottom: none; padding-bottom: 0; }
.ap-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border2); flex-shrink: 0; }
.ap-line-label { font-size: .72rem; font-weight: 700; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; margin-bottom: 3px; }
.ap-line-val { font-size: 1.25rem; font-weight: 700; }

/* ═══════════════════════════════════════════════
   BONUSLAR
═══════════════════════════════════════════════ */
.ap-bonus-grid { display: flex; gap: 0; }
.ap-bonus-col { flex: 1; padding: 0 24px; border-right: 1px solid var(--border); }
.ap-bonus-col:first-child { padding-left: 0; }
.ap-bonus-col:last-child  { border-right: none; }
.ap-bonus-label { font-size: .78rem; font-weight: 700; letter-spacing: .07em; color: var(--text); text-transform: uppercase; margin-bottom: 4px; }
.ap-bonus-rate  { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.ap-bonus-divider { height: 1px; background: var(--border); margin-bottom: 14px; }
.ap-bonus-val   { font-size: 1.4rem; font-weight: 700; }

/* ═══════════════════════════════════════════════
   DIST GRID
═══════════════════════════════════════════════ */
.ap-dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.ap-dist-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.ap-dist-card span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ap-dist-card strong { font-size: 1.25rem; font-weight: 700; }

/* ═══════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════ */
.ap-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
table { width: 100%; border-collapse: collapse; }
.ap-table th {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

html.dark-mode .ap-table th {
  border-bottom-color: #2d3561;
  background: rgba(102, 126, 234, 0.05);
}

.ap-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  white-space: nowrap;
}
.ap-table tbody tr:last-child td { border-bottom: none; }
.ap-table tbody tr:hover td { background: var(--surface2); }
.ap-totals-row td {
  padding-top: 14px;
  border-top: 2px solid var(--border2);
  border-bottom: none !important;
  font-size: .88rem;
}
.ap-empty-row { color: var(--muted); text-align: center; padding: 32px !important; }

/* ═══════════════════════════════════════════════
   INPUTS & BUTTONS
═══════════════════════════════════════════════ */
.ap-search-input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: .88rem;
  width: 200px;
  outline: none;
  transition: border .15s;
}
.ap-search-input:focus { border-color: var(--green); }

.ap-inline-input {
  width: 70px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--green);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: .85rem;
  text-align: center;
  outline: none;
}
.ap-inline-input:focus { border-color: var(--green); }

.ap-save-btn {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-dim);
  border-radius: 7px;
  padding: 6px 13px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  transition: background .15s;
}
.ap-save-btn:hover { background: #0a3d1e; }

.ap-create-btn {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 9px;
  padding: 9px 18px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  width: auto;
  transition: background .15s;
  white-space: nowrap;
}
.ap-create-btn:hover { background: #16a34a; }

.ap-edit-btn {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: .8rem;
  cursor: pointer;
  width: auto;
}
.ap-edit-btn:hover { color: var(--text); border-color: var(--text); }

/* ═══════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════ */
.ap-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.ap-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text);
}
html.light-mode .ap-modal {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1f2937;
}
.ap-modal h3 { font-size: 1rem; font-weight: 700; margin-bottom: 22px; color: var(--text); }
html.light-mode .ap-modal h3 { color: #1f2937; }
.ap-modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.ap-modal-btns button { flex: 1; }

.ap-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.ap-form-row .form-group { margin-bottom: 0; }

/* ═══════════════════════════════════════════════
   AUTH FORMS
═══════════════════════════════════════════════ */
.auth-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 16px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}
.auth-card h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: .04em; text-transform: uppercase; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 9px;
  font-size: .9rem;
  outline: none;
  transition: border .15s;
}
.form-control:focus { border-color: var(--green); }

html.light-mode .form-control {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #1f2937;
}

html.light-mode .form-control:focus {
  border-color: #16a34a;
}

button[type="submit"],
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  width: 100%;
}

button[type="submit"]:hover,
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-cancel {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  width: 100%;
}

.btn-cancel:hover {
  background: var(--border);
  border-color: var(--accent);
}

html.light-mode .btn-cancel {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #1f2937;
}

html.light-mode .btn-cancel:hover {
  background: #e5e7eb;
  border-color: #667eea;
}

select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: .9rem;
  outline: none;
  transition: border .15s;
}

select:focus, textarea:focus {
  border-color: var(--green);
}

html.light-mode select,
html.light-mode textarea {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #1f2937;
}

html.light-mode select:focus,
html.light-mode textarea:focus {
  border-color: #16a34a;
}
button, .btn-primary {
  background: var(--green);
  border: none;
  color: #000;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  font-weight: 700;
  font-size: .9rem;
  transition: background .15s;
}
button:hover, .btn-primary:hover { background: #16a34a; }
.ap-btn-cancel { background: var(--surface2) !important; color: var(--text) !important; border: 1px solid var(--border2) !important; }
.ap-btn-cancel:hover { background: var(--border) !important; }
.auth-link { text-align: center; margin-top: 16px; font-size: .88rem; color: var(--muted); }
.auth-link a { color: var(--green); text-decoration: none; }
.error { color: var(--red); font-size: .82rem; margin-top: 5px; }

/* 2FA */
.tfa-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 4px;
}
.tfa-qr-wrap img, .tfa-qr-wrap canvas { display: block; }
.key-display {
  display: block;
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  color: var(--green);
  font-size: .85rem;
  letter-spacing: .08em;
  border: 1px solid var(--border);
}

/* Profile */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; color: var(--text); }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 20px; color: var(--text); }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.summary-grid .metric-card {
  padding: 12px;
  min-width: 110px;
}

.summary-grid .metric-card span {
  font-size: 0.65rem !important;
  margin-bottom: 4px !important;
}

.summary-grid .metric-card strong {
  font-size: 1.1rem !important;
}
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }

html.dark-mode .panel {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #2d3561;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.light-mode .panel {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.dark-mode .hero-card {
  background: linear-gradient(135deg, #1f1f3d 0%, #19213e 100%);
  border-color: #2d3561;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.light-mode .hero-card {
  background: #ffffff;
  border-color: #e5e7eb !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.dark-mode .metric-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #2d3561;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html.light-mode .metric-card {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

html.dark-mode .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

html.light-mode .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.metric-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.metric-card strong { font-size: 1.6rem; color: var(--green); }
.panel-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
th { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Admin page polish */
.ap-page-hero {
  background: linear-gradient(120deg, #141414 0%, #191919 60%, #0f2517 100%);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

html.light-mode .ap-page-hero {
  background: linear-gradient(120deg, #ffffff 0%, #f8f9fa 60%, #f0f1f3 100%) !important;
  border-color: #e5e7eb !important;
}

html.light-mode .ap-page-hero h2 {
  color: #1f2937;
}

html.light-mode .ap-page-hero p {
  color: #6b7280;
}

.ap-page-hero h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.ap-page-hero p {
  color: var(--muted);
  font-size: .86rem;
}
.ap-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.ap-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.ap-kpi span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ap-kpi strong {
  font-size: 1.2rem;
  font-weight: 700;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--muted);
}
.status-open {
  color: var(--green);
  border-color: var(--green-dim);
  background: var(--green-bg);
}
.status-closed {
  color: #93c5fd;
  border-color: #1d4ed8;
  background: #0b1735;
}

/* ═══════════════════════════════════════════════
   CUSTOMER DASHBOARD - DARK MODE & COLORS
═══════════════════════════════════════════════ */

/* Dashboard Container */
html.dark-mode .dashboard-container {
  background: var(--bg);
  color: var(--text);
}

html.light-mode .dashboard-container {
  background: #ffffff;
  color: #1f2937;
}

/* Dashboard Header */
html.dark-mode .dashboard-header h1 {
  color: var(--text);
}

html.light-mode .dashboard-header h1 {
  color: #1f2937;
}

/* Stat Cards - Colorful Gradients */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  color: white;
  transition: all 0.3s;
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
}

html.dark-mode .stat-card:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

html.dark-mode .stat-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 8px 20px rgba(245, 87, 108, 0.3);
}

html.dark-mode .stat-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
}

html.dark-mode .stat-card:nth-child(4) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 8px 20px rgba(250, 112, 154, 0.3);
}

html.light-mode .stat-card {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #1f2937;
}

.stat-card:hover {
  transform: translateY(-8px);
  filter: brightness(1.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}

.stat-icon {
  font-size: 2rem;
}

.stat-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-value {
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
}

.stat-meta {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

html.light-mode .stat-label,
html.light-mode .stat-value,
html.light-mode .stat-meta {
  color: #1f2937;
}

/* Exchange Cards */
.exchange-card {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.exchange-card:hover {
  transform: translateY(-4px);
}

html.dark-mode .exchange-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #3b4563;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

html.light-mode .exchange-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
  box-shadow: 0 4px 12px rgba(0, 153, 255, 0.1);
}

.exchange-name {
  font-weight: 700;
  color: var(--text);
}

.badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

html.light-mode .badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
}

.badge-inactive {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

/* Bonus Cards */
.bonus-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s;
}

html.dark-mode .bonus-card:nth-child(1) {
  background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
  box-shadow: 0 12px 30px rgba(0, 212, 255, 0.4);
}

html.dark-mode .bonus-card:nth-child(2) {
  background: linear-gradient(135deg, #00ff88 0%, #00d084 100%);
  box-shadow: 0 12px 30px rgba(0, 255, 136, 0.4);
}

html.dark-mode .bonus-card:nth-child(3) {
  background: linear-gradient(135deg, #ff6b35 0%, #ff4500 100%);
  box-shadow: 0 12px 30px rgba(255, 107, 53, 0.4);
}

html.dark-mode .bonus-card:nth-child(4) {
  background: linear-gradient(135deg, #ff006e 0%, #d946ef 100%);
  box-shadow: 0 12px 30px rgba(255, 0, 110, 0.4);
}

html.light-mode .bonus-card:nth-child(1) {
  background: linear-gradient(135deg, #0099ff 0%, #0066ff 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 153, 255, 0.2);
}

html.light-mode .bonus-card:nth-child(2) {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

html.light-mode .bonus-card:nth-child(3) {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.2);
}

html.light-mode .bonus-card:nth-child(4) {
  background: linear-gradient(135deg, #ff006e 0%, #d946ef 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(255, 0, 110, 0.2);
}

.bonus-card:hover {
  transform: translateY(-8px);
  filter: brightness(1.1);
}

.bonus-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.bonus-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.bonus-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

/* Tabs */
.tabs-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

html.dark-mode .tabs-container {
  background: #141414;
  border-color: #242424;
}

html.light-mode .tabs-container {
  background: #ffffff;
  border-color: #e5e7eb;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover {
  color: var(--text);
}

/* Summary Items */
.summary-item {
  background: var(--surface2);
  padding: 1rem;
  border-radius: 8px;
  color: var(--text);
  border: 1px solid var(--border);
}

html.dark-mode .summary-item {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #2d3561;
}

html.light-mode .summary-item {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

.summary-item .label {
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.4rem;
}

.summary-item .value {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
}

/* Section Title */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.8rem;
}

html.light-mode .section-title {
  color: #1f2937;
}

/* Exchange Stats */
.exchange-stat {
  margin-bottom: 0.8rem;
}

.exchange-stat .label {
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.3rem;
}

.exchange-stat .value {
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Dashboard Grids & Layout */
.dashboard-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  color: var(--text);
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.text-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

.exchange-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.exchange-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.exchange-name {
  font-weight: 600;
  color: var(--text);
}

.exchange-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.exchange-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exchange-stat .label {
  font-size: 0.85rem;
  color: var(--muted);
}

.add-exchange {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-secondary {
  background: var(--accent);
  color: white;
}

html.light-mode .btn-secondary {
  background: #667eea;
  color: white;
}

.btn-secondary:hover {
  opacity: 0.9;
}

.bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.bonus-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

/* Tabs Layout */
.tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Transactions Table */
.transactions-table {
  border-radius: 8px;
  overflow: auto;
  background: var(--surface);
}

html.dark-mode .transactions-table {
  background: #141414;
}

html.light-mode .transactions-table {
  background: #ffffff;
}

.transactions-table table {
  width: 100%;
  border-collapse: collapse;
}

.transactions-table thead {
  background: var(--surface2);
}

html.dark-mode .transactions-table thead {
  background: #1f2937;
}

html.light-mode .transactions-table thead {
  background: #f3f4f6;
}

.transactions-table th {
  color: var(--muted);
  font-size: 0.78rem;
}

.transactions-table td {
  color: var(--text);
}

.transactions-table tr:hover {
  background: var(--surface2);
}

html.dark-mode .transactions-table tr:hover {
  background: #1f2937;
}

html.light-mode .transactions-table tr:hover {
  background: #f3f4f6;
}

.text-center {
  text-align: center;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .ap-two-col { grid-template-columns: 1fr; }
  .panel-row   { grid-template-columns: 1fr; }
  .ap-arb-body { flex-direction: column; }
  .ap-arb-left { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 20px; flex-direction: row; flex-wrap: wrap; gap: 20px; }
  .ap-bonus-grid { flex-direction: column; }
  .ap-bonus-col { padding: 12px 0; border-right: none; border-bottom: 1px solid var(--border); }
  .ap-bonus-col:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-220px); width: 220px; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; align-items: center; }
  .main-wrap { margin-left: 0; }
  .main-topbar { padding: 0 16px 0 52px; }
  .page-content { padding: 16px; }
  .ap-boss-grid { gap: 16px; }
  .ap-boss-card strong { font-size: 1.2rem; }
  .ap-table-header { flex-direction: column; align-items: flex-start; }
  .ap-search-input { width: 100%; }
  .ap-modal { padding: 20px; }
  .ap-form-row { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .ap-dist-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .ap-arb-stat strong { font-size: 1.5rem; }
}
