:root {
  --bg: #0b1117;
  --panel: #121a23;
  --panel-2: #17222d;
  --panel-3: #1d2935;
  --line: rgba(139, 169, 200, 0.18);
  --text: #edf4fb;
  --muted: #9eb1c5;
  --accent: #2ec5b6;
  --accent-2: #50d5c8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  --bg: #edf3f8;
  --panel: #ffffff;
  --panel-2: #f6f9fc;
  --panel-3: #eef4f9;
  --line: rgba(36, 58, 84, 0.12);
  --text: #162230;
  --muted: #60758a;
  --accent: #0f9f93;
  --accent-2: #27b6aa;
  --shadow: 0 22px 50px rgba(18, 34, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(46, 197, 182, 0.14), transparent 34%),
    linear-gradient(180deg, #0c141c 0%, var(--bg) 28%);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.login-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-shell::before,
.app-shell-home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 12, 18, 0.18), rgba(6, 12, 18, 0.02) 48%, rgba(6, 12, 18, 0.38)),
    url("/assets/zb-glide-brand-background.png") center center / cover no-repeat;
}

.login-shell::after,
.app-shell-home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 20%, rgba(46, 197, 182, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(11, 17, 23, 0), rgba(11, 17, 23, 0.34));
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 34px;
  display: grid;
  gap: 18px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.login-title {
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: clamp(2rem, 8vw, 2.75rem) !important;
  letter-spacing: -0.03em !important;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.link-button {
  width: max-content;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.form-message.error {
  color: #ff9f9f;
}

.form-message.warn {
  color: #f6c76d;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.app-shell-home {
  height: calc(100vh - var(--zb-shell-height, 0px));
  height: calc(100dvh - var(--zb-shell-height, 0px));
  min-height: 0;
  padding-top: 42px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.app-shell-home.settings-mode {
  overflow: hidden;
  background: var(--bg);
}

.app-shell-home.settings-mode::before,
.app-shell-home.settings-mode::after {
  display: none;
}

.app-shell-home > * {
  position: relative;
  z-index: 1;
}

.app-shell-home .topbar {
  padding-top: 34px;
}

.app-shell-home > .topbar .topbar-actions {
  display: none;
}

.app-shell-home .topbar h1,
.home-title-card,
.landing-card h2,
.settings-grid h2,
.settings-grid h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.landing-card {
  display: inline-block;
  width: fit-content;
  max-width: min(980px, calc(100vw - 56px));
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(16px);
}

.landing-card h2 {
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

/* The daily summary belongs to the existing welcome surface. */
.app-shell-home:not(.settings-mode) { padding-top: 20px; overflow: auto; }
body.zb-dashboard-system .landing-card.home-overview { width: min(840px, 100%); max-width: 100%; padding: clamp(20px, 2.5vw, 32px); }
.home-case-summary { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--color-border, var(--line)); }
.home-case-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.home-case-heading h3 { font-size: 15px; font-weight: 700; color: var(--color-text, var(--text)); }
.home-case-heading p { margin: 6px 0 0; color: var(--color-text-muted, var(--muted)); font-size: 12px; }
.home-case-heading .btn { flex: 0 0 auto; }
.home-case-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.home-case-tile { min-width: 0; padding: 14px 12px; border: 1px solid var(--color-border, var(--line)); border-radius: var(--card-radius, 10px); background: color-mix(in srgb, var(--color-surface-alt, var(--panel)) 62%, transparent); }
.home-case-tile > span { display: block; min-height: 32px; font-size: 12px; line-height: 1.3; color: var(--color-text-muted, var(--muted)); }
.home-case-tile > strong { display: block; margin-top: 7px; font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--color-primary, var(--accent)); }
.home-case-status { min-height: 16px; margin: 12px 0 0; font-size: 11px; line-height: 1.5; color: var(--color-text-muted, var(--muted)); }
.home-case-status.is-error { color: var(--color-warning, var(--color-text)); }
@media(max-width: 740px) { .home-case-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media(max-width: 480px) {
  body.zb-dashboard-system .landing-card.home-overview { padding: 20px; }
  .home-case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-case-tile:last-child { grid-column: 1 / -1; }
  .home-case-tile > span { min-height: 0; }
  .home-case-summary { margin-top: 22px; padding-top: 18px; }
  .home-case-heading p { font-size: 11px; }
}

.home-title-card {
  display: inline-block;
  width: fit-content;
  max-width: min(760px, calc(100vw - 56px));
  padding: 12px 18px;
  border-radius: 18px;
  overflow-wrap: anywhere;
}

:root[data-theme="light"] .app-shell-home .topbar h1,
:root[data-theme="light"] .home-title-card {
  display: inline-block;
  width: fit-content;
  max-width: min(760px, calc(100vw - 56px));
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

:root[data-theme="light"] .landing-card {
  background: rgba(255, 255, 255, 0.92);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(12, 18, 25, 0.92);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-block h1,
.topbar h2,
.section-head h3,
.hero-card h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.brand-block p,
.muted {
  color: var(--muted);
}

.eyebrow,
.metric-label,
.label {
  color: var(--accent-2);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-btn,
.btn,
.pill-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.nav-btn:hover,
.btn:hover,
.pill-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 197, 182, 0.34);
}

.nav-btn.is-active,
.pill-btn.is-active,
.btn.btn-primary {
  background: linear-gradient(180deg, rgba(46, 197, 182, 0.28), rgba(46, 197, 182, 0.14));
  border-color: rgba(46, 197, 182, 0.45);
}

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

.sidebar-card,
.hero-card,
.hero-side,
.section-card,
.table-card,
.workspace-card,
.metric-card,
.mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.input,
.textarea,
select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.password-control {
  position: relative;
  width: 100%;
}

.password-control .input {
  padding-right: 76px;
}

.password-control.compact .input {
  min-width: 180px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: rgba(58, 208, 192, 0.14);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(58, 208, 192, 0.24);
}

.toggle-row,
.topbar-actions,
.hero-actions,
.card-actions,
.workspace-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.main-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 26px 28px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.view-panel {
  padding: 22px 28px 28px;
  display: grid;
  gap: 22px;
}

.hidden {
  display: none !important;
}

body.auth-boot #loginShell,
body.auth-boot #appShell {
  display: none !important;
}

.password-rule {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 22px;
}

.hero-card,
.hero-side,
.section-card,
.table-card {
  padding: 22px;
}

.metric-grid,
.roadmap-grid,
.workspace-grid,
.settings-grid {
  display: grid;
  gap: 18px;
}

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

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric-card strong {
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.roadmap-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-card {
  padding: 18px;
}

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

.workspace-card {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.workspace-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border: 1px solid var(--line);
  background: var(--panel-3);
}

.badge.teal { background: rgba(46, 197, 182, 0.16); }
.badge.blue { background: rgba(67, 140, 245, 0.16); }
.badge.amber { background: rgba(237, 173, 71, 0.18); }
.badge.violet { background: rgba(170, 109, 255, 0.18); }
.badge.green { background: rgba(85, 200, 118, 0.16); }

.module-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.settings-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.settings-card-wide {
  grid-column: span 8;
}

.settings-appearance-card {
  grid-column: span 6;
}

.settings-bethpage-card {
  grid-column: span 6;
}

.settings-summary-card {
  grid-column: 1 / -1;
  grid-row: 1;
}

.settings-oracle-card {
  grid-column: span 4;
}

.settings-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.settings-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.settings-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 15%, var(--panel-2));
  color: var(--accent-2);
  font-weight: 900;
}

.bethpage-add-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.bethpage-account-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  max-height: 314px;
  overflow: auto;
  padding-right: 4px;
}

.bethpage-account-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
}

