* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Design tokens ──────────────────────────────────────────────────────────
   Single source of truth for color, type, spacing, and radius. Every rule
   below reads from these custom properties instead of a literal value, so
   the whole app retheme (including light/dark) happens by editing this one
   block. Palette follows webflow/DESIGN.md: Webflow Blue as the sole accent,
   and DESIGN.md's secondary hues mapped only where this CMS already has a
   matching UI meaning (green = success/open/visible, red = danger/delete,
   orange = warning/hot/attention) rather than used decoratively. */
:root {
  color-scheme: light;

  /* Surfaces */
  --surface-page: #f7f7f8;
  --surface-panel: #ffffff;
  --surface-sunken: #f7f7f8;
  --surface-overlay: rgba(23, 23, 23, 0.4);

  /* Text */
  --text-primary: #080808;
  --text-secondary: #5a5a5a;
  --text-muted: #6e6e76;
  --text-on-accent: #ffffff;

  /* Borders */
  --border: #e4e4e7;
  --border-strong: #d8d8d8;

  /* Accent (Webflow Blue) */
  --accent: #146ef5;
  --accent-hover: #0055d4;
  --accent-subtle: rgba(20, 110, 245, 0.1);
  --accent-subtle-border: rgba(20, 110, 245, 0.35);
  --accent-ring: rgba(20, 110, 245, 0.12);

  /* Status: success (green) */
  --success: #00a82d;
  --success-text: #178a4c;
  --success-subtle: #eafaf0;
  --success-border: #b7e4c7;

  /* Status: danger (red) */
  --danger: #ee1d36;
  --danger-text: #b3372c;
  --danger-subtle: #fbe9e7;
  --danger-border: #f2c6bf;

  /* Status: warning / hot / attention (orange) */
  --warning: #ff6b00;
  --warning-text: #b3590c;
  --warning-subtle: #fff3e2;
  --warning-border: #f4c58a;

  /* Status: gold (legacy "featured" pill, kept distinct from warning-orange) */
  --gold-text: #8a6d00;
  --gold-subtle: #fdf6e0;
  --gold-border: #d9b13b;

  /* Shadows */
  --shadow-sm: 0 4px 18px rgba(20, 110, 245, 0.08);
  --shadow-md: 0 18px 40px rgba(10, 20, 40, 0.28);
  --shadow-lg: -18px 0 50px rgba(0, 0, 0, 0.12);
  --shadow-rail: 8px 0 24px rgba(0, 0, 0, 0.12);

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: Consolas, 'Courier New', monospace;

  --text-2xl: 700 28px/1.3 var(--font-sans);
  --text-xl: 700 20px/1.3 var(--font-sans);
  --text-lg: 600 17px/1.3 var(--font-sans);
  --text-md: 600 16px/1.4 var(--font-sans);
  --text-sm: 500 13px/1.4 var(--font-sans);
  --text-xs: 500 12px/1.3 var(--font-sans);
  --text-label: 600 11px/1.3 var(--font-sans);
  --tracking-label: 0.05em;
  --tracking-micro: 0.06em;

  /* Spacing scale */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-9: 20px;
  --space-10: 24px;
  --space-11: 32px;
  --space-12: 40px;
  --space-13: 48px;

  /* Radius scale */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

/* Dark mode: same roles, restepped for a dark surface. Covers both the OS
   preference (prefers-color-scheme) and an explicit user toggle
   ([data-theme]): the explicit toggle always wins over the OS setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --surface-page: #0d0d0d;
    --surface-panel: #161616;
    --surface-sunken: #1e1e1e;
    --surface-overlay: rgba(0, 0, 0, 0.6);

    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #8f8f95;
    --text-on-accent: #ffffff;

    --border: #2a2a2a;
    --border-strong: #3a3a3a;

    --accent: #3b89ff;
    --accent-hover: #62a0ff;
    --accent-subtle: rgba(59, 137, 255, 0.16);
    --accent-subtle-border: rgba(59, 137, 255, 0.4);
    --accent-ring: rgba(59, 137, 255, 0.2);

    --success: #1fce4f;
    --success-text: #3ddb74;
    --success-subtle: rgba(31, 206, 79, 0.14);
    --success-border: rgba(31, 206, 79, 0.35);

    --danger: #ff5468;
    --danger-text: #ff8a96;
    --danger-subtle: rgba(255, 84, 104, 0.14);
    --danger-border: rgba(255, 84, 104, 0.35);

    --warning: #ff8a3d;
    --warning-text: #ffa663;
    --warning-subtle: rgba(255, 107, 0, 0.14);
    --warning-border: rgba(255, 107, 0, 0.35);

    --gold-text: #e0c04a;
    --gold-subtle: rgba(217, 177, 59, 0.14);
    --gold-border: rgba(217, 177, 59, 0.35);

    --shadow-sm: 0 4px 18px rgba(59, 137, 255, 0.12);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.5);
    --shadow-lg: -18px 0 50px rgba(0, 0, 0, 0.5);
    --shadow-rail: 8px 0 24px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --surface-page: #0d0d0d;
  --surface-panel: #161616;
  --surface-sunken: #1e1e1e;
  --surface-overlay: rgba(0, 0, 0, 0.6);

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #8f8f95;
  --text-on-accent: #ffffff;

  --border: #2a2a2a;
  --border-strong: #3a3a3a;

  --accent: #3b89ff;
  --accent-hover: #62a0ff;
  --accent-subtle: rgba(59, 137, 255, 0.16);
  --accent-subtle-border: rgba(59, 137, 255, 0.4);
  --accent-ring: rgba(59, 137, 255, 0.2);

  --success: #1fce4f;
  --success-text: #3ddb74;
  --success-subtle: rgba(31, 206, 79, 0.14);
  --success-border: rgba(31, 206, 79, 0.35);

  --danger: #ff5468;
  --danger-text: #ff8a96;
  --danger-subtle: rgba(255, 84, 104, 0.14);
  --danger-border: rgba(255, 84, 104, 0.35);

  --warning: #ff8a3d;
  --warning-text: #ffa663;
  --warning-subtle: rgba(255, 107, 0, 0.14);
  --warning-border: rgba(255, 107, 0, 0.35);

  --gold-text: #e0c04a;
  --gold-subtle: rgba(217, 177, 59, 0.14);
  --gold-border: rgba(217, 177, 59, 0.35);

  --shadow-sm: 0 4px 18px rgba(59, 137, 255, 0.12);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.5);
  --shadow-lg: -18px 0 50px rgba(0, 0, 0, 0.5);
  --shadow-rail: 8px 0 24px rgba(0, 0, 0, 0.5);
}

body {
  font-family: var(--font-sans);
  background: var(--surface-page);
  color: var(--text-primary);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Login (Webflow-style replica) ── */
.lg-page {
  display: flex;
  height: 100vh;
  min-height: 620px;
  background: var(--surface-panel);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.lg-page button,
.lg-page input {
  font-family: inherit;
}

/* left promo card */
.lg-left {
  flex: 1 1 48%;
  max-width: 900px;
  margin: var(--space-10);
  border-radius: 26px;
  background: #0a0a0a;
  color: #fff;
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.lg-promo-eyebrow {
  color: #8f8f8f;
  font-size: 17px;
  margin-bottom: var(--space-7);
}

.lg-promo-title {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

.lg-promo-body {
  font-size: 16.5px;
  line-height: 1.55;
  color: #d4d4d4;
  max-width: 640px;
  margin-bottom: var(--space-10);
}

.lg-learn {
  display: inline-block;
  background: #1f1f1f;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 13px var(--space-10);
  border-radius: var(--radius-md);
}

.lg-learn:hover {
  background: #2b2b2b;
}

.lg-arrows {
  position: absolute;
  right: var(--space-12);
  bottom: 36px;
  display: flex;
  gap: var(--space-6);
}

.lg-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #262626;
  border: none;
  color: #c9c9c9;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.lg-arrow:hover {
  background: #333;
  color: #fff;
}

.lg-arrow:disabled {
  opacity: 0.45;
  cursor: default;
}

.lg-arrow:disabled:hover {
  background: #262626;
  color: #c9c9c9;
}

/* promo "screenshot" collage */
.lg-shot {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 460px;
  margin-bottom: var(--space-12);
  background:
    radial-gradient(95% 130% at 0% 18%, #f2a35f 0%, rgba(242, 163, 95, 0.5) 32%, rgba(242, 163, 95, 0) 58%),
    linear-gradient(103deg, #f6ddc6 0%, #d3e0f4 42%, #a3c1ef 72%, #86aeed 100%);
}

.lg-sp {
  position: absolute;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.lg-sp-main {
  left: 6.5%;
  top: 13%;
  width: 41%;
  background: #1b1b1d;
  padding: var(--space-6) var(--space-6) var(--space-5);
}

.lg-sp-main-title {
  font-size: 11px;
  font-weight: 600;
  color: #f2f2f2;
  margin-bottom: var(--space-2);
}

.lg-sp-main-sub {
  font-size: 8px;
  color: #8f8f95;
  margin-bottom: var(--space-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-sp-main-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  font-weight: 600;
  color: #d9d9de;
  margin-bottom: var(--space-3);
}

.lg-chip {
  border: 1px solid #3c3c40;
  border-radius: var(--radius-sm);
  font-size: 7.5px;
  color: #c9c9ce;
  padding: var(--space-1) var(--space-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.lg-chip-light {
  border-color: #4a4a4e;
  background: #232325;
}

.lg-sp-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid #29292c;
}

.lg-sp-row img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: var(--space-2);
  background: #fff;
}

.lg-sp-row-label {
  flex: 1;
  font-size: 8px;
  color: #b9b9bf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-sp-chart {
  left: 43.5%;
  top: 6%;
  width: 30%;
  background: #fdfdfe;
  padding: var(--space-5) var(--space-5) var(--space-4);
  z-index: 2;
}

.lg-sp-chart-title {
  font-size: 9px;
  font-weight: 600;
  color: #2b2b2b;
  margin-bottom: var(--space-3);
}

.lg-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 5px;
}

.lg-bar-label {
  width: 42%;
  font-size: 7.5px;
  color: #55555c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-bar-track {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #e8eef8;
  overflow: hidden;
}

.lg-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.lg-bar-value {
  width: 22px;
  text-align: right;
  font-size: 7.5px;
  color: #55555c;
}

.lg-bar-total {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  font-weight: 600;
  color: #2b2b2b;
  border-top: 1px solid #e4e8f0;
  padding-top: 5px;
  margin-bottom: var(--space-4);
}

.lg-chart-area {
  background: #e9f0fb;
  border-radius: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.lg-chart-area svg {
  display: block;
  width: 100%;
  height: 58px;
}

.lg-chart-x {
  display: flex;
  justify-content: space-between;
  font-size: 6.5px;
  color: #7a869c;
  margin-top: 3px;
}

.lg-sp-code {
  right: -2%;
  top: 4%;
  width: 30%;
  height: 50%;
  background: #10203a;
  padding: var(--space-5) var(--space-6);
  overflow: hidden;
  z-index: 1;
}

.lg-sp-code pre {
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.55;
  color: #a9c2e8;
  white-space: pre;
}

.lg-sp-prompts {
  right: 1%;
  top: 57%;
  width: 31%;
  background: #0e1626;
  padding: var(--space-5) var(--space-6);
  z-index: 3;
}

.lg-sp-prompts-head {
  font-size: 9.5px;
  font-weight: 600;
  color: #eef2f8;
  margin-bottom: 3px;
}

.lg-sp-prompts-sub {
  font-size: 7.5px;
  color: #8b96ad;
  padding-bottom: 5px;
  border-bottom: 1px solid #1f2a3f;
  margin-bottom: 5px;
}

.lg-sp-prompts-topic {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  font-weight: 600;
  color: #d7dee9;
  margin-bottom: var(--space-2);
}

.lg-sp-prompts-count {
  font-weight: 400;
  color: #8b96ad;
  font-size: 7px;
}

.lg-sp-prompt {
  font-size: 7.5px;
  color: #aeb9cc;
  padding: var(--space-2) 0;
  border-top: 1px solid #1a2438;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-sp-issues {
  left: 15%;
  bottom: -3%;
  width: 52%;
  background: #151515;
  padding: 9px var(--space-6) var(--space-7);
  z-index: 4;
}

.lg-sp-issues-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  color: #ececec;
  margin-bottom: var(--space-3);
}

.lg-sp-issues-flag {
  color: var(--warning);
  font-size: 8px;
}

.lg-sp-issues-label {
  font-size: 7.5px;
  color: #8f8f95;
  margin-bottom: 5px;
}

.lg-sp-issue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: 8px;
  color: #cfcfd4;
  padding: var(--space-2) 0;
  border-top: 1px solid #262629;
}

.lg-dim {
  opacity: 0.55;
}

/* right form column */
.lg-right {
  flex: 1 1 52%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-13) var(--space-10);
  overflow-y: auto;
}

.lg-form-col {
  width: 100%;
  max-width: 478px;
}

.lg-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  margin-bottom: var(--space-11);
}

.lg-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.lg-brand span {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.lg-title {
  text-align: center;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-11);
}

.lg-alert {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  background: var(--danger-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-8) 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: var(--space-9);
}

.lg-alert svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.lg-field {
  margin-bottom: var(--space-6);
}

.lg-field-pw {
  position: relative;
}

.lg-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-8);
  margin: 0;
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 15.5px;
  color: var(--text-primary);
  outline: none;
}

.lg-input::placeholder {
  color: var(--text-secondary);
}

.lg-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.lg-field-pw .lg-input {
  padding-right: 48px;
}

.lg-eye {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.lg-eye:hover {
  background: transparent;
}

.lg-link {
  display: inline;
  width: auto;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  color: var(--accent);
  cursor: pointer;
}

.lg-link:hover {
  background: none;
  text-decoration: underline;
}

.lg-forgot {
  font-size: 15px;
  margin: var(--space-2) 0 0;
}

.lg-continue {
  width: 100%;
  height: 48px;
  margin-top: var(--space-10);
  background: color-mix(in srgb, var(--accent) 55%, var(--surface-panel));
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lg-continue:hover {
  background: var(--accent);
}

.lg-continue:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.lg-signup {
  text-align: center;
  font-size: 15px;
  color: var(--text-primary);
  margin-top: var(--space-11);
}

.lg-signup .lg-link {
  font-size: 15px;
}

@media (max-width: 1100px) {
  .lg-left {
    display: none;
  }
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

input {
  width: 100%;
  padding: var(--space-6) var(--space-7);
  margin-bottom: var(--space-8);
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  background: var(--danger-subtle);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: 10px;
  padding: var(--space-5) var(--space-7);
  font-size: 13px;
  margin-bottom: var(--space-8);
}

/* ── Shell ── */
/* Fixed height (not min-height): .main becomes the one well-defined
   scroll container instead of the page growing past 100vh and the
   document itself scrolling. Without this, position: sticky inside
   .main (the category list on Products, Applications, Contacts) has
   no single scrolling ancestor to stick against and just scrolls away
   with the rest of the page instead of staying pinned. */
.shell {
  display: flex;
  height: 100vh;
}

/* Sidebar defaults to a narrow icon rail (real flex width, always reserved).
   Both hovering and pinning expand it in flow (real width change), so the
   main content area (flex: 1 next to it) always reflows to fill the
   remaining space rather than having the sidebar overlay on top of it. */
.sidebar {
  width: 68px;
  background: var(--surface-panel);
  border-right: 1px solid var(--border);
  padding: var(--space-10) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  transition: width 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  z-index: 50;
}

.sidebar a,
.sidebar .nav-group-head,
.sidebar .nav-disabled,
.sidebar-collapse-btn,
.userbox-signout {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: var(--text-muted);
}

.userbox-signout:hover {
  background: transparent;
  color: var(--text-primary);
}

.sidebar .nav-label,
.sidebar .nav-label-block {
  display: none;
  white-space: nowrap;
}

.sidebar .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar.sidebar-expanded {
  width: 230px;
  align-items: stretch;
  padding: var(--space-10) var(--space-8);
  box-shadow: var(--shadow-rail);
}

.sidebar.sidebar-expanded a,
.sidebar.sidebar-expanded .nav-group-head,
.sidebar.sidebar-expanded .nav-disabled,
.sidebar.sidebar-expanded .sidebar-collapse-btn,
.sidebar.sidebar-expanded .userbox-signout {
  width: 100%;
  height: auto;
  justify-content: flex-start;
  padding: var(--space-5) var(--space-6);
}

.sidebar.sidebar-expanded .nav-label,
.sidebar.sidebar-expanded .nav-label-block {
  display: block;
}

.sidebar.sidebar-expanded .sidebar-collapse-btn,
.sidebar.sidebar-expanded .userbox-signout {
  display: flex;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  padding: 0 var(--space-6) var(--space-9);
}

.sidebar .brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.sidebar .brand span {
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar a,
.sidebar .nav-disabled {
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-muted);
}

.sidebar a.active {
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar a:hover {
  color: var(--text-primary);
}

.nav-disabled {
  opacity: 0.45;
  cursor: default;
}

.nav-disabled em {
  font-size: 11px;
  font-style: normal;
  border: 1px solid var(--border);
  border-radius: var(--space-3);
  padding: 1px var(--space-3);
  margin-left: var(--space-3);
}

.sidebar .spacer {
  flex: 1;
}

/* ── Sidebar Pages tree (page-wise nav) ── */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  text-align: left;
}

.nav-group-head:hover {
  color: var(--text-primary);
  background: transparent;
}

.nav-group-head.active {
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-1) 0 var(--space-2) var(--space-5);
  border-left: 1px solid var(--border);
  margin-left: var(--space-6);
}

.nav-tree-page {
  width: 100%;
  text-align: left;
  padding: 7px var(--space-5);
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.nav-tree-page:hover {
  color: var(--text-primary);
  background: transparent;
}

.nav-tree-page.active {
  color: var(--accent);
  font-weight: 600;
  background: transparent;
}

.nav-tree-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-1) 0 var(--space-2) var(--space-6);
}

.nav-tree-section {
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--space-3);
  font-size: 12px;
  text-transform: capitalize;
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.nav-tree-section:hover {
  color: var(--text-primary);
  background: transparent;
}

.nav-tree-section.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.nav-tree-empty {
  padding: var(--space-3) var(--space-5);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

.sidebar-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: var(--space-4);
  margin-bottom: var(--space-2);
}

.sidebar-collapse-btn:hover {
  color: var(--text-primary);
  background: transparent;
  border-color: var(--text-muted);
}

.userbox {
  border-top: 1px solid var(--border);
  padding: var(--space-7) 0 0;
  font-size: 13px;
  width: 100%;
}

.sidebar.sidebar-expanded .userbox {
  padding: var(--space-7) var(--space-6) 0;
}

.userbox .role {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
}

.userbox button {
  margin-top: var(--space-5);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--space-4);
}

.userbox button:hover {
  color: var(--text-primary);
  background: transparent;
  border-color: var(--text-muted);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: auto;
}

.main-content {
  padding: var(--space-11) var(--space-12);
}

.main h2 {
  font: var(--text-xl);
  margin-bottom: var(--space-9);
}

/* ── Top bar (publish / undo) ── */
.stale-build-banner {
  position: sticky;
  top: 0;
  z-index: 41;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-12);
  background: var(--warning-subtle);
  color: var(--warning-text);
  border-bottom: 1px solid var(--warning-border);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  flex-shrink: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-6) var(--space-12);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-status {
  font-size: 13px;
}

