:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-tint: #f3f6fa;
  --text: #1f2329;
  --muted: #7b8494;
  --muted-strong: #4b5565;
  --border: #e5e9f0;
  --border-strong: #cdd5df;
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --accent: #1677ff;
  --accent-cyan: #0ea5e9;
  --sidebar: #ffffff;
  --sidebar-soft: #f5f7fa;
  --sidebar-active: #e6f2ff;
  --shadow: 0 14px 32px rgba(27, 39, 55, 0.07);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 14px;
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.brand-mark.large {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
}

.workspace-switcher {
  position: relative;
  margin: 0 -8px 12px;
}

.workspace-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 0 20px 0 18px;
  border: 0;
  border-radius: 0;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.workspace-current i {
  position: relative;
  width: 16px;
  height: 16px;
  color: var(--muted-strong);
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
}

.workspace-current i::before,
.workspace-current i::after {
  position: absolute;
  left: 3px;
  width: 10px;
  height: 1.5px;
  background: currentColor;
  content: "";
}

.workspace-current i::before {
  top: 5px;
  box-shadow: 0 5px 0 currentColor;
}

.workspace-current i::after {
  top: 2px;
  transform: rotate(90deg);
  transform-origin: center 8px;
}

.workspace-switcher.is-open .workspace-current i {
  transform: rotate(90deg);
}

.workspace-menu {
  position: static;
  z-index: 20;
  width: auto;
  margin: 6px 8px 0 18px;
  display: none;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.workspace-menu[hidden] {
  display: none;
}

.workspace-switcher.is-open .workspace-menu {
  display: grid;
  gap: 4px;
}

.workspace-menu a {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 6px 9px;
  border-radius: 8px;
}

.workspace-menu a:hover,
.workspace-menu a.is-active {
  background: var(--sidebar-active);
  color: var(--primary);
}

.workspace-menu span {
  font-size: 14px;
  font-weight: 800;
}

.workspace-menu small {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item,
.nav-parent,
.sidebar-footer a,
.sidebar-footer button {
  display: flex;
  align-items: center;
  min-height: 42px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2f343d;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.nav-parent {
  justify-content: space-between;
}

.nav-parent span {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
}

.nav-group.is-open .nav-parent span {
  transform: rotate(225deg);
}

.nav-item:hover,
.nav-parent:hover,
.sidebar-footer a:hover,
.sidebar-footer button:hover,
.nav-group.is-open .nav-parent,
.nav-item.is-active {
  background: var(--sidebar-soft);
  color: var(--primary);
  box-shadow: none;
}

.nav-children {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 220ms cubic-bezier(0.2, 0, 0, 1), opacity 160ms ease, transform 220ms cubic-bezier(0.2, 0, 0, 1);
}

.nav-group.is-open .nav-children {
  max-height: 340px;
  opacity: 1;
  transform: translateY(0);
}

.nav-children a {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 2px 0 2px 10px;
  padding: 0 9px;
  border-left: 1px solid #e5e9f0;
  border-radius: 8px;
  color: #2f343d;
  font-size: 13px;
}

.nav-children a:hover,
.nav-children a.is-active {
  background: var(--sidebar-active);
  color: var(--primary);
}

.nav-children a.is-active {
  box-shadow: none;
}

.sidebar-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  max-width: 1280px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 18px;
  padding: 0 2px;
}

.topbar strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fbff;
  color: #1e3a8a;
  font-size: 13px;
}

.hero,
.page-header,
.stat-grid,
.content-grid {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

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

.form-page-header {
  max-width: 980px;
  align-items: center;
  margin-bottom: 24px;
  padding-top: 12px;
}

.form-page-header > div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.form-page-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.form-page-header p {
  max-width: 380px;
  color: var(--muted-strong);
  text-align: right;
}

.back-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  font-size: 25px;
  font-weight: 500;
}

.back-link:hover {
  background: var(--surface-soft);
}

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

.page-actions .button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: none;
}

.page-actions .button:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.page-actions .button:active {
  border-color: var(--primary-active);
  background: var(--primary-active);
}

.row-actions {
  white-space: nowrap;
}

.message-list {
  max-width: 1280px;
  display: grid;
  gap: 8px;
  margin: 0 auto 14px;
}

.message {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted-strong);
  font-size: 13px;
}

