:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-subtle: #f7f9f8;
  --line: #dce2df;
  --line-strong: #c5cfca;
  --text: #17211d;
  --text-secondary: #52615a;
  --text-muted: #75817b;
  --sidebar: #17211d;
  --sidebar-muted: #9daba4;
  --green: #237a52;
  --green-dark: #185f3e;
  --green-soft: #e8f4ed;
  --cyan: #176f7d;
  --cyan-soft: #e7f3f5;
  --amber: #9a5d13;
  --amber-soft: #fbf1e2;
  --red: #b43c3c;
  --red-dark: #923030;
  --red-soft: #fbeaea;
  --shadow: 0 10px 28px rgba(23, 33, 29, 0.09);
  --sidebar-width: 248px;
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
input[type="checkbox"]:not(:disabled) {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

:focus-visible {
  outline: 3px solid rgba(23, 111, 125, 0.34);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Login */

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  background-color: var(--sidebar);
}

.login-panel {
  width: min(100%, 414px);
  padding: 32px;
  border: 1px solid #d7dfdb;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.28);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.login-brand img {
  display: block;
  border-radius: 6px;
}

.login-heading {
  margin-bottom: 25px;
}

.login-heading h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
}

.login-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

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

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

.field label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

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

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::placeholder {
  color: #96a19c;
}

input:hover:not(:disabled) {
  border-color: #a9b7b0;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(23, 111, 125, 0.12);
}

.form-error {
  margin: -4px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--red);
  color: var(--red-dark);
  background: var(--red-soft);
  font-size: 13px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-wide {
  width: 100%;
  margin-top: 2px;
}

.button-primary {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.button-secondary {
  color: var(--text-secondary);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-subtle);
  border-color: #aab8b1;
}

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

.button-danger:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

/* Application shell */

.console {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  padding: 20px 14px 16px;
  color: #edf3f0;
  background: var(--sidebar);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 0 8px;
}

.sidebar-brand img {
  display: block;
  border-radius: 5px;
}

.sidebar-brand div {
  min-width: 0;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand strong {
  font-size: 14px;
}

.sidebar-brand span {
  margin-top: 1px;
  color: var(--sidebar-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.primary-nav {
  display: grid;
  gap: 4px;
  margin-top: 31px;
}

.nav-item {
  display: grid;
  min-height: 43px;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 5px;
  color: #afbbb5;
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  color: #ffffff;
  background: #22302a;
}

.nav-item.is-active {
  color: #ffffff;
  background: #2a3b33;
}

.nav-item.is-active::before {
  position: absolute;
  width: 3px;
  height: 23px;
  margin-left: -11px;
  border-radius: 0 2px 2px 0;
  background: #55b583;
  content: "";
}

.nav-item .icon {
  width: 19px;
  height: 19px;
}

.nav-item > span:not(.nav-count) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid #405149;
  border-radius: 4px;
  color: #c7d1cc;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 4px 0;
  border-top: 1px solid #304038;
}

.session-summary {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
}

.session-summary .avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #dff2e8;
  background: #2d5a45;
  font-size: 12px;
  font-weight: 700;
}

.session-summary div {
  min-width: 0;
}

.session-summary strong,
.session-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-summary strong {
  color: #eef4f1;
  font-size: 12px;
}

.session-summary span {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-secondary);
  background: var(--surface);
}

.icon-button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.icon-button-on-dark {
  color: #aebbb4;
  border-color: transparent;
  background: transparent;
}

.icon-button-on-dark:hover:not(:disabled) {
  color: #ffffff;
  border-color: #3d4d45;
  background: #22302a;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar-title {
  min-width: 0;
}

.topbar-title span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.topbar-title h1 {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.refresh-status {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

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

.global-error {
  position: sticky;
  z-index: 18;
  top: var(--topbar-height);
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 9px 32px;
  border-bottom: 1px solid #ebc4c4;
  color: var(--red-dark);
  background: var(--red-soft);
  font-size: 13px;
}

.global-error .icon {
  width: 17px;
  height: 17px;
}

.global-error .text-button {
  margin-left: auto;
  color: var(--red-dark);
}

.content {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 32px;
}

.view {
  min-width: 0;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading-split,
.subsection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.section-heading > p:last-child,
.section-heading > div > p:last-child {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--text-secondary);
}

.health-status,
.poll-indicator {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-secondary);
  background: var(--surface);
  font-size: 12px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-muted);
}