.topbar-pending {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.topbar-history-wrap {
  position: relative;
}

.topbar-history-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-7);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.topbar-history-btn:hover {
  background: var(--surface-sunken);
}

.topbar-publish-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-8);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.topbar-publish-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.topbar-publish-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.history-panel {
  position: absolute;
  top: calc(100% + var(--space-4));
  right: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-rail);
  z-index: 60;
  overflow: hidden;
  box-sizing: border-box;
}

.history-panel * {
  box-sizing: border-box;
  min-width: 0;
}

.history-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.history-panel-list {
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0;
  flex: 1;
}

.history-empty {
  padding: var(--space-8) var(--space-7);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.history-section-label {
  padding: var(--space-5) var(--space-7) var(--space-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.history-section-label:not(:first-child) {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

.history-bulk-bar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-7);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-shrink: 0;
}

.history-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-7);
}

.history-row-checkbox {
  flex-shrink: 0;
  margin: 3px 0 0;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.history-row-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.history-row:hover {
  background: var(--surface-sunken);
}

.history-row-selected {
  background: var(--surface-sunken);
}

.history-row-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.history-row-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.history-row-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  width: 100%;
}

.history-action {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.history-action-create { color: #16a34a; }
.history-action-update { color: var(--accent); }
.history-action-delete { color: #dc2626; }
.history-action-undo { color: var(--text-muted); }

.history-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}

.history-summary {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-top: 2px;
}

.history-undo-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.history-undo-btn:hover:not(:disabled) {
  background: var(--surface-panel);
  border-color: var(--accent);
  color: var(--accent);
}

.history-undo-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Help panel ── */
.topbar-help-wrap {
  position: relative;
}

.topbar-help-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-7);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.topbar-help-btn:hover {
  background: var(--surface-sunken);
}

.help-panel {
  position: absolute;
  top: calc(100% + var(--space-5));
  right: 0;
  width: 420px;
  max-width: calc(100vw - 48px);
  max-height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 60;
  animation: help-panel-in 0.14s ease-out;
}

@keyframes help-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.help-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-8);
  border-bottom: 1px solid var(--border);
}

