:root,
[data-theme="light"] {
  --sc-bg: #eef5f9;
  --sc-surface: #ffffff;
  --sc-surface-2: #f7fafc;
  --sc-elevated: #ffffff;
  --sc-border: #dbe5ec;
  --sc-text: #3e5569;
  --sc-heading: #243746;
  --sc-muted: #6f8291;
  --sc-primary: #1565c0;
  --sc-primary-hover: #0d55a8;
  --sc-primary-soft: #e3f0ff;
  --sc-cyan: #168a99;
  --sc-success: #18794e;
  --sc-success-soft: #e9f7f0;
  --sc-warning: #9a5b08;
  --sc-warning-soft: #fff6e8;
  --sc-danger: #b4233a;
  --sc-danger-soft: #fff0f2;
  --sc-info: #1565c0;
  --sc-nav: #17344a;
  --sc-nav-border: #294a60;
  --sc-nav-text: #d9e5ec;
  --sc-nav-muted: #9db0bd;
  --sc-focus: #1565c0;
  --sc-shadow: 0 7px 22px rgba(27, 57, 76, 0.08);
  --sc-shadow-raised: 0 14px 36px rgba(23, 52, 74, 0.16);
  --sc-radius: 12px;
  --sc-sidebar-width: 264px;
  --sc-sidebar-rail: 76px;
  color-scheme: light;
}

[data-theme="dark"] {
  --sc-bg: #0f172a;
  --sc-surface: #172033;
  --sc-surface-2: #1c2940;
  --sc-elevated: #22304d;
  --sc-border: #334155;
  --sc-text: #e2e8f0;
  --sc-heading: #f1f5f9;
  --sc-muted: #94a3b8;
  --sc-primary: #60a5fa;
  --sc-primary-hover: #93c5fd;
  --sc-primary-soft: #20395d;
  --sc-cyan: #67e8f9;
  --sc-success: #6ee7b7;
  --sc-success-soft: #183c36;
  --sc-warning: #fbbf24;
  --sc-warning-soft: #3c321d;
  --sc-danger: #fb7185;
  --sc-danger-soft: #432330;
  --sc-info: #7dd3fc;
  --sc-nav: #080f20;
  --sc-nav-border: #23314a;
  --sc-nav-text: #dbe6f1;
  --sc-nav-muted: #8ea1b7;
  --sc-focus: #60a5fa;
  --sc-shadow: 0 8px 26px rgba(0, 0, 0, 0.26);
  --sc-shadow-raised: 0 18px 44px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

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

html {
  background: var(--sc-bg);
}

body.governed-shell {
  min-width: 320px;
  margin: 0;
  background: var(--sc-bg);
  color: var(--sc-text);
  font-family: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
}

a {
  color: var(--sc-primary);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--sc-primary-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sc-focus) 72%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 2000;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--sc-heading);
  color: var(--sc-surface);
  transform: translateY(-160%);
}

.skip-link:focus {
  color: var(--sc-surface);
  transform: translateY(0);
}

.app-frame {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  width: var(--sc-sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--sc-nav-border);
  background: var(--sc-nav);
  color: var(--sc-nav-text);
  transition: width 180ms ease, transform 180ms ease;
}

.sidebar-brand {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 10px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--sc-nav-border);
}

.sidebar-brand > a {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 10px;
  background: #3188e6;
  box-shadow: 0 5px 14px rgba(49, 136, 230, 0.28);
  font-size: 1.1rem;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--sc-nav-muted);
  font-size: 0.72rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 13px 10px 18px;
  scrollbar-color: var(--sc-nav-border) transparent;
}

.nav-section + .nav-section {
  margin-top: 14px;
}

