:root {
  color-scheme: light;
  --ink: #07111f;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --page: #f7fbff;
  --blue: #0866f5;
  --blue-strong: #0051d4;
  --blue-soft: #d8ecff;
  --blue-pale: #eef7ff;
  --green: #168553;
  --amber: #a16207;
  --red: #b4234a;
  --shadow: 0 18px 44px rgba(15, 65, 120, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, var(--page) 44%, #ffffff 100%);
  color: var(--ink);
}

body.auth-needed .sidebar,
body.auth-needed main {
  visibility: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(8, 102, 245, 0.18);
}

button.secondary {
  background: #eff6ff;
  color: var(--blue-strong);
  box-shadow: none;
}

button.danger {
  color: var(--red);
  background: #fff1f4;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.developer-login {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, var(--page) 100%);
}

.developer-login[hidden] {
  display: none;
}

.developer-login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.developer-login-panel img {
  width: min(230px, 100%);
  height: auto;
}

.developer-login-panel h1,
.developer-login-panel p {
  margin: 0;
}

.developer-login-panel p:not(.eyebrow):not(.login-error) {
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 24px 18px;
  box-shadow: 14px 0 34px rgba(15, 65, 120, 0.05);
}

.brand {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-logo {
  width: min(210px, 100%);
  height: auto;
  display: block;
}

.brand small,
.eyebrow,
.meta,
.agent-card span,
.audit-item span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-nav,
.nav-group,
.nav-panel {
  display: grid;
  gap: 8px;
}

.nav-group {
  margin-bottom: 8px;
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px 0 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.chevron {
  color: var(--muted);
  font-size: 22px;
  transform: rotate(90deg);
}

.nav-panel {
  padding-left: 10px;
}

.nav-item {
  position: relative;
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  min-height: 44px;
  padding-left: 36px;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transform: translateY(-50%);
}

.nav-item.active {
  background: var(--blue-pale);
  color: var(--blue-strong);
}

.nav-item.active::before {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(8, 102, 245, 0.16);
}

main {
  min-width: 0;
  padding: 30px 34px 44px;
}

.topbar,
.section-head,
.card-header,
.service-card header,
.agent-detail header,
.audit-item footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 12px;
}

.user-chip:empty {
  display: none;
}

.user-chip strong,
.user-chip span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip span {
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.status-pill,
.badge {
  border-radius: 999px;
  padding: 7px 10px;
  background: #eff6ff;
  color: var(--blue-strong);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 750;
}

.status-pill.ok,
.badge.foundation,
.badge.local,
.badge.ok {
  background: #e0f2fe;
  color: #075985;
}

.badge.planned,
.badge.queued,
.badge.needs-decision,
.badge.warn {
  background: #fef3c7;
  color: var(--amber);
}

.badge.not-connected,
.badge.critical {
  background: #fee2e2;
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel {
  min-height: 232px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 26px;
  align-items: center;
  margin-top: 24px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  font-size: 34px;
  margin-bottom: 10px;
}

.hero-panel p {
  max-width: 760px;
  margin-bottom: 0;
}

.hero-icon {
  width: 154px;
  justify-self: end;
  filter: drop-shadow(0 18px 28px rgba(8, 102, 245, 0.16));
}

.overview-grid,
.project-grid,
.application-grid,
.booking-summary,
.timeslot-summary,
.service-grid,
.integration-grid,
.credential-summary,
.credential-hub-grid,
.dns-summary,
.productivity-summary,
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.section-head {
  margin: 28px 0 18px;
}

.overview-card,
.project-card,
.application-card,
.booking-panel,
.booking-spec-card,
.flow-step,
.service-card,
.integration-card,
.credential-hub-card,
.system-check-card,
.dns-record-card,
.dns-change-card,
.policy-card,
.dns-panel,
.timeline-item,
.protocol-panel,
.protocol-card,
.pipeline-card,
.agent-detail,
.audit-item,
.security-event-panel,
.security-event-item,
.timeslot-panel,
.timeslot-item,
.table-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview-card,
.project-card,
.application-card,
.booking-panel,
.booking-spec-card,
.flow-step,
.service-card,
.integration-card,
.credential-hub-card,
.system-check-card,
.dns-record-card,
.dns-change-card,
.policy-card,
.dns-panel,
.timeline-item,
.protocol-panel,
.protocol-card,
.pipeline-card,
.agent-detail,
.audit-item,
.security-event-panel,
.security-event-item,
.timeslot-panel,
.timeslot-item,
.table-row {
  padding: 18px;
}

.overview-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.service-card,
.project-card,
.application-card,
.booking-panel,
.booking-spec-card,
.integration-card,
.credential-hub-card,
.system-check-card,
.dns-record-card,
.dns-change-card,
.dns-panel {
  display: grid;
  gap: 14px;
}

.system-status-hero {
  margin-bottom: 16px;
}

.mfa-setup-panel {
  margin-bottom: 16px;
}

.mfa-setup-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
}

.system-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.security-event-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.security-event-list {
  display: grid;
  gap: 10px;
}

.security-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: none;
}

.security-event-item p {
  margin: 4px 0 0;
}

.security-event-item footer {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.system-check-card.ok {
  border-color: rgba(22, 133, 83, 0.32);
}

.system-check-card.warn {
  border-color: rgba(161, 98, 7, 0.36);
}

.system-check-card.critical {
  border-color: rgba(180, 35, 74, 0.36);
}

.system-health-ok {
  border-color: rgba(22, 133, 83, 0.28);
  background: linear-gradient(135deg, #ffffff 0%, #effdf6 100%);
}

.system-health-warn {
  border-color: rgba(161, 98, 7, 0.32);
  background: linear-gradient(135deg, #ffffff 0%, #fff8e7 100%);
}

.system-health-critical {
  border-color: rgba(180, 35, 74, 0.32);
  background: linear-gradient(135deg, #ffffff 0%, #fff1f4 100%);
}

.policy-card {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  border-color: rgba(8, 102, 245, 0.22);
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
}

.service-card h3,
.project-card h3,
.application-card h3,
.booking-spec-card h3,
.flow-step h3,
.integration-card h3,
.credential-hub-card h3,
.dns-record-card h3,
.dns-change-card h3,
.policy-card h3 {
  margin-bottom: 4px;
}

.booking-layout,
.booking-roadmap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.booking-roadmap {
  align-items: start;
}

.booking-panel {
  align-content: start;
}

.booking-card-grid,
.flow-list,
.phase-list {
  display: grid;
  gap: 12px;
}

.booking-spec-card {
  display: grid;
  gap: 10px;
  box-shadow: none;
}

.booking-spec-card p {
  margin-bottom: 0;
}

.flow-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  box-shadow: none;
}

.flow-step > strong {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-strong);
}

.flow-step p {
  margin-bottom: 4px;
}

.phase-list {
  margin-top: 18px;
}

.booking-runtime {
  margin-top: 18px;
}

.timeslot-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.84fr) minmax(0, 1.6fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.timeslot-panel {
  display: grid;
  gap: 14px;
}

.timeslot-form {
  display: grid;
  gap: 12px;
}

.timeslot-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.timeslot-form input,
.timeslot-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 10px;
}

.timeslot-form-row,
.timeslot-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-status {
  min-height: 22px;
  margin-bottom: 0;
  font-size: 13px;
}

.timeslot-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.timeslot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: none;
}

.timeslot-item.available {
  border-color: rgba(22, 133, 83, 0.28);
}

.timeslot-item.blocked {
  border-color: rgba(161, 98, 7, 0.32);
  background: #fffbeb;
}

.timeslot-item.booked {
  border-color: rgba(8, 102, 245, 0.18);
  background: #f8fbff;
}

.timeslot-item p {
  margin: 4px 0;
}

.timeslot-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 18px;
}

.dns-panel {
  align-content: start;
}

.panel-head p {
  margin-bottom: 0;
}

.dns-record-grid,
.dns-change-list {
  display: grid;
  gap: 12px;
}

.dns-guardrails {
  margin-top: 18px;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.card-footer strong {
  color: var(--ink);
  text-align: right;
}

.progress-block {
  display: grid;
  gap: 8px;
}

.progress-block > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-block strong {
  color: var(--blue-900);
  font-size: 22px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef8;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
}

.project-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-detail-grid section {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.project-detail-grid h4 {
  margin-bottom: 8px;
  font-size: 13px;
}

.ops-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-strip span {
  padding: 7px 9px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue-900);
  font-size: 12px;
  font-weight: 750;
}

.next-action {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.next-action h4 {
  margin-bottom: 6px;
  font-size: 13px;
}

.readiness-checklist {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.readiness-checklist h4 {
  margin-bottom: 8px;
  font-size: 13px;
}

.readiness-checklist ul {
  display: grid;
  gap: 8px;
  list-style: none;
}

.readiness-checklist li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: start;
}

.readiness-checklist span {
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.readiness-checklist .done span {
  background: #e8f5ef;
  color: #176342;
}

.readiness-checklist .open span {
  background: #fff3df;
  color: #8a4c00;
}

.credential-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.credential-meta div {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.credential-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.credential-meta dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 750;
}

.task-list,
.field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li,
.field-list li {
  border-radius: 999px;
  padding: 6px 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.table-list,
.audit-list,
.timeline-list {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.time-range {
  display: grid;
  gap: 4px;
  color: var(--blue-strong);
}

.time-range span,
.timeline-metrics span,
.pipeline-card footer span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-metrics,
.pipeline-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline-metrics span,
.pipeline-steps span {
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--blue-pale);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
}

.protocol-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.protocol-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.protocol-card {
  box-shadow: none;
}

.pipeline-card {
  display: grid;
  gap: 14px;
}

.pipeline-card footer {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pipeline-card footer strong {
  color: var(--blue-strong);
  font-size: 24px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.table-row p,
.audit-item p {
  margin-bottom: 0;
}

.agent-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
}

.agent-list {
  display: grid;
  gap: 10px;
}

.agent-card {
  width: 100%;
  min-height: 74px;
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.agent-card.active {
  border-color: rgba(8, 102, 245, 0.35);
  background: var(--blue-pale);
}

.load-ring {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 60%),
    conic-gradient(var(--blue) calc(var(--load) * 1%), #e2e8f0 0);
  color: var(--blue-strong);
  font-weight: 800;
}

.agent-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.agent-tools span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--blue-pale);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
}

.audit-item footer {
  margin-top: 12px;
}

.monitoring-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.monitoring-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.monitoring-panel,
.compact-list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.monitoring-panel {
  padding: 18px;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  box-shadow: none;
}

.compact-list-item span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.visitor-table {
  overflow-x: auto;
}

.visitor-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.visitor-table th,
.visitor-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.visitor-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.visitor-table td span {
  display: block;
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.visitor-table td strong {
  display: block;
  max-width: 300px;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .overview-grid,
  .service-grid,
  .integration-grid,
  .booking-summary,
  .booking-layout,
  .booking-roadmap,
  .timeslot-summary,
  .timeslot-layout,
  .timeslot-form-row,
  .timeslot-actions,
  .credential-summary,
  .credential-hub-grid,
  .credential-meta,
  .dns-summary,
  .dns-layout,
  .system-check-grid,
  .monitoring-summary,
  .monitoring-layout,
  .check-list,
  .productivity-summary,
  .pipeline-grid,
  .protocol-layout,
  .timeline-item,
  .agent-layout,
  .mfa-setup-box,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-icon {
    justify-self: start;
  }
}