.help-panel-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.help-panel-sub {
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
}

.help-panel-head .btn-icon {
  flex-shrink: 0;
}

.help-panel-body {
  overflow-y: auto;
  padding: var(--space-6) var(--space-8) var(--space-8);
}

.help-panel-topic {
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--border);
}

.help-panel-topic:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.help-panel-topic-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.help-panel-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.help-panel-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-6);
}

.help-panel-row-context {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.help-panel-row-main {
  min-width: 0;
}

.help-panel-row-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.help-panel-dims {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  margin-right: var(--space-4);
  white-space: nowrap;
}

.help-panel-row-formats {
  margin-top: var(--space-3);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Dashboard ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-11);
}

.card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-9);
}

.card .num {
  font: var(--text-2xl);
}

.card .label {
  color: var(--text-muted);
  font: var(--text-sm);
  margin-top: var(--space-2);
}

/* ── Dashboard ── */
.dash-publish-banner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-7) var(--space-8);
  margin-bottom: var(--space-9);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.dash-publish-banner.has-pending {
  border-color: var(--accent-subtle-border);
  background: var(--accent-subtle);
  color: var(--text-primary);
}

.dash-publish-banner b {
  color: var(--text-primary);
}

.dash-stat-group {
  margin-bottom: var(--space-9);
}

.dash-stat-group-title {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.dash-stat-group .cards {
  margin-bottom: 0;
}

.dash-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.dash-card-icon {
  color: var(--accent);
  margin-bottom: var(--space-5);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-10);
  align-items: start;
}

