@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --bg: #090a13;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #f5f6fb;
  --text-dim: #9aa1b8;
  --text-faint: #5b6178;

  --mint: #6d5efc;
  --mint-bright: #a599ff;
  --mint-dim: rgba(109, 94, 252, 0.16);
  --violet: #22d3ee;
  --violet-dim: rgba(34, 211, 238, 0.16);
  --amber: #f5a623;
  --amber-dim: rgba(245, 166, 35, 0.16);
  --red: #fb5568;
  --red-dim: rgba(251, 85, 104, 0.16);

  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'Fira Code', 'IBM Plex Mono', monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px rgba(109, 94, 252, 0.15), 0 8px 28px rgba(109, 94, 252, 0.14);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Faint technical grid, fading out toward the bottom of the viewport */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
}

/* Ambient color wash behind the grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 650px at 18% -8%, rgba(109, 94, 252, 0.10), transparent 60%),
    radial-gradient(900px 600px at 105% 8%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, rgba(245, 166, 35, 0.04), transparent 60%);
}

/* ---------- Decorative floating orbs (injected by js/effects.js) ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  will-change: transform;
}
.orb-1 {
  width: 520px; height: 520px;
  top: -160px; left: -140px;
  background: radial-gradient(circle, var(--mint) 0%, transparent 70%);
  animation: float-orb-a 20s ease-in-out infinite;
}
.orb-2 {
  width: 460px; height: 460px;
  bottom: -160px; right: -120px;
  background: radial-gradient(circle, var(--violet) 0%, transparent 70%);
  animation: float-orb-b 24s ease-in-out infinite;
}
.orb-3 {
  width: 380px; height: 380px;
  top: 38%; left: 58%;
  background: radial-gradient(circle, var(--amber) 0%, transparent 70%);
  opacity: 0.16;
  animation: float-orb-a 28s ease-in-out infinite reverse;
}
@keyframes float-orb-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -50px) scale(1.08); }
  66% { transform: translate(-24px, 30px) scale(0.94); }
}
@keyframes float-orb-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -30px) scale(1.1); }
}
/* Slow ambient hue drift on the whole orb layer — the orbs still float via
   their own transforms above; this just keeps the color wash from ever
   looking perfectly static over a long session. */
.bg-decor { animation: hue-drift 40s linear infinite; }
@keyframes hue-drift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(18deg); }
}

/* ---------- Cursor spotlight + leading dot (injected by js/effects.js) ---------- */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.22) 32%, transparent 68%);
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.35s ease;
  will-change: transform;
}
/* Crisp little dot that leads the soft glow with a tighter lag, plus a
   thin ring that trails looser — the pair reads as "cursor with momentum"
   rather than the flat OS arrow. Scales up slightly over clickable
   elements (toggled by effects.js via .cursor-dot.hover) and snaps down on
   press for tactile click feedback. */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 16;
  opacity: 0;
  transition: opacity 0.35s ease, width 0.2s var(--ease-out), height 0.2s var(--ease-out);
  will-change: transform;
}
.cursor-dot {
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--mint-bright);
  box-shadow: 0 0 12px 2px rgba(109, 94, 252, 0.65);
}
.cursor-dot.hover { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.cursor-dot.pressed { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
.cursor-ring {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid rgba(165, 153, 255, 0.4);
}
.cursor-ring.hover { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-color: rgba(165, 153, 255, 0.65); }
@media (hover: none), (pointer: coarse) {
  .cursor-glow, .cursor-dot, .cursor-ring, .bg-decor { display: none; }
}

/* ---------- Click ripple (buttons, tabs, coin/amount chips) ---------- */
.ripple-el {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  pointer-events: none;
  animation: ripple-pop 0.55s ease-out forwards;
}
@keyframes ripple-pop {
  to { transform: scale(1); opacity: 0; }
}
.seg-tab, .quick-amount, .coin-chip {
  position: relative;
  overflow: hidden;
}

/* ---------- Magnetic hover (primary CTAs + coin/tab chips) — a small pull
   toward the cursor via effects.js, capped and eased back out on leave. */
.btn, .seg-tab, .coin-chip { transition: transform 0.15s var(--ease-out), filter 0.18s ease, box-shadow 0.25s ease, background 0.18s ease, color 0.2s ease, border-color 0.18s ease; }

/* ---------- Staggered entrance for list/table rows ---------- */
.runner-card:nth-of-type(1) { animation-delay: 0.02s; }
.runner-card:nth-of-type(2) { animation-delay: 0.06s; }
.runner-card:nth-of-type(3) { animation-delay: 0.1s; }
.runner-card:nth-of-type(4) { animation-delay: 0.14s; }
.runner-card:nth-of-type(5) { animation-delay: 0.18s; }
tbody tr:nth-of-type(1) { animation-delay: 0.02s; }
tbody tr:nth-of-type(2) { animation-delay: 0.05s; }
tbody tr:nth-of-type(3) { animation-delay: 0.08s; }
tbody tr:nth-of-type(4) { animation-delay: 0.11s; }
tbody tr:nth-of-type(5) { animation-delay: 0.14s; }
tbody tr:nth-of-type(n+6) { animation-delay: 0.16s; }

a { color: inherit; }

::selection { background: var(--mint-dim); color: var(--mint-bright); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Auth screen ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 44px 36px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: modal-in 0.45s var(--ease-out);
}

.auth-card h1 {
  font-family: var(--display);
  font-size: 23px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
}

.auth-card .subtitle {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 28px;
}

.auth-card label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.auth-card input {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--mint);
  background: rgba(109, 94, 252, 0.05);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.12);
}