.nav-section h2 {
  margin: 0 10px 6px;
  color: var(--sc-nav-muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-section a {
  display: grid;
  min-height: 42px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--sc-nav-text);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.nav-section a i {
  color: var(--sc-nav-muted);
  font-size: 1rem;
  text-align: center;
}

.nav-section a small {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sc-nav-muted);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.nav-section a:hover {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-section a[aria-current="page"] {
  border-color: #63a9ed;
  background: #3188e6;
  box-shadow: 0 0 0 3px rgba(49, 136, 230, 0.24);
  color: #ffffff;
}

.nav-section a[aria-current="page"] i,
.nav-section a[aria-current="page"] small {
  color: #ffffff;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--sc-nav-border);
  background: var(--sc-nav);
}

.sidebar-footer form {
  margin: 0;
}

.sidebar-action {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sc-nav-text);
  text-align: left;
}

.sidebar-action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-action i {
  width: 22px;
  color: var(--sc-nav-muted);
  text-align: center;
}

.app-workspace {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sc-sidebar-width);
  transition: margin-left 180ms ease;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 14px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--sc-border);
  background: var(--sc-surface);
}

.global-search {
  display: flex;
  width: min(520px, 48vw);
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 1px solid var(--sc-border);
  border-radius: 9px;
  background: var(--sc-surface-2);
  color: var(--sc-muted);
  text-decoration: none;
}

.global-search:hover {
  border-color: var(--sc-primary);
  color: var(--sc-heading);
}

.global-search span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search kbd {
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--sc-border);
  border-radius: 5px;
  background: var(--sc-surface);
  box-shadow: none;
  color: var(--sc-muted);
  font: inherit;
}

.topbar-title {
  color: var(--sc-heading);
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.theme-form {
  margin: 0;
}

.icon-control {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--sc-border);
  border-radius: 9px;
  background: var(--sc-surface);
  color: var(--sc-muted);
}

.icon-control:hover {
  border-color: var(--sc-primary);
  color: var(--sc-primary);
}

.notification-center {
  position: relative;
  flex: 0 0 auto;
}

.notification-trigger {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--sc-surface);
  border-radius: 999px;
  background: var(--sc-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1080;
  width: min(390px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  background: var(--sc-surface);
  box-shadow: 0 16px 42px rgba(3, 12, 21, 0.22);
}

.notification-popover[hidden] {
  display: none;
}

.notification-popover > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--sc-border);
}

.notification-popover a {
  font-size: 0.78rem;
  font-weight: 700;
}

.notification-compact {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--sc-border);
}

.notification-compact.unread {
  background: color-mix(in srgb, var(--sc-primary) 7%, var(--sc-surface));
}

.notification-compact span,
.notification-compact small {
  display: block;
}

.notification-compact strong {
  color: var(--sc-heading);
  font-size: 0.8rem;
}

.notification-compact small {
  margin-top: 4px;
  color: var(--sc-muted);
  font-size: 0.7rem;
}

.notification-empty {
  margin: 0;
  padding: 22px 17px;
  color: var(--sc-muted);
}

.notification-toast {
  position: fixed;
  top: 86px;
  right: 24px;
  z-index: 1090;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  flex-direction: column;
  gap: 5px;
  padding: 15px 17px;
  border: 1px solid var(--sc-border);
  border-left: 4px solid var(--sc-primary);
  border-radius: 10px;
  background: var(--sc-surface);
  box-shadow: 0 16px 42px rgba(3, 12, 21, 0.22);
  animation: notification-arrive 180ms ease-out;
}

.notification-toast.severity-error,
.notification-item.severity-error { border-left-color: var(--sc-danger); }
.notification-toast.severity-warning,
.notification-item.severity-warning { border-left-color: var(--sc-warning); }
.notification-toast.severity-success,
.notification-item.severity-success { border-left-color: var(--sc-success); }

@keyframes notification-arrive {
  from { opacity: 0; transform: translateY(-8px); }
}

.since-away-summary {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(280px, 1.4fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--sc-border);
  border-left: 4px solid var(--sc-primary);
  border-radius: 10px;
  background: var(--sc-surface);
}

.since-away-summary h2 { margin: 3px 0 0; font-size: 1.1rem; }
.since-away-summary ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.since-away-summary li { display: grid; grid-template-columns: 20px 1fr; gap: 9px; }
.since-away-summary li span,
.since-away-summary li small { display: block; }
.since-away-summary li small { margin-top: 2px; color: var(--sc-muted); }