.dash-panel {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.dash-panel-wide {
  grid-column: span 2;
}

@media (max-width: 1100px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-panel-wide {
    grid-column: span 1;
  }
}

.dash-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
}

.dash-panel-head h3 {
  font-size: 14px;
  font-weight: 700;
}

.dash-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--space-6) 0;
  text-align: center;
}

.dash-activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 320px;
  overflow-y: auto;
}

.dash-activity-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.dash-activity-row:last-child {
  border-bottom: none;
}

.dash-activity-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dash-list-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.dash-list-row:last-child {
  border-bottom: none;
}

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

.dash-list-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-sunken);
}

td img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--space-3);
  vertical-align: middle;
}

.pill {
  display: inline-block;
  font-size: 11px;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.loading {
  color: var(--text-muted);
  padding: var(--space-12) 0;
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  margin-bottom: var(--space-9);
  flex-wrap: wrap;
}

.add-client-panel {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-7);
  margin-bottom: var(--space-8);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.add-client-panel .search {
  flex: 1;
  min-width: 200px;
}

.add-client-panel .industry-select {
  width: 200px;
  flex-shrink: 0;
}

.toolbar h2 {
  margin: 0;
}

.grow {
  flex: 1;
}

.search {
  width: 260px;
  min-width: 0;
  margin: 0;
  background: var(--surface-sunken);
  border-color: transparent;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.search:hover {
  border-color: var(--border);
}

.search:focus {
  background: var(--surface-panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.search-wide {
  width: 340px;
}

select {
  padding: var(--space-5) var(--space-6);
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 12px;
}

.ok {
  color: var(--success-text);
  font-size: 13px;
}

.error-text {
  color: var(--danger-text);
  font-size: 13px;
}

.replace-image-error {
  display: block;
  margin-top: var(--space-2);
}

/* ── Buttons ── */
.btn-primary,
.btn-sm,
.btn-icon {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-primary {
  padding: var(--space-5) var(--space-8);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-sm {
  padding: 7px var(--space-6);
  font-size: 13px;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 500;
}

.btn-sm:hover {
  background: var(--surface-sunken);
  border-color: var(--text-muted);
}

.btn-sm.danger:hover {
  border-color: var(--danger);
  color: var(--danger-text);
}

.btn-icon {
  padding: var(--space-2) 9px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-icon:hover {
  background: var(--surface-panel);
  color: var(--text-primary);
}

.btn-icon.danger:hover {
  border-color: var(--danger);
  color: var(--danger-text);
}

.btn-primary:disabled {
  opacity: 0.5;
}

a.btn-sm {
  text-decoration: none;
}

/* ── Customizer (Pages editor) ── */
.customizer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: var(--space-9);
  height: calc(100vh - 140px);
}

.customizer.preview-collapsed {
  grid-template-columns: 1fr;
}

.customizer.preview-collapsed .preview-col {
  display: none;
}

.editor-col {
  overflow-y: auto;
  padding-right: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
}

/* ── Pages Editor: Advanced-tab section list ──
   Deliberately its own namespace (not .section-card, which SettingsPage
   also uses) so this list's layout/spacing can't collide with or be
   accidentally overridden by unrelated rules on a shared class name. */
.pgsec-list {
  gap: 0;
}

.pgsec {
  display: flex;
  gap: var(--space-6);
}

.pgsec-rail {
  flex-shrink: 0;
  width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pgsec-index {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pgsec-open .pgsec-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pgsec-rail-line {
  flex: 1;
  width: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
  min-height: var(--space-7);
}

.pgsec:last-child .pgsec-rail-line {
  visibility: hidden;
}

.pgsec-card {
  flex: 1;
  min-width: 0;
  margin-bottom: var(--space-9);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pgsec-open .pgsec-card {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.pgsec-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-7) var(--space-8);
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.pgsec-head:hover {
  background: var(--surface-sunken);
}

.pgsec-head-text {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  min-width: 0;
}

.pgsec-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pgsec-type {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pgsec-flags {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.pgsec-flag {
  font-size: 11px;
  font-weight: 600;
}

.pgsec-flag-hidden {
  color: var(--danger);
}

.pgsec-chevron {
  color: var(--text-muted);
  font-size: 13px;
  width: 14px;
  text-align: center;
}

.pgsec-body {
  padding: var(--space-8) var(--space-9) var(--space-9);
  border-top: 1px solid var(--border);
}

.pgsec-foot {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--border);
}

.preview-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-panel);
}

.preview-col iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.empty-note {
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface-panel);
  border: 1px dashed var(--border);
  border-radius: var(--space-6);
  padding: var(--space-8);
  line-height: 1.5;
}

/* ── Section cards ── */
.section-card {
  position: relative;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--space-6);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.section-card.open {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.section-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px var(--space-8);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  gap: var(--space-5);
}

.section-head-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  overflow: hidden;
}

.section-head-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-head-vis {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.section-head-vis.hidden-flag {
  color: var(--danger);
}

.section-head:hover {
  background: var(--surface-sunken);
}

.section-head.static {
  cursor: default;
}

.section-body {
  padding: var(--space-8) var(--space-9) var(--space-9);
  border-top: 1px solid var(--border);
}

.section-foot {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--border);
}

/* ── Generic editor fields ── */
.field-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-6);
}

.field-row > label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 11px;
  overflow-wrap: break-word;
}

.field-row input,
.field-row textarea {
  margin-bottom: 0;
}

.field-row:last-child {
  margin-bottom: 0;
}

textarea {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
}

.object-field {
  padding-left: var(--space-5);
  border-left: 2px solid var(--border);
}

/* ── Rich text editor (blog Content) ── */
.rte {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-panel);
}

.rte:focus-within {
  border-color: var(--accent);
}

.rte-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

.rte-toolbar button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.rte-toolbar button:hover:not(:disabled) {
  background: var(--surface-panel);
  color: var(--text-primary);
}

.rte-toolbar button.active {
  background: var(--accent-subtle);
  border-color: var(--accent-subtle-border);
  color: var(--accent);
}

.rte-toolbar button:disabled {
  opacity: 0.5;
}

.rte-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--space-2);
}

.rte-content {
  padding: var(--space-6) var(--space-7);
  font-size: 13px;
  line-height: 1.6;
  min-height: 220px;
  max-height: 480px;
  overflow-y: auto;
}

.rte-content .ProseMirror {
  outline: none;
}

.rte-content p {
  margin: 0 0 var(--space-5);
}

.rte-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin: var(--space-7) 0 var(--space-4);
}

.rte-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin: var(--space-6) 0 var(--space-3);
}

.rte-content ul,
.rte-content ol {
  margin: 0 0 var(--space-5);
  padding-left: 22px;
}

.rte-content blockquote {
  margin: 0 0 var(--space-5);
  padding-left: var(--space-6);
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

.rte-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

.rte-content a {
  color: var(--accent);
}

/* Nested object rendered as its own sub-card (top-level object fields inside
   a section body, e.g. Top Fold Panels -> Left / Right) instead of cascading
   indentation, so deep nesting stays readable. */
.field-row.is-nested-object {
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.field-row.is-nested-object > label {
  padding-top: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subcard {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--space-5);
  padding: var(--space-6) var(--space-7);
}

.subcard .field-row {
  grid-template-columns: 100px 1fr;
}

.subcard .field-row:last-child {
  margin-bottom: 0;
}

.array-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.array-item {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--space-5);
  padding: var(--space-5);
}

.array-item-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 13px;
  color: var(--text-primary);
  padding-top: var(--space-2);
}

/* Custom checkbox: hide the native box, draw a rounded one that follows the
   accent color instead of the browser's default flat square. */
.toggle input[type='checkbox'] {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  background: var(--surface-panel);
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, border-color 150ms ease;
}