/* ---------- Input with trailing icon button (password reveal, etc.) ---------- */
.input-group { position: relative; }
.input-group input { padding-right: 40px; }
/* Extra specificity so an ancestor's shorthand `padding` (e.g. `.field
   input`, declared later in the stylesheet) can't collapse this back down
   and let the toggle button overlap the typed text. */
.field .input-group input,
.field-input-icon .input-group input { padding-right: 40px; }
.input-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease, background 0.12s ease;
}
.input-toggle:hover { color: var(--text); background: var(--surface-3); }
.input-toggle svg { width: 15px; height: 15px; }
/* Overrides the generic `.auth-card button` full-width mint styling —
   that selector's specificity otherwise beats a single .input-toggle class. */
.auth-card .input-toggle,
.auth-card .input-toggle:hover {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  color: var(--text-faint);
  font-weight: 400;
  box-shadow: none;
  transform: translateY(-50%);
}
.auth-card .input-toggle:hover { color: var(--text); background: var(--surface-3); }

.auth-card button,
.btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(180deg, var(--mint-bright), var(--mint));
  color: #0e0a2e;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--body);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 18px rgba(109, 94, 252, 0.16);
  transition: filter 0.18s ease, transform 0.15s var(--ease-out), box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
/* Shine sweep on the primary CTA only — kept off secondary/danger buttons
   so the animation reads as "this is the important action," not decoration. */
.auth-card button::before,
.btn::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0; left: -60%;
  width: 35%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.auth-card button:hover::before,
.btn:hover::before { left: 130%; }

.auth-card button:hover,
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 26px rgba(109, 94, 252, 0.32);
}
.btn:active { transform: translateY(0) scale(0.98); box-shadow: 0 4px 10px rgba(109, 94, 252, 0.18); }
.btn:focus-visible, input:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}
.btn:disabled, .auth-card button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Loading state: label hides behind a small spinner instead of the button
   changing size, so nothing jumps in the layout while a request is in flight. */
.btn.is-loading, .auth-card button.is-loading { color: transparent; pointer-events: none; position: relative; }
.btn.is-loading::after, .auth-card button.is-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 15px; height: 15px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(4, 21, 15, 0.3);
  border-top-color: #0e0a2e;
  animation: btn-spin 0.6s linear infinite;
}
.btn-secondary.is-loading::after, .btn-danger.is-loading::after {
  border-color: rgba(245, 246, 251, 0.22);
  border-top-color: var(--text);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-secondary {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--surface-3); box-shadow: none; }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(251, 85, 104, 0.35);
  box-shadow: none;
}
.btn-danger:hover { filter: brightness(1.2); box-shadow: 0 8px 22px rgba(251, 85, 104, 0.2); }

.btn-sm { padding: 7px 12px; font-size: 12px; width: auto; }
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn-icon svg { width: 14px; height: 14px; }

.error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin: 14px 0 0;
}
.hint {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 14px;
}

