/* ============================================================================
 * Genie Admin Design System
 * Hi-fi tokens — warm-neutral + amber. Mirrors design_handoff_genie_admin.
 * ========================================================================= */

/* ── Tokens · Light (default) ──────────────────────────────────────────── */
:root,
:root[data-bs-theme="light"] {
  --g-bg: #f4f2ec;
  --g-canvas: #eeece4;
  --g-surface: #ffffff;
  --g-surface2: #faf8f2;
  --g-surface3: #f1efe7;
  --g-border: #e6e2d6;
  --g-border-strong: #d4cfbf;
  --g-divider: #ece9dc;

  --g-ink: #14130e;
  --g-ink2: #3a382f;
  --g-muted: #7a776a;
  --g-subtle: #a8a497;

  --g-sidebar: #1a1814;
  --g-sidebar-ink: #ece9dd;
  --g-sidebar-muted: #8c8a7c;
  --g-sidebar-active: #2b2823;
  --g-sidebar-hover: #221f1a;

  --g-accent: #e9a23b;
  --g-accent-hover: #d8902a;
  --g-accent-ink: #1a1714;
  --g-accent-soft: #fdf2dd;
  --g-accent-text: #8a5a00;

  --g-ok: #2c6b3f;
  --g-ok-bg: #dfe9de;
  --g-ok-border: #c5d6c4;

  --g-warn: #8a4a00;
  --g-warn-bg: #fbecd0;
  --g-warn-border: #f0d8a8;

  --g-danger: #9d2818;
  --g-danger-bg: #f6dcd3;
  --g-danger-border: #e8b8aa;

  --g-info: #2a5aa0;
  --g-info-bg: #e0e8f3;
  --g-info-border: #c4d2e8;

  --g-shadow: 0 1px 2px rgba(20, 19, 14, .04), 0 4px 12px rgba(20, 19, 14, .04);
  --g-shadow-lg: 0 4px 16px rgba(20, 19, 14, .06), 0 12px 32px rgba(20, 19, 14, .06);
}

/* ── Tokens · Dark ─────────────────────────────────────────────────────── */
:root[data-bs-theme="dark"] {
  --g-bg: #0e0d0a;
  --g-canvas: #15130f;
  --g-surface: #1a1814;
  --g-surface2: #15130f;
  --g-surface3: #211e18;
  --g-border: #2a2721;
  --g-border-strong: #3a362d;
  --g-divider: #22201b;

  --g-ink: #ece9dd;
  --g-ink2: #c8c5b6;
  --g-muted: #8a8778;
  --g-subtle: #5e5b50;

  --g-sidebar: #0a0907;
  --g-sidebar-ink: #ece9dd;
  --g-sidebar-muted: #7a7768;
  --g-sidebar-active: #1c1a15;
  --g-sidebar-hover: #15130f;

  --g-accent: #e9a23b;
  --g-accent-hover: #f0b257;
  --g-accent-ink: #1a1714;
  --g-accent-soft: #2d2210;
  --g-accent-text: #e9a23b;

  --g-ok: #7bb089;
  --g-ok-bg: #1a2a1d;
  --g-ok-border: #264030;

  --g-warn: #e8b972;
  --g-warn-bg: #2d2316;
  --g-warn-border: #4a3820;

  --g-danger: #d8785c;
  --g-danger-bg: #2f1812;
  --g-danger-border: #4a2820;

  --g-info: #8aaee3;
  --g-info-bg: #1a2238;
  --g-info-border: #2a3656;

  --g-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .2);
  --g-shadow-lg: 0 4px 16px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .3);
}

/* ── Body / typography defaults ───────────────────────────────────────── */
html,
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--g-bg);
  color: var(--g-ink);
  font-size: 13.5px;
  line-height: 1.5;
}

/* override the existing app.css body font fallback */
body {
  font-feature-settings: "ss01", "cv02", "cv03", "cv04", "cv11";
}

/* ── Type scale utilities ─────────────────────────────────────────────── */
.g-display { font-size: 32px; font-weight: 600; letter-spacing: -0.6px; line-height: 1.15; margin: 0; }
.g-h1      { font-size: 24px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.2;  margin: 0; }
.g-h2      { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.3;  margin: 0; }
.g-h3      { font-size: 15px; font-weight: 600; letter-spacing: -0.1px; line-height: 1.35; margin: 0; }
.g-body    { font-size: 13.5px; font-weight: 400; line-height: 1.5; margin: 0; }
.g-body-md { font-size: 13.5px; font-weight: 500; line-height: 1.5; margin: 0; }
.g-small   { font-size: 12px; font-weight: 400; line-height: 1.45; margin: 0; }
.g-micro   { font-size: 11px; font-weight: 500; letter-spacing: 0.1px; line-height: 1.4; margin: 0; }
.g-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  line-height: 1.4;
  text-transform: uppercase;
  margin: 0;
}

