/* =============================================================================
   tikmgr v2 — enhancements on top of style.css (the TikAPIs design layer)

   style.css stays as the shared, upstream design system. This file adds only what
   the v2 customer panel needs: a richer hero, the service catalog, price chips, the
   auth card, and the navbar balance pill. It reuses the tokens defined in style.css
   (--brand, --surface, --line, --radius, …) so light/dark themes stay consistent.
   ============================================================================= */

:root {
  --accent-2: #7c5cff;                 /* violet, used only in gradients/accents */
  --brand-soft: rgba(0, 211, 242, 0.10);
  --page-max: 1180px;
}

/* Page shell — a centered column, footer pinned to the bottom on short pages. */
html, body { min-height: 100%; }
body { display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* Slightly wider marketing column than Bootstrap's default, still centered. */
.container-app { max-width: var(--page-max); }

/* ---------------------------------------------------------------- navbar bits */

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  color: #fff;
  font-size: 1rem;
  margin-right: 0.55rem;
  box-shadow: 0 4px 12px -4px var(--brand-shadow);
}

.navbar-brand { display: inline-flex; align-items: center; }

/* Balance / API pill in the header. Monospace value, brand-tinted. */
.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.wallet-pill .bi { color: var(--brand); }
.wallet-pill strong { font-family: var(--font-mono); letter-spacing: -0.02em; }

.avatar-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--glow);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}
[data-bs-theme="dark"] .avatar-dot { color: var(--brand); }

/* ------------------------------------------------------------------- hero v2 */

.hero-v2 {
  position: relative;
  overflow: clip;
  padding: 4.5rem 0 3rem;
  text-align: center;
}

/* Soft brand + violet orbs behind the hero. Purely decorative, non-interactive. */
.hero-v2::before,
.hero-v2::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}

.hero-v2::before {
  width: 34rem; height: 34rem;
  top: -14rem; left: -8rem;
  background: radial-gradient(circle, var(--brand), transparent 62%);
}

.hero-v2::after {
  width: 30rem; height: 30rem;
  top: -12rem; right: -8rem;
  background: radial-gradient(circle, var(--accent-2), transparent 62%);
  opacity: 0.35;
}

.hero-v2 h1 {
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.06;
  font-size: clamp(2.15rem, 5.2vw, 3.5rem);
}

.hero-v2 .lead { max-width: 38rem; margin-inline: auto; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

/* Trust strip under the hero CTA. */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 2rem;
  margin-top: 2.5rem;
  color: var(--bs-secondary-color);
  font-size: 0.86rem;
}

.trust-strip span { display: inline-flex; align-items: center; gap: 0.4rem; }
.trust-strip .bi { color: var(--ok); }

/* Stat trio under the hero. */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 40rem;
  margin: 2.75rem auto 0;
}

.hero-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 0.75rem;
}

.hero-stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--brand-strong);
}
[data-bs-theme="dark"] .hero-stat .num { color: var(--brand); }
.hero-stat .lbl { font-size: 0.76rem; color: var(--bs-secondary-color); }

@media (max-width: 575.98px) {
  .hero-stats { grid-template-columns: 1fr; max-width: 18rem; }
}

/* ------------------------------------------------------- service catalog v2 */

/* Jump-nav rail: category anchors that stick under the navbar on the list page. */
.catalog-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 0;
  position: sticky;
  top: var(--nav-height);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 5;
  border-bottom: 1px solid var(--line);
}

.catalog-jump a {
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--bs-secondary-color);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.catalog-jump a:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
  background: var(--glow);
}

/* One category block. */
.cat-block { margin-top: 2rem; }

.cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cat-head h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.cat-count { font-size: 0.8rem; color: var(--bs-secondary-color); white-space: nowrap; }

/* The service table. On wide screens it's a real table; on phones each row becomes
   a stacked card via the data-label pattern so nothing scrolls sideways. */
.svc-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.svc-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  text-align: left;
  padding: 0.55rem 0.85rem;
}
.svc-table thead th.num, .svc-table td.num { text-align: right; }
.svc-table thead th.act, .svc-table td.act { text-align: right; width: 1%; white-space: nowrap; }

.svc-table tbody tr {
  background: var(--surface);
  transition: background 0.12s ease;
}
.svc-table tbody tr:hover { background: var(--surface-2); }

.svc-table td {
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.9rem;
}

.svc-id { font-family: var(--font-mono); font-size: 0.8rem; color: var(--bs-secondary-color); }

.svc-name { font-weight: 500; }
.svc-desc {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Price per 1000 — the headline number on each row. */
.price-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--brand-strong);
  white-space: nowrap;
}
[data-bs-theme="dark"] .price-chip { color: var(--brand); }
.price-chip .per { font-size: 0.68rem; color: var(--bs-secondary-color); font-weight: 500; }

.qty-range { font-family: var(--font-mono); font-size: 0.82rem; white-space: nowrap; }

.type-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  white-space: nowrap;
}
[data-bs-theme="dark"] .type-tag { color: var(--brand); }

/* Phone layout: stack each row as a card with labels. */
@media (max-width: 767.98px) {
  .svc-table thead { display: none; }
  .svc-table, .svc-table tbody, .svc-table tr, .svc-table td { display: block; width: 100%; }
  .svc-table tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.25rem;
  }
  .svc-table td { border: 0; padding: 0.3rem 0.85rem; text-align: left !important; }
  .svc-table td.num, .svc-table td.act { text-align: left; }
  .svc-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.1rem;
  }
  .svc-table td.act .btn { width: 100%; margin-top: 0.25rem; }
}

/* --------------------------------------------------------------- auth pages */

.auth-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem 1rem 2rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
}

.auth-card .brand-mark { width: 2.4rem; height: 2.4rem; font-size: 1.3rem; margin: 0 0 1rem; }

.auth-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 0.25rem; letter-spacing: -0.02em; }
.auth-sub { color: var(--bs-secondary-color); font-size: 0.9rem; margin-bottom: 1.4rem; }

.auth-alt {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.88rem;
  color: var(--bs-secondary-color);
}

.field-group { margin-bottom: 0.9rem; }

/* Password reveal / hint row. */
.field-hint { font-size: 0.76rem; color: var(--bs-secondary-color); margin-top: 0.3rem; }

/* ----------------------------------------------------------------- empty state */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--bs-secondary-color);
}
.empty-state .bi { font-size: 2.5rem; color: var(--brand); opacity: 0.7; }
.empty-state h3 { font-size: 1.1rem; margin: 0.75rem 0 0.35rem; color: var(--bs-body-color); }

/* --------------------------------------------------------------- misc helpers */

.section-heading {
  text-align: center;
  margin-bottom: 2rem;
}
.section-heading h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
.section-heading p { color: var(--bs-secondary-color); max-width: 34rem; margin: 0.5rem auto 0; }

/* Feature grid on the landing page reuses .feature-card / .feature-icon from style.css. */

/* Filter-bar selects (orders status, etc.): a comfortable minimum width so the label
   and the native dropdown arrow never crowd each other. Builds on style.css's
   .panel-search .form-select { width:auto } rather than restyling the control. */
.panel-search .form-select {
  min-width: 11rem;
  text-overflow: ellipsis;
}

/* --- Add Funds: payment-method cards + quick-amount chips ----------------- */

/* A selectable payment method. The real <input type=radio> is visually hidden
   (.btn-check) and this label is the control; checked state is driven by the sibling
   selector so there is no JS for selection. */
.pay-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pay-method:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }

.btn-check:checked + .pay-method {
  border-color: var(--brand);
  background: var(--glow);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.btn-check:focus-visible + .pay-method { box-shadow: 0 0 0 0.2rem var(--glow); }

.pay-method .pm-icon {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 1.1rem;
}

.pay-method .pm-name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.pay-method .pm-sub { font-size: 0.78rem; color: var(--bs-secondary-color); }
.pay-method .pm-check { margin-left: auto; color: var(--brand); opacity: 0; }
.btn-check:checked + .pay-method .pm-check { opacity: 1; }

.amount-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.55rem; }

.amount-chips .chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--bs-body-color);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.amount-chips .chip:hover { border-color: var(--brand); color: var(--brand); }

/* Native <select> popup options: browsers render the open option list with an OS
   default background, which in dark mode leaves the text washed out / unreadable.
   Force legible colours (literal hex — option/optgroup ignore CSS vars in some
   browsers). */
[data-bs-theme="dark"] .form-select option,
[data-bs-theme="dark"] .form-select optgroup {
  background-color: #161d27;
  color: #e8ecf1;
}
[data-bs-theme="dark"] .form-select option:disabled {
  color: #8a94a6;
}

/* Pager: info line on the left, numbered pagination on the right; wraps on narrow
   screens. Used by the shared Pagination helper on any listing. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}
.pager .pager-count { font-size: 0.85rem; color: var(--bs-body-color); }
.pager .pagination { flex-wrap: wrap; }

/* Theme-aware subtle badge (roles, "soon") — replaces Bootstrap's .text-bg-light,
   which renders a jarring near-white chip in dark mode. */
.badge-soft {
  background: var(--surface-2);
  color: var(--bs-secondary-color);
  border: 1px solid var(--line);
  font-weight: 600;
}

/* Account dashboard (logs page) header — brand gradient banner. */
.dash-head {
  background: linear-gradient(135deg, var(--brand), #6366f1);
  color: #fff;
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
}
.dash-head code { color: #fff; background: rgba(255, 255, 255, 0.18); }
.dash-head-row {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.dash-head-title { min-width: 0; }
.dash-head-title .text-truncate { max-width: 100%; }
.dash-head-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
/* Score sits in its own translucent chip so it reads as a contained badge (white text,
   legible on the gradient) instead of loose coloured text spilling to the edge. */
.score-chip {
  text-align: center; padding: 0.35rem 0.9rem; border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.16); color: #fff; min-width: 74px;
}
.score-chip-num {
  font-family: var(--font-display); font-weight: 800; font-size: 1.55rem;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.score-chip-lbl { font-size: 0.66rem; color: rgba(255, 255, 255, 0.8); margin-top: 0.12rem; }

/* Labelled info cells (basic info grid). */
.info-cell {
  height: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.info-k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--bs-secondary-color); margin-bottom: 0.15rem; }
.info-v { font-weight: 600; word-break: break-word; }

/* TikTok profile stat tiles. */
.profile-stat {
  height: 100%;
  padding: 0.75rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.profile-stat .ps-num { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-word; }
.profile-stat .ps-lbl { font-size: 0.72rem; color: var(--bs-secondary-color); margin-top: 0.15rem; }

/* Interaction-capability cards (logs page): per-interaction score bar + attempts /
   successes / failures, colour-accented by score band via --cc. */
.cap-card {
  --cc: var(--brand);
  height: 100%;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--cc) 22%, var(--line));
  border-left: 3px solid var(--cc);
  border-radius: 0.6rem;
}
.cap-state {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--cc);
  background: color-mix(in srgb, var(--cc) 14%, transparent);
  padding: 0.1rem 0.45rem; border-radius: 1rem;
}
.cap-bar {
  height: 0.5rem; border-radius: 1rem; margin-top: 0.35rem;
  background: color-mix(in srgb, var(--cc) 15%, var(--surface-2));
  overflow: hidden;
}
.cap-bar-fill { height: 100%; border-radius: 1rem; background: var(--cc); }
.cap-stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 0.45rem; padding: 0.3rem 0.2rem;
}
.cap-stat-num { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.cap-stat-lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--bs-secondary-color); }