.message.error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero h1,
.page-header h1 {
  margin: 7px 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero p,
.page-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 650;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.button.primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button.primary:active {
  border-color: var(--primary-active);
  background: var(--primary-active);
}

.button.full {
  width: 100%;
}

.row-actions a,
.row-actions button {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  margin: 0 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: color 120ms ease;
}

.row-actions a:hover,
.row-actions button:hover {
  background: transparent;
  color: var(--primary-hover);
}

.row-actions a:active,
.row-actions button:active {
  background: transparent;
  color: var(--primary);
}

.row-actions form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

tr.is-muted {
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

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

.stat-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card:hover {
  border-color: #b9ccff;
  box-shadow: 0 12px 24px rgba(47, 85, 255, 0.07);
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stat-card strong {
  margin: 10px 0;
  font-size: 30px;
  line-height: 1;
  color: var(--primary);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.content-grid.single {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

.stack {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(27, 39, 55, 0.045);
}

.muted-panel {
  background: var(--surface-soft);
}

.panel h2 {
  margin: 0;
  font-size: 17px;
}

.panel p {
  color: var(--muted-strong);
  line-height: 1.7;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading.sub-heading {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.panel-heading span,
.panel-heading a {
  color: var(--muted);
  font-size: 13px;
}

.module-list,
.compact-list,
.timeline {
  display: grid;
  gap: 10px;
}

.module-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e6f2ff;
  color: var(--primary);
  font-weight: 800;
}

.module-row strong,
.compact-item strong {
  display: block;
  font-size: 14px;
}

.module-row small,
.compact-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.module-row em {
  color: var(--muted-strong);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.compact-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.page-header {
  padding: 8px 2px 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.timeline-item span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e6f2ff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.timeline-item p {
  margin: 3px 0 0;
}

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

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

.data-table thead {
  background: var(--surface-tint);
}

.data-table th {
  color: #4b5565;
  font-weight: 650;
}

.data-table a {
  color: var(--primary);
  font-weight: 650;
}

.form-panel {
  max-width: 980px;
  margin: 0 auto;
}

.form-card {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 18px 18px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(27, 39, 55, 0.055);
}

.business-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
  align-items: start;
}

.form-field {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.form-field.is-wide {
  grid-column: span 2;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #c7d0dc;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.form-field textarea {
  height: 132px;
  min-height: 132px;
  resize: vertical;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 2px;
}

.form-errors {
  color: #b91c1c;
  font-size: 12px;
}

.empty-state {
  color: var(--muted);
}

.detail-grid {
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-left: auto;
  margin-right: auto;
}

.field-list {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  font-size: 14px;
}

.field-list dt {
  color: var(--muted);
}

.field-list dd {
  margin: 0;
}

/* ---- Login: particle backdrop with a calm workspace card ---- */
.login-body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: #151922;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.92)),
    #f8fbff;
}

.login-particle-canvas,
.login-orb {
  position: fixed;
  pointer-events: none;
}

.login-particle-canvas {
  inset: 0;
  z-index: 0;
}

.login-orb {
  z-index: 1;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.12;
}

.login-orb-left {
  left: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25), transparent 68%);
}

.login-orb-right {
  top: -150px;
  right: -120px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.22), transparent 70%);
}

.login-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: clamp(48px, 8vw, 116px);
  width: min(1180px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
}

.login-hero-copy {
  max-width: 620px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.login-brand-row .brand-mark.large {
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 14px;
  background: #111827;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.18);
}

.login-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.login-brand-row strong {
  display: block;
  margin-top: 3px;
  color: #101828;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-kicker {
  display: block;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-hero-copy h1 {
  max-width: 620px;
  margin: 0;
  color: #151922;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: 0;
}

.login-hero-copy p {
  max-width: 520px;
  margin: 22px 0 0;
  color: #536173;
  font-size: 17px;
  line-height: 1.75;
}

.login-module-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.login-module-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #344054;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(14px);
}

.login-card {
  position: relative;
  width: 100%;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    0 18px 56px rgba(15, 23, 42, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(9px) saturate(1.08);
  -webkit-backdrop-filter: blur(9px) saturate(1.08);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(14, 165, 233, 0.1), transparent 38%);
  opacity: 0.02;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-card-head {
  margin-bottom: 26px;
}

.login-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.login-card h2 {
  margin: 16px 0 8px;
  color: #101828;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
}

.login-card p {
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 20px;
}

/* ---- Google-style outlined fields with floating label ---- */
.login-form .field {
  position: relative;
}

.login-form .field input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.46);
  color: #101828;
  font-size: 16px;
  box-shadow: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.login-form .field input:hover {
  border-color: #8fa1b8;
}

.login-form .field input:focus {
  outline: none;
  border-color: #2563eb;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
}

.login-form .field label {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  color: #667085;
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  transition: top 0.16s ease, font-size 0.16s ease, color 0.16s ease;
}

.login-form .field input:focus + label,
.login-form .field input:not(:placeholder-shown) + label {
  top: -8px;
  transform: none;
  color: #2563eb;
  font-size: 12px;
  background: #fcfcff;
  box-shadow: none;
}

.field-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #667085;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.field-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.field-toggle.is-active {
  color: #2563eb;
}

/* keep typed text clear of the password toggle */
.login-form .field input#login-password {
  padding-right: 52px;
}

.login-submit {
  min-height: 48px;
  margin-top: 2px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.login-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.34);
}

.login-submit:active {
  transform: translateY(1px);
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: rgba(254, 242, 242, 0.92);
  color: #b42318;
  font-size: 13.5px;
}

.form-error svg {
  flex: none;
}

.login-foot {
  margin: 24px 0 0;
  text-align: center;
  color: #98a2b3;
  font-size: 12px;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 28px;
    width: min(560px, calc(100vw - 32px));
    padding: 32px 0;
  }

  .login-hero-copy {
    text-align: center;
  }

  .login-brand-row,
  .login-module-pills {
    justify-content: center;
  }

  .login-hero-copy h1 {
    font-size: clamp(34px, 8vw, 48px);
  }

  .login-hero-copy p {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 560px) {
  .login-shell {
    width: min(100% - 24px, 420px);
    padding: 22px 0;
  }

  .login-hero-copy {
    display: none;
  }

  .login-card {
    border-radius: 20px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .brand {
    padding-bottom: 10px;
  }

  .nav-item,
  .nav-parent,
  .sidebar-footer a,
  .sidebar-footer button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .nav-children a {
    min-height: 32px;
    font-size: 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .hero,
  .content-grid,
  .content-grid.single {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
  }

  .hero-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 560px) {
  .topbar {
    min-height: 44px;
    margin-bottom: 10px;
  }

  .topbar .eyebrow,
  .user-chip {
    display: none;
  }

  .hero,
  .panel {
    padding: 16px;
  }

  .login-card {
    padding: 32px 22px 26px;
  }

  .hero h1,
  .page-header h1 {
    font-size: 28px;
  }

  .stat-grid,
  .stat-grid.compact {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 108px;
  }

  .module-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .module-row em {
    grid-column: 2;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 760px;
  }

  .panel:has(.data-table) {
    overflow-x: auto;
  }
}

/* ---- MFA: login-consistent verification card ---- */
.mfa-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(520px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
}

.mfa-brand {
  width: 100%;
  margin-bottom: 24px;
}

.mfa-brand .login-brand-row {
  justify-content: center;
  margin-bottom: 0;
}

.mfa-card {
  width: 100%;
}

.mfa-card .login-card-head {
  margin-bottom: 22px;
}

.mfa-card .login-card-head h2 {
  font-size: 26px;
}

.mfa-form {
  gap: 16px;
}

.mfa-form .field input.mfa-code-input {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.35em;
  text-align: center;
}

.mfa-form .field input.mfa-code-input.is-recovery {
  font-size: 15px;
  letter-spacing: 0;
  text-align: left;
}

.mfa-recovery-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  color: #475467;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}

.mfa-recovery-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}

.mfa-qr-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
}

.mfa-qr-image {
  width: 200px;
  height: 200px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.mfa-manual-secret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #667085;
  font-size: 12px;
}

.mfa-manual-secret code {
  padding: 6px 10px;
  border: 1px dashed rgba(148, 163, 184, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: #101828;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  letter-spacing: 0.08em;
}

.mfa-copy-button {
  padding: 4px 9px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
}

.mfa-copy-button:hover {
  background: rgba(37, 99, 235, 0.12);
}

.mfa-hint {
  margin: 0;
  color: #667085;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: center;
}

.mfa-skip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.26);
  color: #667085;
  font-size: 12.5px;
  text-align: center;
}

.mfa-skip form {
  margin: 0;
}

.mfa-skip-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mfa-skip-button:hover {
  color: #1d4ed8;
}

.mfa-card .login-foot a {
  color: #98a2b3;
  text-decoration: none;
}

.mfa-card .login-foot a:hover {
  color: #2563eb;
}

@media (max-width: 560px) {
  .mfa-shell {
    width: min(100% - 24px, 420px);
    padding: 22px 0;
  }

  .mfa-brand {
    margin-bottom: 18px;
  }

  .mfa-card {
    padding: 26px 20px 22px;
  }

  .mfa-qr-image {
    width: 172px;
    height: 172px;
  }

  .mfa-form .field input.mfa-code-input {
    font-size: 20px;
  }
}