.toggle input[type='checkbox']:hover {
  border-color: var(--accent);
}

.toggle input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input[type='checkbox']:checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.toggle input[type='checkbox']:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.toggle input:not([type='checkbox']) {
  margin: 0;
  width: auto;
}

.field-inline {
  display: flex;
  gap: var(--space-9);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

/* ── Images ── */
.img-field {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}

.img-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-panel);
}

.img-field-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.img-field-controls {
  display: flex;
  gap: var(--space-4);
}

.img-field-controls input {
  margin: 0;
}

.img-field-alt {
  width: 100%;
}

.images-editor {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
}

.upload-hint {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--text-muted);
}

.image-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 104px;
}

/* Running order badge: the number is the image's position in the gallery. */
.image-chip-order {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.image-chip-actions .btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.image-chip img {
  width: 104px;
  height: 78px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-panel);
}

.image-chip-alt {
  width: 104px;
  font-size: 11px;
  padding: var(--space-2) var(--space-3);
}

.image-chip-actions {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  gap: 3px;
}

.image-chip-actions .btn-icon {
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ── Key-value (specs) editor ── */
.kv-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.kv-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: var(--space-4);
  align-items: center;
}

.kv-row input {
  margin: 0;
}

/* Row-delete icon buttons (kv-editor, array-item-bar): small circular
   ghost buttons instead of the default square-bordered .btn-icon, so a
   delete action reads as a subtle inline control, not another form field. */
.kv-row .btn-icon,
.array-item-bar .btn-icon {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
}

.kv-row .btn-icon:hover,
.array-item-bar .btn-icon:hover {
  background: var(--danger-subtle);
  color: var(--danger-text);
}

/* "Add" affordances (add spec / add item / upload image / choose from
   media / add first variant): a dashed tile that reads as "add something
   here", not a bordered button stretched to the input's full width. Applied
   directly via .btn-add so it works regardless of which container the
   button sits in. */
.btn-add {
  align-self: flex-start;
  padding: var(--space-5) var(--space-7);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-add:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent);
}

.images-editor {
  align-items: flex-start;
}

/* ── Drawer (product/blog form) ── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 92vw);
  height: 100vh;
  background: var(--surface-panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

/* Backdrop + slide transition, opt-in via the <Drawer> component. Plain
   .drawer usages (ProductsManager, BlogManager, CareersManager) keep the
   instant mount they've always had; only is-open/is-closing states animate. */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: 49;
  opacity: 0;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.drawer-backdrop.is-closing {
  opacity: 0;
}

.drawer.is-open,
.drawer.is-closing {
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-8) var(--space-9);
  border-bottom: 1px solid var(--border);
}

.drawer-head h3 {
  font: var(--text-md);
}

.drawer .form-grid {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8) var(--space-9);
}

.drawer .error {
  margin: var(--space-6) var(--space-9) 0;
}

.drawer-foot {
  padding: var(--space-7) var(--space-9);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-5);
}

/* ── Drawer field redesign (scoped to .drawer so search bars, toolbars, and
   table filters elsewhere in the app keep their existing look) ── */
.drawer .form-grid input:not([type='checkbox']),
.drawer .form-grid select,
.drawer .form-grid textarea {
  width: 100%;
  margin: 0;
  padding: var(--space-6) var(--space-7);
  background: var(--surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.drawer .form-grid input:not([type='checkbox']):hover,
.drawer .form-grid select:hover,
.drawer .form-grid textarea:hover {
  border-color: var(--border);
}

.drawer .form-grid input:not([type='checkbox']):focus,
.drawer .form-grid select:focus,
.drawer .form-grid textarea:focus {
  background: var(--surface-panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.drawer .form-grid select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-6) center;
  padding-right: var(--space-12);
}

.drawer .form-grid label {
  font: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.drawer .field-row > label {
  padding-top: var(--space-6);
}

.drawer .field-inline {
  row-gap: var(--space-7);
  column-gap: var(--space-8);
  padding: var(--space-7);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  align-items: stretch;
}

.drawer .char-count {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-muted);
}

.drawer .char-count-over {
  color: var(--danger-text);
}

.drawer .field-divider {
  margin-top: var(--space-4);
  padding-top: var(--space-7);
  border-top: 1px solid var(--border);
  font: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Checkbox toggles (Featured, Visible…) sit inline with the box centered
   on the label text, and share one row on the left. */
.drawer .field-inline .toggle:has(input[type='checkbox']) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
  padding: 0;
}

/* Value toggles (Category/Author/Date, Order, etc: any label+input pair
   without a checkbox) get their own compact column: uppercase label on
   top, input below, same shape as every other field in the drawer instead
   of an ad hoc inline pair. Grows to fill available row space so several
   of them side by side (Blog's Category/Author/Date/Read time) split the
   row evenly rather than shrink-wrapping to content width. */
.drawer .field-inline .toggle:not(:has(input[type='checkbox'])) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1;
  min-width: 120px;
}

/* A single trailing value-field alongside checkboxes (Order next to
   Featured/Visible) reads better pinned to the row's right edge, sized to
   its content, instead of stretching to fill the remaining space. Opt-in
   via .toggle-trailing so rows of same-kind fields (Blog's Category/
   Author/Date/Read time) keep their even flex: 1 split by default. */
.drawer .field-inline .toggle-trailing {
  flex: 0 0 auto !important;
  margin-left: auto;
}

.drawer .field-inline .toggle > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.drawer .field-inline .toggle input:not([type='checkbox']) {
  padding: var(--space-5) var(--space-6);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.drawer .img-field-controls,
.drawer .kv-row,
.drawer .array-item-bar {
  align-items: center;
}

.drawer .img-field-controls .btn-sm,
.drawer .img-field-controls .btn-icon {
  flex-shrink: 0;
}

.drawer-foot .btn-primary {
  min-width: 140px;
  justify-content: center;
}

/* ── User form (Users manager) ── */
.user-form-section {
  padding-bottom: var(--space-9);
  margin-bottom: var(--space-9);
  border-bottom: 1px solid var(--border);
}

.user-form-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.user-form-section-title {
  font: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-7);
}

.field-row-clean {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.field-row-clean:last-child {
  margin-bottom: 0;
}

.field-row-clean > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-row-clean input {
  margin: 0;
}

/* ── Password input with show/hide toggle ── */
.password-input {
  position: relative;
  width: 100%;
}

.password-input input {
  width: 100%;
  padding-right: 40px;
  margin: 0;
}

.password-input-toggle {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-muted);
  cursor: pointer;
}

.password-input-toggle:hover {
  color: var(--text-primary);
}

.role-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.role-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  padding: var(--space-6) var(--space-7);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.role-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}

.role-card.is-active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent-subtle-border);
}

.role-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.role-card.is-active .role-card-icon {
  background: var(--accent);
  color: #fff;
}

.role-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.role-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.role-card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.role-card-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
}

.status-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding: var(--space-6) var(--space-7);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.status-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-toggle-track {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 21px;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background 150ms ease;
}

.status-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 150ms ease;
}

.status-toggle input:checked + .status-toggle-track {
  background: var(--success);
}

.status-toggle input:checked + .status-toggle-track .status-toggle-thumb {
  transform: translateX(15px);
}

