/* Manje Stock & Issue — theme + layout */

:root {
  color-scheme: light dark;
  --font: "Söhne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #ffffff;
  --bg-muted: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --border: #e5e5e5;
  --border-strong: #d9d9d9;
  --text: #0d0d0d;
  --text-secondary: #6e6e80;
  --text-tertiary: #8e8ea0;
  --accent: #10a37f;
  --accent-hover: #0d8a6a;
  --accent-soft: rgba(16, 163, 127, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --overlay: rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --topbar-h: 56px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #212121;
  --bg-muted: #171717;
  --surface: #2f2f2f;
  --surface-2: #383838;
  --border: #424242;
  --border-strong: #565656;
  --text: #ececec;
  --text-secondary: #b4b4b4;
  --text-tertiary: #8e8e8e;
  --accent: #10a37f;
  --accent-hover: #1fb88f;
  --accent-soft: rgba(16, 163, 127, 0.18);
  --danger-soft: rgba(239, 68, 68, 0.18);
  --warn-soft: rgba(245, 158, 11, 0.18);
  --overlay: rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #212121;
    --bg-muted: #171717;
    --surface: #2f2f2f;
    --surface-2: #383838;
    --border: #424242;
    --border-strong: #565656;
    --text: #ececec;
    --text-secondary: #b4b4b4;
    --text-tertiary: #8e8e8e;
    --accent-soft: rgba(16, 163, 127, 0.18);
    --danger-soft: rgba(239, 68, 68, 0.18);
    --warn-soft: rgba(245, 158, 11, 0.18);
    --overlay: rgba(0, 0, 0, 0.65);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { overflow-y: auto; }

body {
  font-family: var(--font);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-app {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: visible;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.topbar-menu-btn {
  flex-shrink: 0;
}

.topbar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  min-width: min(280px, calc(100vw - 24px));
}

.topbar-menu.is-open {
  display: block;
}

.topbar-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.topbar-menu-inner .site-pill {
  align-self: stretch;
  justify-content: center;
  text-align: center;
  margin-bottom: 2px;
}

.topbar-menu-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
}

.topbar-menu-user {
  width: 100%;
  text-align: center;
  margin: 2px 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-sub {
  display: none;
}

.brand-mark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-right: 0;
  white-space: nowrap;
}

.brand-mark-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.brand-mark-btn:hover {
  color: var(--accent);
}

.brand-mark-btn:hover .brand-sub {
  color: color-mix(in srgb, var(--accent) 70%, var(--text-secondary));
}

.brand-mark .brand-sub,
.brand-mark span {
  color: var(--text-secondary);
  font-weight: 500;
}

/* One primary view at a time for Manage / Stock */
body[data-app-view="manage"] #hero_section,
body[data-app-view="stock"] #hero_section,
body[data-app-view="manage"] #home_setup_cue,
body[data-app-view="stock"] #home_setup_cue,
body[data-app-view="manage"] #ppe_due_button_container,
body[data-app-view="stock"] #ppe_due_button_container,
body[data-app-view="manage"] #quick_actions,
body[data-app-view="stock"] #quick_actions {
  display: none !important;
}

body[data-app-view="manage"] #admin.section,
body[data-app-view="stock"] #stockLevels.section {
  margin-top: 12px;
}

.topbar-menu-item.is-route-active,
#add_data_btn.is-route-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.user-pill {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.site-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}

/* Buttons */
button, .btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover, .btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

button:active { transform: scale(0.98); }

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

