/* HITPRO Payments — Admin styles */
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400;1,500&display=swap');

:root {
  --bg: #0a0a0c;
  --bg-2: #0f0f12;
  --panel: #16161b;
  --panel-2: #1c1c22;
  --line: #26262e;
  --line-2: #33333d;
  --ink: #f4f4f5;
  --ink-2: #c4c4cc;
  --muted: #8a8a96;
  --accent: #c6f432;
  --accent-ink: #0a0a0c;
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;
  --serif: 'Roboto', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sans: 'Roboto', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
}

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

html, body { margin: 0; padding: 0; }

.admin-body, .login-body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- Layout ---------- */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-side {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
}

.side-brand {
  padding: 22px 22px 18px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1.1;
}
.side-brand .mark {
  font-family: var(--sans);
  font-style: normal;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0;
  flex-shrink: 0;
}
.side-brand .name {
  white-space: nowrap;
}

.side-nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.side-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.side-nav a:hover { background: var(--panel); color: var(--ink); }
.side-nav a.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--accent);
}

.side-foot {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}
.who small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.logout {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.logout:hover { color: var(--ink); border-color: var(--line-2); }

.admin-main {
  padding: 28px 36px 60px;
  max-width: 1400px;
  width: 100%;
}

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--serif);
  
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.page-head .sub, .page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.page-head .actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Flash messages ---------- */
.flash {
  background: rgba(198, 244, 50, 0.08);
  border: 1px solid rgba(198, 244, 50, 0.25);
  color: var(--accent);
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
}
.flash.error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--error);
}

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--line-2);
}
.stat-card.success::before { background: var(--success); }
.stat-card.pending::before { background: var(--warning); }
.stat-card.error::before { background: var(--error); }
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 8px;
}
.stat-value {
  display: block;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-card .hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title {
  font-family: var(--serif);
  
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}
.panel-head .sub { color: var(--muted); font-size: 13px; }
.panel-head .link, a.link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}
.panel-head .link:hover, a.link:hover { filter: brightness(1.1); }

.panel > .data-table,
.panel > form,
.panel > .panel-body { /* allow plain content */ }
.panel-body { padding: 20px; }

/* ---------- Bar chart ---------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.bar-chart .bar {
  flex: 1;
  background: linear-gradient(to top, var(--accent), rgba(198, 244, 50, 0.4));
  border-radius: 3px 3px 0 0;
  height: var(--h, 50%);
  min-height: 2px;
  position: relative;
  transition: opacity 0.15s;
  cursor: default;
}
.bar-chart .bar:hover { opacity: 0.85; }
.bar-chart .bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Volume list ---------- */
.volume-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.volume-list .row {
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
}
.volume-list .row:first-child { border-top: 0; }
.volume-list .ccy {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.volume-list .amt {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
}

/* ---------- Data tables ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(255,255,255,0.015); }
.data-table .row-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.data-table .row-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.data-table .muted { color: var(--muted); }
.data-table .row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.method { text-transform: capitalize; letter-spacing: 0; font-weight: 500; }
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.pill .dot.stripe { background: #635bff; }
.pill .dot.paypal { background: #0070ba; }
.pill .dot.crypto { background: #f7931a; }
.pill .dot.mobile { background: #00d97e; }

.pill.status-succeeded { background: rgba(74, 222, 128, 0.12); color: var(--success); border-color: rgba(74, 222, 128, 0.3); }
.pill.status-pending,
.pill.status-processing { background: rgba(251, 191, 36, 0.12); color: var(--warning); border-color: rgba(251, 191, 36, 0.3); }
.pill.status-failed,
.pill.status-expired { background: rgba(248, 113, 113, 0.12); color: var(--error); border-color: rgba(248, 113, 113, 0.3); }
.pill.status-refunded { background: rgba(96, 165, 250, 0.12); color: var(--info); border-color: rgba(96, 165, 250, 0.3); }
.pill.status-partial_refund { background: rgba(96, 165, 250, 0.08); color: var(--info); border-color: rgba(96, 165, 250, 0.2); }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar select,
.filter-bar input {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  min-width: 140px;
}
.filter-bar input { min-width: 240px; }
.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--line-2);
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field.grow { flex: 1; }
.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.field-row > .field { flex: 1; min-width: 180px; margin-bottom: 16px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.15s;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field .hint {
  color: var(--muted);
  font-size: 12px;
}

.panel form { padding: 20px; }
.panel.inline-form form,
.panel.settings-form form { padding: 20px; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.checkbox-grid label:hover { border-color: var(--line-2); }
.checkbox-grid input[type="checkbox"] { accent-color: var(--accent); }
.checkbox-grid label.check {
  /* Same as bare .checkbox-grid label */
}
.panel form > .panel-title,
.panel form .panel-title {
  margin: 0 0 12px;
  padding-top: 6px;
}
.panel form > .panel-title:first-child { padding-top: 0; }
.panel form > .panel-title + .field,
.panel form > .panel-title + .field-row,
.panel form > .panel-title + .checkbox-grid { margin-top: 0; }
.checkbox-grid label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(198, 244, 50, 0.06);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.toggle input[type="checkbox"] {
  appearance: none;
  width: 38px;
  height: 22px;
  background: var(--line);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.18s;
}
.toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
}
.toggle input[type="checkbox"]:checked { background: var(--accent); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
  flex-wrap: wrap;
}
.form-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--error);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost, .copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-2); background: var(--panel-2); }
.btn-ghost.danger { color: var(--error); border-color: rgba(248, 113, 113, 0.4); }
.btn-ghost.danger:hover { background: rgba(248, 113, 113, 0.08); border-color: var(--error); }