.bethpage-account-row.is-unavailable {
  border-color: rgba(237, 173, 71, 0.46);
}

.bethpage-account-mark,
.user-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 19%, var(--panel-3));
  color: var(--accent-2);
  font-weight: 800;
}

.bethpage-account-mark {
  width: 34px;
  height: 34px;
  font-size: 0.72rem;
}

.bethpage-account-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bethpage-account-copy strong,
.bethpage-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bethpage-account-copy small {
  color: var(--muted);
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-3);
  color: var(--muted);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(255, 120, 120, 0.55);
  color: #ff9f9f;
}

.bethpage-empty,
.user-directory-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.settings-save-strip {
  min-height: 32px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.82rem;
}

.save-state {
  color: var(--accent-2);
}

.save-state.is-saving {
  color: #f6c76d;
}

.save-state.is-error {
  color: #ff9f9f;
}

.table-card.flat {
  padding: 0;
  box-shadow: none;
  border: 0;
  overflow: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.user-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.user-table th,
.user-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
}

.user-directory-card {
  padding: 0;
  overflow: hidden;
}

.user-directory-card > .section-head,
.user-directory-toolbar,
.user-directory-meta,
.user-directory-actions {
  padding-left: 22px;
  padding-right: 22px;
}

.user-directory-card > .section-head {
  padding-top: 22px;
}

