:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-selected: #eef2ff;
  --ink: #172033;
  --text: #344054;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --sidebar: #111827;
  --sidebar-muted: #98a2b3;
  --shadow: 0 6px 18px rgba(16, 24, 40, .05);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 14px; }
button, input, select, textarea { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .22);
  outline-offset: 2px;
}

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

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 26px clamp(20px, 5vw, 72px) 48px;
  background:
    linear-gradient(rgba(255, 255, 255, .82), rgba(255, 255, 255, .82)),
    radial-gradient(circle at 20% 15%, #e6eaff, transparent 38%),
    var(--bg);
}

.login-brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.login-brand > span:last-child,
.sidebar-brand > span:last-child,
.admin-identity > span:last-child,
.sidebar-foot > span:last-child {
  display: grid;
  gap: 2px;
}

.login-brand strong { color: var(--ink); font-size: 15px; }
.login-brand small { color: var(--subtle); font: 9px/1.2 ui-monospace, monospace; letter-spacing: .12em; }

.login-card {
  width: min(420px, 100%);
  align-self: center;
  justify-self: center;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(16, 24, 40, .09);
}

.login-heading { margin-bottom: 26px; }
.environment-chip,
.top-environment {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #475467;
  background: #f2f4f7;
  font-size: 10px;
  font-weight: 700;
}

