@font-face {
  font-family: "Estedad";
  src: url("/fonts/estedad.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: "Estedad", "Segoe UI", Tahoma, sans-serif;

  /* Aevomorph brand primitives — sourced from ../site/brand-tokens.json. */
  --brand-accent-50: #eef1ff;
  --brand-accent-100: #dfe5ff;
  --brand-accent-300: #9faff5;
  --brand-accent-500: #5266d4;
  --brand-accent-700: #333c99;
  --brand-accent-900: #1e246f;
  --brand-accent-950: #11143f;
  --brand-accent-bright: #7184ee;
  --brand-neutral-50: #f6f7fa;
  --brand-neutral-100: #eef0f6;
  --brand-neutral-500: #687083;
  --brand-neutral-900: #141724;
  --brand-neutral-950: #0c0f1c;
  --brand-paper: #f4f5f8;
  --brand-ink: #080a13;

  /* Semantic application tokens. */
  --bg: var(--brand-paper);
  --surface: #ffffff;
  --surface-soft: var(--brand-neutral-50);
  --surface-strong: var(--brand-neutral-100);
  --text: var(--brand-neutral-900);
  --text-soft: var(--brand-neutral-500);
  --text-faint: #7b8393;
  --primary: var(--brand-accent-500);
  --primary-hover: var(--brand-accent-700);
  --primary-soft: var(--brand-accent-50);
  --border: rgb(17 23 42 / 13%);
  --border-strong: #cbd0dc;
  --danger: #b4233e;
  --danger-soft: #fff0f2;
  --warning: #a15c00;
  --warning-soft: #fff7e7;
  --success: #147452;
  --success-soft: #ecf9f3;
  --info: #28659e;
  --info-soft: #edf6ff;
  --shadow: 0 1px 2px rgb(20 23 36 / 5%), 0 8px 24px rgb(20 23 36 / 4%);
  --chrome-surface: #ffffff;
  --chrome-surface-translucent: rgb(255 255 255 / 94%);
  --chrome-text: var(--text);
  --chrome-muted: var(--text-soft);
  --chrome-faint: var(--text-faint);
  --chrome-border: var(--border);
  --chrome-border-strong: var(--border-strong);
  --chrome-hover: var(--surface-soft);
  --sidebar-width: 274px;
  --header-height: 64px;
  --radius: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--brand-neutral-950);
  --surface: var(--brand-neutral-900);
  --surface-soft: #1a1e2d;
  --surface-strong: #242b3d;
  --text: var(--brand-neutral-50);
  --text-soft: #b5bdd2;
  --text-faint: #8f98ad;
  --primary-soft: rgb(82 102 212 / 20%);
  --border: rgb(255 255 255 / 14%);
  --border-strong: rgb(255 255 255 / 24%);
  --danger: #ff9aab;
  --danger-soft: rgb(180 35 62 / 18%);
  --warning: #f5c979;
  --warning-soft: rgb(161 92 0 / 20%);
  --success: #8be0b7;
  --success-soft: rgb(20 116 82 / 22%);
  --info: #9faff5;
  --info-soft: rgb(82 102 212 / 20%);
  --shadow: 0 1px 2px rgb(0 0 0 / 24%), 0 8px 24px rgb(0 0 0 / 18%);
  --chrome-surface: var(--brand-ink);
  --chrome-surface-translucent: rgb(8 10 19 / 94%);
  --chrome-text: #ffffff;
  --chrome-muted: rgb(255 255 255 / 72%);
  --chrome-faint: rgb(255 255 255 / 45%);
  --chrome-border: rgb(255 255 255 / 14%);
  --chrome-border-strong: rgb(255 255 255 / 24%);
  --chrome-hover: rgb(255 255 255 / 8%);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea,
[tabindex] {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  box-shadow: 0 0 0 3px rgb(82 102 212 / 22%);
}

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

button {
  color: inherit;
}

svg {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  right: 8px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--text-soft);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--surface-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 0 0 auto;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--chrome-border);
  background: var(--chrome-surface);
  color: var(--chrome-text);
  transition:
    width 180ms ease,
    transform 180ms ease;
}

.brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--chrome-border);
  white-space: nowrap;
  overflow: hidden;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--chrome-border-strong);
  border-radius: 10px;
  background: #fff;
}

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

.brand-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  margin-top: -2px;
  font-size: 10px;
  color: var(--chrome-muted);
}

