:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211b;
  background: #f4f6f2;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.shell { min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px clamp(20px, 5vw, 64px); color: white; background: #14251d;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #b8ef87; color: #14251d; font-weight: 900; }
.brand strong { display: block; font-size: 15px; }
.brand span, .actor span { display: block; color: #b8c9bd; font-size: 12px; }
.actor { display: flex; align-items: center; gap: 12px; text-align: right; }
.page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 44px 0 80px; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.heading.compact { align-items: center; margin: 4px 0 18px; }
h1 { margin: 0 0 8px; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 46px); font-weight: 500; letter-spacing: -.03em; }
h2 { margin: 0; font-size: 18px; }
p { line-height: 1.55; }
.muted { color: #637067; }
.tabs { display: flex; gap: 6px; margin: 22px 0; border-bottom: 1px solid #d6ddd7; }
.tab { border: 0; border-bottom: 3px solid transparent; padding: 11px 14px; color: #637067; background: transparent; font-weight: 700; }
.tab[aria-selected="true"] { border-color: #2b6b48; color: #1f5a3c; }
.grid { display: grid; gap: 18px; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.metric, .panel, .login-card {
  border: 1px solid #dce2dc; border-radius: 15px; background: white; box-shadow: 0 8px 30px rgba(26, 44, 34, .05);
}
.metric { padding: 20px; }
.metric strong { display: block; font-size: 30px; font-family: Georgia, serif; }
.metric span { color: #637067; font-size: 13px; }
.panel { overflow: hidden; }
.routing-section { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #e4e8e4; }
.provider-panel-head { align-items: flex-start; }
.provider-filters { justify-content: flex-end; }
.provider-filters input { min-width: 260px; }
.provider-filters select { min-width: 130px; }
.panel-body { padding: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar input, .toolbar select { min-width: 180px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #edf0ed; text-align: left; vertical-align: top; }
th { color: #637067; background: #f8faf8; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.person { font-weight: 750; }
.sub { margin-top: 4px; color: #69766d; font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badge { display: inline-flex; align-items: center; margin: 2px 4px 2px 0; border-radius: 999px; padding: 4px 8px; background: #edf2ee; color: #33453a; font-size: 11px; font-weight: 700; }
.badge.active { background: #e0f4e4; color: #176236; }
.badge.suspended, .badge.reserved { background: #fff1d6; color: #805900; }
.badge.failed, .badge.reconciliation_required { background: #fde7e5; color: #842d28; }
.badge.processing, .badge.queued { background: #e7eefb; color: #244d87; }
.audit-events { margin-top: 18px; }
.assignment { margin-bottom: 9px; }
.assignment:last-child { margin-bottom: 0; }
.provider-locations summary { cursor: pointer; color: #1f5a3c; font-weight: 750; }
.provider-locations[open] summary { margin-bottom: 8px; }
.provider-locations > div + div { margin-top: 8px; }
.provider-locations .mono { max-width: 360px; white-space: normal; overflow-wrap: anywhere; }
.btn { border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-weight: 750; }
.btn-primary { background: #225f3d; color: white; }
.btn-primary:hover { background: #184c30; }
.btn-secondary { border-color: #cbd4cd; color: #25352a; background: white; }
.btn-danger { border-color: #e0b9b7; color: #8b2924; background: #fff9f8; }
.btn-small { padding: 6px 9px; font-size: 12px; }
input, select, textarea { width: 100%; border: 1px solid #cbd4cd; border-radius: 9px; padding: 10px 11px; color: #17211b; background: white; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(56, 128, 83, .16); border-color: #388053; }
label { display: grid; gap: 6px; color: #435047; font-size: 12px; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.notice, .error { margin: 14px 0; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.notice { border: 1px solid #d7c58d; background: #fff9e8; color: #614e16; }
.error { border: 1px solid #e2bab7; background: #fff3f2; color: #842d28; }
.empty { padding: 42px 20px; text-align: center; color: #637067; }
dialog { width: min(820px, calc(100% - 30px)); max-height: calc(100vh - 40px); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 30px 90px rgba(10, 25, 16, .25); }
dialog::backdrop { background: rgba(12, 27, 18, .62); }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid #e3e8e4; }
.dialog-body { max-height: calc(100vh - 190px); overflow-y: auto; padding: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid #e3e8e4; background: #f8faf8; }
.routing-editor-form { margin-top: 20px; }
.routing-editor-context {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 12px;
}
.routing-editor-context > div {
  border: 1px solid #dce2dc; border-radius: 10px; padding: 12px; background: #f8faf8;
}
.routing-editor-context span { display: block; color: #637067; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.routing-editor-context strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.routing-editor-coverage { border-left: 3px solid #b8d7c2; padding: 6px 0 6px 12px; }
.routing-editor-coverage .provider-locations { margin-top: 8px; }
.field-hint { color: #69766d; font-size: 11px; font-weight: 500; line-height: 1.4; }
.routing-draft-notice { margin-bottom: 0; }
input[readonly] { color: #546259; background: #f1f4f1; }
.login { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #14251d; }
.login-card { width: min(440px, 100%); padding: 34px; }
.login-card h1 { font-size: 35px; }
.login-card form { display: grid; gap: 15px; margin-top: 24px; }
@media (max-width: 800px) {
  .metrics, .form-grid { grid-template-columns: 1fr; }
  .routing-editor-context { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .heading { align-items: start; flex-direction: column; }
  .table-wrap { overflow-x: auto; }
  .table-wrap .empty { text-align: left; }
  .actor span { display: none; }
}