.health-status.is-online .status-dot,
.poll-indicator .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.health-status.is-offline {
  color: var(--red-dark);
  border-color: #eccaca;
  background: var(--red-soft);
}

.health-status.is-offline .status-dot {
  background: var(--red);
}

.health-status.is-loading .status-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.admission-band {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: var(--surface);
}

.admission-band.is-paused {
  border-left-color: var(--amber);
  background: #fffdf9;
}

.admission-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.admission-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
  color: var(--green);
  background: var(--green-soft);
}

.is-paused .admission-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.admission-copy h3,
.subsection-heading h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.admission-copy p,
.subsection-heading p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.admission-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 700;
}

.switch {
  display: inline-flex;
  position: relative;
}

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

.switch-track {
  display: block;
  position: relative;
  width: 43px;
  height: 24px;
  border: 1px solid #aeb9b3;
  border-radius: 12px;
  background: #c5ceca;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.switch-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(23, 33, 29, 0.26);
  transition: transform 140ms ease;
}

.switch input:checked + .switch-track {
  border-color: var(--green);
  background: var(--green);
}

.switch input:checked + .switch-track span {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(23, 111, 125, 0.34);
  outline-offset: 2px;
}

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

.loading-grid span {
  display: block;
  min-height: 133px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e7ebe9;
  animation: pulse 1.3s ease-in-out infinite;
}

.loading-grid span:nth-child(2) { animation-delay: 100ms; }
.loading-grid span:nth-child(3) { animation-delay: 200ms; }
.loading-grid span:nth-child(4) { animation-delay: 300ms; }

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.metric-card {
  min-width: 0;
  min-height: 133px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.metric-accent-green { border-top-color: var(--green); }
.metric-accent-cyan { border-top-color: var(--cyan); }
.metric-accent-amber { border-top-color: var(--amber); }
.metric-accent-neutral { border-top-color: #66736d; }

.metric-card > span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.metric-card small {
  display: block;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 11px;
}

.detail-section {
  margin-top: 31px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.subsection-heading {
  align-items: center;
  margin-bottom: 15px;
}

.service-facts,
.stat-list {
  display: grid;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.service-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.service-facts > div,
.stat-list > div {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}

.service-facts > div:last-child,
.stat-list > div:nth-child(3n) {
  border-right: 0;
}

.stat-list > div:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}

.service-facts dt,
.stat-list dt {
  color: var(--text-muted);
  font-size: 11px;
}

.service-facts dd,
.stat-list dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.service-facts dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  padding: 3px 5px;
  border: 0;
  color: var(--cyan);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover:not(:disabled) {
  color: #0f5662;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button .icon {
  width: 15px;
  height: 15px;
}

/* Forms, tables, and states */

.add-user-form {
  display: grid;
  max-width: 980px;
  grid-template-columns: minmax(160px, 0.9fr) minmax(220px, 1.4fr) 120px auto;
  align-items: end;
  gap: 14px;
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.route-form-actions {
  display: flex;
  gap: 8px;
}

.route-form-hint {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 12px;
}

.list-section {
  margin-top: 0;
}

.subsection-heading-tools {
  gap: 16px;
}

.search-field {
  display: flex;
  position: relative;
  width: min(100%, 250px);
  align-items: center;
}

.search-field .icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-field input {
  min-height: 38px;
  padding-left: 35px;
}

.inline-state {
  display: grid;
  min-height: 88px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.large-state {
  min-height: 210px;
}

.inline-state.is-error {
  color: var(--red-dark);
  border-color: #e3bcbc;
  background: var(--red-soft);
}

.inline-state .state-action {
  margin-top: 10px;
}

.table-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  min-width: 100px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: var(--text-secondary);
  font-size: 12px;
}

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

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

.compact-table th,
.compact-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.username-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.user-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #cbe0d4;
  border-radius: 4px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  text-transform: uppercase;
}

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

.cell-stack span,
.cell-stack small {
  display: block;
}

.cell-stack small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.action-column {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.table-actions {
  display: inline-flex;
  gap: 5px;
}

td.action-column {
  padding-top: 7px;
  padding-bottom: 7px;
}

.table-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-muted);
  background: transparent;
}

.table-action:hover:not(:disabled) {
  color: var(--red-dark);
  border-color: #e9c5c5;
  background: var(--red-soft);
}

.table-action .icon {
  width: 16px;
  height: 16px;
}

.event-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

.event-marker {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7c8983;
}

.event-marker.is-success { background: var(--green); }
.event-marker.is-warning { background: var(--amber); }
.event-marker.is-danger { background: var(--red); }
.event-marker.is-info { background: var(--cyan); }

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

/* Dialog and toast */

.confirm-dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(17, 25, 21, 0.6);
}

.confirm-dialog form {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
}

.confirm-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: var(--amber);
  background: var(--amber-soft);
}