.sidebar-scroll {
  flex: 1;
  overflow: auto;
  padding: 16px 10px 24px;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-label {
  margin: 0 12px 5px;
  color: var(--chrome-faint);
  font-size: 10px;
  font-weight: 650;
}

.nav-link {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--chrome-muted);
  font-size: 13px;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.nav-link:hover {
  background: var(--chrome-hover);
  color: var(--chrome-text);
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 670;
}

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

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

.sidebar .sidebar-collapse {
  width: 100%;
  justify-content: flex-start;
  border-color: var(--chrome-border);
  background: transparent;
  color: var(--chrome-muted);
}

.sidebar .sidebar-collapse:hover {
  border-color: var(--chrome-border-strong);
  background: var(--chrome-hover);
  color: var(--chrome-text);
}

.shell-main {
  min-height: 100vh;
  margin-right: var(--sidebar-width);
  transition: margin 180ms ease;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--chrome-border);
  background: var(--chrome-surface-translucent);
  color: var(--chrome-text);
  backdrop-filter: blur(10px);
}

.topbar > .btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--chrome-muted);
}

.topbar > .btn-ghost:hover {
  border-color: var(--chrome-border-strong);
  background: var(--chrome-hover);
  color: var(--chrome-text);
}

.mobile-menu {
  display: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--chrome-faint);
  font-size: 12px;
}