/* ---------- App shell ---------- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 10, 17, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar .brand,
.auth-card h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}
.brand .vn {
  background: linear-gradient(135deg, var(--mint-bright), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand .dot,
.auth-card h1 .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px 2px rgba(109, 94, 252, 0.7);
  flex-shrink: 0;
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.topbar .who {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-dim);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--mint), var(--violet));
  border: 1px solid var(--border);
  color: #0e0a2e;
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(109, 94, 252, 0.25);
}

.who-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Profile dropdown (topbar avatar/name trigger) ---------- */
.profile-menu { position: relative; }
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.profile-trigger:hover { background: var(--surface-3); border-color: var(--border); }
.profile-trigger[aria-expanded="true"] { background: var(--surface-3); border-color: var(--border); }
.profile-caret {
  width: 12px; height: 12px;
  color: var(--text-faint);
  transition: transform 0.25s var(--ease-out), color 0.18s ease;
}
.profile-trigger[aria-expanded="true"] .profile-caret { transform: rotate(180deg); color: var(--text); }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: linear-gradient(160deg, rgba(20, 22, 32, 0.95), rgba(10, 12, 20, 0.95));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.22s var(--ease-pop), visibility 0.18s;
  z-index: 12;
}
.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.profile-dropdown-item svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; transition: color 0.15s ease; }
.profile-dropdown-item:hover { background: var(--surface-3); }
.profile-dropdown-item.danger:hover { background: var(--red-dim); color: var(--red); }
.profile-dropdown-item.danger:hover svg { color: var(--red); }
.profile-dropdown-sep { height: 1px; background: var(--border-soft); margin: 5px 6px; }

.pill {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  backdrop-filter: blur(8px);
}
.pill strong { color: var(--mint); }

main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 56px;
  position: relative;
  z-index: 1;
  flex: 1;
}