.user-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 0.75fr));
  gap: 10px;
  margin-top: 18px;
}

.user-directory-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.82rem;
}

.user-directory-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 2px 22px 16px;
  max-height: min(620px, 62vh);
  overflow: auto;
}

.user-directory-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 2.5fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-2) 90%, transparent);
}

.user-directory-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  align-items: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  grid-row: span 2;
}

.user-directory-identity > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-directory-identity strong,
.user-directory-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-directory-identity > div span {
  color: var(--muted);
  font-size: 0.82rem;
}

.user-status-dot {
  grid-column: 2;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(85, 200, 118, 0.14);
  color: var(--color-success, #8ee7a4);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.user-status-dot.is-inactive {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
}

.user-directory-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.user-directory-fields .field > span,
.user-security-fields .field > span {
  font-size: 0.75rem;
  color: var(--muted);
}

.user-dashboard-permissions {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.user-dashboard-permissions summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0 12px;
}

.user-permission-save {
  grid-column: 1 / -1;
  justify-self: end;
  align-self: start;
  min-width: 160px;
  max-width: 260px;
}

.user-permission-message {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.user-security-panel {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.user-notification-setting {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 14px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 64%, transparent);
}

.user-notification-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-notification-copy strong {
  font-size: 0.8rem;
}

.user-notification-copy small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.user-notification-setting .input {
  min-width: 0;
  width: 100%;
}

.user-security-panel summary {
  width: max-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
}

.user-security-fields {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.checkbox-field {
  min-height: 42px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.checkbox-field input {
  width: 20px;
  height: 20px;
}

.user-directory-actions {
  position: sticky;
  bottom: 0;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 18px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

.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;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.role-note {
  color: var(--muted);
  font-size: 0.85rem;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-grid,
  .roadmap-grid,
  .settings-grid,
  .metric-grid.compact {
    grid-template-columns: 1fr;
  }

  .settings-card-wide,
  .settings-appearance-card,
  .settings-bethpage-card,
  .settings-summary-card,
  .settings-oracle-card {
    grid-column: 1 / -1;
  }

  .user-directory-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .view-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .field-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .bethpage-add-row,
  .user-directory-toolbar,
  .user-directory-row,
  .user-directory-fields,
  .user-security-fields {
    grid-template-columns: 1fr;
  }

  .user-directory-identity,
  .user-security-panel {
    grid-column: 1;
  }

  .settings-card-heading,
  .user-directory-card > .section-head,
  .user-directory-meta,
  .user-directory-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

:root[data-theme="light"] html,
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(15, 159, 147, 0.14), transparent 34%),
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 32%);
}

:root[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .input,
:root[data-theme="light"] .textarea,
:root[data-theme="light"] select {
  background: #ffffff;
  border-color: rgba(36, 58, 84, 0.16);
  color: var(--text);
}

:root[data-theme="light"] .input::placeholder,
:root[data-theme="light"] .textarea::placeholder {
  color: #7a8da1;
}

:root[data-theme="light"] .btn.btn-ghost {
  background: #eef3f7;
  color: #31465b;
}

:root[data-theme="light"] .nav-btn.is-active,
:root[data-theme="light"] .pill-btn.is-active,
:root[data-theme="light"] .btn.btn-primary {
  background: rgba(15, 159, 147, 0.14);
  border-color: rgba(15, 159, 147, 0.35);
  color: #0f625a;
}

:root[data-theme="light"] .status-pill,
:root[data-theme="light"] .badge {
  color: #31465b;
}

:root[data-theme="light"] .form-message.error {
  color: #b34747;
}

:root[data-theme="light"] .form-message.warn {
  color: #8a5a00;
}

/* Keep the welcome card clear of the delivery scene. */
body.zb-dashboard-system .app-shell-home .landing-card {
  width: fit-content; max-width: min(90%, 640px); padding: 14px 22px;
}
body.zb-dashboard-system .app-shell-home .landing-card #welcomeTitle {
  margin: 0; font-size: clamp(1.5rem, 2.4vw, 2.5rem); line-height: 1.2;
}

body.zb-dashboard-system .app-shell-home.settings-mode > .topbar { display:none !important; }
body.zb-dashboard-system #settingsView { padding:0; height:100%; min-height:0; grid-template-rows:auto minmax(0,1fr); gap:16px; overflow:hidden; }
body.zb-dashboard-system #settingsView > .section-head { margin:0; padding:0; }
body.zb-dashboard-system #settingsView > .section-head .eyebrow { display:none; }
body.zb-dashboard-system #settingsView > .section-head h2 { margin:0; font-size:var(--dashboard-font-size-lg); }
body.zb-dashboard-system #settingsView > .section-head p { margin:4px 0 0; }
body.zb-dashboard-system #settingsContent { height:100%; min-height:0; padding-right:12px; }
body.zb-dashboard-system .settings-category-nav { border-right:1px solid var(--color-border); padding-right:14px; }
body.zb-dashboard-system #settingsContent > .section-card { padding:20px 24px; background:color-mix(in srgb,var(--color-surface) 85%,rgb(var(--surface-rgb))); }
body.zb-dashboard-system #settingsContent h3 { margin-top:0; font-size:var(--dashboard-font-size-lg); }
body.zb-dashboard-system .settings-appearance-card .visual-settings-grid { display:flex; flex-direction:column; gap:0; }
body.zb-dashboard-system .settings-appearance-card .visual-settings-grid > .field { display:grid; grid-template-columns:minmax(150px,.8fr) minmax(230px,1.2fr); align-items:center; gap:8px 24px; padding:15px 0; border-bottom:1px solid var(--color-border); }
body.zb-dashboard-system .settings-appearance-card .visual-settings-grid > .field > span { color:var(--color-text); font-weight:600; }
body.zb-dashboard-system .settings-appearance-card .background-actions,
body.zb-dashboard-system .settings-appearance-card .background-preview { grid-column:2; }
body.zb-dashboard-system .settings-appearance-card .visual-settings-actions { margin-top:18px; }
body.zb-dashboard-system .appearance-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(240px,.85fr); align-items:start; gap:24px; }
body.zb-dashboard-system .settings-appearance-card .visual-settings-grid > .field { grid-template-columns:minmax(120px,.7fr) minmax(0,1fr); gap:8px 16px; }
body.zb-dashboard-system .appearance-preview-panel { position:sticky; top:0; display:grid; gap:10px; min-width:0; }
body.zb-dashboard-system .appearance-preview-panel .background-preview { grid-column:auto; min-height:280px; height:min(42vh,400px); background-size:contain; background-repeat:no-repeat; background-position:center; }
body.zb-dashboard-system .appearance-preview-panel p { margin:0; font-size:var(--dashboard-font-size-sm); line-height:1.45; }
body.zb-dashboard-system .settings-appearance-card .range-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; }
body.zb-dashboard-system .settings-appearance-card .range-row label { min-width:0; }
body.zb-dashboard-system .settings-appearance-card .visual-settings-actions { flex-wrap:wrap; gap:10px; }
body.zb-dashboard-system .settings-appearance-card .visual-settings-actions .field { min-width:120px; flex:1; }
@media(max-width:1050px) { body.zb-dashboard-system .appearance-layout { grid-template-columns:1fr; } body.zb-dashboard-system .appearance-preview-panel { position:static; } }
body.zb-dashboard-system #usersBody { max-height:none; padding-right:0; }
body.zb-dashboard-system .user-profile-details { min-width:0; }
body.zb-dashboard-system .user-profile-details > summary { padding:8px 0; font-size:var(--dashboard-font-size-sm); color:var(--color-primary); cursor:pointer; }
body.zb-dashboard-system .user-profile-details[open] > summary { margin-bottom:10px; }
body.zb-dashboard-system .user-profile { align-items:start; }
@media(max-width:800px) {
  body.zb-dashboard-system .settings-category-nav { border:0; padding:0; }
  body.zb-dashboard-system #settingsContent { height:100%; min-height:0; padding:0 0 16px; overflow:auto; }
  body.zb-dashboard-system #settingsContent > .section-card { padding:16px; }
  body.zb-dashboard-system .settings-appearance-card .visual-settings-grid > .field { grid-template-columns:1fr; gap:10px; }
  body.zb-dashboard-system .settings-appearance-card .background-actions,
  body.zb-dashboard-system .settings-appearance-card .background-preview { grid-column:1; }
}
/* Settings uses a fixed category rail and a single scrollable content panel. */
.settings-workspace { display:grid; grid-template-columns:210px minmax(0,1fr); gap:28px; align-items:stretch; min-height:0; overflow:hidden; }
.settings-workspace, .settings-category-nav, #settingsContent { min-width:0; max-width:100%; }
#settingsContent .site-overview-table { min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.settings-category-nav { display:flex; flex-direction:column; gap:6px; min-height:0; max-height:100%; overflow-y:auto; padding:12px 0; }
.settings-category { text-align:left; border:0; border-radius:6px; padding:13px 16px; background:transparent; color:var(--color-text-muted); font:inherit; font-weight:600; cursor:pointer; }
.settings-category:hover,.settings-category.is-active { color:var(--color-text); background:color-mix(in srgb,var(--color-primary) 16%,var(--color-surface)); }
.settings-category.is-active { box-shadow:inset 3px 0 var(--color-primary); }
#settingsContent { display:flex; flex-direction:column; gap:20px; height:100%; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:8px 18px 24px 0; }
#settingsContent:focus-visible { outline:2px solid var(--color-primary,var(--accent)); outline-offset:-2px; border-radius:8px; }
#settingsContent > article { flex:0 0 auto; width:100%; margin:0; border-radius:8px; box-sizing:border-box; }
.account-details { display:grid; grid-template-columns:130px 1fr; gap:18px; }
.account-details dt { color:var(--color-text-muted); }.account-details dd { margin:0; overflow-wrap:anywhere; }
.user-profile-details > summary { cursor:pointer; font-weight:600; padding:8px 0 14px; color:var(--color-primary); }
.user-profile-details > .user-directory-fields { padding-top:12px; }
.user-directory-row { border-radius:8px; }
.user-directory-list { max-height:none; padding:12px 0; }
@media(max-width:800px){.settings-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:12px}.settings-category-nav{flex-direction:row;overflow-x:auto;overflow-y:hidden;padding:0}.settings-category{white-space:nowrap}#settingsContent{height:100%;min-height:0;padding:0 0 16px}.user-directory-row{grid-template-columns:1fr}}

/* Leave the delivery scene visible and keep the sign-in controls easy to read. */
body.zb-dashboard-system .login-shell { place-items:center start; padding:clamp(24px,6vw,96px); }
body.zb-dashboard-system .login-card { width:min(410px,100%); padding:32px; gap:20px; background:color-mix(in srgb,rgb(var(--surface-rgb)) 96%,transparent); border-radius:var(--card-radius); }
.login-brand { display:flex; align-items:center; gap:12px; font-size:12px; color:var(--color-text-muted); }
.login-brand img { width:56px; height:56px; object-fit:contain; border-radius:8px; background:white; }
body.zb-dashboard-system .login-title { text-align:left; font-size:34px !important; letter-spacing:-.02em !important; }
.login-intro { margin:-8px 0 0; font-size:14px; line-height:1.5; color:var(--color-text-muted); }
body.zb-dashboard-system .login-card .btn-primary { width:100%; min-height:42px; }
@media(max-width:640px) { body.zb-dashboard-system .login-shell { place-items:center; padding:20px; } body.zb-dashboard-system .login-card { padding:24px; } }
.notification-settings { display:grid;gap:14px;margin:20px 0; }
.notification-settings > label { display:flex;align-items:flex-start;gap:12px;padding:15px;border:1px solid var(--color-border);border-radius:var(--card-radius);background:var(--color-surface-alt);cursor:pointer; }
.address-editor-toolbar { display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap; }
.address-editor-toolbar .field { flex:1 1 220px; }
.address-account-results { max-height:240px;overflow-y:auto;margin:14px 0;display:grid;gap:6px; }
.address-account-option { display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:10px 12px;border:1px solid var(--color-border);border-radius:var(--control-radius);background:var(--color-surface-alt);color:var(--color-text);font:inherit;cursor:pointer; }
.address-account-option span { color:var(--color-text-muted);font-size:var(--dashboard-font-size-sm); }
.address-account-option[aria-pressed="true"] { border-color:var(--color-primary); }
#accountAddressForm { display:grid;gap:14px; }
#accountAddressForm[hidden],#addressSiteField[hidden] { display:none; }
#accountAddressForm h4 { margin:4px 0; }
.notification-settings input { margin-top:3px;width:16px;height:16px;accent-color:var(--color-primary); }
.notification-settings strong { display:block;font-size:14px;margin-bottom:5px; }
.notification-settings small { display:block;font-size:12px;line-height:1.5;color:var(--color-text-muted); }

.login-card .login-brand {justify-content:center;margin:0 0 12px;}
.login-card .login-brand img {width:80px;height:80px;}
.login-card .login-title {text-align:center;margin:0 0 24px;}

body.zb-dashboard-system .login-card .login-title {text-align:center;}
.password-reset-dialog {box-sizing:border-box;position:fixed;margin:auto;inset:0;width:min(410px,calc(100vw - 32px));padding:30px;border:1px solid var(--color-border,#33485b);border-radius:var(--card-radius,14px);background:rgb(var(--surface-rgb,20,31,44));color:var(--color-text,#f1f6fc);box-shadow:0 20px 65px #0006;}
.password-reset-dialog::backdrop {background:rgb(0 0 0 / .6);backdrop-filter:blur(3px);}
.password-reset-dialog h2 {margin:0;font-size:23px;}
.password-reset-dialog .muted {margin:0;line-height:1.5;color:var(--color-text-muted);}
.password-reset-dialog .form-message:empty {display:none;}
.password-dialog-close {position:absolute;top:8px;right:10px;display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:6px;background:transparent;color:inherit;font:24px/1 system-ui;cursor:pointer;}
.password-dialog-close:hover {background:var(--color-surface-alt);}