/* color helpers */
.g-ink     { color: var(--g-ink); }
.g-ink2    { color: var(--g-ink2); }
.g-muted   { color: var(--g-muted); }
.g-subtle  { color: var(--g-subtle); }
.g-accent  { color: var(--g-accent-text); }
.g-ok      { color: var(--g-ok); }
.g-warn    { color: var(--g-warn); }
.g-danger  { color: var(--g-danger); }
.g-info    { color: var(--g-info); }

/* ── Surface / cards ──────────────────────────────────────────────────── */
.g-card {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  box-shadow: none;
}
.g-card-lift { box-shadow: var(--g-shadow); }
.g-card-pad   { padding: 16px 18px; }
.g-card-pad-lg { padding: 20px 22px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .08s ease;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  user-select: none;
}
.g-btn:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
.g-btn:disabled { opacity: .55; cursor: not-allowed; }

.g-btn-sm { padding: 6px 11px; height: 28px; font-size: 12px; }
.g-btn-md { padding: 8px 14px;  height: 34px; font-size: 13px; }
.g-btn-lg { padding: 10px 16px; height: 40px; font-size: 14px; }

.g-btn-primary    { background: var(--g-ink);        color: var(--g-surface); }
.g-btn-primary:hover  { background: var(--g-ink2); }
.g-btn-secondary  { background: var(--g-surface);    color: var(--g-ink); border-color: var(--g-border); }
.g-btn-secondary:hover { background: var(--g-surface2); }
.g-btn-ghost      { background: transparent;         color: var(--g-ink); }
.g-btn-ghost:hover    { background: var(--g-surface3); }
.g-btn-accent     { background: var(--g-accent);     color: var(--g-accent-ink); }
.g-btn-accent:hover   { background: var(--g-accent-hover); }
.g-btn-danger     { background: var(--g-danger-bg);  color: var(--g-danger); }
.g-btn-danger:hover   { background: var(--g-danger); color: #fff; }
.g-btn-destructive { background: var(--g-danger);    color: #fff; }
.g-btn-destructive:hover { background: var(--g-danger); filter: brightness(0.9); }

/* ── Pills / tags ─────────────────────────────────────────────────────── */
.g-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.g-pill .g-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}
.g-pill-neutral { background: var(--g-surface3);    color: var(--g-muted); }
.g-pill-ok      { background: var(--g-ok-bg);       color: var(--g-ok); }
.g-pill-warn    { background: var(--g-warn-bg);     color: var(--g-warn); }
.g-pill-danger  { background: var(--g-danger-bg);   color: var(--g-danger); }
.g-pill-info    { background: var(--g-info-bg);     color: var(--g-info); }
.g-pill-ink     { background: var(--g-ink);         color: var(--g-surface); }
.g-pill-accent  { background: var(--g-accent-soft); color: var(--g-accent-text); }

/* keyboard kbd */
.g-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  padding: 1px 5px;
  border: 1px solid var(--g-border);
  border-radius: 3px;
  color: var(--g-muted);
  background: transparent;
}

/* ── Inputs ───────────────────────────────────────────────────────────── */
.g-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--g-border);
  background: var(--g-surface);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--g-ink);
  font-family: 'Inter', system-ui, sans-serif;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.g-input:focus { border-color: var(--g-accent); box-shadow: 0 0 0 2px var(--g-accent-soft); }
.g-input:disabled { opacity: .6; }

.g-input-sm { padding: 8px 11px; font-size: 13px; }

.g-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 9px;
}
.g-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--g-ink);
  font-family: 'Inter', system-ui, sans-serif;
}

.g-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--g-border);
  background: transparent;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--g-ink);
  font-family: 'Inter', system-ui, sans-serif;
  resize: vertical;
  outline: none;
  min-height: 70px;
}

/* ── Avatar ───────────────────────────────────────────────────────────── */
.g-avatar {
  border-radius: 999px;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  flex-shrink: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--g-border-strong);
}
.g-avatar-22 { width: 22px; height: 22px; font-size: 9px; }
.g-avatar-28 { width: 28px; height: 28px; font-size: 11px; }
.g-avatar-32 { width: 32px; height: 32px; font-size: 13px; }
.g-avatar-36 { width: 36px; height: 36px; font-size: 14px; }
.g-avatar-48 { width: 48px; height: 48px; font-size: 18px; }
.g-avatar-64 { width: 64px; height: 64px; font-size: 24px; }