h2.section-title {
  font-family: var(--display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 42px 0 16px;
}
h2.section-title:first-child { margin-top: 0; }

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* ---------- Table card wrapper (History tab) ---------- */
.table-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
/* Horizontal scroll on narrow viewports instead of letting the table blow
   out the page layout. */
.table-scroll { overflow-x: auto; }
.history-table { min-width: 640px; }
.history-table .th-actions { width: 88px; }
.history-table td.num {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hist-file {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 320px;
}
.hist-num { font-family: var(--mono); color: var(--text-faint); font-size: 11px; }
.hist-name { font-family: var(--body); font-weight: 500; color: var(--text); }
.hist-filename {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-when { color: var(--text-dim); white-space: nowrap; }
.row-actions-cell { white-space: nowrap; }
.history-table .empty { border: none; padding: 40px 24px; }

.badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-admin { background: var(--amber-dim); color: var(--amber); }
.badge-user { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.badge-valid { background: var(--mint-dim); color: var(--mint-bright); }
.badge-invalid { background: var(--red-dim); color: var(--red); }
.badge-idle { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.badge-idle::before { display: none; }
.badge-running { background: var(--mint-dim); color: var(--mint-bright); box-shadow: 0 0 0 1px rgba(109, 94, 252, 0.18); }
.badge-running::before { animation: pulse-dot 1.4s ease-in-out infinite; }
.badge-paused { background: var(--amber-dim); color: var(--amber); }
.badge-paused::before { display: none; }
.badge-stopping { background: var(--amber-dim); color: var(--amber); }
.badge-stopping::before { animation: pulse-dot 0.8s ease-in-out infinite; }
.badge-stopped { background: var(--red-dim); color: var(--red); }
.badge-stopped::before { display: none; }
.badge-completed { background: var(--mint-dim); color: var(--mint-bright); }
.badge-completed::before { display: none; }
.badge-access-active { background: var(--mint-dim); color: var(--mint-bright); }
.badge-access-active::before { display: none; }
.badge-access-pending { background: var(--amber-dim); color: var(--amber); }
.badge-access-pending::before { animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.5; }
}

/* ---------- Progress + ETA bar ---------- */
.mini-bar {
  width: 120px;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--violet));
  box-shadow: 0 0 10px rgba(109, 94, 252, 0.55);
  transition: width 0.5s var(--ease-out);
  position: relative;
  overflow: hidden;
  border-radius: 5px;
}
.mini-bar-fill.animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.mini-bar-pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  min-width: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 2px 7px;
}
.eta-txt { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.eta-txt.live { color: var(--mint-bright); }

/* ---------- Page head ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  animation: fade-up 0.5s var(--ease-out) both;
}
.page-title {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--text), var(--text-dim));
  -webkit-background-clip: text;
  background-clip: text;
}
.page-hint.hint { margin: 0; max-width: 52ch; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Segmented tab switcher (Runners / History) ---------- */
.segmented-tabs {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.5s var(--ease-out) both;
  animation-delay: 0.05s;
}
.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.seg-tab:hover { color: var(--text); }
.seg-tab.active {
  color: #0e0a2e;
  background: linear-gradient(180deg, var(--mint-bright), var(--mint));
  box-shadow: 0 4px 16px rgba(109, 94, 252, 0.35);
}
.seg-tab-count {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  text-align: center;
  line-height: 1.5;
}
.seg-tab.active .seg-tab-count { background: rgba(4, 21, 15, 0.18); }
.seg-tab-count:empty { display: none; }

/* ---------- Runner list ---------- */
.row-actions { display: flex; gap: 6px; }

.runner-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: default;
  transition: border-color 0.2s ease, transform 0.25s var(--ease-out), box-shadow 0.3s ease;
  animation: card-in 0.4s var(--ease-out) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.runner-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.runner-card.running {
  border-color: rgba(109, 94, 252, 0.35);
  box-shadow: var(--shadow-glow), var(--shadow-sm);
  animation: card-in 0.4s var(--ease-out) both, breathe-glow 2.8s ease-in-out infinite;
}
@keyframes breathe-glow {
  0%, 100% { box-shadow: var(--shadow-glow), var(--shadow-sm); }
  50% { box-shadow: 0 0 0 1px rgba(109, 94, 252, 0.28), 0 10px 38px rgba(109, 94, 252, 0.24), var(--shadow-sm); }
}

/* ---------- Numbered status chip ---------- */
.runner-num-chip {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.3s ease;
}
.runner-num { font-family: var(--mono); font-weight: 700; font-size: 12px; }
.runner-card[data-status="running"] .runner-num-chip {
  border-color: rgba(109, 94, 252, 0.4);
  background: linear-gradient(160deg, rgba(109, 94, 252, 0.2), rgba(109, 94, 252, 0.03));
  color: var(--mint-bright);
  box-shadow: 0 0 18px rgba(109, 94, 252, 0.28);
}
.runner-card[data-status="paused"] .runner-num-chip,
.runner-card[data-status="stopping"] .runner-num-chip {
  border-color: rgba(245, 166, 35, 0.4);
  background: linear-gradient(160deg, rgba(245, 166, 35, 0.16), rgba(245, 166, 35, 0.02));
  color: var(--amber);
}
.runner-card[data-status="stopped"] .runner-num-chip {
  border-color: rgba(251, 85, 104, 0.35);
  background: linear-gradient(160deg, rgba(251, 85, 104, 0.14), rgba(251, 85, 104, 0.02));
  color: var(--red);
}
.runner-card[data-status="completed"] .runner-num-chip {
  border-color: rgba(109, 94, 252, 0.35);
  background: linear-gradient(160deg, rgba(109, 94, 252, 0.14), rgba(109, 94, 252, 0.02));
  color: var(--mint-bright);
}

.runner-main { flex: 1; min-width: 0; }

.runner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}
.runner-num { color: var(--text-dim); font-family: var(--mono); font-weight: 500; }
.runner-name { color: var(--text); }

.runner-meta {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.runner-meta b { color: var(--text); font-weight: 500; font-family: var(--mono); }
.runner-meta .stat-valid, .runner-meta .stat-invalid { font-family: var(--mono); font-weight: 600; }
.runner-meta .sep { margin: 0 8px; color: var(--text-faint); }
.runner-meta .meta-file { color: var(--text); font-family: var(--mono); font-weight: 500; }

.runner-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
}
.runner-cpm { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

.runner-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s var(--ease-out);
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); transform: translateY(-1px); }
.icon-btn:active:not(:disabled) { transform: scale(0.9); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:disabled { opacity: 0.28; cursor: default; }
.icon-btn:disabled:hover { color: var(--text-dim); background: none; }

/* Transport controls read as "primary" once they're actionable — a tinted
   fill instead of a flat ghost icon, so Start/Pause don't get lost next to
   Stop/Rename/Delete in the same toolbar. */
.icon-btn.start:not(:disabled) { background: var(--mint-dim); color: var(--mint-bright); }
.icon-btn.start:not(:disabled):hover {
  background: linear-gradient(180deg, var(--mint-bright), var(--mint));
  color: #0e0a2e;
  box-shadow: 0 6px 16px rgba(109, 94, 252, 0.35);
}
.icon-btn.pause:not(:disabled) { background: var(--violet-dim); color: var(--violet); }
.icon-btn.pause:not(:disabled):hover {
  background: linear-gradient(180deg, #67e8f9, var(--violet));
  color: #062329;
  box-shadow: 0 6px 16px rgba(34, 211, 238, 0.35);
}
.icon-btn.stop:not(:disabled):hover { background: var(--red-dim); color: var(--red); }
.icon-btn.rename:not(:disabled):hover { background: var(--surface-3); }
.icon-btn.delete:hover { color: var(--red); background: var(--red-dim); }

/* Standalone icon buttons outside a .runner-actions toolbar (History rows)
   keep their own bordered chip look. */
.row-actions .icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  width: 30px;
  height: 30px;
}
.row-actions .icon-btn:hover { border-color: rgba(255, 255, 255, 0.25); background: var(--surface-3); }
.row-actions .icon-btn.delete:hover { border-color: var(--red); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 8, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: modal-in 0.3s var(--ease-pop);
}
.modal h3 {
  font-family: var(--display);
  font-size: 16px;
  margin: 0 0 20px;
}
.modal .form-row { justify-content: flex-end; }
.modal .btn, .modal .btn-secondary { width: auto; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-backdrop.closing { animation: fade-out 0.15s ease forwards; }
.modal-backdrop.closing .modal { animation: modal-out 0.15s ease forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(0.96); } }

/* ---------- Confirm modal ---------- */
.confirm-modal-msg {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.confirm-modal .modal-heading .icon { background: var(--red-dim); color: var(--red); }

/* ---------- Quick-amount chips (admin credits modal) ---------- */
.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.quick-amount {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}
.quick-amount:hover { border-color: rgba(255, 255, 255, 0.28); color: var(--text); transform: translateY(-1px); }
.quick-amount.positive:hover { border-color: var(--mint); color: var(--mint-bright); }
.quick-amount.negative:hover { border-color: var(--red); color: var(--red); }
.quick-amount.active { background: var(--mint-dim); border-color: var(--mint); color: var(--mint-bright); }

/* ---------- Section header with icon + live indicator ---------- */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 42px 0 16px;
}
.section-title-row:first-child, .section-title-row.no-top-margin { margin-top: 0; }
.section-title-row h2.section-title { margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title-row h2.section-title svg { width: 14px; height: 14px; color: var(--text-faint); }
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.live-indicator::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(109, 94, 252, 0.7);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

/* ---------- Table row avatar (admin users table) ---------- */
.table-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-user .avatar { width: 28px; height: 28px; font-size: 11px; transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease; }
tbody tr:hover .table-user .avatar { transform: scale(1.1) rotate(-3deg); box-shadow: 0 4px 14px rgba(109, 94, 252, 0.35); }
.table-user .table-user-name { font-family: var(--body); font-weight: 500; color: var(--text); }
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 600;
}
.credit-pill svg { width: 13px; height: 13px; color: var(--amber); flex-shrink: 0; }

.tab-panel { animation: fade-in 0.25s ease; }

/* ---------- Table row entrance ---------- */
tbody tr { animation: row-in 0.3s var(--ease-out) both; }
@keyframes row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Tabs (admin Debug Log) ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 4px;
  margin-right: 24px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--mint); }