.status-toggle input:focus-visible + .status-toggle-track {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.status-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-toggle-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.status-toggle-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Table extras ── */
.row-dim {
  opacity: 0.45;
}

/* An outline (not four per-cell borders) draws one continuous line around
   the whole <tr>'s bounding box regardless of border-collapse or per-cell
   padding/vertical-align, so it can't end up misaligned with the row the
   way stacking four separate <td> borders could -- offset negative so it
   sits just inside the row instead of overlapping the next row's edge. */
.row-unpublished {
  background: color-mix(in srgb, #eab308 6%, transparent);
  outline: 1px solid #eab308;
  outline-offset: -1px;
  position: relative;
}

.row-just-published {
  background: color-mix(in srgb, #16a34a 10%, transparent);
  outline: 1px solid #16a34a;
  outline-offset: -1px;
  position: relative;
  transition: background 1.6s ease-out, outline-color 1.6s ease-out;
}

/* Card-shaped variants (blog cards, category cards): border applies to the
   card element itself rather than table cells, so the base .row-unpublished/
   .row-just-published outline (meant for plain <tr>s) is switched off here
   to avoid doubling up with the card's own border. */
.blog-card.row-unpublished,
.client-card.row-unpublished {
  outline: none;
  border-color: #eab308;
  background: color-mix(in srgb, #eab308 6%, var(--surface-panel));
}

.blog-card.row-just-published,
.client-card.row-just-published {
  outline: none;
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 10%, var(--surface-panel));
  transition: border-color 1.6s ease-out, background 1.6s ease-out;
}

.category-card.row-unpublished,
.category-sub-chip.row-unpublished,
.category-producttype-chip.row-unpublished {
  outline: none;
  border-color: #eab308;
  background: color-mix(in srgb, #eab308 6%, var(--surface-panel));
}

.category-card.row-just-published,
.category-sub-chip.row-just-published,
.category-producttype-chip.row-just-published {
  outline: none;
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 10%, var(--surface-panel));
  transition: border-color 1.6s ease-out, background 1.6s ease-out;
}

.dept-row.row-unpublished {
  outline: none;
  box-shadow: inset 3px 0 0 #eab308;
  background: color-mix(in srgb, #eab308 6%, transparent);
}

.dept-row.row-just-published {
  outline: none;
  box-shadow: inset 3px 0 0 #16a34a;
  background: color-mix(in srgb, #16a34a 10%, transparent);
  transition: background 1.6s ease-out, box-shadow 1.6s ease-out;
}

.product-grid-card.row-unpublished {
  outline: none;
  border-color: #eab308;
  background: color-mix(in srgb, #eab308 6%, var(--surface-sunken));
}

.product-grid-card.row-just-published {
  outline: none;
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 10%, var(--surface-sunken));
  transition: border-color 1.6s ease-out, background 1.6s ease-out;
}

.badge-unpublished {
  display: inline-block;
  margin-left: var(--space-5);
  padding: 1px var(--space-4);
  border-radius: var(--space-3);
  border: 1px solid var(--accent-subtle-border);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.actions {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.actions .btn-cluster .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.pill.gold {
  border-color: var(--gold-border);
  background: var(--gold-subtle);
  color: var(--gold-text);
}

.pill-ok {
  border-color: var(--success-border);
  background: var(--success-subtle);
  color: var(--success-text);
}

/* ── Blog card grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-8);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.blog-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-sunken);
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-media-empty {
  display: block;
  width: 100%;
  height: 100%;
}

.blog-card-featured {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-8) var(--space-6);
  flex: 1;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--accent);
}

.blog-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.blog-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-foot {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border);
}

/* ── Client card grid ── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-7);
}

.client-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.client-card-logo {
  position: relative;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  cursor: pointer;
}

.client-card-logo img {
  max-width: 78%;
  max-height: 60%;
  object-fit: contain;
}

.client-card-logo-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.client-card-logo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.client-card-logo:hover .client-card-logo-overlay {
  opacity: 1;
}

.client-card-logo-replace-wrap {
  position: absolute;
  top: var(--space-3);
  right: calc(var(--space-3) + 26px);
}

.client-card-logo-replace-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: var(--radius-pill);
  color: #fff;
  cursor: pointer;
}

.client-card-logo-replace-btn:hover {
  background: var(--accent);
}

.client-card-logo-media-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  z-index: 1;
}

.client-card-logo-media-btn:hover {
  background: var(--accent);
}

.client-card-logo-info {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  cursor: help;
}

.client-card-logo-info .info-tooltip {
  color: #fff;
  margin-left: 0;
}

.client-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-7);
  flex: 1;
}

.client-card-alt-input {
  font-size: 12px;
}

.client-card-name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.client-card-name-row input {
  width: 100%;
  margin: 0;
  font-weight: 600;
}

/* ── Industry combobox (search + create new) ── */
.industry-select {
  position: relative;
  width: 100%;
}

.industry-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.industry-select-trigger:hover {
  border-color: var(--accent);
}

.industry-select.is-open .industry-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.industry-select-trigger svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.industry-select-panel {
  z-index: 900;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.industry-select-search {
  width: 100%;
  margin: 0;
  padding: var(--space-5) var(--space-6);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font-size: 13px;
  background: transparent;
}

.industry-select-search:focus {
  outline: none;
  box-shadow: none;
}

.industry-select-list {
  max-height: 220px;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.industry-select-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.industry-select-option:hover {
  background: var(--surface-sunken);
}

.industry-select-option svg {
  flex-shrink: 0;
  color: var(--accent);
}

.industry-select-option.is-selected {
  font-weight: 600;
  color: var(--accent);
}

.industry-select-option.is-selected svg {
  color: var(--accent);
}

.industry-select-create {
  color: var(--accent);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
  padding-top: var(--space-5);
}

.industry-select-create svg {
  color: var(--accent);
}

.industry-select-empty {
  padding: var(--space-6) var(--space-5);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.client-card-foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
}

td input,
td select {
  margin: 0;
  padding: 7px var(--space-5);
  font-size: 13px;
}

a.card {
  display: block;
}

a.card:hover {
  border-color: var(--accent);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  max-width: 1280px;
}

.settings-list .section-card {
  align-self: stretch;
  width: 100%;
}

.settings-list details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: var(--space-4) 0;
}

.settings-list details .section-card {
  margin-top: var(--space-6);
}

/* ── Segmented toggle (Pages editor mode switch) ── */
.seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: var(--space-1);
}

.seg button {
  width: auto;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-pill);
  padding: 7px var(--space-7);
  font-size: 13px;
  font-weight: 600;
}

.seg button:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.seg button.active,
.seg button.active:hover {
  background: var(--accent);
  color: var(--text-on-accent);
}

.inline-hint {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-subtle-border);
  border-radius: var(--space-6);
  padding: var(--space-6) var(--space-8);
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--space-8);
}

.customizer.inline-only {
  grid-template-columns: 1fr;
}

/* ── Modal (confirm / small forms) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-9);
}

.modal-card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--space-8);
  padding: 26px var(--space-10);
  width: 100%;
  max-width: 440px;
}

.modal-card h3 {
  font: var(--text-lg);
  margin-bottom: var(--space-5);
}

/* ── Asset picker (media/document picker modal) ── */
.asset-picker {
  max-width: 720px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.asset-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.asset-picker-head h3 {
  margin-bottom: 0;
}

.asset-picker-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
}

.asset-picker-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.asset-picker-search input {
  flex: 1;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  font-size: 13px;
}

.asset-picker-search input:focus {
  outline: none;
}

.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--space-5);
  overflow-y: auto;
  padding-right: var(--space-2);
}

.asset-picker-item-wrap {
  position: relative;
}

.asset-picker-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-sunken);
}

.asset-picker-item:hover {
  border-color: var(--accent);
}

.asset-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-picker-item-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.asset-picker-item:hover .asset-picker-item-check {
  opacity: 1;
}

.asset-picker-item-replace {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: var(--radius-pill);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.asset-picker-item-wrap:hover .asset-picker-item-replace {
  opacity: 1;
}

.asset-picker-item-replace:hover {
  background: var(--accent);
}

.asset-picker-item-error {
  display: block;
  font-size: 11px;
  margin-top: var(--space-2);
}

.asset-picker-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
}

.asset-picker-doc-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-7);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
}