/* deterministic palette (used via index in razor) */
.g-avatar-c0 { background: #e9a23b; }
.g-avatar-c1 { background: #9aa9c5; }
.g-avatar-c2 { background: #7bb089; }
.g-avatar-c3 { background: #d8785c; }
.g-avatar-c4 { background: #b298d4; }

/* ── Tabs (underline style) ──────────────────────────────────────────── */
.g-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--g-border);
}
.g-tab {
  padding: 9px 14px 11px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  color: var(--g-muted);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: inherit;
}
.g-tab:hover { color: var(--g-ink); }
.g-tab.active { color: var(--g-ink); font-weight: 600; }
.g-tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--g-accent);
}
.g-tab .g-tab-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--g-subtle);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ── Filter chips (counted) ─────────────────────────────────────────── */
.g-filter-chips {
  display: flex;
  gap: 6px;
}
.g-chip {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--g-muted);
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.g-chip:hover { background: var(--g-surface3); color: var(--g-ink); }
.g-chip.active { background: var(--g-surface3); color: var(--g-ink); }
.g-chip-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--g-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* segmented (3-up pill, language switcher style) */
.g-segmented {
  display: inline-flex;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 9px;
  padding: 3px;
}
.g-segmented > button {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--g-muted);
  border: none;
  font-family: inherit;
}
.g-segmented > button.active { background: var(--g-surface3); color: var(--g-ink); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.g-table {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  overflow: hidden;
}
.g-table-row {
  display: grid;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--g-divider);
  cursor: pointer;
  transition: background .1s;
  gap: 10px;
}
.g-table-row:hover { background: var(--g-surface2); }
.g-table-row:last-child { border-bottom: none; }
.g-table-head {
  background: var(--g-surface2);
  font-family: 'JetBrains Mono', monospace;
  color: var(--g-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: default;
  border-bottom: 1px solid var(--g-border);
}
.g-table-head:hover { background: var(--g-surface2); }

/* ── Sparkline placeholder (fed by SVG inline) ───────────────────────── */
.g-spark { display: block; }

/* ── Sidebar / shell ─────────────────────────────────────────────────── */
.g-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--g-bg);
}
.g-sidebar {
  width: 224px;
  background: var(--g-sidebar);
  color: var(--g-sidebar-ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #000;
}
.g-sidebar-head {
  padding: 20px 18px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.g-sidebar-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.g-glyph {
  width: 30px; height: 30px;
  background: var(--g-accent);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--g-accent-ink);
  font-family: 'Kalam', cursive;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.g-glyph-lg { width: 32px; height: 32px; font-size: 18px; }
.g-brand-stack { display: flex; flex-direction: column; line-height: 1.1; }
.g-brand-name { font-size: 14.5px; font-weight: 600; }
.g-brand-sub  { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--g-sidebar-muted); margin-top: 2px; letter-spacing: 0.4px; text-transform: uppercase; }

.g-sidebar-search {
  margin: 0 12px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--g-sidebar-hover);
  color: var(--g-sidebar-muted);
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid transparent;
}
.g-sidebar-search:hover { background: var(--g-sidebar-active); }
.g-sidebar-search .g-kbd-dark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  padding: 2px 5px;
  border: 1px solid var(--g-sidebar-active);
  border-radius: 4px;
  color: var(--g-sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.g-nav-list {
  padding: 10px 10px;
  flex: 1;
  overflow: auto;
}
.g-nav-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--g-sidebar-muted);
  padding: 16px 12px 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.g-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  margin: 1px 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--g-sidebar-muted);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.g-nav-item:hover { background: var(--g-sidebar-hover); color: var(--g-sidebar-ink); }
.g-nav-item.active {
  background: var(--g-sidebar-active);
  color: var(--g-sidebar-ink);
  font-weight: 600;
}
.g-nav-item.active::before {
  content: "";
  position: absolute;
  left: -6px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--g-accent);
  border-radius: 2px;
}
.g-nav-item .g-nav-icon { color: var(--g-sidebar-muted); flex-shrink: 0; }
.g-nav-item.active .g-nav-icon { color: var(--g-accent); }
.g-nav-label { flex: 1; }
.g-nav-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  padding: 1px 6px;
  background: var(--g-sidebar-active);
  color: var(--g-sidebar-muted);
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.g-nav-item.active .g-nav-badge { background: var(--g-accent); color: var(--g-accent-ink); }

