/* ================================================================
   3C Product Console — app.css
   Desktop-first, dark theme, mobile-supported
   ================================================================ */

/* ── 0. Custom properties ─────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-base:        #0f0f0f;
  --bg-surface:     #1a1a1a;
  --bg-raised:      #242424;
  --bg-input:       #1e1e1e;
  --bg-hover:       #2a2a2a;

  /* Borders */
  --border:         #2e2e2e;
  --border-subtle:  #222222;
  --border-focus:   #b59a3b;

  /* Text */
  --text-primary:   #e8e8e8;
  --text-muted:     #888888;
  --text-dim:       #555555;
  --text-inverse:   #0f0f0f;

  /* Accent — amber (#b59a3b family) */
  --accent:         #b59a3b;
  --accent-hover:   #cfbe6e;
  --accent-rgb:     181, 154, 59;
  --accent-dim:     rgba(var(--accent-rgb), 0.12);
  --accent-ring:    rgba(var(--accent-rgb), 0.30);

  /* Semantic colors */
  --red:            #e05252;
  --red-dim:        rgba(224, 82, 82, 0.12);
  --green:          #52c07a;
  --green-dim:      rgba(82, 192, 122, 0.12);
  --blue:           #5296e0;
  --blue-dim:       rgba(82, 150, 224, 0.12);
  --amber:          #b59a3b;
  --amber-dim:      rgba(var(--accent-rgb), 0.12);

  /* Layout */
  --sidebar-width:   240px;
  --header-height:   56px;
  --content-max-w:   960px;

  /* Spacing scale */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;

  /* Radius */
  --radius-sm:   4px;
  --radius:      6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 2px 8px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.65);

  /* App shell — horizontal brand gradient (~30% darker than original stops) */
  --app-gradient-c1: rgba(22, 32, 54, 1);
  --app-gradient-c2: rgba(var(--accent-rgb), 1);
  --app-gradient-c3: rgba(41, 29, 4, 1);
  --app-gradient-fallback: #162036;
  --app-gradient: linear-gradient(
    90deg,
    var(--app-gradient-c1) 0%,
    var(--app-gradient-c2) 50%,
    var(--app-gradient-c3) 100%
  );

  /* Transitions */
  --t:      150ms ease;
  --t-slow: 250ms ease;

  /* Spacing aliases — --space-N maps to --sp-N */
  --space-1:  var(--sp-1);
  --space-2:  var(--sp-2);
  --space-3:  var(--sp-3);
  --space-4:  var(--sp-4);
  --space-5:  var(--sp-5);
  --space-6:  var(--sp-6);
  --space-8:  var(--sp-8);
  --space-10: var(--sp-10);
  --space-12: var(--sp-12);
}

/* ── 1. Reset + base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  height: 100%;
  color-scheme: dark;
  background-color: var(--bg-base);
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100dvh;
  /* Solid fallback, then prefixed gradients, then standard */
  background: var(--app-gradient-fallback);
  background: -webkit-linear-gradient(90deg, var(--app-gradient-c1) 0%, var(--app-gradient-c2) 50%, var(--app-gradient-c3) 100%);
  background: -moz-linear-gradient(90deg, var(--app-gradient-c1) 0%, var(--app-gradient-c2) 50%, var(--app-gradient-c3) 100%);
  background: var(--app-gradient);
}

a             { color: var(--accent); text-decoration: none; }
a:hover       { color: var(--accent-hover); }
button        { cursor: pointer; font-family: inherit; }
ul, ol        { list-style: none; }
img           { display: block; max-width: 100%; }
input,
select,
textarea      { font-family: inherit; }

/* ── 2. App shell layout ─────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100dvh;
}

/* ── 3. Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: transform var(--t-slow);
  overflow: hidden;
}

.sidebar__header {
  min-height: var(--header-height);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-primary);
  text-decoration: none;
  width: 100%;
  min-width: 0;
}
.sidebar__brand:hover { color: var(--text-primary); }

.sidebar__brand-logo {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 46px;
  object-fit: contain;
  object-position: center center;
  margin-inline: auto;
}

.brand-mark {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
  display: block;
}

.sidebar__brand .brand-version {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

/* Navigation */
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-3) 0 var(--sp-4);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-group {
  margin-bottom: var(--sp-2);
}