.notification-page .section-heading form,
.notification-actions form { margin: 0; }
.notification-list { display: grid; gap: 12px; }
.notification-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
  padding: 17px;
  border: 1px solid var(--sc-border);
  border-left: 4px solid var(--sc-primary);
  border-radius: 10px;
  background: var(--sc-surface);
}
.notification-item.unread { background: color-mix(in srgb, var(--sc-primary) 5%, var(--sc-surface)); }
.notification-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--sc-surface-2); color: var(--sc-primary); }
.notification-copy > div { display: flex; align-items: center; gap: 9px; }
.notification-copy h3 { margin: 0; font-size: 0.95rem; }
.notification-copy p { margin: 7px 0; color: var(--sc-text); }
.notification-copy small { color: var(--sc-muted); }
.notification-actions { display: flex; gap: 7px; align-items: center; }
.notification-actions button { min-height: 36px; padding: 7px 10px; font-size: 0.75rem; }

.account-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 3px 2px 3px 7px;
  border-radius: 9px;
  color: var(--sc-text);
  text-decoration: none;
}

.account-summary:hover {
  background: var(--sc-surface-2);
  color: var(--sc-heading);
}

.account-summary > span:not(.avatar) {
  display: flex;
  min-width: 0;
  max-width: 250px;
  flex-direction: column;
  line-height: 1.2;
}

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

.account-summary strong {
  color: var(--sc-heading);
  font-size: 0.78rem;
}

.account-summary small {
  margin-top: 3px;
  color: var(--sc-muted);
  font-size: 0.64rem;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--sc-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
}

.drawer-open,
.drawer-close {
  display: none;
}

.page-content {
  min-width: 0;
  padding: 34px 32px 48px;
}

.page-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-title-row h1 {
  margin: 3px 0 0;
  color: var(--sc-heading);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.eyebrow {
  color: var(--sc-primary);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.card {
  margin-bottom: 20px;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
  box-shadow: var(--sc-shadow);
  color: var(--sc-text);
}

.card h2,
.card h3 {
  color: var(--sc-heading);
}

.card h2 {
  margin: 0 0 5px;
  font-size: 1.18rem;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  background: var(--sc-surface);
  box-shadow: var(--sc-shadow);
}

.metric > span { color: var(--sc-muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.metric > strong { margin: 6px 0 3px; color: var(--sc-heading); font-size: 1.65rem; line-height: 1.15; }
.metric > small { color: var(--sc-muted); }
.metric.warning { border-top: 3px solid var(--sc-warning); }
.metric.danger { border-top: 3px solid var(--sc-danger); }

.dashboard-grid,
.help-grid,
.policy-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.help-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.help-grid .card > i { color: var(--sc-primary); font-size: 1.35rem; }

.notice {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 17px;
  border: 1px solid var(--sc-border);
  border-left: 4px solid var(--sc-info);
  border-radius: 10px;
  background: var(--sc-primary-soft);
}

.notice.warning { border-left-color: var(--sc-warning); background: var(--sc-warning-soft); }
.notice strong,
.notice span { display: block; }
.notice span { margin-top: 2px; color: var(--sc-text); }

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}
.empty-state > i { color: var(--sc-primary); font-size: 2rem; }
.empty-state p { max-width: 660px; margin: 0 0 8px; }

.table-region { width: 100%; overflow-x: auto; }
.table-link { display: flex; flex-direction: column; color: var(--sc-heading); text-decoration: none; }
.table-link span,
.cell-note { display: block; margin-top: 3px; color: var(--sc-muted); font-size: 0.73rem; font-weight: 400; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; margin: -6px 0 18px; color: var(--sc-muted); }
.definition-grid { display: grid; grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr); gap: 10px 16px; }
.definition-grid dt { color: var(--sc-muted); font-weight: 700; }
.definition-grid dd { margin: 0; color: var(--sc-heading); overflow-wrap: anywhere; }
.clean-list { display: grid; gap: 9px; padding: 0; list-style: none; }
.clean-list li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; }
.clean-list i { color: var(--sc-success); }
.lead-copy { color: var(--sc-heading); font-size: 1rem; line-height: 1.65; }
.recent-links { display: flex; gap: 10px; flex-wrap: wrap; }
.recent-links a { display: flex; min-width: 180px; flex: 1 1 180px; flex-direction: column; padding: 12px; border: 1px solid var(--sc-border); border-radius: 9px; background: var(--sc-surface-2); text-decoration: none; }
.recent-links span { margin-top: 3px; color: var(--sc-muted); font-size: 0.75rem; }
.recent-history { margin-top: 24px; }
.section-heading.compact { margin-bottom: 10px; }
.field-help { display: block; margin-top: 5px; color: var(--sc-muted); font-size: 0.75rem; font-weight: 500; }
.saved-view-bar { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--sc-border); border-radius: 9px; background: var(--sc-surface-2); }
.inline-save-view { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.inline-save-view label { display: grid; min-width: 220px; gap: 5px; color: var(--sc-heading); font-weight: 700; }
.saved-view-links { display: flex; gap: 8px; flex-wrap: wrap; }
.saved-view-links > span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--sc-border); border-radius: 999px; background: var(--sc-surface); }
.saved-view-links form { margin: 0; }