.breadcrumb strong {
  overflow: hidden;
  color: var(--chrome-text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1;
}

.search-trigger {
  width: min(310px, 30vw);
  justify-content: flex-start;
  color: var(--text-soft);
}

.search-trigger kbd {
  margin-right: auto;
}

.topbar > [data-action="quick-create"] {
  flex: 0 0 auto;
  white-space: nowrap;
}

kbd {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-faint);
  font-family: var(--font);
  font-size: 10px;
  text-align: center;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.header-user:hover {
  background: var(--chrome-hover);
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
}

.avatar .icon {
  width: 18px;
  height: 18px;
}

.user-copy {
  min-width: 0;
  text-align: right;
}

.user-copy strong,
.user-copy span {
  max-width: 140px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 11px;
}
.user-copy span {
  color: var(--chrome-faint);
  font-size: 9px;
}

.content {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.page-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.page-icon {
  width: 32px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  color: var(--primary);
}

.page-icon .icon {
  width: 30px;
  height: 30px;
}

.page-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.page-head p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.workspace-focus {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-bottom: 2px;
  border: 1px solid var(--brand-accent-100);
  border-radius: 999px;
  background: var(--primary-soft);
  padding: 1px 8px;
  color: var(--primary-hover);
  font-size: 9px;
  font-weight: 700;
}

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

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  padding: 7px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 610;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.btn[hidden] {
  display: none !important;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}
.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-danger {
  border-color: #f3c8d0;
  color: var(--danger);
}
.btn-sm {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 11px;
}
.btn-icon {
  width: 36px;
  padding: 0;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.role-metrics {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.role-sections.single {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.workspace-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 8px 10px;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 620;
}

.workspace-link:hover {
  border-color: var(--brand-accent-100);
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.workspace-link .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.metric-card {
  min-width: 0;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 1px 1px rgb(20 23 36 / 2%);
  transition:
    border-color 140ms ease,
    transform 140ms ease;
}

.metric-card:hover {
  border-color: var(--brand-accent-100);
  transform: translateY(-1px);
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.metric-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}
.metric-icon .icon {
  width: 20px;
  height: 20px;
}
.metric-icon.warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.metric-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.metric-label {
  color: var(--text-soft);
  font-size: 10.5px;
}
.metric-value {
  margin-top: 9px;
  font-size: 26px;
  font-weight: 760;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-detail {
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

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

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.card-head p {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: 10px;
}
.card-body {
  padding: 16px;
}
.card-body.flush {
  padding: 0;
}

.action-row,
.decision-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.action-row:last-child,
.decision-row:last-child {
  border-bottom: 0;
}
.action-title {
  font-weight: 650;
  font-size: 12px;
}
.action-title:hover {
  color: var(--primary);
  text-decoration: underline;
}
.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 10px;
}
.meta span + span::before {
  content: "•";
  margin-left: 6px;
  color: var(--text-faint);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 2px 8px;
  color: var(--text-soft);
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.75;
}

.permission-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 5px;
}

.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-picker {
  min-width: 0;
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.permission-picker legend {
  padding-inline: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.permission-picker > p {
  margin: 0 0 10px;
  color: var(--text-faint);
  font-size: 9.5px;
}

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

.permission-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 9px;
  cursor: pointer;
}

.permission-option:has(input:checked) {
  border-color: var(--brand-accent-300);
  background: var(--primary-soft);
}

.permission-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.permission-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.permission-option strong {
  color: var(--text);
  font-size: 10px;
}

.permission-option small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.success {
  border-color: #c8ebdc;
  background: var(--success-soft);
  color: var(--success);
}
.badge.warning {
  border-color: #f2deb4;
  background: var(--warning-soft);
  color: var(--warning);
}
.badge.danger {
  border-color: #f1c9d1;
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.info {
  border-color: #cce3f6;
  background: var(--info-soft);
  color: var(--info);
}

.alerts {
  display: grid;
  gap: 9px;
}
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--text-soft);
  font-size: 11px;
}
.alert.warning {
  border-color: #f0deba;
  background: #fffcf4;
  color: #754600;
}
.alert.danger {
  border-color: #f0d0d6;
  background: #fff8f9;
  color: #8d1830;
}
.alert .icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.pipeline {
  display: grid;
  gap: 10px;
}
.pipeline-row {
  display: grid;
  grid-template-columns: 112px minmax(100px, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}
.pipeline-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-strong);
}
.pipeline-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.pipeline-count {
  font-weight: 700;
  text-align: left;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.toolbar > .btn {
  min-height: 38px;
}

.toolbar-summary-only {
  align-items: center;
  padding-block: 6px;
}

.toolbar-summary-only .toolbar-summary {
  margin-inline: 0;
  min-height: 28px;
}

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

.field label,
.field-label {
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 10px;
  color: var(--text);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.7;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(82 102 212 / 12%);
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.field-error {
  min-height: 15px;
  color: var(--danger);
  font-size: 9px;
}
.field-help {
  color: var(--text-faint);
  font-size: 9px;
}
.toolbar-search {
  width: min(310px, 100%);
}
.toolbar .select {
  width: auto;
  min-width: 160px;
}
.toolbar-summary {
  margin-right: auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: var(--text-faint);
  font-size: 10px;
}

.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.data-table th {
  height: 41px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 9.5px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}
.data-table th,
.data-table td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 120ms ease;
}
.data-table tbody tr:hover {
  background: var(--surface-soft);
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.cell-title {
  min-width: 150px;
  font-weight: 650;
}
.cell-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 450;
}
.numeric {
  direction: ltr;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 10px;
}
.pagination-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  min-height: 230px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
}
.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-faint);
}
.empty-state h3 {
  margin: 12px 0 3px;
  font-size: 13px;
}
.empty-state p {
  max-width: 380px;
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface-strong);
}
.skeleton::after {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgb(255 255 255 / 75%),
    transparent
  );
  animation: shimmer 1.2s infinite;
  content: "";
}
@keyframes shimmer {
  to {
    transform: translateX(-100%);
  }
}
.skeleton.line {
  width: 100%;
  height: 12px;
}
.skeleton.card-skeleton {
  height: 92px;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: rgb(8 10 19 / 46%);
  animation: fade-in 140ms ease;
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal {
  width: min(660px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(8 10 19 / 24%);
  animation: modal-in 160ms ease;
}
.modal.wide {
  width: min(900px, 100%);
}
.modal.command-modal {
  width: min(600px, 100%);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 15px;
}
.modal-head p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}
.modal-body {
  overflow: auto;
  padding: 18px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-start;
}
.drawer {
  width: min(540px, 92vw);
  height: 100%;
  overflow: auto;
  background: var(--surface);
  box-shadow: 18px 0 70px rgb(8 10 19 / 22%);
  animation: drawer-in 180ms ease;
}
.drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(8px);
}

:root[data-theme="dark"] .drawer-head {
  background: rgb(20 23 36 / 94%);
}
.drawer-head h2 {
  margin: 0;
  font-size: 16px;
}
.drawer-body {
  padding: 18px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}