.nav-group__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: var(--sp-4) var(--sp-5) var(--sp-1);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 var(--sp-3);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--t), color var(--t), border-color var(--t);
  text-decoration: none;
  border-left: 2px solid transparent;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.nav-link--active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-link--active:hover { color: var(--accent); }

.nav-link--disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--bg-raised);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

/* Sidebar accordion (disclosure pattern; single-open behavior in app.js) */
.sidebar__nav--accordion {
  padding-top: var(--sp-2);
}

.nav-dashboard {
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.nav-list--root {
  padding: 0 var(--sp-3);
}

.nav-accordion {
  display: flex;
  flex-direction: column;
}

.nav-accordion__item {
  border-top: 1px solid var(--border);
}

.nav-accordion__item:first-child {
  border-top: none;
}

.nav-accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  text-align: left;
  transition: background var(--t), color var(--t);
}

.nav-accordion__trigger:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.nav-accordion__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

.nav-accordion__item.is-open > .nav-accordion__trigger {
  color: var(--text-muted);
}

.nav-accordion__chevron {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.nav-accordion__item.is-open .nav-accordion__chevron {
  transform: rotate(180deg);
}

.nav-accordion__panel {
  padding: 0 0 var(--sp-2);
}

.nav-list--nested {
  padding: 0 var(--sp-3) 0 var(--sp-2);
  margin-left: var(--sp-2);
  border-left: 1px solid var(--border);
}

.nav-list--nested .nav-link {
  padding-left: var(--sp-4);
}

/* Sidebar footer */
.sidebar__footer {
  padding: var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  border-radius: var(--radius);
  padding: var(--sp-1);
  margin: calc(-1 * var(--sp-1));
  transition: background var(--t);
}
.user-info:hover { background: var(--bg-raised); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color var(--t), background var(--t);
  text-decoration: none;
}
.btn-logout:hover {
  color: var(--red);
  background: var(--red-dim);
}

/* ── 4. Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}

/* ── 5. Page header ──────────────────────────────────────────── */
.page-header {
  height: var(--header-height);
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header__left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.page-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-header__right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-header__mark-menu {
  position: relative;
  flex-shrink: 0;
}

/* Bridge hover gap between trigger and dropdown (dropdown is position:absolute). */
.page-header__mark-menu::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.page-header__mark-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: inherit;
}

.page-header__mark-trigger:hover .page-header__mark,
.page-header__mark-trigger:focus-visible .page-header__mark {
  opacity: 1;
}

.page-header__mark-trigger:focus-visible {
  outline: 2px solid var(--accent, currentColor);
  outline-offset: 2px;
}

.page-header__mark-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 9rem;
  padding: var(--sp-1) 0;
  margin: 0;
  list-style: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}

.page-header__mark-menu:hover .page-header__mark-dropdown,
.page-header__mark-menu.is-open .page-header__mark-dropdown,
.page-header__mark-menu:focus-within .page-header__mark-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.page-header__mark-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
}

.page-header__mark-dropdown__text {
  display: inline-flex;
  align-items: center;
  line-height: inherit;
}

.page-header__mark-dropdown__icon {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  display: block;
  margin: 0;
}

.page-header__mark-dropdown__item:hover,
.page-header__mark-dropdown__item:focus-visible {
  background: var(--bg-raised);
  color: var(--text-primary);
  outline: none;
}

.page-header__mark {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.95;
}