.g-sidebar-foot {
  padding: 10px;
  border-top: 1px solid var(--g-sidebar-active);
  display: flex;
  align-items: center;
  gap: 10px;
}
.g-sidebar-avatar {
  width: 30px; height: 30px;
  border-radius: 999px;
  color: var(--g-accent-ink);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.g-sidebar-avatar-admin  { background: linear-gradient(135deg, #e9a23b, #d8902a); }
.g-sidebar-avatar-editor { background: linear-gradient(135deg, #9aa9c5, #7a8aaa); color: #fff; }
.g-sidebar-username { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.g-sidebar-username .name { font-size: 12.5px; font-weight: 600; color: var(--g-sidebar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-sidebar-username .role { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--g-sidebar-muted); letter-spacing: 0.4px; text-transform: uppercase; }
/* Sidebar sliding theme toggle — compact version of the login page's pill.
   Track ~44×22, knob 18, slides ~22 to land neatly over the moon/sun. */
.g-sidebar-theme {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.g-sidebar-theme-track {
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: var(--g-sidebar-hover);
  border: 1px solid var(--g-sidebar-active);
  overflow: hidden;
  transition: background .25s ease;
}
.g-sidebar-theme.is-dark .g-sidebar-theme-track { background: #1a1814; }
.g-sidebar-theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  transition: opacity .25s ease;
}
.g-sidebar-theme-icon-sun  { left: 6px;  color: #e9a23b; opacity: 0.9; }
.g-sidebar-theme-icon-moon { right: 6px; color: var(--g-sidebar-muted); opacity: 0.4; }
.g-sidebar-theme.is-dark .g-sidebar-theme-icon-sun  { color: var(--g-sidebar-muted); opacity: 0.4; }
.g-sidebar-theme.is-dark .g-sidebar-theme-icon-moon { color: var(--g-accent); opacity: 0.9; }
.g-sidebar-theme-knob {
  position: absolute;
  top: 1px; left: 1px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: left .25s ease, background .25s ease;
}
.g-sidebar-theme.is-dark .g-sidebar-theme-knob {
  left: 23px;
  background: var(--g-accent);
}

/* Sidebar logout — compact icon button next to the theme toggle. */
.g-sidebar-logout {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--g-sidebar-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
  transition: background .12s ease, color .12s ease;
}
.g-sidebar-logout:hover {
  background: var(--g-sidebar-hover);
  color: var(--g-sidebar-ink);
}
.g-sidebar-logout:focus-visible {
  outline: 2px solid var(--g-accent);
  outline-offset: 2px;
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.g-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.g-topbar {
  height: 64px;
  padding: 0 26px;
  border-bottom: 1px solid var(--g-border);
  background: var(--g-surface);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.g-topbar-titles { display: flex; flex-direction: column; line-height: 1.2; }
.g-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--g-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.g-breadcrumb .last { color: var(--g-muted); }
.g-topbar-title-row { display: flex; align-items: baseline; gap: 10px; }
.g-topbar-spacer { flex: 1; }
.g-topbar-bell {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--g-muted);
}
.g-topbar-bell:hover { background: var(--g-surface3); color: var(--g-ink); }
.g-topbar-divider { width: 1px; height: 22px; background: var(--g-border); }

.g-page {
  flex: 1;
  overflow: auto;
  background: var(--g-bg);
}
.g-page-pad { padding: 22px 26px; }

/* scrollbars in webkit — keep subtle */
.g-page::-webkit-scrollbar,
.g-nav-list::-webkit-scrollbar { width: 8px; height: 8px; }
.g-page::-webkit-scrollbar-thumb,
.g-nav-list::-webkit-scrollbar-thumb { background: var(--g-border-strong); border-radius: 4px; }

/* ── KPI tile ─────────────────────────────────────────────────────────── */
.g-kpi {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
}
.g-kpi-row { display: flex; justify-content: space-between; align-items: center; }
.g-kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--g-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.g-kpi-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--g-ink);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.g-kpi-spark { margin-top: auto; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.g-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--g-muted);
  font-size: 13.5px;
}

/* ── Live tail dot pulse ─────────────────────────────────────────────── */
@keyframes g-pulse {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: .55; transform: scale(1.4); }
  100% { opacity: 1; transform: scale(1); }
}
.g-pulse-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--g-ok);
  animation: g-pulse 1.5s infinite;
  display: inline-block;
}
.g-pulse-dot.paused { background: var(--g-subtle); animation: none; }

/* ── Misc utilities ──────────────────────────────────────────────────── */
.g-divider { border-top: 1px solid var(--g-divider); }
.g-vsep { width: 1px; align-self: stretch; background: var(--g-border); }
.g-spacer { flex: 1; }
.g-row { display: flex; align-items: center; gap: 10px; }
.g-stack { display: flex; flex-direction: column; }
.g-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* hide existing Bootstrap navbar/topbar legacy */
.legacy-hidden { display: none !important; }

/* override Bootstrap link inside design pages */
.g-page a, .g-shell a { color: var(--g-accent-text); text-decoration: none; }
.g-page a:hover, .g-shell a:hover { text-decoration: underline; }

/* keep blazor-error-ui aware */
[data-bs-theme="dark"] #blazor-error-ui { background: #2d1b1b; color: #f8d7da; }

/* ── Users page · clickable sort headers ───────────────────────────── */
.users-sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--g-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: color .12s ease;
  white-space: nowrap;
}
.users-sort-header:hover { color: var(--g-ink); }
.users-sort-header:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; border-radius: 2px; }
.users-sort-header.is-active { color: var(--g-ink); font-weight: 600; }
.users-sort-header.is-right { justify-content: flex-end; width: 100%; }
.users-sort-idle {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--g-subtle);
  opacity: .55;
  letter-spacing: 0;
}
.users-sort-header:hover .users-sort-idle { opacity: 1; }

/* ── Users page · row tints by status ───────────────────────────────── */
/* Active uses a much lighter green tint than --g-ok-bg so the row stays calm. */
.users-row-active      { background: rgba(44, 107, 63, .07); box-shadow: inset 3px 0 0 var(--g-ok); }
.users-row-locked      { background: var(--g-warn-bg);   box-shadow: inset 3px 0 0 var(--g-warn); }
.users-row-deactivated { background: var(--g-surface2);  box-shadow: inset 3px 0 0 var(--g-subtle); }
.users-row-deleted     { background: var(--g-danger-bg); box-shadow: inset 3px 0 0 var(--g-danger); opacity: .75; cursor: default !important; }
.users-row-deleted:hover { background: var(--g-danger-bg); }
:root[data-bs-theme="dark"] .users-row-active { background: rgba(123, 176, 137, .10); }

.users-deleted-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 999px;
  background: var(--g-surface3);
  display: grid; place-items: center;
}

/* ── Users page · filters drawer ────────────────────────────────────── */
.users-filters-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 19, 14, .32);
  z-index: 1040;
}
.users-filters-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px;
  background: var(--g-surface);
  border-left: 1px solid var(--g-border);
  box-shadow: -12px 0 32px rgba(0, 0, 0, .18);
  z-index: 1050;
  display: flex; flex-direction: column;
}
.users-filters-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--g-border);
}
.users-filters-body {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
}
.users-filters-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--g-border);
  background: var(--g-surface);
}
.users-filter-group { margin-bottom: 18px; }
.users-filter-placeholder {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px dashed var(--g-border);
  border-radius: 8px;
}