/* Interaction-details modal → Basic Information as a labelled card grid (mirrors the
   reference): a tinted panel holding cells, each a label + value; badges for type /
   operation / result; timestamp and error span the full width. */
.meta-panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
}
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.meta-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}
.meta-cell-wide { grid-column: 1 / -1; }
.meta-cell-k {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--bs-secondary-color); margin-bottom: 0.25rem;
}
.meta-cell-v { font-weight: 600; font-size: 0.9rem; word-break: break-word; }
@media (max-width: 575px) { .meta-grid { grid-template-columns: repeat(2, 1fr); } }

/* Login Schedule & Automation: four labelled panels of key/value rows. */
.sched-panel { height: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.75rem 0.9rem; }
.border-bottom-subtle { border-bottom: 1px solid var(--line); }
.border-bottom-subtle:last-child { border-bottom: 0; }

/* Account Limits & Usage: summary tiles, trust panel, per-interaction usage cards. */
.lim-sum {
  --sc: var(--brand); height: 100%;
  padding: 0.85rem 1rem; border-radius: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--sc) 22%, var(--line));
  border-left: 3px solid var(--sc);
  background: color-mix(in srgb, var(--sc) 7%, var(--surface));
}
.lim-sum-num { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--sc); }
.lim-sum-lbl { font-size: 0.75rem; color: var(--bs-secondary-color); margin-top: 0.2rem; }
.lim-sum-sub { font-size: 0.68rem; color: var(--bs-secondary-color); }

.lim-trust { background: var(--surface-2); border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.9rem 1rem; }

.lim-mini { background: var(--surface); border: 1px solid var(--line); border-radius: 0.45rem; padding: 0.35rem 0.2rem; height: 100%; }
.lim-mini-num { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.lim-mini-lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--bs-secondary-color); }

.lim-card {
  --sc: var(--brand); height: 100%;
  padding: 0.9rem 1rem; border-radius: 0.7rem;
  border: 1px solid var(--line); border-top: 3px solid var(--sc);
  background: var(--surface);
}
.lim-state {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; color: var(--sc);
  background: color-mix(in srgb, var(--sc) 14%, transparent);
  padding: 0.1rem 0.45rem; border-radius: 1rem;
}
.lim-bar { height: 0.45rem; border-radius: 1rem; background: color-mix(in srgb, var(--sc) 15%, var(--surface-2)); overflow: hidden; }
.lim-bar-fill { height: 100%; border-radius: 1rem; background: var(--sc); }
.lim-sub-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--bs-secondary-color); margin: 0.6rem 0 0.3rem; }

/* Metadata JSON blocks in the interaction-details modal. Wrap long lines (no horizontal
   scrollbar) and let the modal body be the single scroll container — no nested textareas. */
.meta-json {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--bs-body-color);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
}

/* Overview summary tiles (Total / Valid / Kids / Platforms) — icon square + label +
   value, same visual language as the KPI cards so the whole Overview reads as one set. */
.sum-tile {
  --sc: var(--brand);
  display: flex; align-items: center; gap: 0.8rem; height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--sc) 22%, var(--line));
  border-radius: 0.85rem;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--sc) 5%, var(--surface)),
    color-mix(in srgb, var(--sc) 13%, var(--surface)));
}
.sum-ico {
  width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sc); color: #fff; font-size: 1.15rem;
  box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--sc) 65%, transparent);
}
.sum-body { min-width: 0; flex: 1; }
.sum-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--bs-secondary-color);
}
.sum-value {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.5rem; line-height: 1.05; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--bs-body-color); margin-top: 0.1rem;
}
.sum-tile .stat-note { margin-top: 0.15rem; font-size: 0.78rem; }

/* While the Overview is (re)loading: dim the content and block interaction so the
   refresh reads as deliberate, paired with a spinner on the triggering button. */
.ov-loading { position: relative; opacity: 0.5; pointer-events: none; transition: opacity 0.15s ease; }

/* KPI report status bar (Live · Period · Last updated). */
.report-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font-size: 0.875rem;
}
.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #16a34a;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  animation: livePulse 1.8s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Distribution rows (account types / platform split, label · count · %). */
.dist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.dist-row:last-child { border-bottom: 0; }
.dist-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; }

/* Compact account stats cell (followers / following / likes). */
.acc-stats { font-size: 0.75rem; line-height: 1.35; white-space: nowrap; }
.acc-stats i { width: 1rem; }

/* Clickable @username → TikTok/CapCut profile link in the accounts table. */
.user-info-link {
  color: var(--brand-strong, var(--brand));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.user-info-link:hover { text-decoration: underline; }
.user-info-link .bi { font-size: 0.72em; opacity: 0.7; }

/* Admin tabs (Overview / Accounts Manager) — pill tabs driven by the URL hash. */
.admin-tabs { display: inline-flex; gap: 0.4rem; margin-bottom: 1.5rem; }
.admin-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--bs-secondary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.admin-tabs .tab:hover { color: var(--bs-body-color); background: var(--surface-2); }
.admin-tabs .tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 4px 12px -6px var(--brand-shadow);
}

/* Order-status badge with a per-status colour. The colour is supplied once via the
   --sc custom property (from services/order_status.py, the single source), and this
   one rule turns it into a legible tinted chip that works in light and dark themes. */
.status-badge {
  display: inline-block;
  color: var(--sc, var(--bs-secondary-color));
  background: color-mix(in srgb, var(--sc, gray) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc, gray) 32%, transparent);
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 0.2em 0.6em;
  border-radius: 6px;
  white-space: nowrap;
}

/* Orders-by-status: a compact, responsive card grid instead of a tall table of
   mostly-zero rows. Auto-fills columns to the available width. */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}

/* Each card is tinted with its own status colour (supplied via --sc), so every card
   is visibly distinct: a coloured left accent, a faint colour wash, and the count in
   the status colour. */
.status-card {
  --sc: var(--brand);
  border: 1px solid color-mix(in srgb, var(--sc) 26%, var(--line));
  border-left: 3px solid var(--sc);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sc) 7%, var(--surface));
  padding: 0.75rem 0.9rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.status-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.status-card .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
  /* Status colour, nudged toward the text colour so amber/yellow stay legible. */
  color: color-mix(in srgb, var(--sc) 78%, var(--bs-body-color));
}

.status-card .meta {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

/* The leading "Total orders" card is a solid brand tile that stands apart, with its
   label and count centred and vertically middled. */
.status-card.status-total {
  border: 0;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 8px 20px -10px var(--brand-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.status-total .section-label,
.status-total .num { color: #fff; }
.status-total .num { margin-top: 0.25rem; }

/* KPI cards (Overview → Key Performance Indicators). Layout: icon + name on one row,
   then the number on its OWN full-width line (so big figures like 3,821,311 never wrap),
   then a percentage-pill footer. A soft top accent in the status colour keeps every card
   distinct without shouting; the leading Total card is a brand-gradient tile. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.kpi-card {
  --sc: var(--brand);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
  min-height: 116px;
  padding: 1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--sc) 22%, var(--line));
  border-radius: 0.85rem;
  /* Soft diagonal status-colour wash — each card is a distinct, filled tile. */
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--sc) 5%, var(--surface)),
    color-mix(in srgb, var(--sc) 14%, var(--surface)));
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.kpi-ico {
  width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sc); color: #fff; font-size: 1.15rem;
  box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--sc) 65%, transparent);
}
.kpi-right { text-align: right; min-width: 0; flex: 1; }
.kpi-name {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 600; line-height: 1.2;
  color: color-mix(in srgb, var(--sc) 60%, var(--bs-body-color));
}
.kpi-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--bs-body-color); margin-top: 0.15rem;
}
.kpi-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.75rem; color: var(--bs-secondary-color);
}
.kpi-foot strong {
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--sc) 70%, var(--bs-body-color));
}
.kpi-del {
  border: 0; background: transparent; padding: 0; line-height: 1; cursor: pointer;
  color: color-mix(in srgb, var(--sc) 55%, var(--bs-secondary-color));
  opacity: 0.55; font-size: 0.8rem; transition: opacity 0.12s ease, color 0.12s ease;
}
.kpi-del:hover { opacity: 1; color: #ef4444; }

/* Stat tiles: keep big numbers on ONE line and let them shrink to fit the card
   instead of wrapping ("$460,024." / "07"). tabular-nums keeps digits aligned.
   Overrides the fixed size from style.css's .stat-value. */
.stat-tile .stat-value,
.amount-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-tile .stat-value {
  font-size: clamp(1.2rem, 1rem + 1.4vw, 1.75rem);
  letter-spacing: -0.03em;
}

/* Segmented toggle (e.g. Single / Multiple) — a compact multi-option switch built on
   btn-check radios. Defined once here and reused wherever a segmented control is
   needed, instead of restyling Bootstrap's .btn-group per page. */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.segmented .seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.34rem 0.85rem;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--bs-secondary-color);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented .seg-btn:hover { color: var(--bs-body-color); }