@media (max-width: 480px) {
  .page-header__mark {
    width: 32px;
    height: 32px;
  }
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.mobile-nav-toggle:hover { color: var(--text-primary); background: var(--bg-raised); }

/* Page body */
.page-body {
  flex: 1;
  padding: var(--sp-6);
}

/* ── 6. Login page ───────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--app-gradient-fallback);
  background: -webkit-linear-gradient(90deg, var(--app-gradient-c1) 0%, var(--app-gradient-c2) 50%, var(--app-gradient-c3) 100%);
  background: -moz-linear-gradient(90deg, var(--app-gradient-c1) 0%, var(--app-gradient-c2) 50%, var(--app-gradient-c3) 100%);
  background: var(--app-gradient);
  padding: var(--sp-6);
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  text-align: center;
}

.login-brand__logo {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 56px;
  object-fit: contain;
}

.login-brand .brand-mark  { font-size: var(--text-xl); }
.login-brand .brand-label { font-size: var(--text-base); font-weight: 500; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.login-footer {
  margin-top: var(--sp-5);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-dim);
}
.login-footer a { color: var(--text-muted); }
.login-footer a:hover { color: var(--accent); }

/* ── 7. Cards + panels ───────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  box-shadow: var(--shadow);
}

.card + .card { margin-top: var(--sp-5); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--sp-4);
}

.card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-top: 2px;
}

.card__actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* Stub / roadmap pages (customers, orders) — tiles match link-tile / vendor-card */
.stub-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10, 4rem) var(--sp-6);
  gap: var(--sp-5);
}

.stub-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.stub-hero h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.stub-hero p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  max-width: 440px;
  margin: 0;
  line-height: 1.6;
}

.stub-tile-grid,
.stub-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-2);
  width: 100%;
  max-width: 720px;
}

.stub-tile,
.stub-feature {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  text-align: left;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.stub-tile:hover,
.stub-feature:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.stub-tile__title,
.stub-feature__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.stub-tile__title svg,
.stub-feature__title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.stub-tile__desc,
.stub-feature__desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.badge--v1 {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  padding: 2px 6px;
}

.badge--v2 {
  background: var(--bg-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── 8. Forms + fields ───────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.field__label--required::after {
  content: ' *';
  color: var(--red);
  font-size: var(--text-xs);
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  padding: 8px var(--sp-3);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.field__input::placeholder,
.field__textarea::placeholder { color: var(--text-dim); }

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field__input:disabled,
.field__select:disabled,
.field__textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.field__textarea {
  resize: vertical;
  min-height: 80px;
}

.field__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.field__error {
  font-size: var(--text-xs);
  color: var(--red);
}

/* Field input group (input + button side by side) */
.field__group {
  display: flex;
  gap: var(--sp-2);
}
.field__group .field__input { flex: 1; }

/* Field grid layouts */
.field-row          { display: grid; gap: var(--sp-5); }
.field-row--2       { grid-template-columns: 1fr 1fr; }
.field-row--3       { grid-template-columns: 1fr 1fr 1fr; }
.field-row--auto    { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ── Form class aliases ───────────────────────────────────────────
   Pages written after the initial build used .form-* naming.
   These alias to the canonical .field__* classes so both work.
   ---------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.form-label--required::after {
  content: ' *';
  color: var(--red);
}

.form-input,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--text-base);
  padding: 9px var(--sp-3);
  transition: border-color var(--t);
}

.form-input::placeholder { color: var(--text-dim); }

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-input:disabled,
.form-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-8);
  appearance: none;
  cursor: pointer;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--red);
}

/* Form section divider */
.form-section {
  margin-bottom: var(--sp-8);
}

.form-section__title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* Toggle / checkbox */
.toggle-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}

.toggle-row__label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.toggle-row__hint {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

/* ── 9. Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-4);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t);
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-inverse);
}

.btn--secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn--ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.45);
}
.btn--ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px rgba(var(--accent-rgb), 0.45);
}

.btn--danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}
.btn--danger:hover {
  background: var(--red);
  color: #fff;
}

.btn--warning {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.btn--warning:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.24);
  color: #b45309;
}

.btn--sm  { padding: 4px var(--sp-3); font-size: var(--text-xs); }
.btn--lg  { padding: 10px var(--sp-6); font-size: var(--text-base); }
.btn--full { width: 100%; }

.btn__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── 10. Alerts ──────────────────────────────────────────────── */
.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  border: 1px solid;
  margin-bottom: var(--sp-5);
  line-height: 1.5;
}