/* ── User detail · Grant product drawer ──────────────────────── */
.grant-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1040;
}
.grant-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px;
  background: var(--g-surface);
  border-left: 1px solid var(--g-border);
  box-shadow: -12px 0 32px rgba(0, 0, 0, .22);
  z-index: 1050;
  display: flex;
  flex-direction: column;
}
.grant-drawer-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--g-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.grant-drawer-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--g-accent-soft);
  color: var(--g-accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.grant-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.grant-drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--g-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.grant-mode-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; cursor: pointer;
  background: transparent;
}
.grant-mode-row > input[type="radio"] { margin-top: 3px; flex-shrink: 0; }
.grant-mode-row:hover { background: var(--g-surface2); }

.grant-product { padding: 11px 13px; cursor: pointer; }
.grant-product:hover { background: var(--g-surface2); }
.grant-product.is-active {
  border-color: var(--g-accent);
  box-shadow: inset 3px 0 0 var(--g-accent);
}
.grant-radio {
  width: 14px; height: 14px;
  border-radius: 999px;
  border: 2px solid var(--g-border);
  background: transparent;
  flex-shrink: 0;
  display: inline-block;
}
.grant-radio.is-on {
  border-color: var(--g-accent);
  background: var(--g-accent);
}

/* "ink-toned" chip variant for reason chips (matches the design's dark-background reason chips) */
.g-chip-pill.is-on-ink {
  background: var(--g-ink);
  color: var(--g-surface);
  border-color: var(--g-ink);
  font-weight: 600;
}