.segmented .btn-check:checked + .seg-btn {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.segmented .btn-check:focus-visible + .seg-btn { box-shadow: 0 0 0 0.2rem var(--glow); }

/* "How it works" steps on the Add Funds side panel. */
.howto { list-style: none; margin: 0; padding: 0; }
.howto li { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.4rem 0; font-size: 0.88rem; }
.howto .bi { color: var(--brand); margin-top: 0.15rem; }

/* ============================ System Settings ============================ */
/* Category tabs — horizontal pill row with a count badge, active pill uses brand. */
.set-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.set-tab {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem; border-radius: 8px; cursor: pointer;
  background: var(--surface); color: var(--bs-secondary-color);
  border: 1px solid var(--bs-border-color); font-size: 0.85rem; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.set-tab:hover { color: var(--bs-body-color); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.set-tab.active { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.set-tab-badge {
  min-width: 1.4em; text-align: center; font-size: 0.7rem; font-weight: 700;
  padding: 0.05em 0.4em; border-radius: 999px;
  background: color-mix(in srgb, var(--bs-secondary-color) 18%, transparent); color: var(--bs-secondary-color);
}
.set-tab.active .set-tab-badge { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--brand); }

/* Interaction Types grid + cards */
.ix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0.9rem; }
.ix-card {
  border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 1rem;
  background: var(--surface); border-left: 4px solid var(--bs-border-color);
  transition: border-color .15s, box-shadow .15s;
}
.ix-card.enabled { border-left-color: #16a34a; }
.ix-card.disabled { border-left-color: #94a3b8; opacity: 0.92; }
.ix-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.ix-card-title { min-width: 0; }
.ix-card-title h4 { word-break: break-word; }

/* Per-interaction rate-limit sub-cards (daily / weekly / monthly / interval) */
.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; margin-top: 0.85rem; }
.rl-card { border: 1px solid var(--bs-border-color); border-radius: 9px; padding: 0.6rem; background: var(--bs-body-bg); }
.rl-card-empty { opacity: 0.7; }
.rl-card-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--bs-secondary-color); margin-bottom: 0.5rem; }
.rl-inputs { display: flex; flex-direction: column; gap: 0.4rem; }
.rl-field { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.rl-label { font-size: 0.72rem; color: var(--bs-secondary-color); margin: 0; }
.rl-input { max-width: 6.5rem; text-align: right; }
.rl-input.rl-empty { color: var(--bs-secondary-color); }

/* ============================ Language admin ============================ */
/* Coverage bar for each locale (share of canonical keys with a real string). */
.meter, .lang-cov {
  height: 6px; width: 100%; max-width: 220px; border-radius: 999px;
  background: color-mix(in srgb, var(--bs-secondary-color) 20%, transparent);
  overflow: hidden; margin-bottom: 0.25rem;
}
.meter > span, .lang-cov > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
/* Translation editor: keep the inline textarea compact and auto-height-ish. */
textarea.tr-input { resize: vertical; min-height: 2.1rem; }

/* Chart.js canvases must live in a height-bounded, positioned box, otherwise a
   responsive+maintainAspectRatio:false chart grows a few px on every update/resize
   and the page creeps taller forever. */
.chart-box { position: relative; height: 150px; width: 100%; }
.chart-box-lg { position: relative; height: 260px; width: 100%; }

/* ==================== Orders Management (ported 1:1 from the old admin) ==================== */
/* Active Workers real-time monitor banner */
.active-workers-banner {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #60A5FA 100%);
  border-radius: 16px; padding: 24px; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(37,99,235,.3), 0 0 0 1px rgba(255,255,255,.1) inset;
}
.active-workers-content { position: relative; z-index: 1; }
.active-workers-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem;
  margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.2);
}
.active-workers-icon {
  width: 48px; height: 48px; background: rgba(255,255,255,.2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.active-workers-title { font-size: 1.25rem; font-weight: 700; color: #fff; margin: 0; line-height: 1.2; }
.active-workers-subtitle { font-size: .875rem; color: rgba(255,255,255,.9); margin: 4px 0 0; }
.active-workers-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); border: 2px solid rgba(255,255,255,.4);
  box-shadow: 0 4px 12px rgba(34,197,94,.5);
}
.pulse-dot { width: 10px; height: 10px; background: #fff; border-radius: 50%; animation: aw-pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes aw-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.badge-text { font-size: .8rem; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: .1em; }
.active-workers-clear-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 8px;
  background: rgba(239,68,68,.9); color: #fff; border: 1px solid rgba(255,255,255,.3);
  font-size: .875rem; font-weight: 600; cursor: pointer; transition: all .2s ease;
}
.active-workers-clear-btn:hover { background: #dc2626; color: #fff; transform: translateY(-2px); }
.active-workers-body { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 16px; }
@media (max-width: 991.98px) { .active-workers-body { grid-template-columns: 1fr; } }
.active-workers-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 575.98px) { .active-workers-metrics { grid-template-columns: repeat(2, 1fr); } }
.active-workers-metric-card {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); transition: all .3s ease;
}
.active-workers-metric-card:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.active-workers-metric-card.info-card { background: rgba(255,255,255,.05); }
.metric-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0; color: #fff; font-size: 1.1rem;
}
.metric-icon.orders-icon { background: rgba(96,165,250,.35); }
.metric-icon.servers-icon { background: rgba(52,211,153,.35); }
.metric-icon.workers-icon { background: rgba(251,191,36,.35); }
.metric-icon.info-icon { background: rgba(255,255,255,.15); }
.metric-content { flex: 1; min-width: 0; }
.metric-value { font-size: 1.7rem; font-weight: 900; color: #fff; line-height: 1; }
.metric-value-small { font-size: 1rem; font-weight: 700; color: rgba(255,255,255,.95); line-height: 1.2; font-family: var(--bs-font-monospace); }
.metric-label { font-size: .625rem; color: rgba(255,255,255,.75); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.servers-detail-container {
  background: rgba(255,255,255,.08); border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  overflow: hidden; display: flex; flex-direction: column; min-width: 320px; max-width: 420px;
}
@media (max-width: 991.98px) { .servers-detail-container { min-width: 0; max-width: none; } }
.servers-detail-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: #fff;
  background: rgba(255,255,255,.05); border-bottom: 1px solid rgba(255,255,255,.1);
  font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
}
.servers-detail-list { flex: 1; overflow-y: auto; padding: 10px; max-height: 210px; }
.servers-detail-list::-webkit-scrollbar { width: 6px; }
.servers-detail-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }
.servers-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 20px; color: rgba(255,255,255,.6); gap: 8px; font-size: .8rem; }
.server-detail-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 8px; }
.server-detail-item + .server-detail-item { margin-top: 6px; }
.server-detail-item:hover { background: rgba(255,255,255,.07); }
.server-ip { display: flex; align-items: center; gap: 10px; color: #fff; font-size: .9rem; font-weight: 700; font-family: var(--bs-font-monospace); min-width: 0; }
.server-ip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-ip-icon {
  width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  background: rgba(96,165,250,.3); border: 1px solid rgba(96,165,250,.5); color: #fff; flex-shrink: 0;
}
.server-worker-count {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 16px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: #fff;
  font-size: .75rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}

/* Quick-stats grid: one accent-topped card per status (same as the old panel) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: .85rem; }
.stat-card-simple {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem;
  position: relative; overflow: hidden; min-height: 116px; display: flex; flex-direction: column;
  justify-content: space-between; transition: box-shadow .15s, transform .15s;
}
.stat-card-simple:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -12px rgba(0,0,0,.35); }
.stat-card-simple::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--sc, var(--brand)); }
.stat-card-simple .stat-label { font-size: .78rem; color: var(--bs-secondary-color); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .25rem; }
.stat-card-simple .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: var(--sc, var(--bs-body-color)); }
.stat-card-simple .stat-subtitle { font-size: .72rem; color: var(--bs-secondary-color); margin-top: .35rem; }
/* KPI kartları: başlık + silme butonu tek satırda; başlık 2 satırlık sabit
   yükseklik ayırır ki uzun/kısa başlıklarda değerler AYNI hizada başlasın. */
.kpi-stat .kpi-stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.kpi-stat .kpi-stat-head .stat-label {
  min-height: 2.2em; line-height: 1.1; margin-bottom: .35rem; flex: 1; min-width: 0;
}
.kpi-stat .kpi-stat-head .btn { line-height: 1; margin-top: -2px; }
/* Kompakt bilgi kartı: sabit yükseklik/space-between yok — içerik kadar yer
   kaplar, kartın altında boşluk bırakmaz (Account Basic Info / Profile). */
.stat-card-simple.compact { min-height: 0; justify-content: flex-start; padding: .7rem .85rem; }
.stat-card-simple.compact .stat-content { display: flex; flex-direction: column; gap: .1rem; }

/* Bilgi kutucuğu: üstte ikon (sol) + kategori (sağ, vurgu rengi),
   altında kalın alan adı ve vurgu renkli değer (referans tasarım). */
.info-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: .8rem .9rem; position: relative; overflow: hidden;
}
.info-tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--sc, var(--brand)); }
.info-tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.info-tile-head i { color: var(--sc, var(--brand)); font-size: .95rem; }
.info-tile-head span { color: var(--sc, var(--brand)); font-size: .72rem; font-weight: 600; text-transform: capitalize; }
.info-tile-label { font-size: .78rem; font-weight: 600; color: var(--bs-body-color); margin-bottom: .1rem; }
.info-tile-value { font-size: .9rem; font-weight: 600; color: var(--sc, var(--bs-body-color)); overflow-wrap: anywhere; }
.info-tile-sub { font-size: .74rem; color: var(--bs-secondary-color); margin-top: .15rem; }

/* App Info: rounded icon tile + left accent card (mirrors the old panel) */
.ai-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ic, var(--brand)) 16%, transparent);
  color: var(--ic, var(--brand)); font-size: 1.05rem;
}
.card.ai-accent { border-left: 4px solid var(--ic, var(--brand)); }
.card.ai-accent .h4 { color: var(--ic, var(--bs-body-color)); }

/* Sortable table headers (App Info and any future admin table). */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--brand); }
th.sortable .sort-ind { font-size: .7em; opacity: .55; margin-left: .15rem; }
th.sortable.text-brand .sort-ind { opacity: 1; }

/* =============================================================================
   LEGACY BRIDGE — keeps pre-Bootstrap markup working on the new design system.

   The admin templates and the JS bundles still emit two vocabularies that used
   to be served by Tailwind CDN + main.css/modal.css:
     A. component classes (page-header, stat-card, table-cell, sys-modal-*, …)
     B. a bounded subset of Tailwind utilities (flex, gap-2, text-sm, …)
   Both are implemented here on top of the style.css tokens, so light/dark
   theming keeps working through the same variables. As pages get rewritten to
   native Bootstrap markup, blocks in this section can be deleted.
   ============================================================================= */

/* ------------------------------ hue tokens ------------------------------- */
/* One accent per Tailwind hue; flipped lighter in dark so text stays legible. */
:root {
  --tw-gray-4: #9ca3af; --tw-blue: #2563eb; --tw-indigo: #4f46e5;
  --tw-purple: #9333ea; --tw-violet: #7c3aed; --tw-green: #16a34a;
  --tw-emerald: #059669; --tw-teal: #0d9488; --tw-cyan: #0891b2;
  --tw-red: #dc2626; --tw-rose: #e11d48; --tw-orange: #ea580c;
  --tw-amber: #d97706; --tw-yellow: #ca8a04; --tw-pink: #db2777;
  --tw-slate: #64748b;
}
[data-bs-theme="dark"] {
  --tw-gray-4: #6b7280; --tw-blue: #60a5fa; --tw-indigo: #818cf8;
  --tw-purple: #c084fc; --tw-violet: #a78bfa; --tw-green: #4ade80;
  --tw-emerald: #34d399; --tw-teal: #2dd4bf; --tw-cyan: #22d3ee;
  --tw-red: #f87171; --tw-rose: #fb7185; --tw-orange: #fb923c;
  --tw-amber: #fbbf24; --tw-yellow: #facc15; --tw-pink: #f472b6;
  --tw-slate: #94a3b8;
}

/* --------------------------- status indicator ---------------------------- */
.status-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.status-dot-on { background: var(--ok); }
.status-dot-off { background: var(--tw-red); }
.user-status-indicator { align-items: center; }
.user-name { font-size: 0.9rem; font-weight: 500; }
.theme-toggle { line-height: 1; }

/* ------------------------------ login page ------------------------------- */
.login-message { display: none; margin-bottom: 1rem; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; border: 1px solid var(--line); }
.login-message.error { color: var(--bs-danger-text-emphasis); background: var(--bs-danger-bg-subtle); border-color: var(--bs-danger-border-subtle); }
.login-message.success { color: var(--bs-success-text-emphasis); background: var(--bs-success-bg-subtle); border-color: var(--bs-success-border-subtle); }
.login-message.info { color: var(--brand-strong); background: var(--glow); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

/* --------------------------- legacy buttons ------------------------------ */
/* Old markup uses btn-primary/btn-secondary heavily; re-skin them to the
   brand look so every page gets the new design without markup changes. */
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-disabled-color: #fff;
  --bs-btn-bg: var(--btn-from); --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: transparent; --bs-btn-active-bg: transparent;
  --bs-btn-hover-border-color: transparent; --bs-btn-active-border-color: transparent;
  background-image: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  border: 0; font-weight: 600;
  box-shadow: 0 1px 2px -1px var(--brand-shadow), 0 6px 16px -8px var(--brand-shadow);
  padding-block: calc(var(--bs-btn-padding-y) + 1px);
}
.btn-primary:hover { filter: brightness(1.09); }
.btn-primary:active { filter: brightness(0.94); }

.btn-secondary, .btn-outline {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-bg: var(--surface-2);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-bg: var(--surface-3);
  --bs-btn-hover-border-color: var(--bs-secondary-color);
  --bs-btn-active-color: var(--bs-body-color);
  --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-border-color: var(--bs-secondary-color);
}

.btn-purple {
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-bg: var(--tw-purple); --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--tw-violet); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--tw-violet); --bs-btn-active-border-color: transparent;
}