.policy-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.policy-flow article { padding: 16px; border: 1px solid var(--sc-border); border-radius: 10px; background: var(--sc-surface-2); }
.policy-flow h3 { margin: 12px 0 5px; font-size: 1rem; }
.policy-flow p { margin: 0; }

details { padding: 13px 0; border-bottom: 1px solid var(--sc-border); }
details:last-child { border-bottom: 0; }
summary { color: var(--sc-heading); cursor: pointer; font-weight: 700; }
details p { margin: 9px 0 0; }

@media (max-width: 860px) {
  .dashboard-grid,
  .policy-flow { grid-template-columns: 1fr; }
  .notice { grid-template-columns: 24px minmax(0, 1fr); }
  .notice > a { grid-column: 2; }
}

.narrow {
  width: 100%;
  max-width: 680px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading > div:first-child {
  min-width: 0;
}

.section-heading p {
  margin: 4px 0 0;
}

.muted {
  color: var(--sc-muted) !important;
}

.message-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--sc-success) 38%, var(--sc-border));
  border-left: 4px solid var(--sc-success);
  border-radius: 9px;
  background: var(--sc-success-soft);
  color: var(--sc-text);
}

.message.error,
.message.danger {
  border-color: color-mix(in srgb, var(--sc-danger) 38%, var(--sc-border));
  border-left-color: var(--sc-danger);
  background: var(--sc-danger-soft);
}

.message.warning {
  border-color: color-mix(in srgb, var(--sc-warning) 38%, var(--sc-border));
  border-left-color: var(--sc-warning);
  background: var(--sc-warning-soft);
}

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

.incident-summary {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  background: var(--sc-surface-subtle);
}

.incident-summary h3,
.incident-summary p {
  margin: 0;
}

.incident-summary textarea {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.row-actions {
  min-width: 190px;
}

.row-actions form {
  margin: 0;
}

.btn,
button:not(.icon-control):not(.sidebar-action):not(.sort-link):not(.link-button):not(.drawer-backdrop) {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--sc-primary);
  border-radius: 8px;
  background: var(--sc-primary);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--sc-primary) 20%, transparent);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.btn:hover,
button:not(.icon-control):not(.sidebar-action):not(.sort-link):not(.link-button):not(.drawer-backdrop):hover {
  border-color: var(--sc-primary-hover);
  background: var(--sc-primary-hover);
  color: #ffffff;
}

.btn.secondary,
button.secondary {
  border-color: var(--sc-border);
  background: var(--sc-surface);
  box-shadow: none;
  color: var(--sc-heading);
}

.btn.secondary:hover,
button.secondary:hover {
  border-color: var(--sc-primary);
  background: var(--sc-primary-soft);
  color: var(--sc-primary);
}

.sort-link,
.link-button {
  border: 0;
  background: transparent;
  color: var(--sc-primary);
  font: inherit;
  text-decoration: none;
}