.alert--error   { background: var(--red-dim);   border-color: var(--red);   color: var(--red); }
.alert--success { background: var(--green-dim);  border-color: var(--green); color: var(--green); }
.alert--info    { background: var(--blue-dim);   border-color: var(--blue);  color: var(--blue); }
.alert--warning { background: var(--amber-dim);  border-color: var(--amber); color: var(--amber); }

/* PWA “new version” bar — solid panel so text/button stay readable over the app */
.pwa-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-5);
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.pwa-update-banner__text {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.pwa-update-banner__btn {
  flex-shrink: 0;
}

/* Pull-to-refresh hint (mobile / standalone PWA) — driven by app.js */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 75;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-120%);
  transition: opacity 0.12s ease, color 0.12s ease;
  box-shadow: var(--shadow-sm);
}

.ptr-indicator.ptr-indicator--active {
  opacity: 1;
}

.ptr-indicator.ptr-indicator--ready {
  color: var(--accent);
}

.ptr-indicator__icon {
  display: flex;
  color: inherit;
}

.ptr-indicator__text {
  white-space: nowrap;
}

/* ── 11. Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  cursor: help;
}

.badge--draft     { background: var(--bg-raised); color: var(--text-muted); }
.badge--submitted { background: var(--blue-dim);  color: var(--blue); }
.badge--approved  { background: var(--green-dim); color: var(--green); }
.badge--exported  { background: var(--accent-dim);color: var(--accent); }
.badge--for-sale  { background: var(--green-dim); color: var(--green); }
.badge--nfs       { background: var(--amber-dim); color: var(--amber); }
.badge--sold      { background: var(--bg-raised); color: var(--text-dim); }
.badge--personal  { background: var(--blue-dim);  color: var(--blue); }
.badge--error     { background: var(--red-dim);   color: var(--red); }
.badge--warning   { background: var(--amber-dim); color: var(--amber); }
.badge--success   { background: var(--green-dim); color: var(--green); }
.badge--info      { background: var(--blue-dim);  color: var(--blue); }
.badge--default   { background: var(--bg-raised); color: var(--text-muted); }

/* ── 12. Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  background: var(--bg-raised);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-raised); }

.table .table__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.table .table__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* Icon-only row actions (edit / delete / view) */
.btn--icon {
  min-width: 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn--icon.btn--sm {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
}
.btn-icon__svg {
  display: block;
  pointer-events: none;
}

/* Global delete icon treatment: muted gray by default, keeps hover state */
.btn--icon.btn--danger {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn--icon.btn--danger:hover:not(:disabled) {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}

.modal__footer--spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  width: 100%;
}

.delete-confirm__lead {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin: 0 0 var(--sp-2);
}
.delete-confirm__warn {
  font-size: var(--text-sm);
  color: var(--red, #f87171);
  margin: 0 0 var(--sp-4);
  line-height: 1.45;
}
.delete-confirm__detail {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3);
  background: var(--bg-raised);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.5;
}
.delete-confirm__check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  margin: 0;
  line-height: 1.4;
}
.delete-confirm__check input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* ── 13. Stats grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  transition: border-color var(--t);
}
.stat-card:hover { border-color: var(--border-focus); }

.stat-card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.stat-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card__sub {
  font-size: var(--text-xs);
  color: var(--text-dim);
  margin-top: var(--sp-1);
}

.stat-card--accent .stat-card__value { color: var(--accent); }
.stat-card--green  .stat-card__value { color: var(--green); }
.stat-card--blue   .stat-card__value { color: var(--blue); }