.asset-picker-doc-row:hover {
  border-color: var(--accent);
  background: var(--surface-sunken);
}

.asset-picker-doc-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-card p {
  margin-bottom: var(--space-8);
  font-size: 13px;
  line-height: 1.5;
}

.modal-card select {
  width: 100%;
  margin-bottom: var(--space-4);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

/* ── Confirm dialog ── */
.confirm-card {
  text-align: center;
}

.confirm-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
}

.confirm-icon-danger {
  background: color-mix(in srgb, #dc2626 14%, transparent);
  color: #dc2626;
}

.confirm-card p {
  margin-bottom: 0;
}

.confirm-card .modal-actions {
  justify-content: center;
}

/* ── Toasts ── */

.toast-stack {
  position: fixed;
  /* Clears the sticky topbar (space-6 padding top+bottom around a ~36px
     button row, plus its 1px border) with space-6 of breathing room below it. */
  top: calc(var(--space-6) * 2 + 37px + var(--space-6));
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  max-width: 360px;
  pointer-events: auto;
  animation: toast-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.toast-leaving {
  animation: toast-out 0.18s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .toast-item {
    animation: none;
  }

  .toast-item.toast-leaving {
    animation: none;
    opacity: 0;
  }
}

.toast-success {
  border-color: var(--success-border);
  color: var(--success-text);
}

.toast-success svg {
  color: var(--success);
  flex-shrink: 0;
}

.toast-error {
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.toast-error svg {
  color: var(--danger);
  flex-shrink: 0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
}

/* ── Careers layout ── */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-3);
}

.icon-picker-item {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  padding: 0;
  cursor: pointer;
}

.icon-picker-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-picker-item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

/* ── Careers ── */
.careers-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-9);
}

.careers-head p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: var(--space-1);
}

.careers-layout {
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: var(--space-9);
  align-items: start;
}

.dept-panel {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  position: sticky;
  top: 0;
}

.dept-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-6) var(--space-5);
}

.dept-panel-head h3 {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}

.dept-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-3);
}

.dept-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 9px var(--space-5);
  border-radius: 9px;
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid transparent;
}

.dept-row:hover {
  background: var(--surface-sunken);
}

.dept-row.active {
  background: var(--accent-subtle);
  border-color: var(--accent-subtle-border);
}

.dept-row.active .dept-name {
  color: var(--accent);
  font-weight: 600;
}

.dept-icon {
  width: 16px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.dept-row.active .dept-icon {
  color: var(--accent);
}

.dept-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-row .pill {
  flex-shrink: 0;
}

.dept-row-actions {
  display: none;
  flex-shrink: 0;
  gap: var(--space-2);
}

.dept-row:hover .dept-row-actions {
  display: flex;
}

.dept-row:hover .pill {
  display: none;
}

.dept-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) var(--space-5);
}

.dept-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--space-4) var(--space-6) var(--space-6);
}

/* ── Product category tree (Products tab sidebar) ──
   Reuses .dept-row/.dept-name/.dept-icon and .category-card-toggle so it
   reads as the same nav-list pattern as the Careers department sidebar,
   with per-row indentation and an expand toggle added for tree depth. */
.category-tree {
  max-height: 640px;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.category-tree-children {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.jobs-panel {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
}

.jobs-panel table {
  min-width: 760px;
}

.jobs-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  margin-bottom: var(--space-8);
}

.jobs-toolbar h3 {
  font: var(--text-md);
  font-weight: 700;
}

.jobs-toolbar .muted {
  font-size: 13px;
}

.job-title-cell {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: 600;
}

.pill.hot {
  border-color: var(--warning-border);
  background: var(--warning-subtle);
  color: var(--warning-text);
  font-weight: 600;
  gap: 3px;
  display: inline-flex;
  align-items: center;
}

.jobs-empty {
  text-align: center;
  padding: var(--space-13) var(--space-8);
  color: var(--text-muted);
}

/* ── Sub-navigation tabs (Products / Categories) ── */
.subnav-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-9);
  border-bottom: 1px solid var(--border);
}

.subnav-tabs button {
  padding: var(--space-5) var(--space-8);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.subnav-tabs button:hover {
  color: var(--text-primary);
}

.subnav-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Category picker (cascading selects inside the product form) ── */
.category-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.category-picker-row select {
  width: 100%;
}

.category-picker-new {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.category-picker-new input {
  flex: 1;
}

/* ── Category management grid ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-7);
  align-items: start;
}

.category-card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.category-card-open {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .category-card-open {
    grid-column: span 1;
  }
}

.category-card-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-7) var(--space-8);
  cursor: pointer;
}

.category-card-head:hover {
  background: var(--surface-sunken);
}

.category-card-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.category-card-toggle {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.category-card-toggle-hidden {
  visibility: hidden;
}

.category-card-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-left: 24px;
}

.category-card-pills {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.category-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.category-card-subs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
  padding: var(--space-3) var(--space-8) var(--space-8);
  background: var(--surface-sunken);
  border-top: 1px solid var(--border);
}

.category-sub-chip {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.category-sub-chip-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.category-producttype-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-left: var(--space-6);
  padding-left: var(--space-5);
  border-left: 2px solid var(--border);
}

.category-producttype-chip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.category-sub-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-sub-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.category-card-empty-note {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--space-4) 0;
}

.category-card-empty-state {
  opacity: 0.6;
}

.category-card-empty-state:hover {
  opacity: 1;
}

.cat-summary {
  font-size: 13px;
}

.pill-accent {
  border-color: var(--accent-subtle-border);
  background: var(--accent-subtle);
  color: var(--accent);
}

.btn-cluster {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.btn-cluster .btn-icon,
.btn-cluster .btn-sm {
  border: none;
  border-radius: 0;
}

.btn-cluster > *:not(:last-child) {
  border-right: 1px solid var(--border);
}

/* ── Product list grouped by category → subcategory ── */
.product-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
}

.view-mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-mode-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-panel);
  color: var(--text-muted);
  cursor: pointer;
}

.view-mode-toggle button + button {
  border-left: 1px solid var(--border);
}

.view-mode-toggle button:hover {
  color: var(--text-primary);
}

.view-mode-toggle button.active {
  background: var(--accent);
  color: white;
}

.product-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.product-grid-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.product-grid-card-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-panel);
  color: var(--text-muted);
}

.product-grid-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-grid-card-body {
  padding: var(--space-4) var(--space-5);
  flex: 1;
}

.product-grid-card-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.product-grid-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.product-grid-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

.product-subgroup-label {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* Distinct from .apps-detail-panel's own background (both would
   otherwise be --surface-panel and the table would visually vanish
   into the panel behind it, leaving only bare row-separator lines). */
.product-subgroup table {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
}

.product-subgroup table th,
.product-subgroup table td {
  padding: var(--space-4) var(--space-6);
}

.col-thumb {
  width: 52px;
}

.col-thumb img,
.col-thumb .col-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.col-thumb-empty {
  display: block;
  background: var(--border);
}

.col-name {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: 500;
}

.col-status {
  width: 110px;
}

.col-actions {
  width: 1%;
  white-space: nowrap;
}

.products-placeholder {
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  color: var(--text-muted);
  text-align: center;
}

.products-placeholder p {
  font-size: 14px;
  max-width: 240px;
}

/* ── Applications: list + detail split ── */
.apps-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--space-9);
  align-items: start;
}

.apps-list-panel {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 0;
}

