:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-blue: #eff6ff;
  --ink: #172033;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #1e40af;
  --primary-hover: #1e3a8a;
  --primary-soft: #eaf1ff;
  --primary-ring: rgba(37, 99, 235, 0.2);
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #c2413a;
  --danger-hover: #a9312c;
  --danger-soft: #fff1f2;
  --sidebar: #172033;
  --sidebar-raised: #202b40;
  --sidebar-text: #dbe3ef;
  --sidebar-muted: #8fa0b8;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --duration: 180ms;
  --sidebar-width: 264px;
  --z-sidebar: 40;
  --z-scrim: 30;
  --z-sticky: 20;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
summary,
label.check,
label.switch {
  touch-action: manipulation;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 750;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 720;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

code {
  padding: 2px 6px;
  border: 1px solid #dbe4f0;
  border-radius: 5px;
  color: #29446d;
  background: #f3f6fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  transform: translateY(-160%);
  transition: transform var(--duration) ease-out;
}

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

:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  z-index: var(--z-sidebar);
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100dvh;
  padding: 20px 14px 14px;
  color: var(--sidebar-text);
  background: var(--sidebar);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 8px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
}

.brand:hover {
  color: inherit;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #fff;
  background: #315cc9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 800;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-mark.mini {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-label {
  margin: 13px 12px 7px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 27px;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 12px;
  margin-bottom: 3px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 560;
  transition: color var(--duration) ease, background var(--duration) ease;
}

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav a.active {
  color: #fff;
  background: #294a9b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: #82a8ff;
  content: "";
}

.sidebar-nav svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: var(--sidebar-raised);
}

.user-avatar,
.mobile-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #dce8ff;
  background: #355690;
  font-size: 13px;
  font-weight: 750;
}

.user-copy {
  display: grid;
  flex: 1;
  min-width: 0;
}

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

.user-copy strong {
  color: #fff;
  font-size: 13px;
}

.user-copy small {
  color: var(--sidebar-muted);
  font-size: 11px;
}

.workspace {
  min-width: 0;
}

.mobile-header,
.sidebar-close,
.sidebar-scrim {
  display: none;
}