/* ── Users page · pagination segmented page-size control ───────── */
.users-pagesize {
  display: inline-flex;
  padding: 2px;
  background: var(--g-surface2);
  border: 1px solid var(--g-border);
  border-radius: 6px;
}
.users-pagesize > button {
  padding: 3px 9px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--g-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}
.users-pagesize > button:hover:not(:disabled):not(.is-on) {
  background: var(--g-surface3);
  color: var(--g-ink);
}
.users-pagesize > button.is-on {
  background: var(--g-accent);
  color: var(--g-accent-ink);
}
.users-pagesize > button:disabled { cursor: not-allowed; opacity: .55; }

/* ── Users page · admin toolbar coloured buttons ───────────────── */
/* Three discrete admin actions: Notify all (red), Create account (green), Invite user (primary). */
.users-btn-notify-all {
  background: #9d2818;
  color: #fff;
  border-color: #9d2818;
}
.users-btn-notify-all:hover:not(:disabled) {
  background: #842215;
  border-color: #842215;
  color: #fff;
}
.users-btn-create {
  background: #1e5631;
  color: #fff;
  border-color: #1e5631;
}
.users-btn-create:hover:not(:disabled) {
  background: #174523;
  border-color: #174523;
  color: #fff;
}

/* Pill-shaped chip used inside the filters drawer (accent when "on") */
.g-chip-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--g-surface2);
  color: var(--g-ink);
  border: 1px solid var(--g-border);
  font-family: inherit;
}
.g-chip-pill:hover { background: var(--g-surface3); }
.g-chip-pill.is-danger { color: var(--g-danger); }
/* "Permanent" chip when active — warn-toned (matches design) instead of accent. */
.g-chip-pill.is-on-warn {
  background: var(--g-warn);
  color: #fff;
  border-color: var(--g-warn);
  font-weight: 600;
}
.g-chip-pill.is-on {
  background: var(--g-accent);
  color: var(--g-accent-ink);
  border-color: var(--g-accent);
  font-weight: 600;
}

/* ============================================================================
 * Home dashboard — sections A–H (mirrors hf-home-dashboard / sections-abcd / efgh)
 * ========================================================================= */

@keyframes g-spin { to { transform: rotate(360deg); } }
@keyframes g-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Override .g-page-pad here — the sticky toolbar needs to sit flush at the top of
   the scroll container, so the dashboard manages its own padding. */
.g-dash-shell { padding: 0; }

/* ── Sticky controls bar ─────────────────────────────────────────────── */
.g-dash-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--g-bg);
  border-bottom: 1px solid var(--g-border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.g-dash-range { position: relative; }
.g-dash-range-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  padding: 8px;
  min-width: 260px;
}
.g-dash-range-preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.g-dash-range-preset:hover { background: var(--g-surface2); }
.g-dash-range-preset.is-on { background: var(--g-surface3); }
.g-dash-range-custom {
  border-top: 1px solid var(--g-divider);
  margin-top: 6px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.g-dash-range-custom .g-input-sm { padding: 6px 10px; font-size: 12px; }

/* ── Sections grid ───────────────────────────────────────────────────── */
.g-dash-sections {
  padding: 20px 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.g-dash-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  /* Cards size to their own content — avoids the taller sibling stretching the
     shorter one and creating a tall empty card. */
  align-items: start;
}
@media (max-width: 1100px) {
  .g-dash-row-2 { grid-template-columns: 1fr; }
}

.g-dash-section {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.g-dash-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* ── Tile (KPI) ─────────────────────────────────────────────────────── */
.g-dash-tile {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100px;
}
.g-dash-tile-head { display: flex; justify-content: space-between; align-items: center; }
.g-dash-tile-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--g-ink);
  letter-spacing: -0.4px;
  line-height: 1.1;
}
.g-dash-tile-spark { margin-top: auto; }