@keyframes drawer-in {
  from {
    transform: translateX(-100%);
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 13px;
}
.application-field-companion {
  margin-block-start: 21.5px;
}
.field.full {
  grid-column: 1 / -1;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 18px;
}
.step {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text-faint);
  cursor: pointer;
}
.step-number {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 9px;
  font-weight: 700;
}
.step span:last-child {
  max-width: 100%;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step.active {
  color: var(--primary);
}
.step.active .step-number {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.step.done .step-number {
  border-color: #8bd0b5;
  background: var(--success-soft);
  color: var(--success);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 11px;
}
.detail-item dt {
  color: var(--text-faint);
  font-size: 9px;
}
.detail-item dd {
  margin: 3px 0 0;
  font-size: 11px;
  font-weight: 580;
}
.detail-section + .detail-section {
  margin-top: 18px;
}
.detail-section h3 {
  margin: 0 0 9px;
  font-size: 12px;
}
.prose-box {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 11px;
  color: var(--text-soft);
  font-size: 10.5px;
  white-space: pre-wrap;
}

.command-box {
  width: 100%;
  min-height: 0;
}
.command-input {
  width: 100%;
  height: 52px;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  font-size: 13px;
}
.command-list {
  max-height: 360px;
  overflow: auto;
  padding: 7px;
}
.command-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
  text-align: right;
  cursor: pointer;
}
.command-item:hover,
.command-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.command-item .icon {
  width: 17px;
  height: 17px;
}

.popover {
  position: fixed;
  z-index: 90;
  width: 280px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgb(8 10 19 / 17%);
}
.popover-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}
.popover-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 10px 12px;
  text-align: right;
  cursor: pointer;
}
.popover-item:last-child {
  border-bottom: 0;
}
.popover-item:hover {
  background: var(--surface-soft);
}
.popover-item strong {
  display: block;
  font-size: 10.5px;
}
.popover-item span {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 9px;
}

.profile-entry {
  position: relative;
}

.popover-hint {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px !important;
  color: var(--primary) !important;
  font-weight: 650;
}

.popover-hint .icon {
  width: 15px;
  height: 15px;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid var(--brand-accent-100);
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 20px;
  font-weight: 780;
}

.profile-identity h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.profile-identity p {
  margin: 1px 0 8px;
  color: var(--text-soft);
  direction: ltr;
  font-size: 11px;
  text-align: right;
}

.profile-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.profile-summary div {
  min-width: 90px;
  padding: 12px 14px;
  border-left: 1px solid var(--border);
  text-align: center;
}

.profile-summary div:last-child {
  border-left: 0;
}

.profile-summary strong,
.profile-summary span {
  display: block;
}

.profile-summary strong {
  font-size: 20px;
}

.profile-summary span {
  color: var(--text-faint);
  font-size: 9px;
}

.profile-modules {
  margin-top: 0;
}

.profile-settings {
  display: grid;
}

.profile-setting {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-setting:last-child {
  border-bottom: 0;
}

.profile-setting strong,
.profile-setting span {
  display: block;
}

.profile-setting strong {
  font-size: 11px;
}

.profile-setting div > span {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 9.5px;
}

.profile-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  left: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
}
.toast {
  min-width: 280px;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 12px;
  box-shadow: 0 14px 40px rgb(8 10 19 / 15%);
  animation: toast-in 180ms ease;
  font-size: 10.5px;
}
.toast.success {
  border-color: #bde2d3;
}
.toast.error {
  border-color: #ecc4cc;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 42%);
  background: var(--surface);
}

.login-context {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px;
  background: linear-gradient(
    145deg,
    var(--brand-accent-900) 0%,
    var(--brand-ink) 66%
  );
  color: #fff;
}

.login-context::before,
.login-context::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  content: "";
}
.login-context::before {
  width: 520px;
  height: 520px;
  left: -210px;
  bottom: -190px;
}
.login-context::after {
  width: 310px;
  height: 310px;
  left: 130px;
  bottom: -120px;
}
.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-brand .brand-mark {
  background: #fff;
}
.login-brand strong {
  display: block;
  font-size: 16px;
}
.login-brand span {
  color: rgb(255 255 255 / 60%);
  font-size: 10px;
}
.login-summary {
  position: relative;
  max-width: 560px;
}
.login-summary h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.45;
  letter-spacing: -0.04em;
}
.login-summary p {
  max-width: 510px;
  margin: 16px 0 0;
  color: rgb(255 255 255 / 66%);
  font-size: 12px;
  line-height: 2;
}
.login-points {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.login-point {
  border-top: 1px solid rgb(255 255 255 / 16%);
  padding-top: 11px;
}
.login-point strong {
  display: block;
  font-size: 11px;
}
.login-point span {
  color: rgb(255 255 255 / 52%);
  font-size: 9px;
}

.login-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px;
}

.login-panel-tools {
  position: absolute;
  top: 22px;
  left: 22px;
}

.theme-toggle .icon {
  width: 17px;
  height: 17px;
}

:root[data-theme="dark"] .badge.success {
  border-color: rgb(139 224 183 / 35%);
}

:root[data-theme="dark"] .badge.warning {
  border-color: rgb(245 201 121 / 35%);
}