.tab-btn:hover { color: var(--text); }

/* ---------- Stats strip ---------- */
.stats-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stat-chip {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s ease;
  animation: fade-up 0.4s var(--ease-out) both;
}
.stat-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-chip .n { font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--text); }
.stat-chip .l { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-chip.running { border-color: rgba(109, 94, 252, 0.3); }
.stat-chip.running .n { color: var(--mint-bright); }

/* ---------- Debug log tables ---------- */
.log-action {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.log-action.positive { color: var(--mint-bright); border-color: rgba(109, 94, 252, 0.3); }
.log-action.negative { color: var(--red); border-color: rgba(251, 85, 104, 0.3); }
.log-detail { color: var(--text-dim); font-size: 12px; }
.log-detail b { color: var(--text); font-weight: 500; }

/* ---------- Forms in cards ---------- */
.form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .search-input {
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--body);
  min-width: 160px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field input:focus, .field select:focus, .search-input:focus {
  outline: none;
  border-color: var(--mint);
  background: rgba(109, 94, 252, 0.04);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.12);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa1b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* ---------- Icon-prefixed inputs (admin create-user form) ---------- */
.field-input-icon { position: relative; }
.field-input-icon .field-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  pointer-events: none;
  z-index: 1;
  transition: color 0.18s ease;
}
.field-input-icon input,
.field-input-icon select,
.field-input-icon .input-group input {
  padding-left: 32px;
}
.field-input-icon:has(input:focus) .field-icon,
.field-input-icon:has(select:focus) .field-icon { color: var(--mint); }

/* ---------- Custom select (themed dropdown — native <select> popups
   can't be restyled past the closed box, so this replaces the popup with
   our own absolutely-positioned menu for anywhere that needs one). ---------- */
.custom-select { position: relative; }
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 30px 9px 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--body);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.custom-select-trigger:hover { border-color: rgba(255, 255, 255, 0.28); }
.custom-select-trigger:focus-visible,
.custom-select.open .custom-select-trigger {
  outline: none;
  border-color: var(--mint);
  background: rgba(109, 94, 252, 0.04);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.12);
}
.custom-select-trigger span { flex: 1; }
.custom-select-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-faint);
  pointer-events: none;
  transition: transform 0.25s var(--ease-out);
}
.custom-select.open .custom-select-caret { transform: translateY(-50%) rotate(180deg); }

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 140px;
  background: linear-gradient(160deg, rgba(20, 22, 32, 0.97), rgba(10, 12, 20, 0.97));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top;
  transition: opacity 0.16s ease, transform 0.2s var(--ease-pop), visibility 0.16s;
  z-index: 15;
}
.custom-select.open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.custom-select-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.custom-select-option:hover { background: var(--surface-3); color: var(--text); }
.custom-select-option.active { background: var(--mint-dim); color: var(--mint-bright); font-weight: 600; }