.btn-primary:hover {
  opacity: 0.9;
  background: var(--text);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover { background: var(--surface-2); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
}

/* Icons */
.icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-content,
.heading-content,
.meta-line,
.due-banner-content,
.info-box-title,
.toast-content,
.due-contact,
.form-msg,
.chip-with-icon,
.due-item-date,
.projected-summary,
.projected-warn,
.no-email-notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-content { gap: 8px; }
.heading-content { gap: 10px; align-items: center; flex-wrap: wrap; }

.meta-line .icon { color: var(--text-tertiary); flex-shrink: 0; }
.meta-line small { line-height: 1.4; }

.chip-with-icon { gap: 4px; margin-left: 0; }

/* Inputs */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder { color: var(--text-tertiary); }

label { color: var(--text-secondary); font-size: 14px; }

a { color: var(--accent); }

/* Hero / landing */
.app-main {
  width: min(920px, 94vw);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(32px, 8vh, 80px) 0 32px;
}

.hero-logo {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.1;
}

.hero-tagline {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-prompt {
  margin: clamp(24px, 4vh, 48px) 0 20px;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 28ch;
  line-height: 1.25;
}

/* ChatGPT-style search composer */
.search-composer {
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.recipient-type-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.recipient-type-row--compact {
  margin-bottom: 4px;
}

.recipient-type-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.recipient-type-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.recipient-lookup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.search-composer input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 8px;
  font-size: 16px;
  box-shadow: none;
  min-width: 0;
}

.search-composer input:focus {
  box-shadow: none;
}

.search-composer .btn-primary {
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  white-space: nowrap;
}

.search-legacy.search {
  display: none;
}

.meta {
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.quick-action-btn {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.quick-action-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--text);
}

.quick-action-btn:active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

/* Due banner */
.due-banner {
  margin-top: 24px;
  padding: 10px 16px 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border));
  background: var(--warn-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.due-banner:hover {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}

.due-banner .icon { color: var(--warn); flex-shrink: 0; }

.due-banner .chip {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.due-banner--clear {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
}

.due-banner--clear .icon { color: var(--accent); }

.due-banner--clear:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

/* Sections */
.section {
  width: min(1100px, 94vw);
  margin: 0 auto 24px;
  display: none;
}

#admin.section,
#stockLevels.section { display: none; }

#admin.section.is-visible,
#stockLevels.section.is-visible { display: block; }

.center {
  min-height: auto;
  display: block;
  padding: 0;
  text-align: initial;
}

.center > h1,
.center > h2 { display: none; }

/* Cards & grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-title { font-weight: 700; font-size: 17px; color: var(--text); }
.card-title-sm { font-size: 15px; font-weight: 650; }
.card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.row { display: flex; justify-content: space-between; align-items: center; }
.qty { display: inline-flex; gap: 8px; align-items: center; }
pre { white-space: pre-wrap; color: var(--text-secondary); }

/* Issue list — receive-style stacked rows */
.issue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.issue-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.issue-row.is-dimmed { opacity: 0.55; }

.issue-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.issue-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.issue-bar {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.issue-bar-copy .meta { margin-top: 4px; }

.issue-bar-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-bar-fields > input {
  width: 100%;
}

.issue-approval-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.issue-approval-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.issue-approval-fields.hidden { display: none !important; }

.issue-return-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.issue-return-fields.hidden { display: none !important; }

.qty--serial {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.qty--serial select {
  min-width: 140px;
  flex: 1;
}

.serial-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.issue-bar-cta {
  width: 100%;
  justify-content: center;
}

.issue-log {
  margin-top: 10px;
  font-size: 12px;
  max-width: 560px;
}

.issue-row .qty {
  flex-shrink: 0;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.issue-row .qty .pill-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.issue-row .qty .pill-btn:hover,
.issue-row .qty .pill-btn:focus-visible {
  background: transparent;
  color: var(--accent, var(--text));
}

.issue-row .qty span {
  min-width: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

@media (max-width: 760px) {
  .issue-bar { max-width: none; }
  .issue-row {
    flex-direction: column;
    align-items: stretch;
  }
  .issue-row .qty { justify-content: flex-end; align-self: flex-end; }
}

.chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  margin-left: 6px;
}

.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, var(--border));
}

.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.meta-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
}

/* PPE due grid */
#ppe_due_list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

#ppe_due_list > .card { padding: 20px; }

@media (max-width: 768px) {
  #ppe_due_list { grid-template-columns: 1fr; }
}

/* Stock table */
.stock-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  table-layout: fixed;
  border: 1px solid var(--border);
}

.stock-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.stock-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

/* Info icon */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
}

.info-icon::before { content: 'i'; }
.info-icon:hover { transform: scale(1.08); }

.info-icon-corner {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  font-size: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Modals — theme-aware overrides */
#info_modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
  background: var(--overlay);
}

#info_modal.is-open { display: flex; }

#info_modal_content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  padding: 28px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  color: var(--text) !important;
  box-shadow: var(--shadow-md) !important;
}