.copy-btn {
  padding: 6px 10px;
  font-size: 11.5px;
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--ink-2);
}
.copy-btn:hover { color: var(--ink); border-color: var(--line-2); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* ---------- Two-column edit layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: flex-start;
}
.two-col .side-panel { position: sticky; top: 20px; }

.share-url {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.share-url input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  min-width: 0;
}

.qr-wrap {
  background: #fff;
  padding: 12px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.qr-wrap img { display: block; max-width: 100%; height: auto; }

.kv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.kv-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  text-transform: capitalize;
}
.kv-list li:first-child { border-top: 0; }
.kv-list .k, .kv-list span:first-child { color: var(--muted); }
.kv-list .v, .kv-list strong { font-weight: 600; }

.code-block {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
  overflow-x: auto;
}
.code-block .me { color: var(--accent); }

/* ---------- Login ---------- */
.login-body {
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(198, 244, 50, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(198, 244, 50, 0.06), transparent 60%),
    var(--bg);
}
.login-shell {
  width: 100%;
  max-width: 380px;
}
.login-brand {
  text-align: center;
  font-family: var(--serif);
  
  font-size: 40px;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.login-brand .mark {
  font-family: var(--sans);
  font-style: normal;
  font-size: 26px;
  color: var(--accent);
  margin-right: 4px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
}
.login-card h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  
  font-weight: 400;
  font-size: 26px;
}
.login-card .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}
.login-card .form-actions { margin-top: 8px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px 16px; }
.login-card .hint {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.login-card .hint code {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    padding: 0;
  }
  .side-brand { border-bottom: 0; border-right: 1px solid var(--line); padding: 16px 18px; flex-shrink: 0; }
  .side-nav { flex-direction: row; padding: 10px; flex: 1; overflow-x: auto; }
  .side-nav a { white-space: nowrap; }
  .side-foot { border-top: 0; border-left: 1px solid var(--line); flex-shrink: 0; }
  .admin-main { padding: 20px; }
  .two-col { grid-template-columns: 1fr; }
  .two-col .side-panel { position: static; }
}

@media (max-width: 560px) {
  .page-head h1 { font-size: 30px; }
  .stat-value { font-size: 30px; }
  .panel-title { font-size: 18px; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .side-foot .who { display: none; }
}