/* ── Section state — loading / empty / error ─────────────────────────── */
.g-dash-skeleton {
  border-radius: 8px;
  background: var(--g-surface3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-dash-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--g-surface2), transparent);
  animation: g-shimmer 1.4s infinite;
}
.g-dash-empty {
  border-radius: 8px;
  border: 1px dashed var(--g-border-strong);
  background: var(--g-surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.g-dash-error {
  border-radius: 8px;
  border: 1px solid var(--g-danger-border);
  background: var(--g-danger-bg);
  color: var(--g-danger);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

/* ── Donut + legend ──────────────────────────────────────────────────── */
.g-dash-donut { display: flex; align-items: center; gap: 16px; }
.g-dash-donut-legend { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.g-dash-donut-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.g-dash-donut-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.g-dash-donut-label {
  color: var(--g-ink);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Section A · acquisition ─────────────────────────────────────────── */
.g-dash-A-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-dash-A-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-dash-A-donuts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) {
  .g-dash-A-grid, .g-dash-A-tiles, .g-dash-A-donuts { grid-template-columns: 1fr; }
}

/* ── Section B · engagement ──────────────────────────────────────────── */
.g-dash-B-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .g-dash-B-tiles { grid-template-columns: 1fr; } }

/* ── Cohort heatmap ──────────────────────────────────────────────────── */
.g-dash-cohort {
  overflow: auto;
  border: 1px solid var(--g-border);
  border-radius: 10px;
}
.g-dash-cohort table {
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Inter', sans-serif;
  width: 100%;
}
.g-dash-cohort th, .g-dash-cohort td { border-bottom: 1px solid var(--g-divider); }
.g-dash-cohort .g-dash-cohort-th-cohort {
  position: sticky;
  left: 0;
  background: var(--g-surface2);
  font-size: 9.5px;
  color: var(--g-muted);
  padding: 10px 12px;
  text-align: left;
  min-width: 130px;
  border-bottom: 1px solid var(--g-border);
}
.g-dash-cohort .g-dash-cohort-th-size {
  background: var(--g-surface2);
  font-size: 9.5px;
  color: var(--g-muted);
  padding: 10px 8px;
  text-align: right;
  width: 56px;
  border-bottom: 1px solid var(--g-border);
}
.g-dash-cohort .g-dash-cohort-th-week {
  background: var(--g-surface2);
  font-size: 9.5px;
  color: var(--g-muted);
  padding: 10px 8px;
  text-align: center;
  width: 56px;
  border-bottom: 1px solid var(--g-border);
}
.g-dash-cohort .g-dash-cohort-td-cohort {
  position: sticky;
  left: 0;
  background: var(--g-surface);
  padding: 0 12px;
  font-size: 12px;
  color: var(--g-ink);
  font-weight: 500;
}

/* ── Section C · referrals ───────────────────────────────────────────── */
.g-dash-C-top { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 900px) { .g-dash-C-top { grid-template-columns: 1fr; } }
.g-dash-conv { display: inline-flex; align-items: center; gap: 8px; }
.g-dash-conv-bar {
  width: 60px; height: 4px;
  background: var(--g-surface3);
  border-radius: 2px;
  overflow: hidden;
}
.g-dash-conv-fill { height: 100%; background: var(--g-accent); }

/* ── Section D · production ──────────────────────────────────────────── */
.g-dash-D-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 900px) { .g-dash-D-grid { grid-template-columns: 1fr; } }
.g-dash-cat-bar { width: 60px; height: 3px; background: var(--g-surface3); border-radius: 2px; }
.g-dash-cat-fill { height: 100%; background: var(--g-accent); border-radius: 2px; }

/* ── Inline ink-pill toggle (used in Production + Genie type filters) ──── */
.g-dash-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--g-surface);
  color: var(--g-ink2);
  border: 1px solid var(--g-border);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.g-dash-pill:hover { background: var(--g-surface2); }
.g-dash-pill.is-on {
  background: var(--g-ink);
  color: var(--g-surface);
  border-color: var(--g-ink);
}

/* ── Generic dashboard table ─────────────────────────────────────────── */
.g-dash-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
}
.g-dash-table thead tr { background: var(--g-surface2); }
.g-dash-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--g-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--g-border);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 500;
}
.g-dash-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--g-divider);
}
.g-dash-table tbody tr:last-child td { border-bottom: none; }
.g-dash-table-tight tbody td { padding: 8px 12px; }

.g-dash-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--g-surface2);
  border-top: 1px solid var(--g-border);
}

/* ── Section E · segmented tabs (perf tab + top/bottom) ──────────────── */
.g-dash-segmented {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  background: var(--g-surface3);
  border-radius: 8px;
  border: 1px solid var(--g-border);
}
.g-dash-segmented > button {
  padding: 6px 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--g-muted);
  border: none;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.g-dash-segmented > button.is-on {
  background: var(--g-surface);
  color: var(--g-ink);
  font-weight: 600;
  box-shadow: var(--g-shadow);
}
.g-dash-segmented-accent > button.is-on {
  background: var(--g-accent);
  color: var(--g-accent-ink);
  font-weight: 600;
  box-shadow: none;
}

