@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Petrona:wght@500;600&display=swap');

:root {
  --forest-950: #0f2922;
  --forest-900: #14332b;
  --forest-800: #1d473b;
  --paper: #fcfaf6;
  --surface: #ffffff;
  --canvas: #f7f5f0;
  --ink: #292724;
  --muted: #716e67;
  --faint: #98948c;
  --line: #dedad1;
  --line-soft: #ebe8e1;
  --copper: #a45224;
  --sage: #74836a;
  --green: #348553;
  --amber: #d88824;
  --red: #c44336;
  --blue: #2f73bd;
  --radius: 10px;
  --sans: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Petrona, Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.45 var(--sans); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: linear-gradient(90deg, var(--forest-950) 0 34%, var(--paper) 34% 100%);
}

.brand-plaque { background: #fbf8f0; border: 1px solid rgba(20,51,43,.16); border-radius: 8px; box-shadow: 0 8px 24px rgba(5,24,19,.15); }
.login-brand { position: fixed; top: 27px; left: 34px; width: 214px; padding: 14px 16px; }
.login-brand img, .brand-plaque img { display: block; width: 100%; height: auto; }
.login-card { width: min(440px, 100%); margin-left: 20%; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 42px; box-shadow: 0 30px 70px rgba(15, 41, 34, .13); }
.login-card h1 { margin: 0; font: 600 42px/1.1 var(--serif); color: var(--forest-950); }
.login-card > p { color: var(--muted); margin: 8px 0 26px; }
.login-card label, .form-grid label { display: block; margin: 0 0 14px; color: #4c4944; font-size: 12px; font-weight: 700; }
.login-card input, .form-grid input, .form-grid select { width: 100%; display: block; margin-top: 7px; padding: 12px; border: 1px solid #bbb7ae; border-radius: 8px; color: var(--ink); background: white; }
.login-card input:focus, .form-grid input:focus, .form-grid select:focus, .search input:focus { outline: 2px solid #9fb3a4; outline-offset: 1px; }
.login-card .button { width: 100%; margin-top: 13px; }
.login-link { width: 100%; margin-top: 14px; border: 0; background: transparent; color: var(--copper); font-weight: 700; }
.form-message { min-height: 20px; font-size: 12px; }
.demo-note { margin: 18px 0 0 !important; padding: 10px 12px; border-radius: 7px; background: #eef4ef; color: var(--forest-800) !important; text-align: center; font-size: 11px; }
.error { color: var(--red) !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 205px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--forest-950); color: white; display: flex; flex-direction: column; padding: 27px 13px 18px; overflow: auto; }
.sidebar-brand { display: grid; justify-items: center; gap: 8px; padding: 0 7px 30px; }
.sidebar-brand .brand-plaque { width: 172px; max-width: 100%; padding: 10px 11px; }
.sidebar-brand small { display: block; color: #df8050; text-transform: uppercase; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #e9edea; display: flex; align-items: center; gap: 11px; text-align: left; padding: 11px 12px; border-radius: 7px; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: rgba(194, 213, 201, .2); color: white; }
.nav-icon { width: 20px; text-align: center; color: #d5ded9; font-size: 18px; }
.nav-count { margin-left: auto; min-width: 19px; height: 19px; border-radius: 9px; display: grid; place-items: center; background: #fde2dd; color: var(--red); font-size: 10px; font-weight: 700; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 17px; }
.operator { display: flex; gap: 10px; align-items: center; padding: 0 7px 16px; }
.operator > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #ccd8d2; border-radius: 50%; }
.operator strong, .operator small { display: block; }
.operator strong { font-size: 12px; }
.operator small { color: #9eb0a8; font-size: 10px; }
.signout { border: 0; border-top: 1px solid rgba(255,255,255,.15); width: 100%; padding: 17px 7px 0; color: #e9edea; background: transparent; text-align: left; display: flex; gap: 12px; }

.workspace { min-width: 0; padding: 20px 22px 60px; max-width: 1600px; width: 100%; margin: 0 auto; }
.workspace-head { min-height: 57px; display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.workspace-head h1 { margin: 0; color: var(--forest-950); font: 600 39px/1.1 var(--serif); }
.workspace-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.head-tools { display: flex; align-items: center; gap: 10px; }
.environment, .search { height: 40px; background: white; border: 1px solid #cbc7be; border-radius: 7px; display: flex; align-items: center; }
.environment { padding: 0 8px 0 12px; }
.environment > span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #e5efe8; }
.environment select, .filters select { border: 0; background: transparent; color: var(--ink); padding: 0 9px; font-weight: 600; outline: 0; }
.search { width: min(330px, 33vw); gap: 8px; padding-left: 12px; }
.search > span { font-size: 22px; line-height: 1; }
.search input { border: 0; min-width: 0; width: 100%; height: 100%; background: transparent; outline: 0; padding-right: 10px; }
.button { border: 1px solid transparent; border-radius: 7px; padding: 10px 14px; font-weight: 700; font-size: 12px; background: white; color: var(--ink); }
.button.primary { background: var(--forest-900); color: white; }
.button.primary:hover { background: #0b221c; }
.button.outline { color: var(--copper); border-color: var(--copper); }
.button.outline:hover { background: #fff7f1; }
.button.ghost { border-color: var(--line); }
.button:disabled { opacity: .55; cursor: wait; }

.provider-flow { min-height: 165px; margin: 11px 0 15px; padding: 13px 18px; display: grid; grid-template-columns: 210px minmax(70px, 1fr) 215px minmax(95px, 1fr) 240px; align-items: center; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.flow-node { display: flex; gap: 12px; align-items: center; min-width: 0; }
.flow-node strong, .flow-node small, .health { display: block; }
.flow-node strong { font-size: 14px; }
.flow-node small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.provider-logo { flex: 0 0 auto; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; background: white; font-weight: 700; }
.provider-logo.gp { color: var(--blue); font-size: 17px; }
.provider-logo.tt { color: #2676d1; }
.provider-logo.gate { color: var(--copper); }
.provider-logo.core { color: var(--forest-900); font-size: 28px; }
.health { color: var(--muted); font-size: 10px; }
.health i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--amber); }
.health.connected { color: var(--green); }
.health.connected i { background: var(--green); }
.health.blocked { color: var(--red); }
.health.blocked i { background: var(--red); }
.health.processing { color: #966019; }
.health.processing i { background: var(--amber); }
.flow-line { height: 1px; background: #58906a; position: relative; margin: 0 12px; }
.flow-line i { position: absolute; top: 50%; left: 50%; width: 17px; height: 17px; transform: translate(-50%,-50%); background: white; border: 1px solid #58906a; border-radius: 50%; }
.flow-line i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #427c56; font-size: 10px; }
.flow-branch { height: 88px; position: relative; margin: 0 9px; }
.flow-branch::before { content: ""; position: absolute; left: 0; top: 50%; width: 55%; border-top: 1px solid #58906a; }
.flow-branch span { position: absolute; left: 55%; top: 18%; bottom: 18%; width: 45%; border-left: 1px solid #58906a; border-top: 1px solid #58906a; border-bottom: 1px solid #58906a; border-radius: 15px 0 0 15px; transform: scaleX(-1); }
.targets { display: grid; gap: 12px; }

.frontdesk-dashboard { margin: 11px 0 15px; }
.day-board { display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 15px; }
.day-board > article { min-width: 0; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.sage-count { color: var(--green); background: #eaf5ed; border-color: #cbe5d2; }
.blue-count { color: var(--blue); background: #edf4fb; border-color: #d1e2f4; }
.mini-list { padding: 5px 14px 12px; }
.mini-list > span, .status-lines > span { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.mini-list > span:last-child, .status-lines > span:last-child { border: 0; }
.mini-list strong, .mini-list small { display: block; }
.mini-list strong { font-size: 11px; }
.mini-list small { color: var(--muted); text-align: right; font-size: 10px; }
.park-status .surface-head { display: block; }
.park-status .health { margin-top: 3px; }
.status-lines { padding: 5px 14px 12px; font-size: 10px; }
.status-lines strong { color: var(--green); }

.role-surface { margin: 15px 0; scroll-margin-top: 18px; }
.role-surface > .surface-head { min-height: 68px; }
.surface-actions { display: flex; gap: 8px; }
.role-table-wrap { overflow: auto; }
.role-table { min-width: 860px; }
.role-table td strong, .role-table td small { display: block; }
.role-table td small { max-width: 230px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.table-empty { padding: 36px !important; color: var(--muted); text-align: center; }
.battery { font-weight: 700; color: var(--green); }
.battery.low { color: var(--amber); }
.role-chip { display: inline-block; padding: 3px 7px; border-radius: 5px; background: #eaf2ec; color: var(--forest-800); font-size: 9px; font-weight: 700; }
.role-chip.blue { background: #ebf3fb; color: var(--blue); }
.role-chip.amber { background: #fff1de; color: #956018; }
.queue-summary { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: #fbfaf7; }
.queue-summary span { min-width: 145px; padding: 13px 18px; color: var(--muted); font-size: 10px; border-right: 1px solid var(--line); }
.queue-summary strong { margin-right: 7px; color: var(--ink); font-size: 16px; }
.booking-flow-surface { margin-top: 15px; }
.flow-explainer { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfaf7; color: var(--muted); font-size: 10px; }
.flow-explainer span { display: flex; align-items: center; gap: 7px; }
.flow-explainer b, .booking-steps b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: white; font-size: 9px; }
.flow-explainer i { color: #a5afa8; font-style: normal; }
.booking-flow-list { display: grid; gap: 10px; padding: 12px; }
.observed-extra-summary { padding: 16px; border-bottom: 1px solid #c9ddce; background: linear-gradient(135deg, #edf7ef, #f8fbf7); }
.extra-summary-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.extra-summary-title h3 { margin: 1px 0 2px; color: var(--forest-950); font: 600 23px/1.2 var(--serif); }
.extra-summary-title p { margin: 0; color: var(--muted); font-size: 10px; }
.extra-summary-list { display: grid; gap: 9px; }
.extra-summary-item { display: grid; grid-template-columns: minmax(180px, 1fr) 115px minmax(220px, 1.3fr) minmax(180px, 1fr) auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid #b9d4c0; border-radius: 9px; background: white; box-shadow: 0 4px 15px rgba(15,41,34,.05); }
.extra-summary-item > div { min-width: 0; }
.extra-summary-item > div:first-child { display: grid; grid-template-columns: 35px 1fr; column-gap: 9px; }
.extra-summary-item > div:first-child small { grid-column: 2; }
.extra-summary-item small, .extra-summary-item strong, .extra-summary-item em { display: block; }
.extra-summary-item small { color: var(--muted); font-size: 9px; }
.extra-summary-item strong { font-size: 11px; }
.extra-summary-item em { margin-top: 4px; color: var(--muted); font-size: 9px; font-style: normal; }
.extra-mark { grid-row: 1 / 3; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 7px; background: var(--forest-900); color: white; font-size: 10px; font-weight: 700; }
.extra-pin { color: var(--forest-800); font: 700 16px ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .07em; }
.date-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.date-chips span, .inline-extra i { display: inline-block; padding: 4px 7px; border: 1px solid #b8d4c0; border-radius: 5px; background: #edf7ef; color: var(--forest-800); font-size: 10px; font-style: normal; font-weight: 700; }
.extra-lock-result strong.needs_mapping { color: var(--red); }
.extra-lock-result strong.target_unverified { color: #966019; }
.extra-lock-result strong.ready { color: var(--green); }
.extra-summary-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.extra-summary-actions .button { white-space: nowrap; padding: 8px 10px; }
.booking-flow-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.booking-flow-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.booking-flow-card header strong, .booking-flow-card header small { display: block; }
.booking-flow-card header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.booking-flow-meta { display: grid; grid-template-columns: 1fr 2fr .6fr; background: #fcfbf8; border-bottom: 1px solid var(--line); }
.booking-flow-meta span { padding: 10px 14px; border-right: 1px solid var(--line); }
.booking-flow-meta small, .booking-flow-meta strong { display: block; }
.booking-flow-meta small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.booking-flow-meta strong { margin-top: 3px; font-size: 11px; }
.booking-steps { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; }
.booking-steps span { position: relative; min-height: 72px; padding: 12px 12px 12px 42px; border-right: 1px solid var(--line); }
.booking-steps b { position: absolute; top: 12px; left: 12px; }
.booking-steps span.waiting b { background: #d7d4ca; color: #66635c; }
.booking-steps strong, .booking-steps small { display: block; }
.booking-steps strong { font-size: 10px; }
.booking-steps small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.access-plan { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: #f7faf7; }
.access-plan > span { min-width: 0; padding: 11px 14px; border-right: 1px solid var(--line); }
.access-plan > span:last-child { border: 0; }
.access-plan small, .access-plan strong, .access-plan em { display: block; }
.access-plan small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.access-plan strong { margin-top: 3px; font-size: 10px; }
.access-plan em { margin-top: 4px; color: var(--muted); font-size: 9px; font-style: normal; }
.inline-extra { margin-top: 6px; }
.inline-extra b, .inline-extra em { display: block; }
.inline-extra i { margin: 4px 4px 0 0; }
.access-policy { margin-top: 15px; }
.policy-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.policy-grid > span { position: relative; min-height: 118px; padding: 17px 16px 15px 49px; border-right: 1px solid var(--line); }
.policy-grid > span:last-child { border: 0; }
.policy-grid b { position: absolute; top: 17px; left: 16px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest-800); font-size: 10px; }
.policy-grid small, .policy-grid strong, .policy-grid em { display: block; }
.policy-grid small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.policy-grid strong { margin-top: 5px; font-size: 11px; }
.policy-grid em { margin-top: 6px; color: var(--muted); font-size: 9px; font-style: normal; }
.policy-grid .policy-warning { background: #fff8ec; }
.policy-grid .policy-warning b { background: var(--amber); }
.policy-grid .policy-observed { background: #edf7ef; }
.policy-grid .policy-observed b { background: var(--green); }
.queue-dots { display: inline-flex; gap: 3px; }
.queue-dots i { width: 8px; height: 8px; border-radius: 2px; background: var(--green); }
.queue-dots i.waiting { background: var(--amber); }
.queue-dots i.failed { background: var(--red); }
.gateway-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; padding: 14px; }
.gateway-cards article { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.gateway-cards article > div strong, .gateway-cards article > div small { display: block; }
.gateway-cards article > div small { color: var(--muted); font-size: 9px; }
.gateway-cards article > div:nth-child(3) { text-align: right; }
.gateway-cards .button { grid-column: 2 / -1; justify-self: end; padding: 6px 10px; }
.gateway-mark { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; background: #edf4ef; color: var(--forest-800); font-size: 20px; }
.property-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.property-grid > span { padding: 18px; border-right: 1px solid var(--line); }
.property-grid > span:last-child { border: 0; }
.property-grid small, .property-grid strong { display: block; }
.property-grid small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.property-grid strong { margin-top: 4px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); grid-template-areas: "events issues" "connections detail"; gap: 15px; align-items: stretch; }
body[data-role="frontdesk"] .content-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "events"; }
.surface { background: white; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.event-surface { grid-area: events; }
.issues-surface { grid-area: issues; }
.connections-surface { grid-area: connections; }
.detail-surface { grid-area: detail; }
.surface-head { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.surface-head h2, .dialog-head h2 { margin: 0; font-size: 14px; line-height: 1.3; }
.surface-head p, .dialog-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.filters { display: flex; gap: 8px; }
.filters select { height: 31px; border: 1px solid #d1cdc5; border-radius: 6px; font-size: 10px; }
.link-button, .icon-button { border: 0; background: transparent; color: var(--copper); font-size: 10px; }
.icon-button { color: var(--muted); font-size: 22px; padding: 2px 6px; }
.count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 5px; color: var(--red); background: #fde7e3; border: 1px solid #facbc4; border-radius: 5px; font-size: 10px; }

.event-table-wrap, .connection-table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th { color: #5e5b55; font-size: 9px; font-weight: 700; text-align: left; white-space: nowrap; background: #fbfaf7; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
td { font-size: 10px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.event-table tbody tr { cursor: pointer; box-shadow: inset 3px 0 transparent; }
.event-table tbody tr:hover { background: #f7f9f7; }
.event-table tbody tr.selected { background: #eef5f8; box-shadow: inset 3px 0 #3184a8; }
.event-table tbody tr[data-status="failed"] { box-shadow: inset 3px 0 var(--red); }
.event-table tbody tr[data-status="processing"] { box-shadow: inset 3px 0 var(--amber); }
.provider-cell { display: flex; align-items: center; gap: 6px; }
.mini-logo { width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 4px; display: inline-grid; place-items: center; color: var(--blue); font-size: 7px; font-weight: 700; }
.status-label { display: inline-flex; align-items: center; gap: 6px; }
.status-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-label.failed i { background: var(--red); }
.status-label.processing i { background: var(--amber); }
.correlation { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; color: #494741; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty-state { min-height: 235px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--ink); }
.empty-state span { font-size: 11px; }

.issues-list { padding: 0 13px 13px; }
.issue-group { border-bottom: 1px solid var(--line); }
.issue-group:last-child { border: 0; }
.issue-group-head { min-height: 44px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; }
.issue-card { padding: 13px; margin-bottom: 11px; border: 1px solid #efb7af; border-radius: 7px; background: #fff6f4; }
.issue-title { display: flex; gap: 10px; align-items: flex-start; }
.issue-title > span { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--red); font-size: 10px; }
.issue-title strong { font-size: 12px; }
.issue-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 13px 0; padding-left: 28px; }
.issue-meta span { font-size: 10px; }
.issue-meta small { display: block; color: var(--muted); }
.issue-actions { display: flex; justify-content: flex-end; gap: 8px; }
.issue-actions .button { padding: 7px 12px; }
.issues-empty { padding: 38px 16px; text-align: center; color: var(--muted); font-size: 11px; }

.connections-surface footer, .detail-surface footer { padding: 10px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.connection-table { min-width: 840px; }
.connection-name { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.masked-secret { color: #4e4b46; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }
.test-button { border: 1px solid var(--copper); color: var(--copper); background: white; border-radius: 5px; padding: 6px 8px; font-size: 9px; white-space: nowrap; }
.test-button:hover { background: #fff7f1; }

.detail-surface { display: flex; flex-direction: column; }
.detail-surface .surface-head p { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.trace { flex: 1; padding: 12px 16px 14px 29px; }
.trace-empty { display: grid; min-height: 180px; place-content: center; color: var(--muted); font-size: 11px; text-align: center; }
.trace-step { position: relative; padding: 0 0 18px 27px; border-left: 1px solid #b9c3ba; }
.trace-step:last-child { border-left-color: transparent; }
.trace-step::before { content: "✓"; position: absolute; left: -8px; top: 0; width: 15px; height: 15px; border: 1px solid var(--green); color: var(--green); background: white; border-radius: 50%; display: grid; place-items: center; font-size: 8px; }
.trace-step.failed::before { content: "×"; border-color: var(--red); background: var(--red); color: white; }
.trace-step.processing::before { content: ""; border-color: var(--amber); }
.trace-step time { display: block; color: var(--muted); font-size: 9px; }
.trace-step strong { display: block; margin-top: 3px; font-size: 11px; }
.trace-step p { margin: 2px 0 0; font-size: 10px; color: #55524c; }

.mappings-surface { margin-top: 15px; }
.mapping-table { min-width: 720px; }
.mapping-table td strong, .mapping-table td small { display: block; }
.mapping-table td small { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { text-align: right; }
.row-action { border: 0; background: transparent; color: var(--forest-800); font-size: 10px; padding: 4px 6px; }
.row-action.danger { color: var(--red); }
.mapping-empty { padding: 37px; text-align: center; color: var(--muted); }
.mapping-empty strong, .mapping-empty span { display: block; }
.mapping-empty strong { color: var(--ink); }
.mapping-empty span { font-size: 11px; margin: 3px 0 13px; }

.toast { position: fixed; right: 24px; bottom: 22px; z-index: 20; max-width: 390px; margin: 0; padding: 12px 16px; border-radius: 8px; color: white; background: var(--forest-900); box-shadow: 0 13px 35px rgba(15,41,34,.2); font-size: 12px; }

dialog { width: min(590px, calc(100vw - 28px)); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 30px 90px rgba(15,41,34,.25); }
dialog[open] { z-index: 100; }
dialog::backdrop { background: rgba(10,30,24,.5); }
dialog form { padding: 23px; }
.diagnostic-dialog { width: min(640px, calc(100vw - 32px)); padding: 0; }
.eyebrow { color: var(--copper) !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.diagnostic-body { min-height: 180px; padding: 22px; color: var(--ink); white-space: pre-wrap; }
.diagnostic-body.loading { color: var(--muted); }
.diagnostic-stages { display: grid; gap: 9px; }
.diagnostic-stages > span { display: grid; grid-template-columns: 28px 105px 1fr; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fbfaf7; }
.diagnostic-stages b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--forest-800); font-size: 10px; }
.diagnostic-stages strong { font-size: 11px; }
.diagnostic-stages small { color: var(--muted); font-size: 10px; }
.diagnostic-hint { margin: 15px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.diagnostic-result { line-height: 1.6; }
.diagnostic-result h3 { margin: 0 0 8px; font: 600 22px/1.2 var(--serif); color: var(--forest-950); }
.diagnostic-result small { display: block; margin-top: 16px; color: var(--muted); }
.diagnostic-guard { display: flex; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fff8ec; color: #715223; font-size: 11px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.dialog-head h2 { font: 600 24px var(--serif); color: var(--forest-950); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px; background: var(--canvas); border-radius: 7px; }
.checkbox input { margin-top: 3px; }
.checkbox strong, .checkbox small { display: block; }
.checkbox small { color: var(--muted); font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 1160px) {
  .provider-flow { grid-template-columns: 185px minmax(45px,1fr) 190px minmax(60px,1fr) 200px; }
  .content-grid { grid-template-columns: 1fr; grid-template-areas: "events" "issues" "connections" "detail"; }
  .issues-surface, .detail-surface { min-height: 260px; }
  .day-board, .gateway-cards { grid-template-columns: 1fr 1fr; }
  .policy-grid { grid-template-columns: 1fr 1fr; }
  .extra-summary-item { grid-template-columns: 1fr 110px 1.3fr; }
  .extra-lock-result { grid-column: 1 / 3; }
  .extra-summary-actions { grid-column: 3; grid-row: 2; }
  .park-status { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 67px minmax(0,1fr); }
  .sidebar { padding-left: 8px; padding-right: 8px; }
  .sidebar-brand { padding: 0 0 24px; }
  .sidebar-brand .brand-plaque { width: 62px; padding: 5px; }
  .sidebar-brand small { display: none; }
  .nav-item:not(.active) { color: transparent; }
  .nav-item { justify-content: center; gap: 0; font-size: 0; padding: 11px; }
  .nav-icon { font-size: 19px; }
  .nav-count { position: absolute; margin: -23px 0 0 24px; }
  .operator div, .signout span { display: none; }
  .signout { justify-content: center; }
  .workspace-head { display: block; }
  .head-tools { margin-top: 15px; }
  .search { flex: 1; width: auto; }
  .provider-flow { grid-template-columns: 1fr; gap: 13px; padding: 18px; }
  .flow-line, .flow-branch { display: none; }
  .targets { grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 13px; }
  .day-board, .gateway-cards, .property-grid { grid-template-columns: 1fr; }
  .extra-summary-item { grid-template-columns: 1fr 1fr; }
  .extra-summary-item > div:nth-child(3), .extra-lock-result, .extra-summary-actions { grid-column: 1 / -1; }
  .extra-summary-actions { flex-direction: row; }
  .park-status { grid-column: auto; }
  .property-grid > span { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .login-view { background: var(--forest-950); padding: 18px; }
  .extra-summary-title { display: block; }
  .extra-summary-title .status-label { margin-top: 9px; }
  .extra-summary-item { grid-template-columns: 1fr; }
  .extra-summary-item > div:nth-child(3), .extra-lock-result, .extra-summary-actions { grid-column: auto; }
  .extra-summary-actions { flex-direction: column; grid-row: auto; }
  .login-brand { position: static; width: 205px; margin-bottom: 25px; }
  .login-card { margin: 0; padding: 27px; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; display: block; padding: 13px 14px; }
  .sidebar-brand { padding: 0; }
  .sidebar nav { position: fixed; z-index: 12; left: 0; right: 0; bottom: 0; grid-template-columns: repeat(5,1fr); background: var(--forest-950); padding: 7px; }
  .sidebar-foot { display: none; }
  .workspace { padding: 16px 12px 85px; }
  .workspace-head h1 { font-size: 32px; }
  .environment { display: none; }
  .search { min-width: 0; }
  .search input { font-size: 12px; }
  .button.outline { white-space: nowrap; }
  .targets { grid-template-columns: 1fr; }
  .surface-head { align-items: flex-start; }
  .flow-explainer { justify-content: flex-start; overflow-x: auto; }
  .flow-explainer span { flex: 0 0 auto; }
  .booking-flow-meta, .access-plan, .policy-grid { grid-template-columns: 1fr; }
  .policy-grid > span { border-right: 0; border-bottom: 1px solid var(--line); }
  .event-surface .surface-head { display: block; }
  .filters { margin-top: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .diagnostic-stages > span { grid-template-columns: 28px 1fr; }
  .diagnostic-stages small { grid-column: 2; }
}

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .25s ease-out; }
  @keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
}


/* ---- additions for the server-rendered port ----
   The original console was a single page driven by JavaScript; these screens
   are separate documents, so the brand plaque holds a wordmark rather than an
   image asset, and the sign-out control is a form rather than a button with a
   handler. */
.role-chip.red { background: #fdecea; color: #a5352a; }
.role-chip.grey { background: #efedea; color: var(--muted); }
.role-chip.green { background: #e7f4ec; color: #1f5c38; }
.chip-note { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.mono { font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; color: #494741; }
.stack { display: grid; gap: 15px; margin-top: 15px; }
.status-lines strong.bad { color: var(--red); }
.status-lines strong.idle { color: var(--muted); }
.pick-list { display: grid; gap: 8px; margin-bottom: 18px; }
.pick-list a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 600; }
.pick-list a:hover { border-color: var(--copper); color: var(--copper); }
.brand-word { padding: 13px 14px; text-align: center; }
.brand-word strong { display: block; font: 600 19px/1.1 var(--serif); color: var(--forest-950); }
.brand-word span { display: block; margin-top: 2px; font-size: 8px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }
.sidebar nav .nav-item { text-decoration: none; }
.sidebar-foot .nav-item { color: #c7d2cc; }
.signout-form { margin: 0; }
.workspace-head + .surface, .workspace-head + form, .workspace-head + .notice { margin-top: 15px; }
.surface form { margin: 0; }
.surface > p, .surface > form { padding: 0 15px 15px; }
.surface > p:first-of-type { padding-top: 13px; }
.notice { margin: 13px 0; padding: 12px 15px; border-radius: var(--radius); font-size: 12px; }
.notice.ok { background: #eaf5ed; border: 1px solid #cbe5d2; color: #1f5c38; }
.notice.bad { background: #fff6f4; border: 1px solid #efb7af; color: #8d2b20; }

a.button { display: inline-block; text-decoration: none; line-height: 1.1; }
.surface fieldset { margin: 0 0 13px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.surface fieldset:last-of-type { margin-bottom: 0; }
.surface legend { padding: 0 6px; color: var(--forest-950); font-size: 11px; font-weight: 700; }
.surface > form + form { border-top: 0; }
.date-chips label.checkbox { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 11px; font-weight: 600; }
.date-chips label.checkbox:hover { border-color: var(--copper); }
.date-chips input[type="checkbox"] { margin: 0; accent-color: var(--forest-900); }
.role-table td a { color: var(--copper); text-decoration: none; }
.role-table td a:hover { text-decoration: underline; }
.role-table td form { display: inline-block; margin: 0; }
.role-table td .role-chip + .role-chip { margin-left: 4px; }
.head-tools form { margin: 0; }
.head-tools .button { height: 40px; }

.sidebar-foot .nav-item { text-decoration: none; }
.role-table details { margin-top: 7px; }
.role-table summary { display: inline-block; color: var(--copper); font-size: 10px; font-weight: 700; cursor: pointer; }
.role-table details[open] summary { margin-bottom: 9px; }
.role-table details form { display: block; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; white-space: normal; }
.role-table details .date-chips { margin-bottom: 9px; }

.sync-form { display: flex; align-items: flex-end; gap: 10px; margin: 0; }
.sync-form label { display: grid; gap: 4px; color: #4c4944; font-size: 10px; font-weight: 700; }
.sync-form input[type="date"] { height: 40px; padding: 0 10px; border: 1px solid #cbc7be;
  border-radius: 7px; background: white; color: var(--ink); font: inherit; }