/* ---------- Table-header column filter (e.g. Payments tab "User") ---------- */
.th-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}
.th-filter-trigger:hover, .custom-select.open .th-filter-trigger { color: var(--text); }
.th-filter-trigger svg { width: 11px; height: 11px; transition: transform 0.2s var(--ease-out); }
.custom-select.open .th-filter-trigger svg { transform: rotate(180deg); }
.th-filter-trigger.active { color: var(--mint-bright); }

/* ---------- Upload zone ---------- */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s var(--ease-out), box-shadow 0.25s ease;
}
.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(109, 94, 252, 0.1), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--mint);
  background: rgba(109, 94, 252, 0.04);
  transform: translateY(-1px);
}
.dropzone:hover::before, .dropzone.drag::before { opacity: 1; }
.dropzone.drag { transform: scale(1.015); box-shadow: var(--shadow-glow); }
.dropzone .icon {
  position: relative;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--mint-bright);
  margin-bottom: 12px;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--mint-dim), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(109, 94, 252, 0.25);
  display: flex; align-items: center; justify-content: center;
  margin-left: auto; margin-right: auto;
  transition: transform 0.3s var(--ease-pop), box-shadow 0.3s ease;
}
.dropzone:hover .icon, .dropzone.drag .icon {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 22px rgba(109, 94, 252, 0.3);
}
.dropzone .main-txt { font-size: 14px; font-weight: 500; margin-bottom: 4px; position: relative; }
.dropzone .sub-txt { font-size: 11.5px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.02em; position: relative; }

.empty {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty .empty-icon {
  width: 36px; height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
}
.empty .empty-icon svg { width: 17px; height: 17px; }

/* ---------- Access gate (self-registered, not yet approved) ---------- */
.access-gate {
  max-width: 480px;
  margin: 64px auto;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 36px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: modal-in 0.4s var(--ease-out);
}
.access-gate-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: var(--amber-dim);
  color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.18), 0 10px 30px rgba(245, 166, 35, 0.15);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
.access-gate-icon svg { width: 24px; height: 24px; }
.access-gate-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.access-gate-msg { color: var(--text-dim); font-size: 13px; line-height: 1.6; margin: 0 0 18px; }
.access-gate-cta {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  padding: 12px 16px;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: var(--radius-sm);
}
.access-gate-cta .handle { color: var(--amber); font-family: var(--mono); }