.apps-filters {
  padding: var(--space-7);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* .search already carries the sunken-fill look globally; the filter
   <select>s get the same treatment here since plain <select> elsewhere
   isn't restyled by default. */
.apps-filter-row select {
  background: var(--surface-sunken);
  border: 1px solid transparent;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.apps-filter-row select:hover {
  border-color: var(--border);
}

.apps-filter-row select:focus {
  background: var(--surface-panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}

.apps-filters .search {
  width: 100%;
}

.apps-filter-row {
  display: flex;
  gap: var(--space-4);
}

.apps-filter-row select {
  flex: 1;
  min-width: 0;
  padding: var(--space-4) var(--space-11) var(--space-4) var(--space-5);
  font-size: 13px;
  border-radius: var(--radius-md);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-5) center;
}

.apps-filters .muted.small {
  padding-left: var(--space-2);
  font-weight: 600;
}

.apps-list {
  max-height: 640px;
  overflow-y: auto;
}

.apps-list-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: var(--space-6) var(--space-7);
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease;
}

/* Contacts' rows additionally carry a leading .apps-list-icon, so lay out
   as icon + body side by side instead of the plain top-to-bottom stack
   Careers' Applications rows use. */
.apps-list-row:has(.apps-list-icon) {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-6);
}

.apps-list-row:last-child {
  border-bottom: none;
}

.apps-list-row:hover {
  background: var(--surface-sunken);
}

.apps-list-row.active {
  background: var(--accent-subtle);
}

.apps-list-row-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.apps-list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.apps-list-row.active .apps-list-icon {
  background: var(--surface-panel);
}

/* One muted accent tint per submission type, echoed by .apps-detail-icon
   in the detail header so the two views read as the same record. */
.apps-list-icon-contact { color: var(--accent); background: var(--accent-subtle); }
.apps-list-icon-product_inquiry { color: var(--gold-text); background: var(--gold-subtle); }
.apps-list-icon-rfq { color: var(--success-text); background: var(--success-subtle); }
.apps-list-icon-cart_inquiry { color: var(--warning-text); background: var(--warning-subtle); }

.apps-detail-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.apps-detail-head-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
}

.apps-list-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.apps-list-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.status-dot-new {
  background: var(--accent);
}

.status-dot-reviewed {
  background: var(--success);
}

.status-dot-rejected {
  background: var(--warning);
}

/* Contact submission statuses reuse the .status-dot base but their own
   color mapping (REVIEWED reads as "in progress" here, not "done" as it
   does for applications, so it is not the same color as .status-dot-reviewed). */
.status-dot-contact-new {
  background: var(--accent);
}

.status-dot-contact-reviewed {
  background: var(--warning);
}

.status-dot-contact-resolved {
  background: var(--success);
}

.apps-detail-panel {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  min-height: 300px;
}

.apps-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-9);
}

.apps-detail-head h3 {
  margin: 0 0 var(--space-2);
}

/* Status select in the detail header: tinted to match the status it holds
   (same palette as .status-dot-contact-*) instead of a neutral dropdown,
   so the current state is legible at a glance, not just on hover-open. */
.status-select {
  padding: var(--space-4) var(--space-11) var(--space-4) var(--space-6);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right var(--space-5) center;
  cursor: pointer;
  flex-shrink: 0;
}

.status-select-contact-new {
  background-color: var(--accent-subtle);
  color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23146ef5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.status-select-contact-reviewed {
  background-color: var(--warning-subtle);
  color: var(--warning-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b3590c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.status-select-contact-resolved {
  background-color: var(--success-subtle);
  color: var(--success-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23178a4c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.apps-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-9);
  padding-bottom: var(--space-9);
  border-bottom: 1px solid var(--border);
}

.apps-detail-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.apps-detail-inline-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.apps-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-13) var(--space-8);
  color: var(--text-muted);
  text-align: center;
}

.apps-empty-state p {
  font-size: 13px;
  max-width: 220px;
}

.apps-empty-state-panel {
  min-height: 260px;
}

/* Each block below the top info grid (products, message) is its own
   section with consistent top spacing and a divider, so the detail panel
   reads as a clear stack instead of loose, ambiguously-related pieces. */
.apps-detail-section {
  padding-top: var(--space-9);
  margin-top: var(--space-9);
  border-top: 1px solid var(--border);
}

.apps-detail-section:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.apps-motivation {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
  color: var(--text-secondary);
}

.cart-inquiry-products {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
}

.cart-inquiry-product-row {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cart-inquiry-product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-inquiry-product-thumb-empty {
  background: var(--surface-panel);
}

.cart-inquiry-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-inquiry-product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-inquiry-product-variants {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cart-inquiry-product-qty {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-5);
  flex-shrink: 0;
}

.apps-detail-foot {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

/* ── Analytics: charts ── */
.chart-card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-9);
  margin-bottom: var(--space-9);
}

.chart-card h3 {
  margin: 0 0 var(--space-8);
  font-size: 14px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-9);
}

.chart-grid .chart-card {
  margin-bottom: 0;
}

.chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-gridline {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis-label {
  font-size: 11px;
  fill: var(--text-muted);
}

.chart-bar-label {
  font-size: 12px;
  fill: var(--text-primary);
}

.chart-value-label {
  font-size: 12px;
  font-weight: 600;
  fill: var(--text-primary);
}

.chart-legend {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ── Theme toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: var(--space-4);
  width: 100%;
  margin-bottom: var(--space-2);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: transparent;
  border-color: var(--text-muted);
}

@media (max-width: 860px) {
  .careers-layout {
    grid-template-columns: 1fr;
  }

  .dept-panel {
    position: static;
  }

  .apps-layout {
    grid-template-columns: 1fr;
  }

  .apps-list-panel {
    position: static;
  }
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-2);
  color: var(--text-muted);
  cursor: help;
}

.info-tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: none;
  width: max-content;
  /* Not min(240px, calc(...)): some CSS minifiers strip the inner calc()
     wrapper from a min()/max() argument, silently breaking the whole
     declaration. A single calc() has no such issue. This still caps the
     bubble at the viewport edge; it just won't also cap at 240px on very
     wide screens, which the short copy here never approaches anyway. */
  max-width: calc(100vw - 48px);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  overflow-wrap: break-word;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 20;
}

.info-tooltip:hover .info-tooltip-bubble,
.info-tooltip:focus .info-tooltip-bubble,
.info-tooltip:focus-visible .info-tooltip-bubble {
  opacity: 1;
  visibility: visible;
}

/* ── Media Library ── */
.media-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-8);
  align-items: start;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-6);
  min-height: 200px;
}

.media-tile {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: left;
}

.media-tile:hover {
  border-color: var(--accent);
}

.media-tile-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.media-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-sunken);
  display: block;
}

.media-tile-name {
  padding: var(--space-4) var(--space-5);
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: var(--space-13) var(--space-8);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.media-detail {
  position: sticky;
  top: 0;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.media-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.media-detail-head h3 {
  font-size: 14px;
  font-weight: 700;
}

.media-detail-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-7);
}

.media-detail-replace-row {
  display: flex;
  margin-bottom: var(--space-7);
}

.media-detail-foot {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.media-url-row {
  display: flex;
  gap: var(--space-4);
}

.media-url-row input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .media-layout {
    grid-template-columns: 1fr;
  }
  .media-detail {
    position: static;
  }
}

/* Inputs nested inside sunken cards (variants, sub-cards) otherwise share
   the card's own grey background with a transparent border and disappear. */
.drawer .array-item input:not([type='checkbox']),
.drawer .array-item textarea,
.drawer .subcard input:not([type='checkbox']),
.drawer .subcard textarea,
.array-item input:not([type='checkbox']),
.array-item textarea,
.subcard input:not([type='checkbox']),
.subcard textarea {
  background: var(--surface-panel);
  border: 1px solid var(--border-strong);
}

.array-item input:not([type='checkbox']):focus,
.array-item textarea:focus,
.subcard input:not([type='checkbox']):focus,
.subcard textarea:focus {
  border-color: var(--accent);
}

.variants-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.variants-subhead {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kv-row.variants-col-row {
  grid-template-columns: 1fr auto;
}

.variants-col-row .field-error {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--danger, #d92d20);
}
