/* =========================================================================
   Leonardo Reseller — design system
   Spotify-inspired dark UI · Manrope display · pill geometry
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* — Palette ------------------------------------------------------------- */
  --bg:            #000000;
  --bg-elev-1:     #0e0e10;
  --bg-elev-2:     #161618;
  --bg-elev-3:     #1f1f22;
  --bg-elev-4:     #2a2a2e;
  --hover-bg:      rgba(255,255,255,0.08);
  --active-bg:     rgba(255,255,255,0.16);
  --hairline:      rgba(255,255,255,0.07);
  --hairline-strong: rgba(255,255,255,0.14);

  --text:          #ffffff;
  --text-mid:      #b3b3b3;
  --text-mut:      #6a6a72;

  --accent:        #1ed760;
  --accent-hi:     #1fdf64;
  --accent-lo:     #169c46;
  --accent-tint:   rgba(30,215,96,0.14);
  --accent-glow:   rgba(30,215,96,0.40);

  --danger:        #ff5252;
  --warning:       #f5a623;
  --info:          #5cb8ff;
  --purple:        #b794ff;

  /* — Geometry ------------------------------------------------------------ */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 9999px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px rgba(30,215,96,0.25), 0 12px 40px rgba(30,215,96,0.18);

  /* — Layout ------------------------------------------------------------- */
  --topbar-h: 64px;
  --bottom-nav-h: 64px;
  --container-max: 1240px;

  /* — Type --------------------------------------------------------------- */
  --display: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --body:    'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* — Reset --------------------------------------------------------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 100% -10%, rgba(30,215,96,0.06), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(91,184,255,0.04), transparent 50%),
    linear-gradient(180deg, #050505 0%, #000000 60%, #000000 100%);
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 24px);
}
@media (max-width: 760px) {
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0) + 16px); }
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--accent); color: #000; }

/* — Typography rhythm --------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 12px 0;
  color: var(--text);
}
h1 { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.02; font-weight: 900; letter-spacing: -0.04em; }
h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 13px; line-height: 1.3; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mid); }
p { margin: 0 0 12px 0; color: var(--text-mid); }
.muted { color: var(--text-mut); }
small.muted { font-size: 12px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* — Layout shell -------------------------------------------------------- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
main.container { padding-top: 32px; padding-bottom: 48px; }
@media (max-width: 760px) {
  .container { padding: 0 16px; }
  main.container { padding-top: 16px; padding-bottom: calc(var(--bottom-nav-h) + 24px); }
}

/* — Topbar -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 80;
  background: rgba(0,0,0,0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  max-width: var(--container-max); margin: 0 auto;
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 17px; letter-spacing: -0.02em;
  color: var(--text); white-space: nowrap;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-pill);
  background: var(--accent); display: grid; place-items: center;
  color: #000; font-weight: 900; font-family: var(--display); font-size: 13px;
  letter-spacing: -0.04em;
}
.brand:hover { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--text-mid);
  font-weight: 700; font-size: 14px;
  padding: 8px 14px; border-radius: var(--r-pill);
  transition: color 120ms, background-color 120ms;
}
.nav-links a:hover { color: var(--text); background: var(--hover-bg); }
.nav-links a.is-active { color: var(--text); background: var(--hover-bg); }
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover,
.nav-links a.btn-primary:focus { color: #000; background: var(--accent); }
.balance-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 12px; border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: -0.01em;
  border: 1px solid rgba(30,215,96,0.22);
}
.balance-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
}
@media (max-width: 760px) {
  .topbar-inner { padding: 0 16px; height: 56px; }
  .nav-links a { display: none; }
  .nav-links .nav-cta { display: inline-flex; }
}

/* — Bottom nav (mobile) ------------------------------------------------- */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: grid; grid-template-columns: repeat(var(--bn-cols, 4), 1fr);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0));
    background: rgba(7,7,8,0.92);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-top: 1px solid var(--hairline);
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 8px 4px; border-radius: var(--r-md);
    color: var(--text-mut); font-size: 10px; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase;
    transition: color 140ms;
  }
  .bottom-nav a svg { width: 22px; height: 22px; stroke-width: 2.2; }
  .bottom-nav a.is-active { color: var(--accent); }
  .bottom-nav a:active { transform: scale(0.96); }
}

/* — Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  font-family: var(--body);
  font-weight: 700; font-size: 14px; letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  background: var(--bg-elev-3);
  color: var(--text);
  border: 1px solid var(--hairline);
  transition: transform 90ms ease, background-color 160ms, border-color 160ms, color 160ms;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--bg-elev-4); border-color: var(--hairline-strong); color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"], .btn.disabled {
  opacity: 0.45; cursor: not-allowed; transform: none; pointer-events: none;
}
.pager { display: flex; align-items: center; justify-content: center; margin-top: 16px; }
.btn-primary {
  background: var(--accent); color: #000;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 6px 18px rgba(30,215,96,0.28);
}
.btn-primary:hover { background: var(--accent-hi); color: #000; transform: scale(1.02); }
.btn-primary:active { background: var(--accent-lo); transform: scale(0.99); }
.btn-ghost { background: transparent; border-color: var(--hairline); }
.btn-ghost:hover { background: var(--hover-bg); }
.btn-danger { background: transparent; border-color: rgba(255,82,82,0.45); color: #ff8b8b; }
.btn-danger:hover { background: rgba(255,82,82,0.08); border-color: rgba(255,82,82,0.7); color: #ff8b8b; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-xs, .btn-tiny { height: 30px; padding: 0 12px; font-size: 12px; gap: 4px; }
.btn-block { width: 100%; }

/* — Forms --------------------------------------------------------------- */
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form > label, .order-form > label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-mid);
}
.input,
input:not([type]), input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"], input[type="date"],
input[type="tel"], input[type="time"], input[type="datetime-local"],
select, textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--bg-elev-2);
  border: 1px solid var(--hairline);
  color: var(--text);
  font-family: var(--body);
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.005em;
  line-height: 1.2;
  text-transform: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color 120ms, background-color 120ms, box-shadow 120ms;
}
textarea { font-family: var(--mono); font-size: 13.5px; line-height: 1.55; resize: vertical; min-height: 140px; padding: 16px 18px; }
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev-3);
  box-shadow: 0 0 0 3px rgba(30,215,96,0.18);
}
input::placeholder, textarea::placeholder {
  color: #7e7e87; font-weight: 500; opacity: 1;
  font-family: var(--body); font-size: 1em; letter-spacing: -0.005em;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-elev-2) inset;
  font-family: var(--body) !important;
  font-size: 15.5px !important;
  font-weight: 600 !important;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23b3b3b3' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 38px;
}