/* ---------- Skeleton loading state ---------- */
.skeleton-card {
  height: 92px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
}
.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-chip {
  width: 96px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.skeleton-chip::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ---------- File dropzone (runner-create modal) ---------- */
.dropzone input[type="file"] { display: none; }
.dropzone {
  padding: 22px;
}
.dropzone .icon svg { width: 20px; height: 20px; }
.dropzone.has-file {
  border-style: solid;
  border-color: var(--mint);
  background: linear-gradient(160deg, rgba(109, 94, 252, 0.07), rgba(109, 94, 252, 0.015));
}
.dropzone.has-file .icon {
  background: linear-gradient(160deg, var(--mint), var(--mint-bright));
  color: #0e0a2e;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(109, 94, 252, 0.35);
}
.dropzone .main-txt.file-name {
  color: var(--mint-bright);
  font-family: var(--mono);
  font-weight: 600;
  word-break: break-all;
}

/* ---------- Modal header with icon ---------- */
.modal-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.modal-heading .icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--mint-dim);
  color: var(--mint-bright);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-heading .icon svg { width: 15px; height: 15px; }
.modal-heading h3 { margin: 0; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(160deg, rgba(20, 22, 32, 0.92), rgba(12, 14, 22, 0.92));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mint);
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 30;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s var(--ease-pop);
}
.toast.error { border-left-color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Footer ---------- */
.app-footer, .auth-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  padding: 20px 16px 28px;
  position: relative;
  z-index: 1;
}
.app-footer { border-top: 1px solid var(--border-soft); margin-top: 8px; }
.auth-footer { margin-top: 24px; }
.app-footer .handle, .auth-footer .handle {
  color: var(--mint-bright);
  font-family: var(--mono);
  font-weight: 600;
}

/* ---------- Top up credits (crypto payment gateway) ---------- */
.topup-modal { max-width: 440px; }
.topup-section-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 8px;
}
.topup-usd-hint { color: var(--mint-bright); font-family: var(--mono); font-weight: 600; }

.coin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.coin-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}
.coin-chip:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.28); color: var(--text); transform: translateY(-1px); }
.coin-chip.active { background: var(--mint-dim); border-color: var(--mint); color: var(--mint-bright); }
.coin-chip:disabled { opacity: 0.35; cursor: default; }
.coin-symbol { font-family: var(--display); font-weight: 700; font-size: 13px; }
.coin-network { font-family: var(--mono); font-size: 10px; color: inherit; opacity: 0.85; }

.invoice-status {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.invoice-status.pending { background: var(--amber-dim); border-color: rgba(245, 166, 35, 0.3); color: var(--amber); }
.invoice-status.confirmed { background: var(--mint-dim); border-color: rgba(109, 94, 252, 0.3); color: var(--mint-bright); }
.invoice-status.expired, .invoice-status.underpaid { background: var(--red-dim); border-color: rgba(251, 85, 104, 0.3); color: var(--red); }

.invoice-qr-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.invoice-qr { width: 180px; height: 180px; border-radius: 12px; background: #fff; padding: 10px; box-shadow: var(--shadow-sm); }

.invoice-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  margin-bottom: 4px;
  text-align: center;
}
.invoice-amount { font-size: 19px; font-weight: 700; color: var(--text); }
.invoice-coin { font-size: 12px; color: var(--text-dim); }

.invoice-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 14px;
}
.invoice-address { flex: 1; font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text); }
.invoice-expiry { text-align: center; margin-top: 14px; }
.invoice-reference { text-align: center; margin-top: 6px; font-size: 11px; }
.invoice-reference code { font-family: var(--mono); color: var(--text-dim); }
.invoice-reference a { color: var(--mint-bright); }

/* ---------- Owner wallet-secrets panel ---------- */
.secrets-warning {
  background: var(--red-dim);
  border: 1px solid rgba(251, 85, 104, 0.35);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}
#secretsTable { min-width: 720px; }
#secretsTable td { font-size: 11.5px; word-break: break-all; }
#secretsTable td:nth-child(4) { font-family: var(--mono); color: var(--amber); }

/* ---------- Detail modal (key/value list for a past invoice) ---------- */
.detail-list { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.detail-list dt { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.detail-list dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-all; }
.detail-list dd a { color: var(--mint-bright); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 640px) {
  main { padding: 20px 16px 48px; }
  .topbar { padding: 14px 16px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .field input, .field select { min-width: 0; }
  .runner-card { flex-direction: column; align-items: stretch; }
  .runner-actions { justify-content: flex-end; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn-icon { width: 100%; justify-content: center; }
  .segmented-tabs { width: 100%; }
  .seg-tab { flex: 1; justify-content: center; }
}