/* ---------------------------- legacy badges ------------------------------ */
.badge-primary, .badge-info, .badge-secondary, .badge-warning, .badge-id,
.badge-required, .badge-optional, .permission-badge, .no-permissions-badge,
.badge-success, .badge-danger, .badge-purple, .badge-orange, .badge-rose,
.platform-badge, .doc-badge, .interaction-status-badge, .settings-status-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600; line-height: 1.3;
  padding: 0.25em 0.6em; border-radius: 6px; white-space: nowrap;
  border: 1px solid transparent;
}
/* Hesap durum rozetleri (valid/failed/quota vb.) bu beş çeşidi kullanır —
   tanımsızken Bootstrap .badge beyaz metni şeffaf zeminde görünmez kılıyordu. */
.badge-success { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.badge-danger { color: var(--tw-red); background: color-mix(in srgb, var(--tw-red) 12%, transparent); }
.badge-purple { color: var(--tw-purple); background: color-mix(in srgb, var(--tw-purple) 14%, transparent); }
.badge-orange { color: var(--tw-orange); background: color-mix(in srgb, var(--tw-orange) 14%, transparent); }
.badge-rose { color: var(--tw-rose); background: color-mix(in srgb, var(--tw-rose) 14%, transparent); }
.badge-primary, .badge-info, .doc-badge { color: var(--brand-strong); background: var(--glow); }
[data-bs-theme="dark"] .badge-primary, [data-bs-theme="dark"] .badge-info,
[data-bs-theme="dark"] .doc-badge { color: var(--brand); }
.badge-secondary, .badge-optional, .no-permissions-badge, .platform-badge {
  color: var(--bs-secondary-color); background: var(--surface-2); border-color: var(--line);
}
.badge-warning { color: var(--tw-amber); background: color-mix(in srgb, var(--tw-amber) 14%, transparent); }
.badge-required { color: var(--tw-red); background: color-mix(in srgb, var(--tw-red) 12%, transparent); }
.badge-id { font-family: var(--font-mono); color: var(--bs-secondary-color); background: var(--surface-2); border-color: var(--line); }
.permission-badge { color: var(--tw-emerald); background: color-mix(in srgb, var(--tw-emerald) 12%, transparent); }

/* ---------------------------- legacy alerts ------------------------------ */
.alert-error { color: var(--bs-danger-text-emphasis); background-color: var(--bs-danger-bg-subtle); border-color: var(--bs-danger-border-subtle); }
.alert-content { display: flex; align-items: flex-start; gap: 0.6rem; }
.alert-icon { flex: 0 0 auto; }
.alert-text, .alert-message { flex: 1; min-width: 0; }

/* ----------------------------- legacy forms ------------------------------ */
.form-input, .login-input, .profile-field-input, .profile-modal-input,
.api-key-input, .rate-limit-input, .search-input, .settings-search-input {
  display: block; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background-color: var(--surface-2); color: var(--bs-body-color);
  font-family: inherit; font-size: 0.92rem; line-height: 1.5;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .login-input:focus, .profile-field-input:focus,
.profile-modal-input:focus, .api-key-input:focus, .rate-limit-input:focus,
.search-input:focus, .settings-search-input:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 0.2rem var(--glow);
}
.form-group, .field-group { margin-bottom: 0.9rem; }
.form-checkbox { width: 1em; height: 1em; accent-color: var(--brand); }
.input-hint { font-size: 0.76rem; color: var(--bs-secondary-color); margin-top: 0.3rem; }
.input-validation-error { font-size: 0.78rem; color: var(--bs-danger-text-emphasis); margin-top: 0.3rem; }

/* -------------------------- page scaffolding ----------------------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1.5rem; }
.page-title { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.page-subtitle { color: var(--bs-secondary-color); font-size: 0.92rem; margin: 0.15rem 0 0; }
.section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.section-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.card-content { padding: 1rem; }
/* h1-h6.card-title her yerde aynı ölçüde görünsün — Bootstrap boyut vermez,
   verilmeyince kart başlıkları ham h3 boyutunda basılıyordu. */
.card-title { font-size: 1.02rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.card-subtitle { color: var(--bs-secondary-color); font-size: 0.82rem; margin: 0.15rem 0 0; }

/* ------------------------------ stat cards ------------------------------- */
.stat-card, .metric-card, .analytics-card, .info-card,
.profile-stat-card, .trend-card, .chart-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.stat-card { display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem; }
.stat-content { min-width: 0; flex: 1; }
.stat-subtitle { font-size: 0.75rem; color: var(--bs-secondary-color); margin-top: 0.3rem; }
.stat-change { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; }
.stat-change-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-change-label, .stat-trend { color: var(--bs-secondary-color); font-size: 0.74rem; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.76rem;
  background: var(--surface-2); border: 1px solid var(--line);
}
.stats-section { margin-block: 1.5rem; }
.stats-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* --------------------------------- tabs ---------------------------------- */
.nav-tab, .cat-tab, .settings-nav-tab {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.9rem; border-radius: var(--radius-sm);
  color: var(--bs-secondary-color); text-decoration: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; border: 1px solid transparent;
  background: transparent; transition: background 0.15s ease, color 0.15s ease;
}
.nav-tab:hover, .cat-tab:hover, .settings-nav-tab:hover { color: var(--bs-body-color); background: var(--surface-2); }
.nav-tab.active, .cat-tab.active, .settings-nav-tab.active {
  color: #fff; background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 4px 12px -6px var(--brand-shadow);
}
.cat-tabs, .settings-nav-tabs, .stats-navigation { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.settings-nav-tab-badge {
  min-width: 1.4em; text-align: center; font-size: 0.7rem; font-weight: 700;
  padding: 0.05em 0.4em; border-radius: 999px;
  background: color-mix(in srgb, currentColor 18%, transparent);
}

/* ------------------------------ filter bars ------------------------------ */
.filter-bar, .filters-section { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.9rem; margin-bottom: 1rem; }
.filter-group { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.filter-group > label { font-size: 0.76rem; font-weight: 600; color: var(--bs-secondary-color); }
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 1.05rem; height: 1.05rem; flex: 0 0 auto; color: var(--bs-secondary-color); pointer-events: none; }
.search-wrap .search-input, .search-wrap .form-input, .search-wrap .form-control { padding-left: 2.1rem; }

/* ----------------------------- legacy tables ----------------------------- */
.table-container, .table-wrap, .settings-table-container, .accounts-table-container {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.table-container table, .table-wrap table, .accounts-table, .settings-table,
.services-table, .performance-table, .login-history-table, .params-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0;
}
.table-header-cell,
.table-container thead th, .table-wrap thead th, .accounts-table thead th,
.settings-table thead th, .services-table thead th, .performance-table thead th,
.login-history-table thead th, .params-table thead th {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--bs-secondary-color); text-align: left;
  white-space: nowrap; padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.table-cell,
.table-container tbody td, .table-wrap tbody td, .accounts-table tbody td,
.settings-table tbody td, .services-table tbody td, .performance-table tbody td,
.login-history-table tbody td, .params-table tbody td {
  padding: 0.65rem 0.85rem; vertical-align: middle; border-top: 1px solid var(--line);
}
.table-row:hover,
.table-container tbody tr:hover, .table-wrap tbody tr:hover,
.accounts-table tbody tr:hover, .settings-table tbody tr:hover,
.services-table tbody tr:hover { background: var(--surface-2); }

/* ------------------------------ pagination ------------------------------- */
.pagination-container, .custom-pagination {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.75rem 1rem; margin-top: 1rem;
}
.pagination-info { font-size: 0.82rem; color: var(--bs-secondary-color); }
.pagination-controls, .page-numbers { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.page-btn, .pagination-page-btn, .pagination-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 0.5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; color: var(--bs-body-color);
  font-size: 0.85rem; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.page-btn:hover, .pagination-page-btn:hover, .pagination-nav-btn:hover { background: var(--surface-2); color: var(--brand); }
.page-btn.active, .pagination-page-btn.active { background: var(--btn-from); border-color: var(--btn-from); color: #fff; }
.page-btn:disabled, .pagination-nav-btn:disabled { opacity: 0.45; cursor: default; }
.pagination-ellipsis { padding: 0 0.35rem; color: var(--bs-secondary-color); }

/* --------------------------- toggle switches ----------------------------- */
.settings-toggle-switch, .interaction-toggle-switch {
  position: relative; display: inline-block; width: 2.5rem; height: 1.4rem; flex: 0 0 auto;
}
.settings-toggle-input, .interaction-toggle-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.settings-toggle-slider, .interaction-toggle-slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.settings-toggle-slider::before, .interaction-toggle-slider::before {
  content: ""; position: absolute; width: 1rem; height: 1rem;
  left: 0.15rem; top: 50%; transform: translateY(-50%);
  border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: left 0.15s ease;
}
.settings-toggle-input:checked + .settings-toggle-slider,
.interaction-toggle-input:checked + .interaction-toggle-slider {
  background: var(--btn-from); border-color: var(--btn-from);
}
.settings-toggle-input:checked + .settings-toggle-slider::before,
.interaction-toggle-input:checked + .interaction-toggle-slider::before { left: calc(100% - 1.15rem); }

/* ------------------------- spinners & animations ------------------------- */
@keyframes tw-spin { to { transform: rotate(360deg); } }
@keyframes tw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes tw-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.loading-spinner {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: tw-spin 0.75s linear infinite;
}
.animate-spin { animation: tw-spin 1s linear infinite; }
/* Tam sayfa yükleme örtüsü (window.Loading.overlay) */
.app-loading-overlay {
  position: fixed; inset: 0; z-index: 2000; display: none;
  align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(2px);
}
.app-loading-overlay.show { display: flex; }
.app-loading-box {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 1.4rem 1.8rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); color: var(--brand);
}
.app-loading-spinner { width: 1.9rem; height: 1.9rem; border-width: 3px; }
.app-loading-text { font-size: .85rem; color: var(--bs-secondary-color); }
.pulse { animation: tw-pulse 1.8s ease-in-out infinite; }
.fade-in { animation: tw-fade-in 0.25s ease; }
.skeleton, .skeleton-text {
  background: var(--surface-3); border-radius: 6px; color: transparent !important;
  animation: tw-pulse 1.5s ease-in-out infinite; min-height: 0.9em;
}

/* --------------------------- sys-modal system ---------------------------- */
.sys-modal-backdrop {
  position: fixed; inset: 0; z-index: 1080;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(2, 8, 23, 0.55); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.sys-modal-backdrop.sys-modal-active { opacity: 1; visibility: visible; }
.sys-modal-hidden { display: none !important; }
.sys-modal-body-lock { overflow: hidden; }
.sys-modal-container {
  display: flex; flex-direction: column; width: 100%; max-width: 34rem;
  max-height: 90vh; overflow: hidden; position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  transform: scale(0.96); transition: transform 0.2s ease;
}
.sys-modal-active .sys-modal-container { transform: scale(1); }
.sys-modal-size-xs .sys-modal-container { max-width: 20rem; }
.sys-modal-size-sm .sys-modal-container { max-width: 26rem; }
.sys-modal-size-md .sys-modal-container { max-width: 34rem; }
.sys-modal-size-lg .sys-modal-container { max-width: 46rem; }
.sys-modal-size-xl .sys-modal-container { max-width: 60rem; }
.sys-modal-size-xxl .sys-modal-container { max-width: 72rem; }
.sys-modal-size-full .sys-modal-container { max-width: 96vw; max-height: 94vh; }
.sys-modal-header {
  flex: 0 0 auto; padding: 1rem 3rem 1rem 1.25rem;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.sys-modal-heading { font-size: 1.05rem; font-weight: 600; margin: 0; line-height: 1.4; }
.sys-modal-dismiss {
  position: absolute; top: 0.7rem; right: 0.7rem; z-index: 10;
  width: 2.1rem; height: 2.1rem; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--bs-secondary-color);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.sys-modal-dismiss:hover { background: var(--surface-3); color: var(--bs-body-color); }
.sys-modal-content { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem; }
.sys-modal-actions {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end;
  gap: 0.5rem; padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line); background: var(--surface);
}
.confirm-message, .sys-modal-content .alert-message { margin: 0; font-size: 0.95rem; line-height: 1.6; }

/* Legacy hand-rolled modals (modal-overlay pattern used by a few pages). */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1080;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(2, 8, 23, 0.55); backdrop-filter: blur(3px);
}
.modal-hidden { display: none !important; }
.modal-overlay .modal-content {
  width: 100%; max-width: 34rem; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.modal-overlay .modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; }
.modal-overlay .modal-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.modal-overlay .modal-body { padding: 1.25rem; overflow-y: auto; }
.modal-overlay .modal-footer { padding: 0.85rem 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 0.5rem; }
.modal-overlay .modal-close { border: 0; background: transparent; color: var(--bs-secondary-color); font-size: 1.4rem; line-height: 1; cursor: pointer; }

/* ------------------------------- API docs -------------------------------- */
.doc-hero { padding: 1.5rem 0 1rem; }
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 991.98px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-sidebar { position: sticky; top: calc(var(--nav-height) + 1rem); display: flex; flex-direction: column; gap: 2px; }
.sidebar-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bs-secondary-color); margin: 0.75rem 0 0.35rem; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm); color: var(--bs-secondary-color);
  text-decoration: none; font-size: 0.88rem;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--bs-body-color); }