.form {
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 24px;
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.form.grid-1 { grid-template-columns: 1fr; }
.form.grid-2 { grid-template-columns: 1fr 1fr; }
.form.grid-3 { grid-template-columns: repeat(3, 1fr); }
.form.grid-4 { grid-template-columns: repeat(4, 1fr); }
.form .actions-row { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* — Order form: 2-pane shell (fields left, cost-card right sticky) ----- */
.order-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.order-shell .cost-card { position: sticky; top: calc(var(--topbar-h) + 20px); }
.order-form {
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.order-form > label { display: flex; flex-direction: column; gap: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mid); }
.order-form .span-2 { grid-column: 1 / -1; }
.order-form .actions-row { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .order-shell { grid-template-columns: 1fr; }
  .order-shell .cost-card { position: static; }
}
@media (max-width: 760px) {
  .form { padding: 18px; gap: 12px; }
  .form.grid-2, .form.grid-3, .form.grid-4 { grid-template-columns: 1fr; }
  .order-form { padding: 18px; gap: 12px 12px; grid-template-columns: 1fr; }
  .order-form .span-2 { grid-column: 1; }
  .actions-row .btn { flex: 1 1 calc(50% - 5px); }
}

/* — Cards --------------------------------------------------------------- */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
@media (max-width: 760px) { .card { padding: 16px; border-radius: var(--r-lg); } }

/* — Page heading -------------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 4px 0 18px;
}
.page-head h1 { margin: 0; font-size: clamp(28px, 3.8vw, 42px); }
.subnav { display: flex; gap: 8px; flex-wrap: wrap; }

/* — Hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px;
  padding: 36px 36px;
  margin: 4px 0 18px;
  background:
    radial-gradient(700px 400px at 90% 10%, rgba(30,215,96,0.22), transparent 60%),
    radial-gradient(500px 300px at 10% 90%, rgba(91,184,255,0.10), transparent 60%),
    linear-gradient(135deg, #0e0e10 0%, #1c1c1f 100%);
  border: 1px solid var(--hairline);
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: center;
}
.hero h1 { letter-spacing: -0.045em; font-weight: 900; }
.hero .lead {
  color: var(--text-mid); font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 500; max-width: 56ch; margin: 6px 0 22px;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: grid; gap: 12px; align-content: center; }
.stat {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.stat-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mid); }
.stat-value { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 760px) {
  .hero { padding: 32px 22px; border-radius: var(--r-xl); grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(28px, 9vw, 40px); }
}

/* — Feature row --------------------------------------------------------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 28px; }
.feature {
  position: relative;
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 26px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 180ms, transform 180ms, background 180ms;
}
.feature:hover { border-color: var(--hairline-strong); background: var(--bg-elev-2); transform: translateY(-2px); }
.feature h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.feature .feature-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent);
  display: grid; place-items: center; margin-bottom: 6px;
}
.feature .feature-icon svg { width: 22px; height: 22px; }
.feature p { color: var(--text-mid); }
.feature .btn { align-self: flex-start; margin-top: 6px; }

/* — Summary tiles (KPI) ------------------------------------------------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric {
  background: var(--bg-elev-1); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.metric-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mid); }
.metric-value { font-size: 26px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; }
.metric-sub { font-size: 12px; color: var(--text-mut); font-weight: 500; }

/* — Table (Spotify list) ----------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  padding: 12px 10px; text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle; white-space: nowrap;
}
.table th {
  font-weight: 800; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-mut);
  border-bottom-color: var(--hairline-strong);
  background: var(--bg-elev-1);
}
.table tbody tr { transition: background-color 120ms; }
.table tbody tr:hover { background: rgba(255,255,255,0.04); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.mono, .table .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-mid); }
.table td.target { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; }
@media (max-width: 760px) {
  /* Tables collapse into per-row cards on mobile.
     Each <td> becomes a flex key/value line using its data-label attribute. */
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
  .table { display: block; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table tbody tr {
    display: block;
    background: var(--bg-elev-2);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 6px 14px;
    margin-bottom: 10px;
  }
  .table tbody tr:hover { background: var(--bg-elev-2); }
  .table tbody tr:last-child { margin-bottom: 0; }
  .table tbody td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: normal; word-break: break-word;
    text-align: right; font-size: 13px;
  }
  .table tbody td:last-child { border-bottom: 0; }
  .table tbody td::before {
    content: attr(data-label);
    color: var(--text-mut);
    font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.08em;
    flex: 0 0 auto;
    text-align: left;
  }
  /* Cells without a data-label span the full width (e.g. action button rows). */
  .table tbody td:not([data-label])::before { display: none; }
  .table tbody td:not([data-label]) { justify-content: flex-end; }
  /* Truncated targets — let them wrap on mobile cards. */
  .table tbody td.target { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; }
  .table tbody td .bar { width: 80px; }
  .progress-cell { min-width: 0; }
}

/* — Country chip & badges ---------------------------------------------- */
.cc {
  display: inline-block; padding: 3px 9px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08); color: var(--text);
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.badge-done      { background: var(--accent-tint); color: var(--accent); }
.badge-running   { background: rgba(91,184,255,0.16); color: var(--info); }
.badge-queued    { background: rgba(245,166,35,0.14); color: var(--warning); }
.badge-scheduled { background: rgba(91,184,255,0.10); color: var(--info); border: 1px solid rgba(91,184,255,0.25); }
.badge-failed    { background: rgba(255,82,82,0.15); color: #ff8b8b; }
.badge-refunded  { background: rgba(183,148,255,0.16); color: var(--purple); }
.badge-paused    { background: rgba(255,255,255,0.10); color: var(--text-mid); }
.badge-cancelled { background: rgba(255,255,255,0.05); color: var(--text-mut); }

/* — Progress bar -------------------------------------------------------- */
.progress-cell { min-width: 160px; }
.bar { display: inline-block; width: 110px; height: 4px; background: rgba(255,255,255,0.10); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); box-shadow: 0 0 8px var(--accent-glow); transition: width 320ms ease; }
.bar-lg { display: block; width: 100%; height: 8px; margin: 10px 0; }
.progress-inline { display: inline-flex; align-items: center; gap: 8px; }
.pct { margin-left: 10px; font-variant-numeric: tabular-nums; color: var(--text-mid); font-size: 12.5px; font-weight: 600; }
.pct-lg { font-size: 13px; color: var(--text); font-weight: 700; }

/* — Cost card / order summary ----------------------------------------- */
.cost-card {
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl); padding: 22px;
}
.cost-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mid); }
.cost-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--hairline); font-size: 13.5px; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.cost-line b { color: var(--text); font-weight: 700; }
.cost-line.total { font-size: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); border-bottom: 0; color: var(--text); margin-top: 6px; }
.cost-line.total b { color: var(--accent); font-weight: 900; letter-spacing: -0.02em; }
/* — Side stack (chart card + cost card) ------------------------------- */
.side-stack { display: flex; flex-direction: column; gap: 14px; align-self: start; position: sticky; top: calc(var(--topbar-h) + 20px); }
.order-shell .side-stack { grid-column: 2; }
.order-shell .cost-card { position: static; }
@media (max-width: 980px) {
  .side-stack { position: static; }
  .order-shell .side-stack { grid-column: 1; }
}

