:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-synthesis: none;
  --nav: #0f1f3c;
  --nav-2: #142a4f;
  --nav-ink: #c3d1ec;
  --nav-strong: #ffffff;
  --nav-line: rgba(255, 255, 255, 0.1);
  --ground: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --track: #e9edf4;
  --line: #e2e7f0;
  --line-strong: #cdd6e5;
  --ink: #1a2438;
  --ink-2: #5a6883;
  --ink-3: #8a97b0;
  --brand: #2f66f0;
  --brand-hover: #2455d6;
  --brand-soft: #e7eefe;
  --success: #1f9254;
  --success-soft: #e4f6ec;
  --warning: #b86e0f;
  --warning-soft: #fbeed6;
  --danger: #d8362d;
  --danger-soft: #fbe5e3;
  --info: #2f66f0;
  --info-soft: #e7eefe;
  --radius: 9px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(18, 30, 55, 0.06), 0 6px 20px rgba(18, 30, 55, 0.06);
  --shadow-lift: 0 2px 4px rgba(20, 33, 61, 0.07), 0 12px 28px rgba(20, 33, 61, 0.1);
  --focus: 0 0 0 3px rgba(47, 102, 240, 0.24);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --nav: #081322;
  --nav-2: #0f1d33;
  --nav-ink: #9baaca;
  --nav-strong: #eef3ff;
  --nav-line: rgba(255, 255, 255, 0.08);
  --ground: #0b1322;
  --surface: #131f34;
  --surface-2: #0e1828;
  --track: #1b2942;
  --line: #223049;
  --line-strong: #2c3d5a;
  --ink: #e7edf8;
  --ink-2: #a6b2c8;
  --ink-3: #74839e;
  --brand: #5b8bff;
  --brand-hover: #74a0ff;
  --brand-soft: #1a2b4e;
  --success: #3ec36f;
  --success-soft: #102c1e;
  --warning: #eaa53c;
  --warning-soft: #33260f;
  --danger: #f0675e;
  --danger-soft: #331917;
  --info: #5b8bff;
  --info-soft: #1a2b4e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 32px rgba(0, 0, 0, 0.36);
  --focus: 0 0 0 3px rgba(91, 139, 255, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--ground);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  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: var(--focus);
}

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

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

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

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

.boot-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.boot-screen strong {
  font-size: 17px;
}

.boot-screen p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.boot-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: var(--nav);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.9fr) minmax(460px, 1.1fr);
  background: var(--surface);
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px clamp(36px, 6vw, 88px);
  overflow: hidden;
  color: var(--nav-strong);
  background: var(--nav);
}