.container {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px clamp(24px, 3.2vw, 48px) 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-head > div {
  max-width: 820px;
}

.page-head .muted {
  margin-bottom: 0;
  font-size: 15px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.panel {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.panel-head h2,
.panel-head p:last-child {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 30px 0 14px;
}

.section-head h2,
.section-head p {
  margin-bottom: 0;
}

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

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stats article {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 102px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stats article > div {
  display: grid;
}

.stats strong {
  color: var(--ink);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stats article > div > span {
  color: var(--muted);
  font-size: 13px;
}

.stat-icon,
.quick-icon,
.summary-icon,
.empty-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
}

.stat-icon {
  width: 48px;
  height: 48px;
}

.stat-icon svg {
  width: 23px;
  height: 23px;
}

.stat-icon.blue {
  color: var(--primary);
  background: var(--primary-soft);
}

.stat-icon.amber {
  color: var(--warning);
  background: var(--warning-soft);
}

.stat-icon.green {
  color: var(--success);
  background: var(--success-soft);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.quick-actions > a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 15px 18px;
  border: 1px solid #d9e3f3;
  border-radius: var(--radius);
  color: var(--ink);
  background: #fafdff;
  transition: border-color var(--duration) ease, box-shadow var(--duration) ease, background var(--duration) ease;
}

.quick-actions > a:hover {
  border-color: #b7c9e8;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.quick-actions a > span:nth-child(2) {
  display: grid;
}

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

.quick-icon {
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--primary-soft);
}

.quick-icon svg {
  width: 21px;
  height: 21px;
}

.arrow-icon {
  width: 19px;
  height: 19px;
  color: var(--muted-light);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.text-link svg {
  width: 16px;
  height: 16px;
}

.list {
  display: grid;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.list-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.list-row:last-child {
  padding-bottom: 0;
}

.list-row > div {
  display: grid;
  flex: 1;
  min-width: 0;
}

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

.list-row small {
  color: var(--muted);
}

.calendar {
  display: grid;
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 42px;
  padding: 5px;
  place-items: center;
  border-radius: 9px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 10px;
  font-weight: 750;
}

.badge,
.status,
.meta-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.badge::before,
.status::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--muted-light);
  content: "";
}

.badge.active,
.status.success {
  border-color: #bbebcd;
  color: #126232;
  background: var(--success-soft);
}

.badge.active::before,
.status.success::before {
  background: #22a95a;
}

.status.queued {
  border-color: #c8d7f2;
  color: var(--primary);
  background: var(--primary-soft);
}

.status.queued::before {
  background: #4c75d8;
}

.status.running {
  border-color: #f5d6ad;
  color: #8b490d;
  background: var(--warning-soft);
}

.status.running::before {
  background: #dd871f;
  animation: pulse 1.2s ease-in-out infinite;
}

.status.error {
  border-color: #f2c8c5;
  color: #a4322c;
  background: var(--danger-soft);
}

.status.error::before {
  background: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 680;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: color var(--duration) ease, border-color var(--duration) ease, background var(--duration) ease, box-shadow var(--duration) ease;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button.primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 5px rgba(30, 64, 175, 0.18);
}

.button.primary:hover {
  color: #fff;
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(30, 64, 175, 0.2);
}

.button.ghost {
  color: var(--ink-soft);
  border-color: var(--line-strong);
  background: var(--surface);
}

.button.ghost:hover {
  color: var(--ink);
  border-color: #aebcce;
  background: var(--surface-subtle);
}

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

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

.button.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.button.wide {
  width: 100%;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.button.is-loading {
  cursor: wait;
}

.button.is-loading::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 0.7s linear infinite;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.sidebar .sidebar-close {
  display: none;
}

.logout-button {
  width: 36px;
  height: 36px;
  color: var(--sidebar-muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
  font-weight: 450;
  outline: none;
  transition: border-color var(--duration) ease, box-shadow var(--duration) ease, background var(--duration) ease;
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

select[multiple] {
  padding: 6px;
}

select[multiple] option {
  padding: 8px;
  border-radius: 5px;
}

input::placeholder,
textarea::placeholder {
  color: #98a5b7;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aab9cc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4f74d2;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid,
.field-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(194, 65, 58, 0.12);
}

input[type="file"] {
  padding: 6px;
  color: var(--muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  background: #edf1f6;
  font-weight: 650;
  cursor: pointer;
}

.required {
  color: var(--danger);
}

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

.form-narrow {
  max-width: 880px;
}

.form-footer,
.actions,
.test-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.form-footer .form-hint {
  margin-right: auto;
}

.form-hint {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 480;
  line-height: 1.45;
}

fieldset {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

legend {
  padding: 0 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.check {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.check:hover {
  border-color: #b6c4d5;
  background: var(--surface-subtle);
}

.check input,
.switch input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.switch {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  cursor: pointer;
}

.switch > span {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background var(--duration) ease;
}

.switch > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  content: "";
  transition: transform var(--duration) ease;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.flash,
.notice-box {
  position: relative;
  margin-bottom: 20px;
  padding: 13px 16px 13px 43px;
  border: 1px solid;
  border-radius: var(--radius);
  line-height: 1.5;
}

.flash::before,
.notice-box::before {
  position: absolute;
  top: 13px;
  left: 16px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.flash.success,
.notice-box {
  border-color: #bce4cb;
  color: #176537;
  background: var(--success-soft);
}

.flash.success::before,
.notice-box::before {
  content: "i";
}

.flash.error {
  border-color: #efc4c1;
  color: #9f302b;
  background: var(--danger-soft);
}

.flash.error::before {
  content: "!";
}

.disclosure-panel {
  padding: 0;
  overflow: hidden;
}

.disclosure-panel > summary,
.inline-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.disclosure-panel > summary::-webkit-details-marker,
.inline-disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure-panel > summary > span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.disclosure-panel > summary > span > span:last-child {
  display: grid;
}

.disclosure-panel summary strong {
  font-size: 15px;
}

.disclosure-panel summary small {
  color: var(--muted);
  font-size: 12px;
}

.summary-icon {
  width: 38px;
  height: 38px;
  color: var(--primary);
  background: var(--primary-soft);
}

.summary-icon svg {
  width: 20px;
  height: 20px;
}

.chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform var(--duration) ease;
}

details[open] > summary .chevron {
  transform: rotate(180deg);
}

.disclosure-content {
  padding: 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
}

.inline-disclosure {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.inline-disclosure > summary {
  min-height: 48px;
  color: var(--primary);
  font-weight: 680;
}

.inline-disclosure .disclosure-content {
  margin: 0;
}

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

.connection-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 15px;
  margin: 0;
}

.connection-card .actions {
  grid-column: 1 / -1;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.connection-icon {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #cad9f2;
  border-radius: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 16px;
  font-weight: 780;
}

.connection-icon.small-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 13px;
}

.connection-card h2,
.connection-card p {
  margin-bottom: 4px;
}

.connection-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grow {
  min-width: 0;
}

.connection-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-fieldset {
  display: grid;
  gap: 12px;
}

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

.permission-check {
  align-items: flex-start;
}

.permission-check > span {
  display: grid;
  gap: 2px;
}

.permission-check small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 480;
  line-height: 1.4;
}

.active-check {
  align-self: end;
}

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

.staff-card,
.authorization-card {
  margin-bottom: 0;
}

.authorization-identity {
  padding: 11px 13px;
  border: 1px solid #c4e5d0;
  border-radius: 9px;
  color: #176537;
  background: var(--success-soft);
}

.authorization-delete {
  margin-top: 16px;
}

.time-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  margin-top: 10px;
  color: var(--ink-soft);
}

.empty p {
  max-width: 420px;
  margin: 4px 0 0;
}

.empty-icon {
  width: 42px;
  height: 42px;
  color: var(--muted);
  background: #edf1f6;
}

.empty-icon svg {
  width: 21px;
  height: 21px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
}

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

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

tbody tr:hover td {
  background: #fafcff;
}

td details {
  margin-top: 6px;
}

td details summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

td details ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.login-container {
  display: grid;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  place-items: center;
  background: #eef3fa;
}

.login-container > .flash {
  position: fixed;
  z-index: 10;
  top: 20px;
  right: 20px;
  max-width: 440px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.75fr);
  width: min(1060px, calc(100% - 40px));
  min-height: 600px;
  overflow: hidden;
  border: 1px solid #d9e2ef;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(31, 50, 81, 0.14);
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  color: #d8e5ff;
  background: var(--sidebar);
  background-image: radial-gradient(circle at 20% 10%, rgba(70, 114, 217, 0.28), transparent 38%), radial-gradient(circle at 90% 90%, rgba(30, 64, 175, 0.22), transparent 44%);
}

.login-brand {
  align-self: flex-start;
  color: #fff;
}

.login-intro h1 {
  max-width: 620px;
  margin-bottom: 16px;
  color: #fff;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
}

.login-intro > div > p:last-child {
  max-width: 570px;
  margin: 0;
  color: #afbed4;
  font-size: 16px;
}

.login-intro .eyebrow {
  color: #8fb0ff;
}

.login-benefits {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: #c5d2e5;
  list-style: none;
  font-size: 13px;
}

.login-benefits li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.login-benefits svg {
  width: 19px;
  height: 19px;
  padding: 3px;
  border-radius: 50%;
  color: #bcd0ff;
  background: rgba(82, 126, 226, 0.22);
}

.login-card {
  align-self: center;
  width: min(100%, 460px);
  padding: 44px;
}

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

.login-card-head h2 {
  margin-bottom: 8px;
  font-size: 27px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
}

.login-security {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.login-security svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
}

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

@keyframes pulse {
  50% { opacity: 0.35; }
}

@media (max-width: 1120px) {
  .connection-cards,
  .staff-cards,
  .authorization-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 52px));
    transform: translateX(-105%);
    transition: transform 220ms ease-out;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar .sidebar-close {
    display: grid;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: var(--z-scrim);
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(15, 23, 42, 0.52);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .mobile-header {
    position: sticky;
    z-index: var(--z-sticky);
    top: 0;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    min-height: 62px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-header .icon-button:hover {
    background: var(--surface-subtle);
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: 9px;
    color: var(--ink);
  }

  .mobile-brand:hover {
    color: var(--ink);
  }

  .mobile-avatar {
    justify-self: end;
  }
}

@media (max-width: 850px) {
  .container {
    padding: 25px 18px 42px;
  }

  .page-head {
    align-items: flex-start;
  }

  .stats,
  .two-columns,
  .quick-actions,
  .form-grid,
  .text-grid,
  .staff-grid {
    grid-template-columns: 1fr;
  }

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

  .stats {
    gap: 10px;
  }

  .stats article {
    min-height: 84px;
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    width: min(560px, calc(100% - 28px));
    min-height: auto;
    margin: 28px 0;
  }

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

  .login-intro h1 {
    font-size: 30px;
  }

  .login-benefits {
    display: none;
  }

  .login-card {
    padding: 30px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .mobile-header {
    padding-inline: 12px;
  }

  .container {
    padding: 22px 14px 38px;
  }

  .page-head {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
  }

  .page-head > .button {
    width: 100%;
  }

  .panel {
    padding: 17px;
    border-radius: var(--radius);
  }

  .panel-head {
    display: grid;
  }

  .card-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .connection-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .connection-card .actions,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-card .actions form,
  .connection-card .actions .button,
  .form-footer .button {
    width: 100%;
  }

  .disclosure-panel > summary {
    padding: 13px 14px;
  }

  .disclosure-content {
    padding: 16px;
  }

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

  .login-intro h1 {
    font-size: 25px;
  }

  .login-intro > div > p:last-child {
    font-size: 14px;
  }

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

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