#ppe_due_widget {
  background: var(--overlay) !important;
}

#ppe_due_widget > div {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-md) !important;
}

#info_modal_content h3 { color: var(--text) !important; }
#info_modal_content h4 { color: var(--accent) !important; }
#info_modal_content p,
#info_modal_content li { color: var(--text-secondary) !important; }
#info_modal_content code,
#info_modal_content pre { background: var(--surface-2) !important; color: var(--text) !important; }

.info-example {
  background: var(--accent-soft) !important;
  border-left-color: var(--accent) !important;
  color: var(--text) !important;
}

.topbar--minimal {
  justify-content: flex-end;
}

.topbar--minimal .topbar-app {
  display: none !important;
}

.hero-login {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(320px, 100%);
  margin: 22px auto 0;
  text-align: left;
}

.hero-login input[type="text"],
.hero-login input[type="password"] {
  width: 100%;
  border-radius: var(--radius-sm);
}

.hero-login .login-pass-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.hero-login .login-pass-row input {
  flex: 1;
  min-width: 0;
}

.hero-login .btn-primary {
  width: 100%;
  margin-top: 4px;
  border-radius: var(--radius-pill);
}

.hero-login-forgot {
  align-self: center;
  margin-top: 4px;
}

.hero-login-signup {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
}

.hero-login .form-msg {
  width: 100%;
  margin-top: 2px;
}