.sidebar-link.active { background: var(--glow); color: var(--brand); font-weight: 600; }
.sidebar-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; opacity: 0.5; }
.doc-main { min-width: 0; }
.endpoint-box, .method-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.endpoint-header, .method-card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: pointer; }
.endpoint-method, .method-action-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem;
  font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 5px;
  background: var(--glow); color: var(--brand-strong); text-transform: uppercase;
}
[data-bs-theme="dark"] .endpoint-method, [data-bs-theme="dark"] .method-action-badge { color: var(--brand); }
.endpoint-url { font-family: var(--font-mono); font-size: 0.85rem; overflow-wrap: anywhere; }
.endpoint-body, .method-body { padding: 1rem; }
.endpoint-note { display: flex; gap: 0.5rem; font-size: 0.85rem; color: var(--bs-secondary-color); }
.method-title, .method-desc { margin: 0; }
.method-desc { font-size: 0.85rem; color: var(--bs-secondary-color); }
.method-chevron { margin-left: auto; transition: transform 0.15s ease; }
.param-name { font-family: var(--font-mono); font-weight: 600; font-size: 0.85rem; }
.param-type { font-family: var(--font-mono); font-size: 0.78rem; color: var(--bs-secondary-color); }
.code-section { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-block: 0.75rem; }
.code-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.85rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 0.78rem; color: var(--bs-secondary-color); }
.code-lang-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brand); }
.code-pre, .response-pre { margin: 0; border: 0; border-radius: 0; background: var(--surface-2); padding: 0.9rem 1rem; font-size: 0.8rem; overflow-x: auto; }
.copy-btn, .api-key-copy-btn, .add-interaction-copy-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--bs-secondary-color);
  border-radius: var(--radius-sm); padding: 0.25rem 0.6rem; font-size: 0.78rem; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover, .api-key-copy-btn:hover, .add-interaction-copy-btn:hover { color: var(--brand); border-color: var(--brand); }
.response-success-label { color: var(--ok); font-weight: 600; font-size: 0.8rem; }
.response-error-label { color: var(--tw-red); font-weight: 600; font-size: 0.8rem; }

/* ------------------------------ misc legacy ------------------------------ */
.chevron-icon { width: 1em; height: 1em; flex: 0 0 auto; transition: transform 0.15s ease; }
.open > .chevron-icon, .open .chevron-icon { transform: rotate(180deg); }
.menu-divider { margin: 0.35rem 0; border-color: var(--line); }
.logout-form { margin: 0; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.scroll-mt-4 { scroll-margin-top: 1rem; }
.auto-refresh-indicator { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--bs-secondary-color); }

/* =============================================================================
   UTILITY BRIDGE — the Tailwind subset the templates/JS actually use.
   Values follow the Tailwind scale (0.25rem per step) so existing markup keeps
   its intended rhythm. Colors route through the hue tokens above.
   ============================================================================= */

/* display */
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.flex-shrink-0, .shrink-0 { flex-shrink: 0; }
.flex-grow, .grow { flex-grow: 1; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }

/* grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-full { grid-column: 1 / -1; }

/* gap */
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.gap-x-2 { column-gap: 0.5rem; } .gap-x-4 { column-gap: 1rem; }
.gap-y-2 { row-gap: 0.5rem; } .gap-y-4 { row-gap: 1rem; }

/* space-between children */
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* padding */
.p-0 { padding: 0; } .p-1 { padding: 0.25rem; } .p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-1 { padding-inline: 0.25rem; } .px-2 { padding-inline: 0.5rem; }
.px-3 { padding-inline: 0.75rem; } .px-4 { padding-inline: 1rem; }
.px-5 { padding-inline: 1.25rem; } .px-6 { padding-inline: 1.5rem; }
.py-0\.5 { padding-block: 0.125rem; }
.py-1 { padding-block: 0.25rem; } .py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; } .py-4 { padding-block: 1rem; }
.py-6 { padding-block: 1.5rem; } .py-8 { padding-block: 2rem; }
.py-12 { padding-block: 3rem; }
.pt-2 { padding-top: 0.5rem; } .pt-3 { padding-top: 0.75rem; } .pt-4 { padding-top: 1rem; }
.pb-2 { padding-bottom: 0.5rem; } .pb-3 { padding-bottom: 0.75rem; } .pb-4 { padding-bottom: 1rem; }
.pl-2 { padding-left: 0.5rem; } .pl-3 { padding-left: 0.75rem; } .pl-4 { padding-left: 1rem; }
.pr-2 { padding-right: 0.5rem; } .pr-3 { padding-right: 0.75rem; } .pr-4 { padding-right: 1rem; }

/* margin */
.m-0 { margin: 0; }
.mx-auto { margin-inline: auto; }
.my-2 { margin-block: 0.5rem; } .my-4 { margin-block: 1rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-1 { margin-left: 0.25rem; } .ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; } .ml-4 { margin-left: 1rem; }
.mr-1 { margin-right: 0.25rem; } .mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; } .mr-4 { margin-right: 1rem; }
.-ml-1 { margin-left: -0.25rem; }
.-top-2 { top: -0.5rem; } .-right-2 { right: -0.5rem; }

/* sizing */
.w-2 { width: 0.5rem; } .w-3 { width: 0.75rem; } .w-4 { width: 1rem; }
.w-5 { width: 1.25rem; } .w-6 { width: 1.5rem; } .w-8 { width: 2rem; }
.w-10 { width: 2.5rem; } .w-11 { width: 2.75rem; } .w-12 { width: 3rem; }
.w-16 { width: 4rem; } .w-full { width: 100%; } .w-1\/2 { width: 50%; }
.h-2 { height: 0.5rem; } .h-3 { height: 0.75rem; } .h-4 { height: 1rem; }
.h-5 { height: 1.25rem; } .h-6 { height: 1.5rem; } .h-8 { height: 2rem; }
.h-10 { height: 2.5rem; } .h-11 { height: 2.75rem; } .h-12 { height: 3rem; }
.h-16 { height: 4rem; } .h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.max-w-full { max-width: 100%; }