/* ── 14. Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
  gap: var(--sp-4);
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
}

.empty-state__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 340px;
}

/* ── 15. Toast notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 200ms ease forwards;
}

.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--red); }
.toast--info    { border-left: 3px solid var(--blue); }
.toast--warning { border-left: 3px solid var(--amber); }

.toast__text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  flex: 1;
  line-height: 1.5;
}

.toast__close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 1px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--t);
}
.toast__close:hover { color: var(--text-muted); }

.toast--removing {
  animation: toastOut 200ms ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ── 16. Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: fadeIn 150ms ease;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - var(--sp-12));
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease;
}

.modal__header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: var(--text-md);
  font-weight: 600;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
  line-height: 1;
}
.modal__close:hover { color: var(--text-primary); background: var(--bg-raised); }

.modal__body {
  padding: var(--sp-6);
}

.modal__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── 17. Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) 0;
  justify-content: center;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--sp-2);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  text-decoration: none;
}
.page-btn:hover     { background: var(--bg-hover); color: var(--text-primary); }
.page-btn--active   { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.page-btn:disabled,
.page-btn--disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* ── 18. Utilities ───────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.font-mono   { font-family: var(--font-mono); }
.font-bold   { font-weight: 700; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: var(--sp-2); }
.gap-3        { gap: var(--sp-3); }
.gap-4        { gap: var(--sp-4); }
.flex-1       { flex: 1; }
.min-w-0      { min-width: 0; }

.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

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

/* ── Help Center (section → topic → Q&A) ─────────────────────── */
.help-center__body {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.help-center__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.help-center__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.help-center__card:hover {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.help-center__card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.help-center__card-title {
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.help-center__card-count {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.help-center__card-desc {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.help-center__crumb {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.help-center__crumb-link {
  color: var(--accent);
  text-decoration: none;
}

.help-center__crumb-link:hover {
  text-decoration: underline;
}

.help-center__crumb-sep {
  color: var(--text-dim);
  user-select: none;
}

.help-center__crumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.help-center__topics {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.help-center__topic-desc {
  margin: 0 0 var(--sp-3);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 60ch;
}

.help-center__qa-block + .help-center__qa-block {
  margin-top: var(--sp-5);
}

.help-center__group-title {
  margin: 0 0 var(--sp-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.help-center__topic-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.help-center__qa-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.help-center__details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-raised);
}

.help-center__summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
  list-style: none;
}

.help-center__summary::-webkit-details-marker {
  display: none;
}

.help-center__summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid var(--text-dim);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: var(--sp-2);
  vertical-align: middle;
  transition: transform var(--t);
}

.help-center__details[open] .help-center__summary::before {
  transform: rotate(90deg);
}

.help-center__answer {
  margin-top: var(--sp-3);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}

.help-center__answer a {
  color: var(--accent);
}

.help-center__back {
  margin: 0;
}

.help-center__rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.help-center__h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--sp-3);
}

.help-center__lede {
  color: var(--text-secondary);
  margin: 0 0 var(--sp-4);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.help-center__form {
  display: grid;
  gap: var(--sp-4);
  max-width: 600px;
}

.help-center__meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-3) 0 var(--sp-2);
}

.help-center__send-confirmation {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  max-width: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-raised, rgba(255, 255, 255, 0.03));
}

.help-center__send-confirmation-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--sp-2);
}

.help-center__send-confirmation-lede {
  margin: 0 0 var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.help-center__send-confirmation-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.help-center__confirm-line {
  display: grid;
  grid-template-columns: minmax(140px, 34%) 1fr;
  gap: var(--sp-2) var(--sp-4);
  align-items: start;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.help-center__confirm-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.help-center__confirm-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.help-center__confirm-value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 99;
}

/* ── 19. Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.is-visible {
    display: block;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .page-body {
    padding: var(--sp-4);
  }

  .field-row--2,
  .field-row--3 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast-container {
    bottom: var(--sp-4);
    right: var(--sp-4);
    left: var(--sp-4);
  }

  .toast {
    max-width: 100%;
  }

  .modal {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card {
    padding: var(--sp-6);
  }

  .page-header {
    padding: 0 var(--sp-4);
  }
}