.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.record-form p,
.filters label {
  display: grid;
  gap: 6px;
  margin: 0 0 13px;
  color: var(--sc-heading);
  font-weight: 700;
}

.record-form ul.errorlist {
  margin: 0 0 6px;
  padding: 9px 12px 9px 28px;
  border-radius: 7px;
  background: var(--sc-danger-soft);
  color: var(--sc-danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--sc-border);
  border-radius: 7px;
  background: var(--sc-surface);
  color: var(--sc-text);
}

textarea {
  min-height: 110px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--sc-primary);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sc-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc-focus) 18%, transparent);
  outline: 0;
}

.helptext {
  color: var(--sc-muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.record-form ul:not(.errorlist) {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.record-form ul:not(.errorlist) label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.break-word {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.recovery-code-list {
  columns: 2;
  list-style: none;
  margin: var(--space-4) 0;
  padding: 0;
}

.recovery-code-list li {
  break-inside: avoid;
  margin-bottom: var(--space-2);
}

@media (max-width: 36rem) {
  .recovery-code-list {
    columns: 1;
  }
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--sc-text);
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--sc-border);
  text-align: left;
  vertical-align: middle;
}

.density-compact th,
.density-compact td { padding-top: 7px; padding-bottom: 7px; }

th {
  background: var(--sc-surface-2);
  color: var(--sc-muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--sc-primary) 4%, var(--sc-surface));
}

tbody tr:last-child td {
  border-bottom: 0;
}

code,
pre {
  color: var(--sc-text);
}

td pre {
  max-width: 380px;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  background: var(--sc-surface-2);
  color: var(--sc-text);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: capitalize;
}

.badge.pending,
.badge.warning,
.badge.rotating,
.badge.retiring {
  border-color: color-mix(in srgb, var(--sc-warning) 35%, var(--sc-border));
  background: var(--sc-warning-soft);
  color: var(--sc-warning);
}

.badge.approved,
.badge.accepted,
.badge.active,
.badge.completed {
  border-color: color-mix(in srgb, var(--sc-success) 35%, var(--sc-border));
  background: var(--sc-success-soft);
  color: var(--sc-success);
}

.badge.rejected,
.badge.revoked,
.badge.expired,
.badge.inactive,
.badge.failed,
.badge.interrupted {
  border-color: color-mix(in srgb, var(--sc-danger) 35%, var(--sc-border));
  background: var(--sc-danger-soft);
  color: var(--sc-danger);
}

.badge.new,
.badge.running {
  border-color: color-mix(in srgb, var(--sc-info) 35%, var(--sc-border));
  background: var(--sc-primary-soft);
  color: var(--sc-info);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.report-summary > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--sc-border);
  border-radius: 9px;
  background: var(--sc-surface-2);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--sc-border);
  flex-wrap: wrap;
}

.pagination-summary {
  margin: 0;
  color: var(--sc-muted);
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.product-thumb {
  display: block;
  width: 56px;
  height: 56px;
  border: 1px solid var(--sc-border);
  border-radius: 7px;
  background: var(--sc-surface-2);
  object-fit: cover;
}

.image-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.image-strip img {
  width: clamp(96px, 18vw, 160px);
  border: 1px solid var(--sc-border);
  border-radius: 9px;
  aspect-ratio: 1;
  object-fit: cover;
}

.log-output {
  min-height: 20rem;
  max-height: 70vh;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--sc-border);
  border-radius: 9px;
  background: #080f20;
  color: #dbe6f1;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.session-warning {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 12, 21, 0.68);
}

.session-warning .card {
  background: var(--sc-elevated);
  box-shadow: var(--sc-shadow-raised);
}

[hidden] {
  display: none !important;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.9fr) minmax(430px, 1.1fr);
  background: var(--sc-bg);
}

.auth-brand {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(44px, 8vw, 120px);
  background: var(--sc-nav);
  color: #ffffff;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.auth-brand-lockup i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #3188e6;
}