:root[data-theme="dark"] .badge.danger {
  border-color: rgb(255 154 171 / 35%);
}

:root[data-theme="dark"] .badge.info {
  border-color: rgb(159 175 245 / 35%);
}

:root[data-theme="dark"] .alert.warning {
  border-color: rgb(245 201 121 / 35%);
  background: var(--warning-soft);
  color: var(--warning);
}

:root[data-theme="dark"] .alert.danger {
  border-color: rgb(255 154 171 / 35%);
  background: var(--danger-soft);
  color: var(--danger);
}

:root[data-theme="dark"] .toast.success {
  border-color: rgb(139 224 183 / 35%);
}

:root[data-theme="dark"] .toast.error {
  border-color: rgb(255 154 171 / 35%);
}
.login-form-wrap {
  width: min(390px, 100%);
}
.login-form-wrap h2 {
  margin: 0;
  font-size: 21px;
}
.login-form-wrap > p {
  margin: 5px 0 25px;
  color: var(--text-soft);
  font-size: 11px;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-form .btn {
  margin-top: 4px;
  min-height: 42px;
}
.demo-accounts {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}
.demo-accounts strong {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}
.demo-account {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  padding: 7px 0;
  color: var(--text-soft);
  font-size: 9px;
  cursor: pointer;
}
.demo-account:first-of-type {
  border-top: 0;
}
.demo-account:hover {
  color: var(--primary);
}

.error-page {
  min-height: 55vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.error-page h2 {
  margin: 14px 0 4px;
  font-size: 17px;
}
.error-page p {
  max-width: 480px;
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 11px;
}

body.sidebar-collapsed {
  --sidebar-width: 76px;
}
body.sidebar-collapsed .brand {
  padding: 0 20px;
}
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .sidebar-collapse span {
  display: none;
}
body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding-inline: 0;
}
body.sidebar-collapsed .sidebar-collapse {
  justify-content: center;
}

@media (max-width: 1250px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .topbar {
    gap: 8px;
    padding-inline: 16px;
  }
  .search-trigger {
    width: min(250px, 26vw);
  }
  .user-copy {
    display: none;
  }
  .header-user {
    padding-inline: 4px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 0px;
  }
  body.sidebar-collapsed {
    --sidebar-width: 0px;
  }
  .sidebar {
    width: 274px;
    transform: translateX(100%);
    box-shadow: -20px 0 60px rgb(8 10 19 / 12%);
  }
  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }
  body.mobile-nav-open::after {
    position: fixed;
    z-index: 45;
    inset: 0;
    background: rgb(8 10 19 / 35%);
    content: "";
  }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-link span,
  body.sidebar-collapsed .sidebar-collapse span {
    display: block;
  }
  body.sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding-inline: 11px;
  }
  body.sidebar-collapsed .sidebar-collapse {
    justify-content: flex-start;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .search-trigger {
    width: 170px;
  }
  .grid-2,
  .grid-equal {
    grid-template-columns: 1fr;
  }
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .profile-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 13px;
  }
  .content {
    padding: 18px 13px 38px;
  }
  .breadcrumb,
  .search-trigger span,
  .search-trigger kbd,
  .user-copy,
  .quick-create-label {
    display: none;
  }
  .search-trigger {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }
  .page-actions .btn {
    flex: 1;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .permission-options {
    grid-template-columns: 1fr;
  }
  .application-field-companion {
    margin-block-start: 0;
  }
  .field.full {
    grid-column: auto;
  }
  .stepper {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
  }
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-context {
    min-height: 210px;
    padding: 24px;
  }
  .login-summary h1 {
    font-size: 24px;
  }
  .login-summary p,
  .login-points {
    display: none;
  }
  .login-panel {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 6px;
    padding-inline: 8px;
  }
  .topbar .header-user {
    padding: 2px;
  }
  .topbar > [data-action="quick-create"] {
    width: 36px;
    padding: 0;
  }
}

@media (max-width: 450px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .metric-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .metric-value {
    grid-row: 1 / 3;
    grid-column: 2;
    margin: 0;
  }
  .metric-detail {
    margin-top: 3px;
  }
  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .profile-identity p {
    text-align: center;
  }
  .profile-roles {
    justify-content: center;
  }
  .profile-summary {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-summary div {
    min-width: 0;
    padding-inline: 7px;
  }
  .workspace-links {
    grid-template-columns: 1fr;
  }
  .action-row {
    grid-template-columns: 1fr;
  }
}