/* typography */
.text-xs { font-size: 0.75rem; line-height: 1.4; }
.text-sm { font-size: 0.85rem; line-height: 1.5; }
.text-base { font-size: 0.95rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.25rem; line-height: 1.35; }
.text-2xl { font-size: 1.5rem; line-height: 1.3; }
.text-3xl { font-size: 1.85rem; line-height: 1.25; }
.text-4xl { font-size: 2.2rem; line-height: 1.2; }
.text-left { text-align: left; } .text-right { text-align: right; }
.font-normal { font-weight: 400; } .font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-none { line-height: 1; } .leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.65; }
.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.break-words { overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.align-middle { vertical-align: middle; }
.list-none { list-style: none; }

/* text colors — grays map to theme tokens so dark mode stays legible */
.text-gray-400 { color: color-mix(in srgb, var(--bs-secondary-color) 70%, transparent); }
.text-gray-500, .text-gray-600, .text-slate-500, .text-slate-600 { color: var(--bs-secondary-color); }
.text-gray-700, .text-gray-800, .text-gray-900,
.text-slate-700, .text-slate-800, .text-slate-900 { color: var(--bs-body-color); }
.text-blue-400, .text-blue-500, .text-blue-600 { color: var(--tw-blue); }
.text-blue-700, .text-blue-800, .text-blue-900 { color: color-mix(in srgb, var(--tw-blue) 78%, var(--bs-body-color)); }
.text-indigo-500, .text-indigo-600 { color: var(--tw-indigo); }
.text-indigo-700, .text-indigo-800 { color: color-mix(in srgb, var(--tw-indigo) 78%, var(--bs-body-color)); }
.text-purple-500, .text-purple-600, .text-violet-600 { color: var(--tw-purple); }
.text-purple-700, .text-purple-800 { color: color-mix(in srgb, var(--tw-purple) 78%, var(--bs-body-color)); }
.text-green-500, .text-green-600, .text-emerald-500, .text-emerald-600 { color: var(--tw-green); }
.text-green-700, .text-green-800, .text-emerald-700 { color: color-mix(in srgb, var(--tw-green) 78%, var(--bs-body-color)); }
.text-teal-600, .text-cyan-600 { color: var(--tw-teal); }
.text-red-400, .text-red-500, .text-red-600, .text-rose-600 { color: var(--tw-red); }
.text-red-700, .text-red-800 { color: color-mix(in srgb, var(--tw-red) 78%, var(--bs-body-color)); }
.text-orange-500, .text-orange-600 { color: var(--tw-orange); }
.text-orange-700, .text-orange-800 { color: color-mix(in srgb, var(--tw-orange) 78%, var(--bs-body-color)); }
.text-amber-500, .text-amber-600 { color: var(--tw-amber); }
.text-yellow-500, .text-yellow-600 { color: var(--tw-yellow); }
.text-yellow-700, .text-yellow-800 { color: color-mix(in srgb, var(--tw-yellow) 78%, var(--bs-body-color)); }
.text-pink-600 { color: var(--tw-pink); }

/* backgrounds — surfaces & tints via color-mix stay theme-aware */
.bg-white { background-color: var(--surface) !important; }
.bg-gray-50 { background-color: var(--surface-2) !important; }
.bg-gray-100, .bg-gray-200, .bg-slate-50, .bg-slate-100 { background-color: var(--surface-3) !important; }
.bg-blue-50 { background-color: color-mix(in srgb, var(--tw-blue) 9%, var(--surface)); }
.bg-blue-100 { background-color: color-mix(in srgb, var(--tw-blue) 16%, var(--surface)); }
.bg-blue-500, .bg-blue-600 { background-color: var(--tw-blue); }
.bg-indigo-50 { background-color: color-mix(in srgb, var(--tw-indigo) 9%, var(--surface)); }
.bg-indigo-100 { background-color: color-mix(in srgb, var(--tw-indigo) 16%, var(--surface)); }
.bg-green-50, .bg-emerald-50 { background-color: color-mix(in srgb, var(--tw-green) 9%, var(--surface)); }
.bg-green-100, .bg-emerald-100 { background-color: color-mix(in srgb, var(--tw-green) 16%, var(--surface)); }
.bg-green-500, .bg-green-600 { background-color: var(--tw-green); }
.bg-red-50, .bg-rose-50 { background-color: color-mix(in srgb, var(--tw-red) 9%, var(--surface)); }
.bg-red-100 { background-color: color-mix(in srgb, var(--tw-red) 16%, var(--surface)); }
.bg-red-500, .bg-red-600 { background-color: var(--tw-red); }
.bg-yellow-50, .bg-amber-50 { background-color: color-mix(in srgb, var(--tw-amber) 10%, var(--surface)); }
.bg-yellow-100, .bg-amber-100 { background-color: color-mix(in srgb, var(--tw-amber) 18%, var(--surface)); }
.bg-yellow-500 { background-color: var(--tw-yellow); }
.bg-orange-50 { background-color: color-mix(in srgb, var(--tw-orange) 10%, var(--surface)); }
.bg-orange-100 { background-color: color-mix(in srgb, var(--tw-orange) 18%, var(--surface)); }
.bg-purple-50 { background-color: color-mix(in srgb, var(--tw-purple) 9%, var(--surface)); }
.bg-purple-100 { background-color: color-mix(in srgb, var(--tw-purple) 16%, var(--surface)); }
.bg-purple-500, .bg-purple-600 { background-color: var(--tw-purple); }
.bg-teal-50, .bg-cyan-50 { background-color: color-mix(in srgb, var(--tw-teal) 9%, var(--surface)); }
.bg-pink-50 { background-color: color-mix(in srgb, var(--tw-pink) 9%, var(--surface)); }

/* borders */
.border-0 { border: 0; }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top: 1px solid var(--line); }
.border-b { border-bottom: 1px solid var(--line); }
.border-l { border-left: 1px solid var(--line); }
.border-r { border-right: 1px solid var(--line); }
.border-gray-100, .border-gray-200, .border-gray-300, .border-slate-200 { border-color: var(--line); }
.border-blue-200, .border-blue-300 { border-color: color-mix(in srgb, var(--tw-blue) 30%, transparent); }
.border-green-200, .border-emerald-200 { border-color: color-mix(in srgb, var(--tw-green) 30%, transparent); }
.border-red-200 { border-color: color-mix(in srgb, var(--tw-red) 30%, transparent); }
.border-yellow-200, .border-amber-200 { border-color: color-mix(in srgb, var(--tw-amber) 34%, transparent); }
.border-purple-200 { border-color: color-mix(in srgb, var(--tw-purple) 30%, transparent); }
.border-orange-200 { border-color: color-mix(in srgb, var(--tw-orange) 30%, transparent); }
.border-white { border-color: #fff; }
.border-t-transparent { border-top-color: transparent; }

/* radius & shadows (Tailwind names not covered by Bootstrap) */
.rounded-sm { border-radius: 4px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 10px; }
.rounded-xl { border-radius: var(--radius); }
.rounded-2xl { border-radius: 18px; }
.rounded-full { border-radius: 9999px; }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-xl, .shadow-2xl { box-shadow: var(--shadow-lg); }

/* gradients — real from/to plumbing like Tailwind's */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--twg-from, transparent), var(--twg-to, transparent)); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--twg-from, transparent), var(--twg-to, transparent)); }
.bg-gradient-to-b { background-image: linear-gradient(to bottom, var(--twg-from, transparent), var(--twg-to, transparent)); }
.from-blue-50 { --twg-from: color-mix(in srgb, var(--tw-blue) 9%, var(--surface)); }
.from-blue-100 { --twg-from: color-mix(in srgb, var(--tw-blue) 16%, var(--surface)); }
.from-blue-500 { --twg-from: #3b82f6; } .from-blue-600 { --twg-from: #2563eb; }
.from-indigo-500 { --twg-from: #6366f1; }
.from-purple-50 { --twg-from: color-mix(in srgb, var(--tw-purple) 9%, var(--surface)); }
.from-purple-500 { --twg-from: #a855f7; }
.from-emerald-50 { --twg-from: color-mix(in srgb, var(--tw-emerald) 9%, var(--surface)); }
.from-emerald-500 { --twg-from: #10b981; } .from-emerald-600 { --twg-from: #059669; }
.from-green-50 { --twg-from: color-mix(in srgb, var(--tw-green) 9%, var(--surface)); }
.from-green-400 { --twg-from: #4ade80; }
.from-teal-600 { --twg-from: #0d9488; }
.from-red-50 { --twg-from: color-mix(in srgb, var(--tw-red) 9%, var(--surface)); }
.from-red-400 { --twg-from: #f87171; }
.from-amber-50 { --twg-from: color-mix(in srgb, var(--tw-amber) 10%, var(--surface)); }
.from-amber-400 { --twg-from: #fbbf24; } .from-amber-500 { --twg-from: #f59e0b; }
.from-yellow-50 { --twg-from: color-mix(in srgb, var(--tw-yellow) 10%, var(--surface)); }
.from-yellow-400 { --twg-from: #facc15; }
.from-gray-50 { --twg-from: var(--surface-2); } .from-gray-100 { --twg-from: var(--surface-3); }
.from-slate-50 { --twg-from: var(--surface-2); } .from-slate-600 { --twg-from: #475569; }
.to-blue-100 { --twg-to: color-mix(in srgb, var(--tw-blue) 16%, var(--surface)); }
.to-blue-200 { --twg-to: color-mix(in srgb, var(--tw-blue) 26%, var(--surface)); }
.to-blue-600 { --twg-to: #2563eb; }
.to-cyan-50 { --twg-to: color-mix(in srgb, var(--tw-cyan) 9%, var(--surface)); }
.to-emerald-50 { --twg-to: color-mix(in srgb, var(--tw-emerald) 9%, var(--surface)); }
.to-emerald-100 { --twg-to: color-mix(in srgb, var(--tw-emerald) 16%, var(--surface)); }
.to-green-50 { --twg-to: color-mix(in srgb, var(--tw-green) 9%, var(--surface)); }
.to-green-100 { --twg-to: color-mix(in srgb, var(--tw-green) 16%, var(--surface)); }
.to-green-500 { --twg-to: #22c55e; }
.to-gray-50 { --twg-to: var(--surface-2); } .to-gray-100 { --twg-to: var(--surface-3); }
.to-gray-200 { --twg-to: var(--surface-3); } .to-gray-600 { --twg-to: #4b5563; }
.to-indigo-50 { --twg-to: color-mix(in srgb, var(--tw-indigo) 9%, var(--surface)); }
.to-indigo-100 { --twg-to: color-mix(in srgb, var(--tw-indigo) 16%, var(--surface)); }
.to-indigo-600 { --twg-to: #4f46e5; }
.to-orange-50 { --twg-to: color-mix(in srgb, var(--tw-orange) 10%, var(--surface)); }
.to-orange-500 { --twg-to: #f97316; }
.to-pink-50 { --twg-to: color-mix(in srgb, var(--tw-pink) 9%, var(--surface)); }
.to-purple-50 { --twg-to: color-mix(in srgb, var(--tw-purple) 9%, var(--surface)); }
.to-purple-100 { --twg-to: color-mix(in srgb, var(--tw-purple) 16%, var(--surface)); }
.to-purple-400 { --twg-to: #c084fc; } .to-purple-600 { --twg-to: #9333ea; }
.to-red-100 { --twg-to: color-mix(in srgb, var(--tw-red) 16%, var(--surface)); }
.to-rose-50 { --twg-to: color-mix(in srgb, var(--tw-rose) 9%, var(--surface)); }
.to-slate-50 { --twg-to: var(--surface-2); }
.to-teal-600 { --twg-to: #0d9488; }
.to-yellow-50 { --twg-to: color-mix(in srgb, var(--tw-yellow) 10%, var(--surface)); }
.to-yellow-100 { --twg-to: color-mix(in srgb, var(--tw-yellow) 18%, var(--surface)); }
.to-yellow-500 { --twg-to: #eab308; }

/* layout misc */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-0 { top: 0; } .right-0 { right: 0; } .bottom-0 { bottom: 0; } .left-0 { left: 0; }
.z-10 { z-index: 10; } .z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.-translate-y-1\/2 { transform: translateY(-50%); }
.-rotate-90 { transform: rotate(-90deg); }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }
.opacity-50 { opacity: 0.5; } .opacity-75 { opacity: 0.75; }

/* transitions */
.transition-all { transition: all 0.15s ease; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-shadow { transition: box-shadow 0.15s ease; }
.transition-transform { transition: transform 0.15s ease; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.ease-in-out { transition-timing-function: ease-in-out; }

/* state variants */
.hover\:shadow-sm:hover { box-shadow: var(--bs-box-shadow-sm); }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.hover\:shadow-lg:hover, .hover\:shadow-xl:hover, .hover\:shadow-2xl:hover,
.group:hover .group-hover\:shadow-lg { box-shadow: var(--shadow-lg); }
.hover\:bg-gray-50:hover, .hover\:bg-white:hover { background-color: var(--surface-2); }
.hover\:bg-gray-100:hover, .hover\:bg-gray-200:hover { background-color: var(--surface-3); }
.hover\:bg-blue-50:hover { background-color: color-mix(in srgb, var(--tw-blue) 9%, var(--surface)); }
.hover\:bg-red-50:hover { background-color: color-mix(in srgb, var(--tw-red) 9%, var(--surface)); }
.hover\:bg-blue-600:hover, .hover\:bg-blue-700:hover { background-color: var(--tw-blue); }
.hover\:bg-green-600:hover { background-color: var(--tw-green); }
.hover\:bg-red-600:hover, .hover\:bg-red-700:hover, .hover\:bg-red-800:hover { background-color: var(--tw-red); }
.hover\:bg-yellow-600:hover { background-color: var(--tw-yellow); }
.hover\:bg-orange-700:hover { background-color: var(--tw-orange); }
.hover\:bg-purple-600:hover { background-color: var(--tw-purple); }
.hover\:bg-gray-600:hover { background-color: var(--tw-slate); }
.hover\:text-blue-500:hover, .hover\:text-blue-600:hover, .hover\:text-blue-800:hover { color: var(--tw-blue); }
.hover\:text-gray-600:hover, .hover\:text-gray-700:hover { color: var(--bs-secondary-color); }
.hover\:text-gray-800:hover, .hover\:text-gray-900:hover { color: var(--bs-body-color); }
.hover\:text-red-800:hover { color: var(--tw-red); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:border-gray-300:hover, .hover\:border-gray-400:hover { border-color: var(--bs-secondary-color); }
.hover\:border-blue-300:hover, .hover\:border-blue-700:hover { border-color: var(--tw-blue); }
.hover\:border-red-700:hover { border-color: var(--tw-red); }
[class*="focus\:outline-none"]:focus { outline: 0; }
[class*="focus\:ring"]:focus { outline: 0; box-shadow: 0 0 0 0.2rem var(--glow); }

/* responsive variants — Tailwind breakpoints */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-start { align-items: flex-start; }
  .sm\:items-center { align-items: center; }
  .sm\:items-end { align-items: flex-end; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:inline { display: inline; }
  .sm\:hidden { display: none; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:gap-3 { gap: 0.75rem; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:rounded-lg { border-radius: 10px; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:flex-row { flex-direction: row; }
  .lg\:items-end { align-items: flex-end; }
  .lg\:hidden { display: none; }
  .lg\:w-72 { width: 18rem; }
  .lg\:w-1\/2 { width: 50%; }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .xl\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .xl\:col-span-1 { grid-column: span 1 / span 1; }
  .xl\:col-span-4 { grid-column: span 4 / span 4; }
}
@media (min-width: 1536px) {
  .\32xl\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .\32xl\:col-span-1 { grid-column: span 1 / span 1; }
}

/* ------------------------------ profile page ----------------------------- */
/* Bridge for the profile template's legacy class names, on the new tokens. */
.profile-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 991.98px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.profile-main { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.profile-card-header { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.profile-card-title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.profile-card-subtitle { font-size: 0.78rem; color: var(--bs-secondary-color); margin: 0.15rem 0 0; }
.profile-card-body { padding: 1.1rem; }
/* Four uniform tiles: auto-fit stretches them across the full row, grid
   stretch equalises heights, and the pinned icon + one-line value mean the
   text never shifts between cards. */
.profile-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.profile-stat-card {
  position: relative; height: 100%; min-height: 108px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.15rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  padding-right: 4rem; /* room for the pinned icon */
}
.profile-stat-icon {
  position: absolute; top: 1rem; right: 1rem;
  width: 2.4rem; height: 2.4rem; border-radius: 0.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glow); color: var(--brand); font-size: 1.1rem;
}
.profile-stat-label {
  order: 1; font-size: 0.71rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--bs-secondary-color); white-space: nowrap;
}
.profile-stat-value {
  order: 2; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.1rem, 0.9rem + 0.7vw, 1.45rem); line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.profile-stat-trend {
  order: 3; font-size: 0.74rem; color: var(--bs-secondary-color);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.profile-field-group { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.profile-field-group:last-child { border-bottom: 0; }
.profile-field-label { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bs-secondary-color); margin-bottom: 0.25rem; }
.profile-field-content { min-width: 0; }
.profile-field-display { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.profile-field-text { font-size: 0.95rem; overflow-wrap: anywhere; }
.profile-field-edit-trigger {
  border: 1px solid var(--line); background: var(--surface); color: var(--bs-secondary-color);
  border-radius: var(--radius-sm); padding: 0.25rem 0.6rem; font-size: 0.78rem; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.profile-field-edit-trigger:hover { color: var(--brand); border-color: var(--brand); }
.profile-field-edit { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.35rem; }
.profile-field-loading { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--bs-secondary-color); }
.profile-loading-spinner {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: tw-spin 0.75s linear infinite;
}
.profile-modal-form { display: flex; flex-direction: column; gap: 0.9rem; }
.profile-modal-field { display: flex; flex-direction: column; gap: 0.3rem; }
.profile-modal-label { font-size: 0.8rem; font-weight: 500; color: var(--bs-secondary-color); }
.profile-modal-input {
  display: block; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background-color: var(--surface-2); color: var(--bs-body-color);
  font-size: 0.92rem; line-height: 1.5; padding: 0.5rem 0.75rem;
}
.profile-modal-input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 0.2rem var(--glow); }

/* =============================================================================
   BRIDGE ADDITIONS — classes templates still reference that had no definition.
   Two groups: (1) colour modifiers wired into the existing --sc system, and
   (2) genuinely missing generic utilities. No duplicates of existing rules.
   ============================================================================= */

/* --- colour-word modifiers: legacy markup says "stat-card-simple success"; the
       word now feeds the same --sc token the rest of the design system uses. */
.stat-card-simple.primary, .status-card.primary { --sc: var(--btn-from); }
.stat-card-simple.success, .status-card.success { --sc: var(--ok); }
.stat-card-simple.info, .status-card.info { --sc: var(--tw-cyan); }
.stat-card-simple.warning, .status-card.warning { --sc: var(--tw-amber); }
.stat-card-simple.danger, .status-card.danger { --sc: var(--tw-red); }
.stat-card-simple.secondary, .status-card.secondary { --sc: var(--tw-slate); }
.stat-card-simple.purple, .status-card.purple { --sc: var(--tw-purple); }
.stat-card-simple.positive { --sc: var(--tw-green); }
.status-badge.status-info { --sc: var(--tw-blue); }
.status-badge.status-warning { --sc: var(--tw-amber); }

/* --- chart canvases: same box the design system's .chart-box-lg provides; the
       class name is a JS hook (analytics.js), so it keeps its own definition. */
.chart-container { position: relative; height: 260px; width: 100%; }

/* --- checkbox hook used by tiktok_accounts.js */
.table-checkbox { width: 1em; height: 1em; accent-color: var(--brand); }

/* --- users page: analytics/permissions blocks (label · value rows) */
.analytics-grid, .trends-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; }
.analytics-header { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.analytics-content { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; }
.activity-item, .balance-item, .growth-item, .dist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.3rem 0; border-bottom: 1px solid var(--line); font-size: 0.88rem;
}
.activity-item:last-child, .balance-item:last-child, .growth-item:last-child { border-bottom: 0; }
.activity-label, .balance-label, .growth-label { color: var(--bs-secondary-color); }
.activity-value, .balance-value, .growth-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.permissions-container { display: flex; flex-direction: column; gap: 0.4rem; max-height: 18rem; overflow-y: auto; }
.permission-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 0.85rem;
}
.permission-controls { display: flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; }
.update-info { font-size: 0.78rem; color: var(--bs-secondary-color); }

/* --- generic utilities the bridge lacked (Tailwind scale, theme tokens) --- */
.animate-pulse { animation: tw-pulse 1.6s ease-in-out infinite; }
.animate-bounce { animation: tw-fade-in 0.8s ease infinite alternate; }
.divide-y > * + * { border-top: 1px solid var(--line); }
.divide-gray-200 > * + * { border-color: var(--line); }
.min-w-full { min-width: 100%; }
.w-px { width: 1px; }
.w-fit { width: fit-content; }
.h-1 { height: 0.25rem; }
.h-24 { height: 6rem; } .h-32 { height: 8rem; } .h-40 { height: 10rem; }
.h-48 { height: 12rem; } .h-64 { height: 16rem; } .h-80 { height: 20rem; } .h-96 { height: 24rem; }
.max-h-32 { max-height: 8rem; overflow-y: auto; } .max-h-36 { max-height: 9rem; overflow-y: auto; }
.w-24 { width: 6rem; } .w-52 { width: 13rem; } .w-56 { width: 14rem; } .w-64 { width: 16rem; }
.max-w-xs { max-width: 20rem; } .max-w-md { max-width: 28rem; }
.w-1\/4 { width: 25%; } .w-1\/5 { width: 20%; } .w-1\/8 { width: 12.5%; }
.w-1\/12 { width: 8.333%; } .w-3\/4 { width: 75%; }
.top-1\/2 { top: 50%; } .left-3 { left: 0.75rem; } .top-4 { top: 1rem; } .right-4 { right: 1rem; }
.p-0\.5 { padding: 0.125rem; } .p-1\.5 { padding: 0.375rem; }
.py-1\.5 { padding-block: 0.375rem; } .py-16 { padding-block: 4rem; }
.pb-6 { padding-bottom: 1.5rem; } .pl-1 { padding-left: 0.25rem; } .pl-9 { padding-left: 2.25rem; }
.mt-0\.5 { margin-top: 0.125rem; } .mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1\.5 { margin-bottom: 0.375rem; } .mx-0\.5 { margin-inline: 0.125rem; }
.mb-16 { margin-bottom: 4rem; } .ml-auto { margin-left: auto; }
.space-y-0\.5 > * + * { margin-top: 0.125rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.border-b-2 { border-bottom: 2px solid var(--line); }
.border-t-2 { border-top: 2px solid var(--line); }
.border-l-4 { border-left: 4px solid var(--sc, var(--line)); }
.border-dashed { border-style: dashed; }
.border-collapse { border-collapse: collapse; }
.border-blue-500, .border-blue-600, .border-primary-600 { border-color: var(--tw-blue); }
.border-red-400, .border-red-600 { border-color: var(--tw-red); }
.border-purple-500 { border-color: var(--tw-purple); }
.border-indigo-200 { border-color: color-mix(in srgb, var(--tw-indigo) 30%, transparent); }
.border-cyan-200 { border-color: color-mix(in srgb, var(--tw-cyan) 30%, transparent); }
.border-t-blue-500 { border-top: 3px solid var(--tw-blue); }
.border-t-emerald-500 { border-top: 3px solid var(--tw-emerald); }
.border-t-slate-500 { border-top: 3px solid var(--tw-slate); }
.border-l-blue-500 { border-left: 4px solid var(--tw-blue); }
.border-l-green-500 { border-left: 4px solid var(--tw-green); }
.border-l-yellow-500 { border-left: 4px solid var(--tw-yellow); }
.border-l-purple-500 { border-left: 4px solid var(--tw-purple); }
.border-l-indigo-500 { border-left: 4px solid var(--tw-indigo); }
.border-l-red-500 { border-left: 4px solid var(--tw-red); }
.text-md { font-size: 0.95rem; }
.text-gray-300 { color: color-mix(in srgb, var(--bs-secondary-color) 50%, transparent); }
.text-green-900 { color: color-mix(in srgb, var(--tw-green) 70%, var(--bs-body-color)); }
.text-purple-900 { color: color-mix(in srgb, var(--tw-purple) 70%, var(--bs-body-color)); }
.text-yellow-900 { color: color-mix(in srgb, var(--tw-yellow) 70%, var(--bs-body-color)); }
.text-indigo-900 { color: color-mix(in srgb, var(--tw-indigo) 70%, var(--bs-body-color)); }
.text-red-900 { color: color-mix(in srgb, var(--tw-red) 70%, var(--bs-body-color)); }
.text-amber-700 { color: color-mix(in srgb, var(--tw-amber) 80%, var(--bs-body-color)); }
/* -100 shades appear on gradient banners: keep them near-white for contrast */
.text-blue-100, .text-emerald-100, .text-purple-100, .text-amber-100, .text-slate-100 { color: rgba(255, 255, 255, 0.88); }
.bg-blue-200 { background-color: color-mix(in srgb, var(--tw-blue) 26%, var(--surface)); }
.bg-blue-400 { background-color: color-mix(in srgb, var(--tw-blue) 70%, var(--surface)); }
.bg-cyan-100 { background-color: color-mix(in srgb, var(--tw-cyan) 16%, var(--surface)); }
.bg-gray-300 { background-color: var(--surface-3); }
.bg-gray-500 { background-color: var(--tw-slate); }
.bg-amber-500 { background-color: var(--tw-amber); }
.bg-orange-600 { background-color: var(--tw-orange); }
.bg-red-700 { background-color: var(--tw-red); }
.ring-1 { box-shadow: 0 0 0 1px var(--line); }
.shadow-inner { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06); }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }
.resize-none { resize: none; }
.resize-vertical { resize: vertical; }
.self-stretch { align-self: stretch; }
.lg\:grid-cols-1 { }
@media (min-width: 1024px) { .lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
/* floating containers (toasts) clear the sticky navbar */
.top-header-offset { top: calc(var(--nav-height) + 0.5rem); }
.accent-gradient { background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); color: #fff; }

/* Add-interaction accordion (SystemSettings.js toggles .active on the content;
   the item/content class names are JS hooks, styled here once). */
.add-interaction-accordion { display: flex; flex-direction: column; gap: 0.5rem; }
.add-interaction-accordion-item { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.add-interaction-accordion-header {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 1rem; background: var(--surface-2); cursor: pointer;
}
.add-interaction-accordion-title { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.add-interaction-accordion-status { font-size: 0.72rem; color: var(--bs-secondary-color); }
.add-interaction-accordion-toggle { border: 0; background: transparent; color: var(--bs-secondary-color); font-size: 1rem; }
.add-interaction-accordion-content { display: none; padding: 1rem; border-top: 1px solid var(--line); }
.add-interaction-accordion-content.active { display: block; }
.add-interaction-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.add-interaction-limit-inputs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.add-interaction-limit-description, .add-interaction-validation-hint { font-size: 0.76rem; color: var(--bs-secondary-color); margin-top: 0.25rem; }
.add-interaction-quick-info, .add-interaction-info-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; }
.add-interaction-info-header { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.35rem; }
.add-interaction-info-content { font-size: 0.82rem; color: var(--bs-secondary-color); }
.add-interaction-json-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.add-interaction-json-header { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.85rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 0.78rem; }
.add-interaction-json-code { margin: 0; padding: 0.75rem 0.85rem; background: var(--surface-2); font-size: 0.78rem; max-height: 16rem; overflow: auto; }
.add-interaction-global-status, .add-interaction-validation-status { font-size: 0.82rem; }
.add-interaction-form-error { font-size: 0.78rem; color: var(--bs-danger-text-emphasis); }
.json-editor-container { display: flex; flex-direction: column; gap: 0.5rem; }
.json-editor { font-family: var(--font-mono); font-size: 0.8rem; min-height: 8rem; }
.json-preview { font-family: var(--font-mono); font-size: 0.78rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; overflow: auto; max-height: 12rem; }

/* Final sweep leftovers: translucent chips on gradient banners, rounded ends,
   small page-specific containers. */
.bg-white.bg-opacity-20 { background-color: rgba(255, 255, 255, 0.16) !important; }
.bg-white.hover\:bg-opacity-30:hover { background-color: rgba(255, 255, 255, 0.28) !important; }
.rounded-t-xl { border-radius: var(--radius) var(--radius) 0 0; }
.rounded-b-xl { border-radius: 0 0 var(--radius) var(--radius); }
.col-span-12 { grid-column: span 12 / span 12; }
.duration-500 { transition-duration: 500ms; }
.settings-nav-tab-icon { width: 1em; height: 1em; flex: 0 0 auto; }
.settings-nav-tab-text { line-height: 1.2; }
label .optional { color: var(--bs-secondary-color); font-weight: 400; font-size: 0.85em; }
.balance-stats, .activity-stats, .growth-stats, .summary-content { display: flex; flex-direction: column; }
.profile-stat-icon.balance { background: color-mix(in srgb, var(--tw-green) 14%, transparent); color: var(--tw-green); }
.profile-stat-icon.status { background: color-mix(in srgb, var(--tw-blue) 14%, transparent); color: var(--tw-blue); }
.profile-stat-icon.member { background: color-mix(in srgb, var(--tw-purple) 14%, transparent); color: var(--tw-purple); }
.profile-stat-icon.login { background: color-mix(in srgb, var(--tw-amber) 14%, transparent); color: var(--tw-amber); }
/* Analytics world-map dashboard containers */
.map-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
@media (max-width: 991.98px) { .map-dashboard { grid-template-columns: 1fr; } }
.map-main, .global-distribution-container, .country-analytics, .global-summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
}
/* Ülke paneli: yan sütun harita yüksekliğinde sabit, içeride kaydırılır —
   ~111 ülkeyi dikey dizip sayfayı devasa boşlukla uzatmasını engeller. */
.country-analytics { display: flex; flex-direction: column; max-height: 560px; }
#countryCardsContainer { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
#countryCardsContainer > * + * { margin-top: 0.6rem; }
.country-card { transition: box-shadow .15s, transform .15s; }
.country-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
/* Ülke kartı iç düzeni — ad ve sayı artık çarpışmaz/kırpılmaz. */
.country-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.country-badge {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 1.35rem; padding: 0 0.4rem; border-radius: 6px;
  background: var(--glow); color: var(--brand-strong); font-size: 0.68rem; font-weight: 700;
}
.country-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; color: var(--bs-body-color); }
.country-share { flex-shrink: 0; font-size: 0.72rem; font-weight: 600; color: var(--bs-secondary-color); }
.country-total { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.1; color: var(--bs-body-color); margin-bottom: 0.5rem; font-variant-numeric: tabular-nums; }
.country-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.country-metric { border-radius: var(--radius-sm); padding: 0.4rem 0.55rem; text-align: center; }
.country-metric.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.country-metric.info { background: color-mix(in srgb, var(--tw-blue) 12%, transparent); }
.country-metric .cm-value { display: block; font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.country-metric.ok .cm-value { color: var(--ok); }
.country-metric.info .cm-value { color: var(--tw-blue); }
.country-metric .cm-label { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); }
.total-number { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.total-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bs-secondary-color); }

/* Tabbed stat sections (users/app_info/tiktok_accounts/services pages):
   panels are hidden until their tab marks them .active — this rule lived in
   the removed main.css, which is why hash tabs stopped switching. */
.stats-section { display: none; }
.stats-section.active { display: block; }

/* Profile page JS feedback states (toggled by inline script). */
.copy-success, .api-key-success { border-color: var(--ok) !important; color: var(--ok) !important; }
.btn-loading-state, .btn.btn-loading { opacity: 0.7; pointer-events: none; }
.btn-disabled { opacity: 0.55; pointer-events: none; }
.generate-btn-pulse { animation: tw-pulse 1.8s ease-in-out infinite; }

/* --- audit sweep: last genuinely-missing generic utilities --- */
.px-1\.5 { padding-inline: 0.375rem; } .px-2\.5 { padding-inline: 0.625rem; }
.py-2\.5 { padding-block: 0.625rem; } .pt-1\.5 { padding-top: 0.375rem; }
.mr-1\.5 { margin-right: 0.375rem; } .gap-1\.5 { gap: 0.375rem; }
.h-1\.5 { height: 0.375rem; } .w-1\.5 { width: 0.375rem; }
.space-y-10 > * + * { margin-top: 2.5rem; }
.max-h-48 { max-height: 12rem; overflow-y: auto; }
/* Kartlarda kullanılan ama tanımsız kalan hover gölgesi (analytics/orders/logs) */
.hover\:shadow-md { transition: box-shadow .15s ease, transform .15s ease; }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.max-w-3xl { max-width: 48rem; }
.duration-700 { transition-duration: 700ms; }
.ease-out { transition-timing-function: ease-out; }
.last\:mb-0:last-child { margin-bottom: 0; }
.bg-green-200 { background-color: color-mix(in srgb, var(--tw-green) 26%, var(--surface)); }
.bg-purple-200 { background-color: color-mix(in srgb, var(--tw-purple) 26%, var(--surface)); }
.bg-orange-500 { background-color: var(--tw-orange); }
.text-emerald-800 { color: color-mix(in srgb, var(--tw-emerald) 78%, var(--bs-body-color)); }
.text-orange-900 { color: color-mix(in srgb, var(--tw-orange) 70%, var(--bs-body-color)); }

/* Functional states toggled by page scripts (not decorative inventions). */
.rl-card.collapsed .rate-limit-card-content { display: none; }
.rate-limit-card-content { padding-top: 0.5rem; }
input.modified { border-color: var(--tw-amber) !important; box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--tw-amber) 25%, transparent); }
input.saving { opacity: 0.6; pointer-events: none; }
.active-tab { color: var(--brand) !important; }
.border-transparent { border-color: transparent !important; }
.hashtag-highlight { background: var(--glow); color: var(--brand-strong); border-radius: 4px; padding: 0 0.25rem; }
.performance-status-indicator { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--sc, var(--tw-slate)); }
.platform-unknown { background: var(--surface-2); color: var(--bs-secondary-color); }

/* Leaflet map popups + country cards (analytics world map). */
.country-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; }
.popup-header { font-weight: 700; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.4rem; }
.popup-title { font-weight: 600; }
.popup-label { color: var(--bs-secondary-color); font-size: 0.78rem; }
.popup-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.popup-share { color: var(--bs-secondary-color); font-size: 0.78rem; }

/* Row-actions dropdown used by tiktok_accounts.js (its own toggle logic adds
   .active on the wrapper). Styled once here on design tokens. */
.actions-dropdown { position: relative; display: inline-block; }
.actions-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--bs-secondary-color); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.actions-trigger:hover { color: var(--bs-body-color); background: var(--surface-2); }
.actions-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 1050;
  min-width: 11rem; padding: 0.35rem 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.actions-dropdown.active .actions-menu { display: block; }
.actions-menu-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.45rem 1rem; border: 0; background: none; text-align: left;
  font-size: 0.88rem; color: var(--bs-body-color); text-decoration: none; cursor: pointer;
}
.actions-menu-item:hover { background: var(--surface-2); }
.actions-menu-item.danger { color: var(--bs-danger-text-emphasis); }
.bg-indigo-600 { background-color: var(--tw-indigo); }
.bg-yellow-200 { background-color: color-mix(in srgb, var(--tw-yellow) 26%, var(--surface)); }
.text-emerald-900 { color: color-mix(in srgb, var(--tw-emerald) 70%, var(--bs-body-color)); }
.space-x-8 > * + * { margin-left: 2rem; }
.max-h-80 { max-height: 20rem; overflow-y: auto; }
.max-w-sm { max-width: 24rem; }
/* Vurgu halkaları (analytics highlight): renk hue token'larından gelir */
.ring-2 { box-shadow: 0 0 0 2px var(--ring-color, color-mix(in srgb, var(--tw-blue) 45%, transparent)); }
.ring-4 { box-shadow: 0 0 0 4px var(--ring-color, color-mix(in srgb, var(--tw-blue) 45%, transparent)); }
.ring-blue-300 { --ring-color: color-mix(in srgb, var(--tw-blue) 45%, transparent); }
.ring-green-300 { --ring-color: color-mix(in srgb, var(--tw-green) 45%, transparent); }
.ring-purple-300 { --ring-color: color-mix(in srgb, var(--tw-purple) 45%, transparent); }
/* Hata geri bildirimi: butonu kısaca salla */
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake 0.3s ease-in-out 2; }
/* backdrop=false ile açılan modallar: karartma olmadan yüzer */
.sys-modal-backdrop.sys-modal-no-backdrop { background: transparent; backdrop-filter: none; }
.mb-10 { margin-bottom: 2.5rem; }
.pt-6 { padding-top: 1.5rem; }
.border-blue-100 { border-color: color-mix(in srgb, var(--tw-blue) 18%, transparent); }
.border-green-500 { border-color: var(--tw-green); }
.border-orange-500 { border-color: var(--tw-orange); }

/* /orders: 14 sütunlu tablo container'a sığmadığı için yatay scroll çıkıyordu.
   Tabloyu daraltıyoruz (ID-scope'lu, sadece orders tablosu) → varsayılan container
   genişliğinde bile scroll çıkmaz. Link/User/Service ellipsis + hover title ile
   tam okunur. Kompakt hücre boşlukları toplam genişliği ~90px düşürür. */
#ordersTable th, #ordersTable td { padding-left: 0.35rem; padding-right: 0.35rem; }
#ordersTable .truncate-md { max-width: 10rem; }
#ordersTable .truncate-sm { max-width: 4.5rem; }
