:root {
  --ink: #17201d;
  --muted: #64706a;
  --line: #d8dfda;
  --canvas: #f5f6f1;
  --surface: #ffffff;
  --moss: #1a6653;
  --moss-dark: #104235;
  --moss-pale: #e2f1e9;
  --amber: #865100;
  --amber-pale: #fff1d5;
  --rust: #942f1b;
  --rust-pale: #fee8e2;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
svg { width: 17px; height: 17px; stroke-width: 2; }

.page-shell { min-height: 100vh; background: linear-gradient(105deg, #f5f6f1 0%, #f5f6f1 63%, #edf3ed 100%); }
.topbar { min-height: 76px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(255, 255, 255, .88); border-bottom: 1px solid var(--line); }
.brand, .topbar-actions, .primary-button, .secondary-button, .icon-button, .search-field, .segmented-control, .status, .detail-actions { display: flex; align-items: center; }
.brand { gap: 10px; font-size: 14px; white-space: nowrap; }
.brand strong { font-weight: 700; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; font-family: "DM Mono", monospace; font-size: 15px; font-weight: 700; color: #fff; background: var(--moss); border-radius: 5px; }
.topbar-actions { gap: 10px; }
.source-indicator { padding: 5px 9px; font-family: "DM Mono", monospace; font-size: 11px; color: var(--muted); background: #f0f2ee; border-radius: 4px; }
.primary-button, .secondary-button, .icon-button { justify-content: center; gap: 8px; min-height: 38px; border: 1px solid transparent; border-radius: 6px; transition: background .18s ease, transform .18s ease; }
.primary-button { padding: 0 13px; color: #fff; background: var(--moss); font-weight: 700; font-size: 13px; }
.primary-button:hover { background: var(--moss-dark); transform: translateY(-1px); }
.secondary-button { padding: 0 11px; color: var(--ink); background: #fff; border-color: var(--line); font-size: 12px; font-weight: 700; }
.secondary-button:hover { border-color: var(--moss); color: var(--moss-dark); }
.icon-button { width: 38px; padding: 0; color: var(--muted); background: transparent; border-color: var(--line); }
.icon-button:hover { color: var(--moss); border-color: var(--moss); }
.is-loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 1500px; margin: 0 auto; padding: clamp(34px, 5vw, 68px) clamp(20px, 5vw, 76px) 48px; }
.overview { display: flex; justify-content: space-between; align-items: flex-end; gap: 36px; padding-bottom: 42px; }
.eyebrow { margin: 0 0 8px; color: var(--moss); font-family: "DM Mono", monospace; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 650px; margin-bottom: 11px; font-size: clamp(29px, 4vw, 46px); line-height: 1.12; }
h2 { margin-bottom: 0; font-size: 23px; }
.subheading { max-width: 590px; margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(108px, 1fr)); border-left: 1px solid var(--line); }
.metric { min-height: 64px; padding: 2px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.metric strong { font-family: "DM Mono", monospace; font-size: 22px; }
.metric span { margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }

.workspace { border-top: 1px solid var(--line); }
.toolbar { min-height: 84px; display: flex; gap: 13px; align-items: center; flex-wrap: wrap; }
.search-field { width: min(100%, 315px); gap: 8px; padding: 0 11px; height: 38px; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.search-field:focus-within { border-color: var(--moss); box-shadow: 0 0 0 3px var(--moss-pale); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 13px; background: transparent; }
.segmented-control { padding: 3px; gap: 2px; background: #e9ece7; border-radius: 6px; }
.filter-button { padding: 6px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); text-transform: capitalize; font-size: 11px; font-weight: 700; }
.filter-button.selected { color: var(--moss-dark); background: #fff; box-shadow: 0 1px 2px rgba(23, 32, 29, .1); }
.record-count { margin-left: auto; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: 20px; align-items: start; }
.registry-panel, .detail-panel { min-height: 430px; background: rgba(255, 255, 255, .93); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 13px 16px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
td { padding: 15px 16px; font-size: 12px; vertical-align: middle; border-bottom: 1px solid #e9ece8; }
tbody tr { cursor: pointer; transition: background .16s ease; }
tbody tr:hover, tbody tr.selected { background: #f3f8f4; }
td strong { display: block; font-size: 13px; }
.secondary-text { display: block; margin-top: 3px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; }
.platform-label { display: block; color: var(--ink); font-family: "DM Mono", monospace; font-size: 11px; }
.status { width: max-content; gap: 6px; padding: 4px 7px; border-radius: 4px; text-transform: capitalize; font-family: "DM Mono", monospace; font-size: 10px; font-weight: 700; }
.status i { width: 6px; height: 6px; border-radius: 100%; background: currentColor; }
.status-active { color: var(--moss-dark); background: var(--moss-pale); }
.status-provisioning { color: var(--amber); background: var(--amber-pale); }
.status-inactive { color: #525a54; background: #e8ece8; }
.status-failed { color: var(--rust); background: var(--rust-pale); }
.status-unknown { color: var(--muted); background: #edf0ee; }
.row-action { padding: 5px; border: 0; color: var(--muted); background: transparent; }
.row-action:hover { color: var(--moss); }
.empty-state, .detail-placeholder { min-height: 360px; padding: 24px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state svg, .detail-placeholder svg { width: 28px; height: 28px; margin-bottom: 9px; color: var(--moss); }
.empty-state p, .detail-placeholder p { max-width: 210px; margin-bottom: 0; font-size: 12px; line-height: 1.6; }

.detail-panel { padding: 22px; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-heading h2 { font-size: 22px; }
.detail-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.detail-status strong { color: var(--ink); font-family: "DM Mono", monospace; text-transform: capitalize; font-size: 10px; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf0ed; }
.detail-list dt { color: var(--muted); font-size: 10px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-family: "DM Mono", monospace; font-size: 10px; line-height: 1.4; text-align: right; }
.detail-actions { flex-wrap: wrap; gap: 8px; padding-top: 20px; }

.orchestrator-dialog { width: min(100% - 32px, 560px); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 8px; box-shadow: 0 24px 80px rgba(20, 32, 26, .25); }
.orchestrator-dialog::backdrop { background: rgba(16, 35, 27, .48); backdrop-filter: blur(2px); }
.orchestrator-dialog form { padding: 26px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.dialog-heading .icon-button { flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid label { display: grid; gap: 7px; color: #405048; font-size: 11px; font-weight: 700; }
.form-grid input[type="text"], .form-grid select { width: 100%; height: 38px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 5px; outline: 0; font-size: 12px; }
.form-grid input:focus, .form-grid select:focus { border-color: var(--moss); box-shadow: 0 0 0 3px var(--moss-pale); }
.full-width { grid-column: 1 / -1; }
.form-grid .toggle-field { display: flex; align-items: center; gap: 8px; padding-top: 5px; cursor: pointer; }
.toggle-field input { width: 15px; height: 15px; accent-color: var(--moss); }
.form-note { min-height: 17px; margin: 19px 0 0; color: var(--muted); font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .overview { align-items: flex-start; flex-direction: column; }
  .summary { width: 100%; max-width: 440px; }
  .content-grid { grid-template-columns: 1fr; }
  .detail-panel { min-height: auto; }
  .detail-placeholder { min-height: 180px; }
}
@media (max-width: 620px) {
  .topbar { min-height: 68px; padding: 0 16px; }
  .brand > span:last-child, .source-indicator { display: none; }
  main { padding: 33px 16px; }
  .summary { grid-template-columns: repeat(3, 1fr); }
  .metric { padding: 2px 10px; }
  .metric strong { font-size: 18px; }
  .toolbar { align-items: stretch; padding: 17px 0; }
  .search-field { width: 100%; }
  .segmented-control { overflow-x: auto; }
  .filter-button { white-space: nowrap; }
  .record-count { margin-left: 0; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .dialog-actions { flex-wrap: wrap; }
}