.theme-toggle-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-right: 2px;
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    gap: 8px;
  }

  .topbar-brand .brand-sub {
    display: none;
  }

  .topbar--minimal {
    display: flex;
    justify-content: flex-end;
  }

  .theme-toggle-label {
    display: none;
  }

  /* Icon-only green Manage control — hide label, keep the SVG */
  #add_data_btn .btn-label {
    display: none;
  }

  #add_data_btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #add_data_btn .btn-content {
    gap: 0;
  }

  #add_data_btn .icon {
    color: #fff;
  }

  .app-main {
    width: 100%;
    padding: 12px 12px 48px;
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }

  .hero {
    padding: 20px 0 16px;
  }

  .hero-logo {
    font-size: 26px;
  }

  .hero-prompt {
    font-size: 1.35rem;
    margin: 20px 0 16px;
    max-width: none;
    padding: 0 4px;
  }

  .search-composer {
    flex-wrap: wrap;
    border-radius: var(--radius-md);
    padding: 10px;
    width: 100%;
  }

  .recipient-lookup-row {
    flex-wrap: wrap;
  }

  .recipient-lookup-row .btn-primary,
  .search-composer .btn-primary {
    width: 100%;
    min-height: 44px;
  }

  .search-composer input {
    width: 100%;
    font-size: 16px;
  }

  .quick-actions {
    width: 100%;
    padding: 0 4px;
  }

  .quick-action-btn {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }

  .center-block {
    padding: 0 4px;
  }

  .due-banner {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 13px;
  }

  .section {
    width: 100%;
  }

  .manage-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .manage-tabs::-webkit-scrollbar {
    display: none;
  }

  .manage-tab {
    flex-shrink: 0;
  }

  .panel-inner {
    padding: 16px 12px;
    min-height: auto;
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-overlay .panel-inner {
    max-height: 92vh;
    overflow-y: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

/* Utilities */
.hidden { display: none !important; }

.section.is-visible { display: block; }

.link-sm {
  font-size: 12px;
  margin-left: 4px;
}

.login-pass-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.center-block {
  text-align: center;
  margin-bottom: 24px;
}

.meta-spaced { margin-top: 8px; }

/* Toolbar & tabs */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar--loose { margin-bottom: 16px; }

.tab-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn.is-active {
  background: var(--surface-2);
  border-color: var(--border-strong);
  font-weight: 600;
}

/* Forms */
.issue-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.form-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
}

.form-field--checkbox .form-label {
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field--action {
  display: flex;
  align-items: flex-end;
}

.form-field--action .btn-primary,
.form-field--action button {
  width: 100%;
  justify-content: center;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.form-msg {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-msg--ok { color: var(--accent); }
.form-msg--err { color: var(--danger); }

.form-hint {
  font-size: 12px;
  opacity: 0.7;
  margin: 4px 0 0;
}

.form-hint--warn { color: var(--danger); opacity: 1; }
.form-hint--ok { color: var(--accent); opacity: 1; }

.form-field { display: flex; flex-direction: column; }

.input-full { width: 100%; }
.input-flex { flex: 1; min-width: 220px; }
.input-qty { width: 80px; }
.input-narrow { width: 140px; }

.label-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.nested-form {
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.nested-form .input-full + .input-full { margin-top: 6px; }

.history-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

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

/* History tab — timeline + summary stats */
.history-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-summary {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.history-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.history-stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.history-stat-name {
  font-size: 14px;
  color: var(--text);
}

.history-stat-qty {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 4px 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
}

.history-day:first-child { margin-top: 0; }

.history-entry {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.history-entry:last-child { border-bottom: none; }

.history-entry-time {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  padding-top: 2px;
}

.history-entry-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}

.history-entry-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.history-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text);
}

.history-item-chip strong {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.history-issuer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.history-issuer .icon { flex-shrink: 0; }

@media (max-width: 560px) {
  .history-entry { grid-template-columns: 1fr; gap: 6px; }
  .history-issuer { margin-left: 0; width: 100%; }
}

/* Due this week — stats + filters */
.due-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .due-stats { grid-template-columns: repeat(2, 1fr); }
}

.due-stat {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.due-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.due-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.due-stat--danger .due-stat-num { color: var(--danger); }
.due-stat--warn .due-stat-num { color: var(--warn); }

.due-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.due-filter {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.due-filter:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
}

.due-filter.is-active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-weight: 600;
}

.due-info-fold {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.due-info-fold-summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
}

.due-info-fold-summary::-webkit-details-marker { display: none; }

.due-info-fold[open] .due-info-fold-summary {
  border-bottom: 1px solid var(--border);
}

.info-box--compact {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.info-box--compact .info-box-body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.hist-items { margin-top: 6px; }

/* Admin */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-lead {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.manage-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.manage-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.manage-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
}

.manage-tab.is-active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-weight: 600;
}

.manage-panel { display: none; }
.manage-panel.is-active { display: block; }

.manage-panel-intro { margin-bottom: 18px; }

.manage-panel-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
}

.manage-panel-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.manage-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 16px;
  align-items: start;
}

.manage-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
  overflow: hidden;
}

.manage-card--muted { background: var(--surface-2); }

.manage-card--inline { grid-column: 1 / -1; }

.manage-card:has(.issue-history-list),
.manage-card:has(.receipt-history) {
  overflow: visible;
}

.manage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 15px;
}

.manage-textarea {
  width: 100%;
  min-height: 120px;
  margin-bottom: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.form-stack--compact { gap: 10px; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.manage-card input,
.manage-card select,
.manage-card textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.manage-card .form-stack button {
  width: 100%;
}

.form-row-2 > input,
.form-row-2 > select {
  width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

.btn-link-sm {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link-sm:hover { color: var(--accent-hover); }

/* Receive evidence capture */
.evidence-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-md, 12px);
  background: var(--accent-soft);
}

.evidence-field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.evidence-field input[type="file"] {
  width: 100%;
  font-size: 13px;
  color: var(--text-secondary);
}

.evidence-preview {
  font-size: 12px;
  color: var(--accent);
  word-break: break-word;
}

.manage-panel-desc--tight {
  margin: 0 0 10px;
}

.receipt-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.receipt-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--surface);
}