.g-dash-reach-bar {
  flex: 1;
  height: 18px;
  background: var(--g-surface3);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--g-border);
}
.g-dash-reach-fill { height: 100%; opacity: 0.85; }

/* ── Section F · funnel ──────────────────────────────────────────────── */
.g-dash-funnel { display: flex; flex-direction: column; gap: 0; }
.g-dash-funnel-drop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 2px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
}
.g-dash-funnel-drop-line { width: 1px; height: 14px; background: var(--g-border-strong); }
.g-dash-funnel-row { display: flex; align-items: center; gap: 12px; }
.g-dash-funnel-rank {
  width: 24px;
  font-size: 9.5px;
  color: var(--g-subtle);
  text-align: center;
}
.g-dash-funnel-bar {
  flex: 1;
  position: relative;
  background: var(--g-surface3);
  border-radius: 8px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--g-border);
}
.g-dash-funnel-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--g-accent), var(--g-accent-hover));
  border-radius: 8px;
}
.g-dash-funnel-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

/* ── Section F · category select ─────────────────────────────────────── */
.g-dash-select {
  padding: 6px 10px;
  border: 1px solid var(--g-border);
  background: var(--g-surface);
  border-radius: 8px;
  font-size: 12px;
  color: var(--g-ink);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}

/* ── Section G · genie usage ────────────────────────────────────────── */
.g-dash-G-charts {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}
.g-dash-G-bottom {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
@media (max-width: 1000px) {
  .g-dash-G-charts, .g-dash-G-bottom { grid-template-columns: 1fr; }
}

/* ── Section H · moderation ──────────────────────────────────────────── */
.g-dash-flag-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .g-dash-flag-grid { grid-template-columns: repeat(2, 1fr); } }
.g-dash-flag-tile {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.g-dash-flag-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  padding: 1px 6px;
  background: var(--g-danger-bg);
  color: var(--g-danger);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.g-dash-flag-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--g-ink);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

/* ── IAP form scaffolding (used by ProductEditor + AppleSetup) ───────────
   Pinned to the viewport bottom — always visible, fully opaque, covers
   content underneath. Spacer sits inside the page scroller so content
   can scroll up to (but not under) the bar. */
.g-action-bar {
    position: fixed;
    bottom: 0;
    left: 224px;          /* matches .g-sidebar width */
    right: 0;
    padding: 12px 26px;
    background: var(--g-bg);
    border-top: 1px solid var(--g-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    z-index: 50;
}
.g-action-bar-spacer { height: 72px; }

/* ── Char counter (used by BilingualField + ProductEditor text inputs) ─── */
.g-char-count {
    font: 11px/1 var(--g-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    color: var(--g-muted);
    letter-spacing: .3px;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: transparent;
    user-select: none;
    transition: color 120ms ease, background-color 120ms ease;
}
.g-char-count--idle   { color: var(--g-muted); opacity: .65; }
.g-char-count--ok     { color: var(--g-muted); }
.g-char-count--warn   { color: var(--g-warn);   background: var(--g-warn-bg); }
.g-char-count--danger { color: var(--g-danger); background: var(--g-danger-bg); font-weight: 600; }

/* Counter sits BELOW the input / textarea, right-aligned, on its own line.
   Never overlaps the text. */
.g-field--with-counter {
    display: flex;
    flex-direction: column;
}
.g-field--with-counter > .g-char-count {
    align-self: flex-end;
    margin-top: 4px;
}
/* RTL fields (Arabic): align counter to the left so it sits under the text's start. */
.g-bilingual__col.g-field--with-counter:has(.g-rtl) > .g-char-count {
    align-self: flex-start;
}

/* ── Google regional pricing table inside the IAP editor ────────────── */
.g-table-wrap   { overflow-x: auto; max-width: 100%; }
.g-table-compact th,
.g-table-compact td { padding: 6px 8px; font-size: 13px; }
.g-table-compact thead th {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .6px;
    color: var(--g-muted);
    border-bottom: 1px solid var(--g-border);
    text-align: left;
    background: transparent;
}
.g-row-overridden td   { background: color-mix(in srgb, var(--g-info-bg) 35%, transparent); }
.g-row-overridden td:first-child { box-shadow: inset 3px 0 0 var(--g-info); }