/* — Chart insights card ----------------------------------------------- */
.chart-card {
  background: linear-gradient(180deg, rgba(91,184,255,0.06), var(--bg-elev-1));
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 20px;
}
.chart-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mid); }
.chart-empty { color: var(--text-mut); font-size: 13px; font-weight: 500; padding: 6px 0; }
.chart-rank {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  background: rgba(91,184,255,0.10);
  border: 1px solid rgba(91,184,255,0.22);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}
.chart-rank-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--info); }
.chart-rank-value { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-rank.is-out { background: rgba(255,255,255,0.04); border-color: var(--hairline); }
.chart-rank.is-out .chart-rank-label { color: var(--text-mid); }
.chart-current {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; margin-bottom: 10px;
  background: var(--accent-tint);
  border: 1px solid rgba(30,215,96,0.30);
  border-radius: var(--r-md);
}
.chart-current .chart-rank-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.chart-current .chart-rank-value { font-size: 20px; font-weight: 900; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-current .chart-meta { font-size: 12px; color: var(--text-mid); }

/* — Track preview card ------------------------------------------------ */
.track-preview {
  display: flex; align-items: center; gap: 14px;
  padding: 10px; border-radius: var(--r-md);
  background: var(--bg-elev-2); border: 1px solid var(--hairline);
}
.track-preview img {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover;
  background: var(--bg-elev-3);
}
.track-preview-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.track-preview-title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-preview-artist { font-size: 13px; color: var(--text-mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-benchmarks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bench {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 7px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 12px;
}
.bench span { color: var(--text-mid); font-weight: 700; }
.bench b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }

/* — Cutoff banner ----------------------------------------------------- */
.cutoff-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-md);
  background: rgba(245,166,35,0.12); color: var(--warning);
  border: 1px solid rgba(245,166,35,0.28);
  font-size: 13px; font-weight: 600;
  margin-bottom: 14px;
}
.cutoff-banner.is-closed {
  background: rgba(255,82,82,0.10); color: #ff8b8b;
  border-color: rgba(255,82,82,0.32);
}
.cutoff-banner .cutoff-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 7px; box-shadow: 0 0 8px currentColor; }
.cutoff-banner b { font-variant-numeric: tabular-nums; }