.login-heading h1 { margin: 16px 0 7px; color: var(--ink); font-size: 25px; letter-spacing: -.03em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 8px; }
.login-card label,
.field label,
.action-dialog label { margin-top: 7px; color: #344054; font-size: 12px; font-weight: 650; }
.login-card label span { color: var(--subtle); font-weight: 400; }

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

input,
select { height: 42px; padding: 0 12px; }
textarea { min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #aab1bd; }
input:focus, select:focus, textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }

.login-footnote {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.6;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  color: #e5e7eb;
  background: var(--sidebar);
}

.sidebar-brand { height: 40px; padding: 0 7px; }
.sidebar-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.sidebar-brand strong { color: #fff; font-size: 13px; }
.sidebar-brand small { color: var(--sidebar-muted); font-size: 9px; }

.environment-banner {
  margin: 16px 5px 13px;
  padding: 8px 10px;
  border: 1px solid rgba(129, 140, 248, .24);
  border-radius: 7px;
  color: #c7d2fe;
  background: rgba(79, 70, 229, .12);
  font: 9px/1 ui-monospace, monospace;
  letter-spacing: .08em;
}
.environment-banner span { color: #818cf8; }

.side-nav { min-height: 0; flex: 1; overflow: auto; }
.side-nav button {
  width: 100%;
  height: 39px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: #cbd5e1;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.side-nav button > span { width: 18px; color: #8491a7; text-align: center; font-size: 14px; }
.side-nav button strong { font-size: 12px; font-weight: 550; }
.side-nav button:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.side-nav button.active { color: #fff; background: #312e81; }
.side-nav button.active > span { color: #a5b4fc; }
.nav-group-label { margin: 18px 10px 7px; color: #667085; font-size: 9px; font-weight: 750; letter-spacing: .12em; }

.sidebar-foot {
  margin: 12px 5px 0;
  padding: 12px 8px 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.service-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .13); }
.service-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .13); }
.service-dot.offline { background: #f04438; box-shadow: 0 0 0 3px rgba(240, 68, 56, .13); }
.sidebar-foot strong { color: #d0d5dd; font-size: 10px; }
.sidebar-foot small { color: #667085; font-size: 8px; }

.sidebar-scrim { display: none; }
.admin-main { min-width: 0; grid-column: 2; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(260px, 480px) 1fr;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.icon-button.menu-button { display: none; }
.global-search {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.global-search > span { color: var(--subtle); }
.global-search input { min-width: 0; height: auto; padding: 0; border: 0; box-shadow: none; background: transparent; }
.global-search input:focus { box-shadow: none; }
.global-search kbd { flex: none; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--subtle); background: #fff; font: 9px/1.2 ui-monospace, monospace; }

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.admin-identity { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #3730a3; background: #e0e7ff; font-size: 10px; font-weight: 750; }
.admin-identity strong { color: var(--text); font-size: 11px; }
.admin-identity small { color: var(--subtle); font-size: 9px; }

.workspace { width: min(1440px, 100%); min-height: calc(100vh - 64px); margin: 0 auto; padding: 28px 30px 56px; }
.page-header { min-height: 64px; margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.breadcrumbs { margin-bottom: 7px; color: var(--subtle); font-size: 10px; }
.page-header h1 { margin: 0; color: var(--ink); font-size: 24px; line-height: 1.25; letter-spacing: -.025em; }
.page-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
  transition: border-color .15s, background .15s, transform .15s;
}
.button { min-height: 38px; padding: 0 13px; font-size: 12px; }
.button.wide { width: 100%; margin-top: 11px; min-height: 44px; }
.button.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.button.primary:hover:not(:disabled) { border-color: var(--primary-hover); background: var(--primary-hover); }
.button.secondary, .button.quiet { color: #475467; border-color: var(--line-strong); background: #fff; }
.button.secondary:hover:not(:disabled), .button.quiet:hover:not(:disabled) { background: var(--surface-subtle); }
.button.danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .46; cursor: not-allowed; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border-color: var(--line); background: #fff; }
.text-button { padding: 0; border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 11px; font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: 2px; }
.text-button.danger-text { color: var(--danger); }

.toolbar-card,
.panel,
.metric-card,
.provider-card,
.detail-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar-card { margin-bottom: 14px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select { width: auto; min-width: 130px; height: 36px; font-size: 11px; }
.filters .search-field { width: min(260px, 100%); }
.toolbar-meta { color: var(--subtle); font-size: 10px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { min-height: 126px; padding: 17px; }
.metric-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.metric-card header span:first-child { color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: #4338ca; background: #eef2ff; font-size: 12px; }
.metric-card strong { display: block; margin-top: 13px; color: var(--ink); font-size: 25px; line-height: 1; letter-spacing: -.035em; }
.metric-card footer { margin-top: 9px; color: var(--subtle); font-size: 10px; }
.metric-card footer .positive { color: var(--success); }
.metric-card footer .negative { color: var(--danger); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 14px; }
.panel { min-width: 0; }
.panel-header { min-height: 56px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; color: var(--ink); font-size: 13px; }
.panel-header p { margin: 3px 0 0; color: var(--subtle); font-size: 9px; }
.panel-body { padding: 17px; }
.panel-stack { display: grid; gap: 14px; }

.trend-chart { min-height: 220px; display: flex; align-items: flex-end; gap: 7px; padding-top: 18px; }
.trend-bar { min-width: 7px; flex: 1; display: grid; align-items: end; gap: 6px; height: 190px; }
.trend-bar i { width: 100%; min-height: 2px; border-radius: 3px 3px 1px 1px; background: #818cf8; }
.trend-bar span { color: var(--subtle); font-size: 8px; text-align: center; white-space: nowrap; }

.alert-list, .timeline, .compact-list { list-style: none; margin: 0; padding: 0; }
.alert-list li, .compact-list li { min-height: 54px; padding: 11px 0; display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid #f0f2f5; }
.alert-list li:last-child, .compact-list li:last-child { border-bottom: 0; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.alert-dot.danger { background: var(--danger); }
.alert-dot.info { background: var(--info); }
.alert-list strong, .compact-list strong { display: block; color: var(--text); font-size: 11px; }
.alert-list small, .compact-list small { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; }
.alert-list time, .compact-list time { color: var(--subtle); font-size: 8px; white-space: nowrap; }

.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 11px; }
th { height: 40px; padding: 0 13px; color: var(--muted); background: var(--surface-subtle); border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 700; white-space: nowrap; }
td { height: 49px; padding: 9px 13px; color: #475467; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
td strong { color: var(--text); font-size: 11px; }
td small { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; }
td code { color: #344054; font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 999px;
  color: #475467;
  background: #f2f4f7;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.status::before { content: "•"; font-size: 13px; line-height: 0; }
.status.success { color: var(--success); background: var(--success-soft); }
.status.warning { color: var(--warning); background: var(--warning-soft); }
.status.danger { color: var(--danger); background: var(--danger-soft); }
.status.info { color: var(--info); background: var(--info-soft); }
.status.neutral { color: #475467; background: #f2f4f7; }

.table-footer { min-height: 48px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; }
.pagination { display: flex; gap: 6px; }
.pagination button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; cursor: pointer; }

.empty-state,
.error-state,
.loading-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 38px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}
.state-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 12px; color: #667085; background: #f2f4f7; font-size: 18px; }
.error-state .state-icon { color: var(--danger); background: var(--danger-soft); }
.empty-state h2, .error-state h2 { margin: 0; color: var(--ink); font-size: 15px; }
.empty-state p, .error-state p { max-width: 440px; margin: 7px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.request-id { font: 9px/1.4 ui-monospace, monospace; color: var(--subtle); }

.skeleton-grid { width: 100%; display: grid; gap: 10px; }
.skeleton { height: 52px; border-radius: 7px; background: linear-gradient(90deg, #f2f4f7 25%, #fafafa 38%, #f2f4f7 62%); background-size: 400% 100%; animation: shimmer 1.25s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.split-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .7fr); gap: 14px; align-items: start; }
.detail-card { position: sticky; top: 82px; overflow: hidden; }
.detail-header { min-height: 64px; padding: 14px 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 0; color: var(--ink); font-size: 14px; }
.detail-header p { margin: 4px 0 0; color: var(--subtle); font-size: 9px; }
.detail-body { padding: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.detail-item span { display: block; margin-bottom: 4px; color: var(--subtle); font-size: 9px; }
.detail-item strong { color: var(--text); font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.detail-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 11px; color: var(--text); font-size: 11px; }
.detail-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px; }

.timeline li { position: relative; min-height: 54px; padding: 0 0 17px 24px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 11px; bottom: -4px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 9px; height: 9px; border: 2px solid #a5b4fc; border-radius: 50%; background: #fff; }
.timeline strong { display: block; color: var(--text); font-size: 10px; }
.timeline p { margin: 3px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.timeline time { color: var(--subtle); font-size: 8px; }

.create-panel { margin-bottom: 14px; }
.create-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.helper { color: var(--subtle); font-size: 9px; line-height: 1.5; }
.one-time-export-notice { grid-column: 1 / -1; padding: 12px 14px; border: 1px solid #fedf89; border-radius: 10px; background: var(--warning-soft); color: #7a2e0e; }
.one-time-export-notice strong { display: block; font-size: 11px; }
.one-time-export-notice p { margin: 5px 0 8px; color: #93370d; font-size: 9px; line-height: 1.6; }
.one-time-acknowledgement { display: flex; gap: 8px; align-items: flex-start; color: #7a2e0e; font-size: 9px; line-height: 1.5; cursor: pointer; }
.one-time-acknowledgement input { width: 14px; height: 14px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--warning); }
.form-error { margin: 5px 0 0; color: var(--danger); font-size: 11px; line-height: 1.5; }

.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.provider-card { padding: 16px; }
.provider-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.provider-card h2 { margin: 0; color: var(--ink); font-size: 13px; }
.provider-card header p { margin: 4px 0 0; color: var(--subtle); font-size: 9px; }
.provider-metrics { margin-top: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.provider-metrics div { padding: 10px; border-radius: 7px; background: var(--surface-subtle); }
.provider-metrics span { display: block; color: var(--subtle); font-size: 8px; }
.provider-metrics strong { display: block; margin-top: 5px; color: var(--text); font-size: 13px; }
.provider-foot { margin-top: 13px; padding-top: 12px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--subtle); font-size: 8px; }

.operations-layout { display: grid; gap: 14px; }
.operation-summary {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.operation-summary::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--success); }
.operation-summary.operation-draining::before { background: var(--warning); }
.operation-summary.operation-maintenance::before { background: var(--danger); }
.eyebrow { display: block; margin-bottom: 8px; color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.operation-status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.operation-status-line h2 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.025em; }
.operation-summary-main p { max-width: 650px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.operation-summary-meta { min-width: 370px; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); align-items: stretch; }
.operation-summary-meta > div { padding: 4px 16px; border-left: 1px solid var(--line); }
.operation-summary-meta dt { color: var(--subtle); font-size: 9px; }
.operation-summary-meta dd { margin: 7px 0 0; color: var(--text); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }

.operation-form { display: grid; gap: 20px; }
.mode-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.mode-fieldset legend { padding: 0; color: var(--text); font-size: 12px; font-weight: 700; }
.section-helper { margin: 5px 0 12px; color: var(--subtle); font-size: 9px; line-height: 1.55; }
.mode-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 17px 1fr;
  gap: 9px;
  align-items: flex-start;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.mode-choice:hover { border-color: #a5b4fc; background: #fafaff; }
.mode-choice:has(input:focus-visible) { outline: 3px solid rgba(79, 70, 229, .18); outline-offset: 2px; }
.mode-choice:has(input:checked) { border-color: #818cf8; background: var(--surface-selected); box-shadow: inset 0 0 0 1px #818cf8; }
.mode-choice input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); }
.mode-choice-indicator { display: none; }
.mode-choice-copy { min-width: 0; display: grid; gap: 5px; }
.mode-choice-copy strong { color: var(--text); font-size: 11px; }
.mode-choice-copy small { color: var(--muted); font-size: 9px; line-height: 1.55; }
.mode-choice.mode-draining:has(input:checked) { border-color: #f79009; background: var(--warning-soft); box-shadow: inset 0 0 0 1px #f79009; }
.mode-choice.mode-maintenance:has(input:checked) { border-color: #f04438; background: var(--danger-soft); box-shadow: inset 0 0 0 1px #f04438; }
.operation-form-grid { display: grid; grid-template-columns: minmax(200px, .55fr) minmax(300px, 1.45fr); gap: 14px; align-items: start; }
.operation-form-grid textarea { min-height: 86px; }
.operation-acknowledgement { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); cursor: pointer; }
.operation-acknowledgement input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.operation-acknowledgement span { display: grid; gap: 3px; }
.operation-acknowledgement strong { color: var(--text); font-size: 10px; }
.operation-acknowledgement small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.operation-form-actions { display: flex; justify-content: flex-end; }

.provider-section { margin-bottom: 14px; }
.section-heading { margin: 20px 1px 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 13px; }
.section-heading p { margin: 0; color: var(--subtle); font-size: 9px; }
.provider-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.catalog-list { list-style: none; margin: -6px 0; padding: 0; }
.catalog-list li { min-height: 58px; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f0f2f5; }
.catalog-list li:last-child { border-bottom: 0; }
.catalog-list li > div:first-child { min-width: 0; }
.catalog-list strong { display: block; color: var(--text); font-size: 10px; overflow-wrap: anywhere; }
.catalog-list small { display: block; margin-top: 4px; color: var(--subtle); font: 8px/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
.catalog-list-meta { flex: none; display: flex; align-items: center; gap: 9px; }
.catalog-list-meta > strong { font-size: 11px; }
.compact-empty { min-height: 150px; display: grid; place-items: center; align-content: center; text-align: center; }
.compact-empty strong { color: var(--text); font-size: 12px; }
.compact-empty p { max-width: 380px; margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.reconciliation-body { display: grid; gap: 15px; }
.reconciliation-grid { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reconciliation-grid > div { padding: 4px 16px; border-left: 1px solid var(--line); }
.reconciliation-grid > div:first-child { padding-left: 0; border-left: 0; }
.reconciliation-grid dt { color: var(--subtle); font-size: 9px; }
.reconciliation-grid dd { margin: 7px 0 0; color: var(--text); font-size: 18px; font-weight: 750; letter-spacing: -.025em; }
.reconciliation-grid .has-variance dd { color: var(--danger); }
.reconciliation-note { margin: 0; padding: 11px 12px; border-radius: 8px; color: var(--muted); background: var(--surface-subtle); font-size: 9px; line-height: 1.6; }

.action-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .22);
}
.action-dialog::backdrop { background: rgba(16, 24, 40, .52); backdrop-filter: blur(2px); }
.action-dialog form { padding: 22px; }
.dialog-heading { margin-bottom: 18px; display: grid; grid-template-columns: 38px 1fr; gap: 11px; }
.dialog-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-soft); font-weight: 800; }
.dialog-heading h2 { margin: 1px 0 4px; color: var(--ink); font-size: 16px; }
.dialog-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.action-dialog label { display: block; margin-bottom: 7px; }
.resolution-field { margin-top: 14px; }
.dialog-actions { margin-top: 17px; display: flex; justify-content: flex-end; gap: 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: calc(100% - 28px);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1d2939;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .2);
  font-size: 11px;
}

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .split-layout { grid-template-columns: 1fr; }
  .detail-card { position: static; }
  .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-summary { grid-template-columns: 1fr; gap: 18px; }
  .operation-summary-meta { min-width: 0; }
  .operation-summary-meta > div:first-child { padding-left: 0; border-left: 0; }
}

@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 19; display: block; border: 0; background: rgba(16, 24, 40, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar.open + .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .admin-main { grid-column: 1; }
  .topbar { grid-template-columns: 38px minmax(150px, 1fr) auto; gap: 10px; padding: 0 14px; }
  .icon-button.menu-button { display: grid; }
  .top-environment, .admin-identity { display: none; }
  .workspace { padding: 23px 16px 44px; }
}

@media (max-width: 620px) {
  .login-view { padding: 20px 14px 32px; }
  .login-card { padding: 26px 20px; }
  .topbar { height: 58px; }
  .global-search kbd, .topbar-actions .quiet { display: none; }
  .workspace { min-height: calc(100vh - 58px); padding: 20px 12px 40px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-header h1 { font-size: 21px; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .metrics-grid, .provider-grid, .create-form { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .metric-card { min-height: 112px; }
  .toolbar-card { align-items: stretch; flex-direction: column; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filters input, .filters select, .filters .search-field { width: 100%; min-width: 0; }
  .toolbar-meta { padding-left: 2px; }
  .detail-grid { grid-template-columns: 1fr; }
  .flow-actions, .form-actions { flex-direction: column-reverse; }
  .dialog-actions .button { flex: 1; }
  .mode-choices, .operation-form-grid, .provider-detail-grid { grid-template-columns: 1fr; }
  .operation-summary { padding: 18px 16px; }
  .operation-summary-meta { grid-template-columns: 1fr; }
  .operation-summary-meta > div,
  .operation-summary-meta > div:first-child { padding: 9px 0; border-left: 0; border-top: 1px solid var(--line); }
  .operation-summary-meta > div:first-child { border-top: 0; }
  .operation-form-actions .button { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .catalog-list li { align-items: flex-start; flex-direction: column; }
  .catalog-list-meta { width: 100%; justify-content: space-between; }
  .reconciliation-grid { grid-template-columns: 1fr; }
  .reconciliation-grid > div,
  .reconciliation-grid > div:first-child { padding: 9px 0; border-left: 0; border-top: 1px solid var(--line); }
  .reconciliation-grid > div:first-child { border-top: 0; }
}

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