.receipt-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.receipt-qty {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.receipt-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.receipt-ref {
  font-weight: 600;
  color: var(--text);
}

.receipt-ref--muted {
  font-weight: 500;
  color: var(--text-tertiary);
}

.receipt-stock {
  font-variant-numeric: tabular-nums;
}

.receipt-row-actions {
  display: flex;
  gap: 10px;
}

.issue-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.issue-history-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  min-width: min(100%, 260px);
}

.issue-history-filter select {
  min-width: 220px;
}

.issue-history-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* Let the page scroll — nested max-height panes clipped long groups on laptop */
  max-height: none;
  overflow: visible;
  padding-bottom: 24px;
}

.issue-history-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--surface);
  overflow: visible;
}

.issue-history-group-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2, color-mix(in srgb, var(--surface) 88%, var(--text) 6%));
}

.issue-history-manager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.issue-history-group .history-timeline {
  padding: 10px 12px 14px;
  max-height: none;
  overflow: visible;
}

.issue-history-entry {
  align-items: flex-start;
}

.issue-history-emp {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.issue-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.emp-picker-panel {
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
}

.emp-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.emp-picker-list {
  flex: 1;
  overflow-y: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  max-height: 360px;
}

.emp-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.emp-picker-row:last-child { border-bottom: none; }

.emp-picker-row:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

.emp-picker-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.emp-picker-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.emp-picker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.emp-picker-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.section-subtle {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

.onboarding {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

.onboarding-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.onboarding-body {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* First-time setup — catalog → people → receive */
.home-setup-cue {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.home-setup-cue strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.home-setup-cue p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.home-setup-cue .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

.setup-checklist {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.setup-checklist-head .card-title {
  margin: 0;
  font-size: 1.05rem;
}

.setup-checklist-head .meta {
  margin: 6px 0 0;
}

.setup-steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-step {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.setup-step.is-next {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface);
}

.setup-step.is-done {
  opacity: 0.78;
}

.setup-step-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  border-radius: var(--radius-sm);
}

.setup-step-btn:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.setup-step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.setup-step.is-done .setup-step-num {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}

.setup-step.is-next .setup-step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.setup-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setup-step-body strong {
  font-size: 14px;
  color: var(--text);
}

.setup-step-body span {
  font-size: 12px;
  color: var(--text-secondary);
}

.setup-step-status {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-right: 10px;
}

.setup-step.is-done .setup-step-status { color: var(--accent); }
.setup-step.is-next .setup-step-status { color: var(--accent); }

.setup-checklist-foot {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.setup-step-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.manage-layout--single {
  grid-template-columns: minmax(0, 560px);
}

.manage-secondary {
  margin-top: 14px;
}

.bulk-file-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.bulk-file-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.bulk-file-field input[type="file"] {
  width: 100%;
  font-size: 13px;
  color: var(--text-secondary);
}

.bulk-file-name {
  font-size: 12px;
  color: var(--accent);
  word-break: break-word;
}

.manage-secondary code {
  font-size: 12px;
}

.setup-step-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.setup-step-actions .btn-primary,
.setup-step-actions .btn-secondary {
  width: 100%;
  justify-content: center;
}

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

.nested-form > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
}

.nested-form > summary::-webkit-details-marker { display: none; }

.nested-form > summary::after {
  content: ' ▾';
  font-size: 11px;
  opacity: 0.7;
}

.nested-form[open] > summary {
  margin-bottom: 10px;
  color: var(--text);
}

@media (max-width: 640px) {
  .home-setup-cue {
    flex-direction: column;
    align-items: stretch;
  }
  .home-setup-cue .btn-primary { width: 100%; }
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.admin-card { position: relative; }

/* Filters & tables */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-input { min-width: 180px; }
.filter-select { min-width: 140px; }

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

.table-footnote {
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.7;
  text-align: center;
  color: var(--text-secondary);
}

.cell-muted {
  font-size: 13px;
  opacity: 0.9;
}

.cell-strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-num {
  font-size: 13px;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

/* Empty / loading states */
.empty-state,
.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
}

.empty-state--lg {
  padding: 60px;
  grid-column: 1 / -1;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-state--success {
  flex-direction: row;
  gap: 10px;
}

.error-state {
  text-align: center;
  padding: 20px;
  color: var(--danger);
}

/* Chips */
.chip.good,
.chip.success {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.chip-lg {
  font-size: 18px;
  padding: 8px 14px;
}

.chip-sm {
  font-size: 10px;
  padding: 2px 6px;
}

.chip-md {
  font-size: 12px;
  padding: 6px 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip-muted {
  opacity: 0.5;
  margin-left: 6px;
}

/* Cards */
.card-relative { position: relative; }
.card-dimmed { opacity: 0.7; }

.card-title-xl {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(22px, 3vw, 28px);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.card-title-lg {
  font-size: 18px;
  font-weight: 700;
}

.card-title-md {
  font-size: 20px;
  font-weight: 700;
}

.card-sub-lg {
  font-size: 15px;
  opacity: 0.9;
}

.card-selected {
  border: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Buttons */
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  white-space: nowrap;
}

.btn-info {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn-info:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-overlay--toast { z-index: 1100; }
.modal-overlay--due { z-index: 2000; overflow-y: auto; align-items: flex-start; }
.modal-overlay--bulk { z-index: 2100; }

.modal-panel {
  box-sizing: border-box;
  width: min(640px, calc(100vw - 40px));
  margin: 20px;
  max-height: 80vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.modal-panel--md { width: min(560px, calc(100vw - 40px)); }

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-body-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.modal-body-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.modal-body-stack--items {
  margin-top: 16px;
  gap: 12px;
}

.modal-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Toast */
.toast-success {
  background: var(--accent);
  color: #fff;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow-md);
}

.empty-state--success .icon { color: var(--accent); }
.empty-state--success { color: var(--text-secondary); }

.due-item > div:first-child { flex: 1; min-width: 0; }

.actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Full-screen due panel */
#ppe_due_widget.modal-overlay--due.is-open { display: block; }

.panel-inner {
  max-width: 1600px;
  margin: 0 auto;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  min-height: calc(100vh - 40px);
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.panel-actions .btn {
  min-height: 38px;
}

/* Banners */
.banner-warn {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--warn-soft);
  border: 2px solid color-mix(in srgb, var(--warn) 50%, var(--border));
  border-radius: var(--radius-sm);
}

.banner-warn--urgent {
  border-color: color-mix(in srgb, var(--warn) 70%, var(--border));
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
}

.modal-panel .input-full { margin-top: 14px; }

.banner-bulk {
  margin-bottom: 24px;
  padding: 20px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-sm);
}

.banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.info-box {
  margin-bottom: 24px;
  padding: 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

.info-box-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.info-box-title .icon { flex-shrink: 0; }

.info-box-body { opacity: 0.9; }

/* PPE due list items */
.due-emp-card {
  display: flex;
  flex-direction: column;
}

.due-emp-header {
  display: flex;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.due-emp-checkbox {
  margin-top: 6px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.due-emp-meta {
  flex: 1;
  min-width: 0;
}

.due-emp-name {
  font-size: 18px;
  margin-bottom: 6px;
  word-break: break-word;
  font-weight: 700;
}

.due-emp-num {
  font-size: 13px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.due-contact {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 6px;
}

.due-items-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  flex: 1;
}

.due-items-label {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.due-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 4px solid var(--accent);
}

.due-item--overdue { border-left-color: var(--danger); }
.due-item--soon { border-left-color: var(--warn); }

.due-item-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.due-item-name {
  font-size: 15px;
  font-weight: 600;
}

.due-item-date {
  font-size: 12px;
  opacity: 0.8;
}

.due-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.no-email-notice {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

/* Projected stock rows */
.projected-summary {
  font-size: 11px;
  opacity: 0.9;
  margin-bottom: 8px;
  padding: 6px;
  background: var(--warn-soft);
  border-radius: 4px;
}

.projected-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  background: var(--warn-soft);
  border-radius: 6px;
  margin-bottom: 4px;
  border-left: 3px solid var(--warn);
}

.projected-row--out { border-left-color: var(--danger); }
.projected-row--low { border-left-color: var(--warn); }

.projected-name { font-size: 13px; }
.projected-warn {
  font-size: 10px;
  color: var(--warn);
  margin-top: 2px;
}

.projected-stat {
  font-size: 11px;
  opacity: 0.9;
  text-align: right;
}

.projected-stat-label { opacity: 0.7; }

.projected-delta {
  font-size: 9px;
  opacity: 0.6;
  margin-top: 1px;
}

/* Stock table column widths */
.stock-table th:nth-child(1) { width: 15%; }
.stock-table th:nth-child(2) { width: 18%; }
.stock-table th:nth-child(3) { width: 15%; }
.stock-table th:nth-child(4) { width: 10%; }
.stock-table th:nth-child(5) { width: 8%; }
.stock-table th:nth-child(6) { width: 10%; }
.stock-table th:nth-child(7) { width: 12%; }
.stock-table th:nth-child(8) { width: 12%; }
.stock-table td:nth-child(1) { width: 15%; white-space: normal; }
.stock-table td:nth-child(2) { width: 18%; white-space: normal; }
.stock-table td:nth-child(3) { width: 15%; white-space: normal; }
.stock-table td:nth-child(4) { width: 10%; font-variant-numeric: tabular-nums; }
.stock-table td:nth-child(5) { width: 8%; font-variant-numeric: tabular-nums; }
.stock-table td:nth-child(6) { width: 10%; font-variant-numeric: tabular-nums; }
.stock-table td:nth-child(7) { width: 12%; white-space: normal; }
.stock-table td:nth-child(8) { width: 12%; white-space: normal; }

/* Info modal header */
.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Landing page */
.landing-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing-topbar .brand-link {
  text-decoration: none;
  color: inherit;
}

.landing-topbar {
  flex-wrap: wrap;
  align-items: center;
  height: auto;
  min-height: var(--topbar-h);
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 8px 12px;
}

.landing-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  flex: 1 1 200px;
  min-width: 0;
}

.landing-nav a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.landing-nav a:hover,
.landing-nav a.is-active {
  color: var(--accent);
}

.landing-nav a.is-active {
  font-weight: 600;
}

@media (max-width: 720px) {
  .landing-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand tools"
      "nav nav";
    align-items: center;
  }

  .landing-topbar > .topbar-left,
  .landing-topbar > .legal-topbar-left {
    grid-area: brand;
  }

  .landing-topbar > .topbar-right {
    grid-area: tools;
    margin-left: 0;
  }

  .landing-topbar > .landing-nav {
    grid-area: nav;
    justify-content: flex-start;
    width: 100%;
    padding-top: 2px;
  }
}

.legal-topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.legal-back-btn {
  flex-shrink: 0;
}

.landing-main {
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.landing-hero {
  text-align: center;
  padding: 48px 0 56px;
  max-width: 720px;
  margin: 0 auto;
}

.landing-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.landing-lead {
  margin: 0 auto 28px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 560px;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}

.landing-cta {
  padding: 10px 22px;
  text-decoration: none;
}

.landing-includes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.landing-includes li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.landing-section-title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
  text-align: center;
}

.landing-section-sub {
  margin: 0 auto 32px;
  max-width: 560px;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.5;
}

.landing-features {
  padding: 24px 0 40px;
}

.landing-usecase {
  padding: 0 0 56px;
}

.landing-usecase-inner {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.landing-usecase-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-usecase-title {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  letter-spacing: -0.02em;
}

.landing-usecase-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.landing-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.landing-feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.landing-feature-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.landing-pricing {
  padding: 16px 0 24px;
}

.landing-pricing-header {
  margin-bottom: 28px;
}

.landing-pricing-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .landing-pricing-layout {
    grid-template-columns: 1fr;
  }
}

.landing-configurator {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-fieldset {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.landing-fieldset legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 14px;
}

.landing-fieldset-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.landing-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.landing-option:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.landing-option:first-of-type {
  padding-top: 8px;
}

.landing-option--locked {
  cursor: default;
  opacity: 0.92;
}

.landing-option input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.landing-option-body {
  flex: 1;
  min-width: 0;
}

.landing-option-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.landing-option-desc {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.landing-option-price {
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.landing-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.landing-stepper-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.landing-stepper-label {
  flex: 1;
  min-width: 0;
}

.landing-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.landing-stepper-value {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.landing-quote-card {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.landing-quote-label {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.landing-quote-total {
  margin: 8px 0 4px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.landing-quote-note {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.landing-quote-lines {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  border-top: 1px solid var(--border);
}

.landing-quote-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.landing-quote-lines li span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.landing-quote-cta {
  display: flex;
  width: 100%;
  text-decoration: none;
  justify-content: center;
  padding: 10px 16px;
}

.landing-quote-foot {
  margin: 14px 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--text-tertiary);
}

.landing-quote-foot code {
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  text-align: center;
  margin-top: auto;
}

.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing-footer p {
  margin: 0;
}

.landing-legal-links,
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 10px;
}

.site-footer-links {
  margin-top: 0;
}

.landing-legal-links a,
.site-footer-links a {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.landing-legal-links a:hover,
.site-footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.legal-main {
  max-width: 760px;
  padding-top: 12px;
}

.legal-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}

.legal-meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.legal-title {
  margin: 0 0 20px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal-body p {
  margin: 0;
  white-space: pre-wrap;
}

.legal-loading,
.legal-empty {
  color: var(--text-tertiary);
  font-style: italic;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.legal-nav a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.legal-nav a:hover,
.legal-nav a.is-active {
  color: var(--accent);
}

.legal-nav a.is-active {
  font-weight: 600;
}

@media (max-width: 640px) {
  .legal-article {
    padding: 20px 16px;
  }

  .legal-body {
    font-size: 14px;
  }
}

/* Signup flow */
.signup-main {
  padding-top: 16px;
}

.signup-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
}

.signup-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.signup-lead {
  margin-bottom: 0;
}

.signup-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 20px;
  align-items: start;
}

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

.signup-plan-card {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}

.signup-plan-toggles {
  margin: 16px 0 0;
  padding: 0;
  border: none;
}

.signup-plan-toggles .landing-option {
  padding: 10px 0;
}

.signup-form {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.signup-form-legend {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 16px;
}

.signup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.signup-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.signup-field input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-color: var(--accent);
}

.signup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.signup-pay-btn {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
}

.signup-foot {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
  text-align: center;
}

.signup-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.signup-success-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
}

.signup-success-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: static;
}

.signup-success-icon {
  margin: 0 auto 16px;
}

/* Subscription / billing UI */
.subscription-banner {
  margin: 0;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.subscription-banner--trial {
  background: color-mix(in srgb, #3b82f6 16%, var(--surface));
}

.subscription-banner--grace {
  background: color-mix(in srgb, #d97706 16%, var(--surface));
}

.billing-card {
  max-width: 520px;
}

.billing-status-label {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.billing-status-label--grace { color: #d97706; }
.billing-status-label--blocked { color: #dc2626; }
.billing-status-label--active { color: var(--accent); }

.billing-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.billing-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.billing-meta dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.billing-meta dd {
  margin: 0;
  text-align: right;
}

.billing-total {
  font-weight: 700;
  margin: 12px 0 8px;
}

.billing-lifecycle-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 16px;
}

.billing-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* Marketing pages */
.marketing-main {
  max-width: 720px;
}

.marketing-article {
  padding-bottom: 32px;
}

.marketing-page .landing-lead {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

.marketing-section {
  margin-top: 28px;
}

.marketing-section h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.marketing-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.marketing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.pricing-table-wrap {
  overflow-x: auto;
  margin: 24px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pricing-table th,
.pricing-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pricing-table th {
  background: var(--surface-2);
  font-weight: 600;
}

.support-form {
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}

.support-form textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.faq-section .faq-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-section p {
  margin-top: 8px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.signup-login-url {
  margin-bottom: 14px;
}

.signup-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.signup-copy-row {
  display: flex;
  gap: 8px;
}

.signup-copy-input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.signup-copy-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 8px 0 0;
}