.confirm-icon.is-danger {
  color: var(--red);
  background: var(--red-soft);
}

.confirm-copy h2 {
  margin: 1px 0 0;
  font-size: 17px;
}

.confirm-copy p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.dialog-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 7px;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(calc(100% - 40px), 360px);
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 9px 9px 9px 13px;
  border: 1px solid #b9c9c1;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  border-color: #e1baba;
  border-left-color: var(--red);
}

.toast > .icon {
  color: var(--green);
}

.toast.is-error > .icon {
  color: var(--red);
}

.toast p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.toast button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--text-muted);
  background: transparent;
}

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

.toast button .icon {
  width: 15px;
  height: 15px;
}

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

.is-spinning .icon,
.icon.is-spinning {
  animation: spin 650ms linear infinite;
}

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

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

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

  .service-facts > div:nth-child(2) {
    border-right: 0;
  }

  .service-facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 64px;
  }

  .sidebar {
    width: min(82vw, 276px);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

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

  .sidebar-scrim {
    position: fixed;
    z-index: 35;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(17, 25, 21, 0.55);
  }

  .console.sidebar-open .sidebar-scrim {
    display: block;
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
    margin-right: 12px;
  }

  .topbar {
    padding: 0 20px;
  }

  .content {
    padding: 26px 20px;
  }

  .global-error {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 720px) {
  .login-view {
    align-items: center;
    padding: 18px 12px;
  }

  .login-panel {
    padding: 25px 21px;
  }

  .login-brand {
    margin-bottom: 28px;
  }

  .refresh-status {
    display: none;
  }

  .section-heading-split,
  .subsection-heading-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .health-status,
  .poll-indicator {
    align-self: flex-start;
  }

  .admission-band {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .admission-control {
    width: 100%;
    justify-content: space-between;
    padding-left: 51px;
  }

  .metric-grid,
  .loading-grid,
  .service-facts,
  .stat-list {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 118px;
  }

  .service-facts > div,
  .service-facts > div:nth-child(2),
  .stat-list > div,
  .stat-list > div:nth-child(3n) {
    border-right: 0;
  }

  .service-facts > div:nth-child(n + 2),
  .stat-list > div:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

  .search-field {
    width: 100%;
  }

  .add-user-form {
    grid-template-columns: 1fr;
  }

  .route-form-actions {
    justify-content: flex-end;
  }

  .responsive-table {
    display: block;
  }

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tbody {
    padding: 8px;
  }

  .responsive-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 8px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
  }

  .responsive-table tr:last-child {
    margin-bottom: 0;
  }

  .responsive-table td,
  .responsive-table tbody tr:last-child td {
    min-width: 0;
    padding: 7px;
    border: 0;
  }

  .responsive-table td::before {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
  }

  .responsive-table td.action-column {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .responsive-table td.action-column::before {
    display: none;
  }

  .responsive-table td.action-column .table-action {
    display: inline-flex;
    width: auto;
    padding: 0 9px;
    gap: 6px;
  }

  .responsive-table td.action-column .table-action::after {
    content: attr(aria-label);
    font-size: 11px;
    font-weight: 700;
  }

  .audit-table tr {
    grid-template-columns: 1fr;
  }

  .audit-table td {
    grid-column: 1;
  }
}

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

  .content {
    padding: 22px 12px 30px;
  }

  .global-error {
    align-items: flex-start;
    padding-right: 12px;
    padding-left: 12px;
  }

  .global-error .text-button {
    min-height: 22px;
  }

  .topbar-title h1 {
    max-width: 150px;
  }

  .input-action-row {
    grid-template-columns: 1fr;
  }

  .input-action-row .button {
    width: 100%;
  }

  .admission-control {
    padding-left: 0;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .subsection-heading:not(.subsection-heading-tools) {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .compact-table .action-column {
    min-width: 58px;
  }

  .confirm-dialog form {
    padding: 19px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

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