.auth-brand h1 {
  max-width: 620px;
  margin: 26px 0 16px;
  font-size: clamp(2.15rem, 4.2vw, 3.5rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.auth-brand p {
  max-width: 570px;
  color: var(--sc-nav-muted);
  font-size: 1rem;
}

.auth-brand ul {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--sc-nav-text);
  list-style: none;
}

.auth-brand li i {
  margin-right: 7px;
  color: #6ee7b7;
}

.auth-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 34px 20px;
}

.auth-content {
  width: min(470px, 100%);
}

.auth-content .card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 30px;
  overflow: visible;
  box-shadow: var(--sc-shadow-raised);
}

.auth-content .card h2 {
  margin-bottom: 7px;
  font-size: 1.55rem;
}

.auth-content .record-form {
  margin-top: 20px;
}

.auth-content .record-form > button {
  width: 100%;
}

.auth-content .card > p:last-child {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--sc-border);
}

.nav-collapsed .app-sidebar {
  width: var(--sc-sidebar-rail);
}

.nav-collapsed .app-workspace {
  margin-left: var(--sc-sidebar-rail);
}

.nav-collapsed .brand-copy,
.nav-collapsed .nav-section h2,
.nav-collapsed .nav-section a span,
.nav-collapsed .nav-section a small,
.nav-collapsed .sidebar-action span {
  display: none;
}

.nav-collapsed .sidebar-brand {
  justify-content: center;
  padding-inline: 18px;
}

.nav-collapsed .nav-section a {
  grid-template-columns: 1fr;
  justify-items: center;
}

.nav-collapsed .sidebar-action {
  justify-content: center;
}

.nav-collapsed .collapse-control i {
  transform: rotate(180deg);
}

@media (max-width: 1199px) {
  .app-sidebar {
    width: var(--sc-sidebar-rail);
  }

  .app-workspace {
    margin-left: var(--sc-sidebar-rail);
  }

  .brand-copy,
  .nav-section h2,
  .nav-section a span,
  .nav-section a small,
  .sidebar-action span {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
    padding-inline: 18px;
  }

  .nav-section a {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .sidebar-action {
    justify-content: center;
  }

  .collapse-control {
    display: none;
  }

  .page-content {
    padding-inline: 24px;
  }
}

@media (max-width: 767px) {
  .app-sidebar {
    width: min(300px, 86vw);
    transform: translateX(-104%);
    box-shadow: var(--sc-shadow-raised);
  }

  .app-sidebar.drawer-visible {
    transform: translateX(0);
  }

  .app-sidebar .brand-copy,
  .app-sidebar .nav-section h2,
  .app-sidebar .nav-section a span,
  .app-sidebar .nav-section a small,
  .app-sidebar .sidebar-action span {
    display: flex;
  }

  .app-sidebar .sidebar-brand {
    justify-content: flex-start;
  }

  .app-sidebar .nav-section a {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    justify-items: stretch;
  }

  .app-sidebar .sidebar-action {
    justify-content: flex-start;
  }

  .app-workspace,
  .nav-collapsed .app-workspace {
    margin-left: 0;
  }

  .drawer-open,
  .drawer-close {
    display: inline-grid;
  }

  .drawer-close {
    border-color: var(--sc-nav-border);
    background: transparent;
    color: var(--sc-nav-text);
  }

  .drawer-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(3, 12, 21, 0.62);
    box-shadow: none;
  }

  .app-topbar {
    padding-inline: 13px;
  }

  .global-search {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .global-search kbd,
  .account-summary > span:not(.avatar),
  .account-summary > i {
    display: none;
  }

  .page-content {
    padding: 24px 16px 36px;
  }

  .since-away-summary,
  .notification-item {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    flex-wrap: wrap;
  }

  .section-heading {
    flex-direction: column;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    padding: 28px 16px;
  }

  .filters,
  .form-grid,
  .report-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-topbar {
    gap: 8px;
  }

  .global-search {
    font-size: 0.72rem;
  }

  .avatar {
    display: none;
  }

  .page-title-row h1 {
    font-size: 1.5rem;
  }

  .card,
  .auth-content .card {
    padding: 16px;
  }

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

  .actions > * {
    width: 100%;
  }

  .session-warning {
    align-items: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