.custom-pricing-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 12px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(183,148,255,0.16); color: var(--purple);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}
.custom-pricing-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--purple); }

/* — Auth card ---------------------------------------------------------- */
.auth-shell { display: grid; place-items: center; min-height: calc(100vh - var(--topbar-h) - 80px); padding: 24px 0; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-elev-1); border: 1px solid var(--hairline);
  border-radius: 24px; padding: 36px;
}
.auth-card h1 { font-size: 32px; letter-spacing: -0.04em; margin-bottom: 6px; }
.auth-card .form { padding: 0; background: transparent; border: 0; grid-template-columns: 1fr; }
.auth-card .form > label { gap: 6px; }
.auth-card .actions-row .btn { width: 100%; height: 48px; font-size: 15px; }
.auth-card p.muted { text-align: center; margin-top: 18px; }
@media (max-width: 760px) { .auth-card { padding: 26px; border-radius: var(--r-xl); } }

/* — Flash / alert ------------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: var(--r-md); margin: 0 0 14px; font-size: 13.5px; font-weight: 600; }
.flash-success { background: var(--accent-tint); color: var(--accent); }
.flash-error   { background: rgba(255,82,82,0.14); color: #ff8b8b; }
.alert { background: rgba(255,82,82,0.10); border: 1px solid rgba(255,82,82,0.35); color: #ffb1b1; padding: 14px 16px; border-radius: var(--r-md); margin-bottom: 14px; font-size: 13.5px; }
.alert-ok { background: var(--accent-tint); border-color: rgba(30,215,96,0.4); color: var(--accent); }

/* — Footer -------------------------------------------------------------- */
.footer { text-align: center; padding: 30px 16px; color: var(--text-mut); font-size: 12px; }
@media (max-width: 760px) { .footer { padding-bottom: calc(var(--bottom-nav-h) + 24px); } }

/* — Admin user-detail layout ----------------------------------------- */
.user-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.user-detail-grid > .card { margin-bottom: 0; }
@media (max-width: 760px) { .user-detail-grid { grid-template-columns: 1fr; } }

/* — kv grid (order details) -------------------------------------------- */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 4px; }
.kv-k { color: var(--text-mut); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }

/* — Inline forms / actions --------------------------------------------- */
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; padding: 0; background: transparent; border: 0; }
.inline-form .amt { width: 100px; }
.inline-form .note { width: 160px; }
.inline-form input[type="number"], .inline-form input[type="text"] {
  height: 34px; padding: 0 10px; font-size: 12.5px;
}
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-vert { flex-direction: column; align-items: stretch; gap: 6px; }

/* — Filter bar --------------------------------------------------------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--bg-elev-2); }
.filter-bar input { flex: 1; min-width: 240px; }

/* — Code block --------------------------------------------------------- */
.codeblock {
  background: #050505; border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 16px;
  overflow: auto; max-height: 480px;
  font-family: var(--mono); font-size: 12px; color: var(--text);
  white-space: pre; line-height: 1.55;
}
details summary { cursor: pointer; color: var(--text-mid); margin-top: 6px; font-weight: 600; }
details ul { margin: 8px 0 0 18px; font-size: 12.5px; color: var(--text-mut); }