.login-intro::after {
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  content: "";
  background: var(--nav-2);
  border: 1px solid var(--nav-line);
  border-radius: 50%;
  opacity: 0.65;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-lockup svg {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.brand-lockup strong {
  display: block;
  color: var(--nav-strong);
  font-size: 18px;
}

.brand-lockup small {
  display: block;
  margin-top: 1px;
  color: var(--nav-ink);
  font-size: 11px;
}

.login-intro__copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.login-intro__copy span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  color: #8fe0b0;
  background: rgba(31, 146, 84, 0.16);
  border: 1px solid rgba(95, 205, 137, 0.22);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.login-intro__copy h1 {
  margin: 22px 0 12px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.login-intro__copy p {
  max-width: 480px;
  margin: 0;
  color: var(--nav-ink);
  font-size: 14px;
  line-height: 1.8;
}

.login-intro__footer {
  position: relative;
  z-index: 1;
  color: var(--nav-ink);
  font-size: 12px;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px;
  background: var(--ground);
}

.login-card {
  width: min(100%, 440px);
  padding: 34px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}

.login-card h2 {
  margin: 0;
  font-size: 24px;
}

.login-card > p {
  margin: 7px 0 26px;
  color: var(--ink-2);
  font-size: 13px;
}

.login-security {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding: 12px 13px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.65;
}

.security-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  background: var(--success);
  border-radius: 50%;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  grid-template-columns: 214px minmax(0, 1fr);
  grid-template-rows: 56px minmax(calc(100vh - 56px), auto);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  grid-area: topbar;
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: var(--nav-ink);
  background: var(--nav);
  border-bottom: 1px solid var(--nav-line);
}

.topbar__left,
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar .brand-lockup svg {
  width: 30px;
  height: 30px;
}

.topbar .brand-lockup strong {
  font-size: 15px;
}

.topbar .brand-lockup small {
  font-size: 10px;
}

.service-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: #8fe0b0;
  background: rgba(31, 146, 84, 0.13);
  border: 1px solid rgba(95, 205, 137, 0.2);
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}

.service-badge::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  color: var(--nav-strong);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.account-chip:hover,
.topbar-button:hover {
  color: var(--nav-strong);
  background: rgba(255, 255, 255, 0.08);
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.topbar-button,
.mobile-menu-button {
  display: inline-grid;
  min-width: 36px;
  height: 36px;
  place-items: center;
  padding: 0 10px;
  color: var(--nav-ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.mobile-menu-button {
  display: none;
  font-size: 20px;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 56px;
  grid-area: sidebar;
  display: flex;
  height: calc(100vh - 56px);
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.side-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.side-nav__group {
  margin: 12px 0 5px;
  padding: 0 16px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.side-nav__group:first-child {
  margin-top: 2px;
}

.side-nav a {
  position: relative;
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--ink-2);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.side-nav a[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-soft);
  border-left-color: var(--brand);
}

.nav-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.side-nav a[aria-current="page"] .nav-mark {
  background: var(--surface);
  border-color: var(--brand);
}

.sidebar-footer {
  padding: 13px 16px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.sidebar-scrim {
  display: none;
}

.main-layout {
  min-width: 0;
  grid-area: main;
}

.content-area {
  min-height: calc(100vh - 56px);
  padding: 22px 26px 36px;
}

.page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

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

.page-heading h1 {
  margin: 1px 0 3px;
  font-size: 21px;
  font-weight: 680;
  line-height: 30px;
}

.page-heading h1:focus {
  box-shadow: none;
}

.page-heading p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 22px;
}

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

.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  color: var(--brand);
  border-color: var(--brand);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.button--primary:hover:not(:disabled) {
  color: #fff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.button--danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button--danger:hover:not(:disabled) {
  color: #fff;
  filter: brightness(0.94);
  border-color: var(--danger);
}

.button--text {
  min-height: 30px;
  padding: 0 7px;
  color: var(--brand);
  background: transparent;
  border-color: transparent;
}

.button--text:hover:not(:disabled) {
  background: var(--brand-soft);
  border-color: transparent;
}

.button--danger-text {
  color: var(--danger);
}

.button--danger-text:hover:not(:disabled) {
  color: var(--danger);
  background: var(--danger-soft);
}

.button--block {
  width: 100%;
  min-height: 42px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.section-card,
.table-surface,
.toolbar,
.detail-panel,
.error-surface,
.empty-surface,
.loading-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 126px;
  padding: 18px;
}

.metric-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-2);
  font-size: 12px;
}

.metric-card__label::after {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--brand);
  border-radius: 50%;
}

.metric-card--success .metric-card__label::after {
  background: var(--success);
}

.metric-card--warning .metric-card__label::after {
  background: var(--warning);
}

.metric-card--danger .metric-card__label::after {
  background: var(--danger);
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric-card small {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.section-card {
  padding: 20px;
}

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

.section-card__head h2 {
  margin: 0;
  font-size: 16px;
}

.section-card__head p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.attention-list,
.activity-list,
.detail-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--ink-3);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  font-weight: 620;
  text-align: right;
  overflow-wrap: anywhere;
}

.attention-item,
.activity-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.attention-item__mark {
  width: 7px;
  height: 7px;
  background: var(--warning);
  border-radius: 50%;
}

.attention-item strong,
.activity-item strong {
  display: block;
  font-size: 12.5px;
}

.attention-item small,
.activity-item small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.toolbar__summary {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.control {
  display: grid;
  gap: 6px;
}

.control label,
.control__label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
}

.input,
.select,
.textarea {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input,
.select {
  min-height: 36px;
  padding: 0 11px;
}

.textarea {
  min-height: 90px;
  padding: 9px 11px;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--brand);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus);
}

.toolbar .input {
  width: min(310px, 100%);
}

.toolbar .select {
  width: 160px;
}

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

.form-span {
  grid-column: 1 / -1;
}

.form-help {
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.55;
}

.stack-gap-sm {
  margin-top: 15px;
}

.stack-gap-lg {
  margin-top: 22px;
}

.section-card--spaced,
.inline-actions--spaced {
  margin-top: 14px;
}

.prewrap-copy {
  margin: 0;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.code-block {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

.required::after {
  margin-left: 3px;
  color: var(--danger);
  content: "*";
}

.table-surface {
  min-width: 0;
  overflow-x: auto;
}

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

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

.data-table th {
  color: var(--ink-2);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

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

.resource-identity {
  display: grid;
  min-width: 170px;
  gap: 2px;
}

.resource-identity strong {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-identity small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  color: var(--info);
  background: var(--info-soft);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.status-pill--success {
  color: var(--success);
  background: var(--success-soft);
}

.status-pill--warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-pill--danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-pill--neutral {
  color: var(--ink-2);
  background: var(--track);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.pagination__page {
  min-width: 90px;
  text-align: center;
}

.empty-surface,
.error-surface,
.loading-surface {
  display: grid;
  min-height: 320px;
  place-items: center;
  padding: 32px;
  text-align: center;
}

.empty-state,
.error-state,
.loading-state {
  max-width: 520px;
}

.empty-state__mark,
.error-state__mark,
.loading-state__mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 14px;
  font-size: 18px;
  font-weight: 750;
}

.error-state__mark {
  color: var(--danger);
  background: var(--danger-soft);
}

.loading-state__mark {
  animation: loading-pulse 1s ease-in-out infinite alternate;
}

.empty-state h2,
.error-state h2,
.loading-state h2 {
  margin: 0;
  font-size: 17px;
}

.empty-state p,
.error-state p,
.loading-state p {
  margin: 6px 0 16px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

@keyframes loading-pulse {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 13px;
  color: var(--info);
  background: var(--info-soft);
  border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.65;
}

.alert--warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 25%, transparent);
}

.alert--danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.alert strong {
  display: block;
  margin-bottom: 2px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.detail-grid > div {
  min-height: 68px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.detail-grid dt {
  color: var(--ink-3);
  font-size: 11px;
}

.detail-grid dd {
  margin: 5px 0 0;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.code-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: var(--nav);
  border-radius: var(--radius);
}

.code-card code {
  display: block;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.code-card p {
  margin: 0;
  color: var(--nav-ink);
  font-size: 11.5px;
}

.app-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-lift);
}

.app-dialog::backdrop {
  background: rgba(5, 12, 24, 0.62);
  backdrop-filter: blur(2px);
}

.dialog-shell {
  display: grid;
  max-height: inherit;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.dialog-eyebrow {
  min-height: 0;
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-eyebrow:empty {
  display: none;
}

.dialog-body {
  padding: 20px;
  overflow-y: auto;
}

.dialog-footer {
  justify-content: flex-end;
  padding: 13px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}

.app-dialog--wide {
  width: min(900px, calc(100vw - 32px));
}

.app-dialog--danger .dialog-eyebrow {
  color: var(--danger);
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: 70px;
  right: 18px;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  animation: toast-in 160ms ease-out;
}

.toast::before {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  content: "";
  background: var(--brand);
  border-radius: 50%;
}

.toast--success::before { background: var(--success); }
.toast--warning::before { background: var(--warning); }
.toast--danger::before { background: var(--danger); }

.toast strong {
  display: block;
  font-size: 12.5px;
}

.toast p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.session-expiry {
  color: var(--nav-ink);
  font-size: 11px;
}

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

.settings-card {
  min-height: 160px;
}

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

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.feature-chip {
  display: inline-flex;
  padding: 3px 8px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
}

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

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-areas:
      "topbar"
      "main";
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    padding-top: 56px;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-lift);
  }

  .app-shell[data-menu-open="true"] .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(5, 12, 24, 0.62);
    border: 0;
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .app-shell[data-menu-open="true"] .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .content-area {
    padding: 18px 16px 28px;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 260px;
    padding: 30px;
  }

  .login-intro__copy h1 {
    margin-top: 16px;
    font-size: 30px;
  }

  .login-intro__footer {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 28px 18px 46px;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 10px;
  }

  .topbar .brand-lockup small,
  .account-chip span:not(.avatar),
  .service-badge,
  .session-expiry {
    display: none;
  }

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

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1;
  }

  .metrics-grid,
  .form-grid,
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .form-span,
  .settings-card--wide {
    grid-column: auto;
  }

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

  .toolbar .input,
  .toolbar .select {
    width: 100%;
  }

  .toolbar__summary {
    margin-left: 0;
  }

  .login-intro {
    min-height: 220px;
    padding: 24px;
  }

  .login-intro__copy p {
    display: none;
  }

  .login-card {
    padding: 27px 22px;
  }

  .dialog-body,
  .dialog-header,
  .dialog-footer {
    padding-right: 15px;
    padding-left: 15px;
  }
}

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