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

/* Front desk: Today and Guest keys. Larger type than the system screens:
   these are read at a glance across a counter, not studied. */
.nav-section { margin: 18px 12px 6px; color: #9fb3a8; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-system .nav-item { font-size: 12px; padding: 8px 12px; color: #c9d3ce; }
.alert-strip { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 13px 16px;
  border: 1px solid #f0c9c3; border-radius: var(--radius); background: #fdf0ee; color: #8f2c22; text-decoration: none; font-size: 14px; }
.alert-strip span { font-weight: 600; }
.today-grid { display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 15px; margin-top: 15px; }
.today-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.today-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.today-card h2 { margin: 0; font: 600 18px/1.2 var(--serif); color: var(--forest-950); }
.count-bubble { min-width: 28px; padding: 3px 9px; border-radius: 14px; background: #e7f0ea; color: var(--forest-800); font-weight: 700; font-size: 13px; text-align: center; }
.day-list { display: grid; }
.day-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.day-list a:last-child { border-bottom: 0; }
.day-list a:hover { background: #faf8f3; }
.day-list strong { display: block; font-size: 14px; }
.day-list small { display: block; color: var(--muted); font-size: 12px; }
.day-right { display: grid; justify-items: end; gap: 4px; }
.day-right b { font-size: 13px; }
.day-empty { margin: 0; padding: 22px 16px; color: var(--muted); font-size: 13px; }
.park .health { font-size: 12px; }
.park-lines { display: grid; padding: 4px 16px 10px; }
.park-lines span { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.park-lines span:last-child { border-bottom: 0; }
.park-lines em { font-style: normal; color: #4c4944; }
.park-lines strong.warn { color: #956018; }
.park-lines strong.bad { color: var(--red); }
.key-surface { margin-top: 15px; }
.key-surface .surface-head h2 { font: 600 18px/1.2 var(--serif); color: var(--forest-950); }
.key-surface .surface-head p { font-size: 12px; }
.key-table { min-width: 980px; }
.key-table th { font-size: 11px; letter-spacing: .02em; }
.key-table td { padding-top: 12px; padding-bottom: 12px; font-size: 13px; vertical-align: middle; }
.key-table td small { font-size: 11px; }
.key-table tr.is-past td { color: var(--faint); }
.guest-link { display: block; color: var(--forest-900); font-weight: 700; font-size: 14px; text-decoration: none; }
.guest-link:hover { color: var(--copper); }
.key-cell { white-space: nowrap; }
.key-mask { font: 700 15px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: #4e4b46; margin-right: 10px; }
.key-cell .extra-pin { font: 700 18px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; color: var(--forest-900); }
.reveal-form { display: inline; margin: 0; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--copper); font-weight: 700; font-size: 12px; text-decoration: underline; }
.key-status { display: inline-block; padding: 4px 10px; border-radius: 14px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.key-status.green { background: #e2f2e7; color: #1f5c38; }
.key-status.blue { background: #e6f0fa; color: #22598f; }
.key-status.amber { background: #fdefd9; color: #8a5413; }
.key-status.red { background: #fbe4e1; color: #9c2e24; }
.key-status.grey { background: #efedea; color: var(--muted); }
.key-detail { display: block; margin-top: 4px; max-width: 260px; color: var(--muted); }
.gp-yes { color: #1f5c38; font-weight: 700; font-size: 12px; }
.gp-no { color: #8a5413; font-weight: 700; font-size: 12px; }
.quiet { color: var(--faint); font-size: 12px; }
.key-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs .tab { padding: 7px 13px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); text-decoration: none; font-size: 13px; background: white; }
.tabs .tab span { margin-left: 4px; color: var(--muted); font-weight: 700; }
.tabs .tab.active { background: var(--forest-900); border-color: var(--forest-900); color: white; }
.tabs .tab.active span { color: #cfe0d6; }
.tabs .tab.alert:not(.active) { border-color: #f0c9c3; color: #9c2e24; }
.key-search { display: flex; gap: 8px; margin: 0; }
.key-search input[type="search"] { width: min(320px, 60vw); height: 36px; padding: 0 12px; border: 1px solid #cbc7be; border-radius: 8px; font-size: 13px; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: 1fr; } }

/* Staff & contractor PINs */
.pin-form { padding: 15px !important; }
.pin-fields { display: grid; grid-template-columns: 1.4fr .8fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pin-fields label { display: grid; gap: 6px; color: #4c4944; font-size: 12px; font-weight: 700; }
.pin-fields input { height: 40px; padding: 0 11px; border: 1px solid #cbc7be; border-radius: 8px; font-size: 14px; color: var(--ink); background: white; }
.pin-form legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: #4c4944; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }
.pick:hover { border-color: #9fb3a4; }
.pick em { color: var(--muted); font-style: normal; font-size: 11px; }
.pin-submit { display: flex; justify-content: flex-end; margin-top: 12px; }
.pin-name { font-size: 14px; }
.lock-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 420px; }
.lock-chip { padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.lock-chip.green { background: #e2f2e7; color: #1f5c38; }
.lock-chip.blue { background: #e6f0fa; color: #22598f; }
.lock-chip.amber { background: #fdefd9; color: #8a5413; }
.lock-chip.red { background: #fbe4e1; color: #9c2e24; }
.lock-chip.grey { background: #efedea; color: var(--muted); }
.button.small { padding: 6px 12px; font-size: 12px; }
.danger-text { color: var(--red) !important; border-color: #efc4be !important; }
@media (max-width: 900px) { .pin-fields { grid-template-columns: 1fr 1fr; } }

/* Lock groups */
.group-card { margin: 0 15px 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.group-card h3 { margin: 0 0 8px; font: 600 16px/1.3 var(--serif); color: var(--forest-950); }
.group-card fieldset { margin-bottom: 10px; }
.all-sites { display: inline-flex; margin: 4px 0 8px; }

/* Search */
.side-search { margin: 0 4px 14px; }
.side-search input { width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: white; font-size: 13px; }
.side-search input::placeholder { color: #aebdb6; }
@media (max-width: 1180px) { .side-search { display: none; } }
.hero-search { display: flex; gap: 10px; margin: 4px 0 16px; }
.hero-search input { flex: 1; height: 50px; padding: 0 18px; border: 1px solid #cbc7be; border-radius: 12px; font-size: 17px; background: white; box-shadow: 0 2px 8px rgba(15,41,34,.05); }
.hero-search input:focus { outline: 2px solid var(--forest-800); outline-offset: 1px; }
.hero-search .button { height: 50px; padding: 0 22px; font-size: 15px; }

/* Codes, in plain digits */
.code-plain { display: inline-block; padding: 3px 9px; border-radius: 7px; background: #eef4ef; color: var(--forest-950); font: 700 18px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.code-plain.small { font-size: 13px; padding: 1px 6px; margin-left: 4px; }
.code-big { display: block; font: 700 44px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; color: var(--forest-950); }
.key-mask.big { font-size: 34px; }

/* Today: keys beside activity */
.today-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); gap: 15px; align-items: start; }
@media (max-width: 1700px) { .today-split { grid-template-columns: 1fr; } }
.today-split .activity { max-height: 720px; overflow: auto; }
.park-lines a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }

/* Activity feed */
.activity { list-style: none; margin: 0; padding: 4px 18px 16px; }
.act { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 10px 0 10px 14px; border-bottom: 1px solid var(--line-soft); position: relative; }
.act:last-child { border-bottom: 0; }
.act::before { content: ''; position: absolute; left: 0; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.act.green::before { background: var(--green); } .act.blue::before { background: var(--blue); }
.act.amber::before { background: var(--amber); } .act.red::before { background: var(--red); }
.act time { color: var(--muted); font-size: 12px; padding-top: 2px; white-space: nowrap; }
.act strong { display: block; font-size: 14px; }
.act.red strong { color: #9c2e24; }
.act-meta { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.act-meta a { color: var(--forest-800); font-weight: 600; }
.act-detail { display: block; margin-top: 4px; font-size: 12.5px; color: #8a5413; background: #fdf6ea; padding: 5px 8px; border-radius: 6px; }
.act.red .act-detail { color: #9c2e24; background: #fdf0ee; }

/* A booking's key panel */
.stay-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 15px; }
.stay-top { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
.stay-code { background: #f3f7f3; border: 1px solid #d7e6da; border-radius: 12px; padding: 14px 18px; }
.stay-code small, .stay-facts small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 4px; }
.stay-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; }
.stay-facts strong { font-size: 15px; }
.stay-note { margin: 12px 0 0; color: #8a5413; }
.stay-card h3 { margin: 20px 0 8px; font: 600 16px/1.3 var(--serif); color: var(--forest-950); }
.door-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: 10px; }
.door-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.door-list li:last-child { border-bottom: 0; }
.door-name { flex: 1; min-width: 180px; }
.door-name small { display: block; color: var(--muted); font-size: 12px; }
.door-detail { flex-basis: 100%; color: #9c2e24; font-size: 12.5px; }
.door-list form { margin: 0; }
.door-hint { flex-basis: 100%; color: var(--ink); font-size: 12.5px; background: #f6f4ee; padding: 6px 9px; border-radius: 6px; }
@media (max-width: 760px) { .stay-top { grid-template-columns: 1fr; } .act { grid-template-columns: 1fr; gap: 2px; } }

/* Doors & locks */
.door-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.door-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 14px; font-size: 12.5px; font-weight: 600; }
.door-chip.lock { background: #eef4ef; color: var(--forest-900); }
.door-chip.group { background: #eef0fa; color: #2d3f82; }
.door-chip em { font-style: normal; font-weight: 500; opacity: .75; }
.room-name { font-size: 15px; }
.room-edit summary, .group-card summary { cursor: pointer; color: var(--copper); font-weight: 600; font-size: 13px; margin-top: 4px; }
.room-edit form, .group-card details form { margin-top: 10px; padding: 12px 14px; background: #faf8f3; border: 1px solid var(--line-soft); border-radius: 10px; }
.room-edit fieldset, .group-new fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.room-edit legend, .group-new legend { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.group-new { margin: 0 18px 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 10px; }
.group-new > label { display: grid; gap: 4px; font-weight: 600; max-width: 360px; }
.group-new > .button { justify-self: start; }
.group-new input[name=name] { height: 38px; padding: 0 10px; border: 1px solid #cbc7be; border-radius: 8px; }
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.group-cards .group-card { margin: 0; }
.group-card header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.group-users { margin: 6px 0; font-size: 13px; color: var(--muted); }
.group-users b { color: var(--ink); font-weight: 600; }
.group-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.group-actions form { margin: 0; }

/* Lock queue */
.queue-table tr.is-problem td { background: #fffaf9; }
.queue-table td small { display: block; }
.queue-table .door-detail, .queue-table .door-hint { margin-top: 5px; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; max-width: 420px; }
.queue-table td:nth-child(4) { min-width: 300px; }
.tech summary { cursor: pointer; font-size: 11px; color: var(--faint); margin-top: 6px; }
.tech .mono { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); word-break: break-all; }

/* Team */
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select, .inline-form input { height: 32px; padding: 0 8px; border: 1px solid #cbc7be; border-radius: 7px; }
.role-help { margin: 4px 0 8px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.role-help li { margin: 3px 0; }
.pin-fields select { height: 38px; padding: 0 10px; border: 1px solid #cbc7be; border-radius: 8px; }

/* Guest messaging */
.form-grid textarea, .template-edit textarea { width: 100%; display: block; margin-top: 7px; padding: 12px; border: 1px solid #bbb7ae; border-radius: 8px; font: 14px/1.5 inherit; color: var(--ink); background: white; }
.template-edit label { display: block; margin: 0 0 14px; color: #4c4944; font-size: 12px; font-weight: 700; }
.template-edit input { width: 100%; display: block; margin-top: 7px; padding: 12px; border: 1px solid #bbb7ae; border-radius: 8px; color: var(--ink); background: white; }
.message-preview { white-space: pre-wrap; padding: 14px; border: 1px dashed #bbb7ae; border-radius: 8px; background: var(--canvas); font-size: 14px; }
.message-send { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 10px 0 0; }
.message-send select { height: 32px; padding: 0 8px; border: 1px solid #cbc7be; border-radius: 7px; }
.flag { color: #9b3b2a; font-weight: 700; }

/* Phones: a compact top bar and one scrolling row of the day-to-day screens. */
@media (max-width: 560px) {
  .sidebar { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
  .sidebar-foot { border-top: 0 !important; }
  .sidebar-brand { display: block; padding: 0; }
  .sidebar-brand .brand-plaque { width: auto; padding: 5px 9px; }
  .sidebar-brand .brand-plaque span { display: none; }
  .nav-section, .nav-system, .side-search { display: none !important; }
  .sidebar-foot { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; border: 0; }
  .sidebar-foot .operator, .sidebar-foot a[href="/ops"] { display: none; }
  .sidebar-foot .nav-item, .sidebar-foot .signout { width: auto; padding: 8px; font-size: 0; color: #e9edea; }
  .sidebar-foot .nav-icon, .sidebar-foot .signout { font-size: 18px; }
  .sidebar nav[aria-label="Front desk"] { display: flex; overflow-x: auto; gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .sidebar nav[aria-label="Front desk"] .nav-item { flex: 0 0 auto; width: 74px; display: grid; justify-items: center; gap: 2px; padding: 7px 4px;
    font-size: 10.5px; color: #cfdad4; text-align: center; line-height: 1.15; white-space: normal; }
  .sidebar nav[aria-label="Front desk"] .nav-item.active { color: white; }
  .sidebar nav[aria-label="Front desk"] .nav-icon { font-size: 18px; }
  .hero-search input { height: 46px; font-size: 16px; }
  .hero-search .button { height: 46px; padding: 0 14px; }
  .workspace-head .head-tools { display: none; }
}

/* Contacts */
.contact-card { padding: 4px 18px 16px; display: grid; gap: 8px; }
.contact-link { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; padding: 6px 12px; border-radius: 18px; background: #eef4ef; color: var(--forest-900); font-weight: 600; text-decoration: none; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-row .contact-link { margin-right: 0; }
.pin-contact { display: block; margin-top: 4px; }
.pin-contact .contact-link { padding: 2px 8px; font-size: 12px; margin-right: 6px; }

/* Ridge24 brand lockup (ops-brand.ts): mark + wordmark, drawn for the dark
   forest backgrounds of the sidebar and the sign-in panel. */
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { flex: none; width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.25); }
.brand-text { min-width: 0; }
.brand-name { display: block; font: 700 22px/1 var(--sans, Figtree, system-ui, sans-serif); letter-spacing: -.01em; color: #fbf8f0; }
.brand-name b { color: #df8050; font-weight: 800; margin-left: 1px; }
.brand-text span { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #aebfb6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand { justify-items: start; padding-left: 4px; }
.login-brand { width: auto; padding: 0; }
.login-brand .brand-mark { width: 48px; height: 48px; }
.login-brand .brand-name { font-size: 28px; }
@media (max-width: 820px) {
  .sidebar-brand .brand-text { display: none; }
  .sidebar-brand { justify-items: center; padding-left: 0; }
}
@media (max-width: 560px) {
  .sidebar-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
}

/* Shared readable operations controls, including older administration views. */
.role-table th { font-size: 12px; }
.role-table td { font-size: 13px; }
.role-chip { font-size: 12px; }
.surface-head p, .workspace-subtitle, .role-table summary { font-size: 13px; }
.button, .button.small { min-height: 40px; }
:where(a, button, input, select, summary):focus-visible { outline: 3px solid #bb6b36; outline-offset: 3px; }
.refresh-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.section-tabs { margin: 14px 0; }
.stay-status { font-weight: 600; }
.attention-list { list-style: none; margin: 0; padding: 0 18px; }
.attention-list li { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.attention-list small, .attention-list p { font-size: 13px; color: var(--muted); }
.attention-list p { margin: 5px 0 0; }
@media (max-width: 760px) {
  .attention-list li { grid-template-columns: 1fr; gap: 10px; }
  .attention-list .button { justify-self: start; }
  .refresh-bar { align-items: flex-start; }
  .refresh-bar .button { flex-shrink: 0; }
}

.sidebar-brand { max-width: 100%; overflow: hidden; }
@media (max-width: 560px) {
  .key-table, .key-table tbody { display: block; width: 100%; min-width: 0; }
  .key-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .key-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
  .key-table td { display: block; padding: 0; white-space: normal; border: 0; overflow-wrap: anywhere; }
  .key-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .key-table td:first-child, .key-table td:nth-child(7) { grid-column: 1 / -1; }
  .key-table td:first-child::before, .key-table td:last-child::before { display: none; }
  .key-table .key-status { white-space: normal; }
}