/* — Tier card chooser (marketplace) ----------------------------------- */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tier-card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  background: var(--bg-elev-2);
  padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 140ms, background-color 140ms, transform 140ms;
}
.tier-card:hover { border-color: var(--hairline-strong); background: var(--bg-elev-3); transform: translateY(-1px); }
.tier-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tier-card-name { font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.tier-card-price { font-size: 12.5px; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.tier-card-stock { font-size: 11px; color: var(--text-mut); margin-top: 2px; }
.tier-card.is-selected {
  border-color: var(--accent); background: rgba(30,215,96,0.06);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(30,215,96,0.18);
}
.tier-card.is-selected .tier-card-name { color: var(--accent); }
.tier-card.is-empty { opacity: 0.5; cursor: not-allowed; }
.tier-card .mix-tag,
.tier-card .verified-tag {
  position: absolute; top: 10px; right: 10px;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: rgba(183,148,255,0.18); color: var(--purple);
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}
.tier-card .verified-tag { background: var(--accent-tint); color: var(--accent); }

/* — Segmented control (mode toggle) ----------------------------------- */
.seg {
  display: inline-flex; padding: 4px; background: var(--bg-elev-2);
  border: 1px solid var(--hairline); border-radius: var(--r-pill);
  gap: 2px; margin-bottom: 8px;
}
.seg input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 13px; color: var(--text-mid);
  cursor: pointer; user-select: none;
  text-transform: none; letter-spacing: 0;
  transition: color 140ms, background-color 140ms;
}
.seg-btn:hover { color: var(--text); }
.seg input[type="radio"]:checked + .seg-btn {
  background: var(--text); color: #000;
}
@media (max-width: 760px) {
  .seg { width: 100%; }
  .seg-btn { flex: 1; }
}

/* — Calendar ----------------------------------------------------------- */
.calendar { width: 100%; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.cal-h { text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mut); padding: 6px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  position: relative;
  min-height: 110px;
  padding: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 140ms, background-color 140ms;
}
.cal-cell.cal-empty { background: transparent; border-color: transparent; }
.cal-cell.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-cell.is-past { opacity: 0.85; }
.cal-cell.has-items:hover { background: var(--bg-elev-3); border-color: var(--hairline-strong); }
.cal-date { font-weight: 800; font-size: 14px; color: var(--text); letter-spacing: -0.01em; }
.cal-cell.is-today .cal-date { color: var(--accent); }
.cal-summary { display: flex; flex-direction: column; gap: 2px; }
.cal-plays { font-weight: 700; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-meta { font-size: 11px; color: var(--text-mut); }
.cal-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.cal-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.cal-items { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.cal-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 4px 6px; border-radius: 6px;
  font-size: 11px; color: var(--text-mid);
  background: rgba(255,255,255,0.04);
  transition: background-color 120ms, color 120ms;
}
.cal-item:hover { background: rgba(255,255,255,0.10); color: var(--text); text-decoration: none; }
.cal-item .cc { font-size: 9.5px; padding: 1px 6px; }
.cal-more { font-size: 10.5px; color: var(--text-mut); padding: 0 6px; }
@media (max-width: 760px) {
  .cal-cell { min-height: 78px; padding: 6px; gap: 3px; }
  .cal-h { font-size: 9px; }
  .cal-plays { font-size: 12px; }
  .cal-meta { display: none; }
  .cal-item { font-size: 9.5px; padding: 2px 4px; }
  .cal-items { display: none; }
}

/* — Reveal on load ----------------------------------------------------- */
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal-1 { animation-delay: 60ms; }
.reveal-2 { animation-delay: 120ms; }
.reveal-3 { animation-delay: 180ms; }
.reveal-4 { animation-delay: 240ms; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* — Utility ------------------------------------------------------------ */
.text-accent { color: var(--accent); }
.text-mid    { color: var(--text-mid); }
.text-mut    { color: var(--text-mut); }
.pos { color: var(--accent); }
.neg { color: #ff8b8b; }
.show-mobile { display: none; }
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: initial; }
}
