:root {
  --bg: #f5f4ef;
  --ink: #1d1f23;
  --muted: #6a6f76;
  --line: #ddd8cd;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #be123c;
  --success: #0f766e;
  --danger: #be123c;
  --warning: #d97706;
  --soft: #eef7f6;
  --warn: #fff4d8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.intake-body {
  display: block;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.09), transparent 34%),
    var(--bg);
}

.login-panel {
  min-height: 100vh;
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  padding: 22px;
}

.login-box {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 18px;
}

.login-box button {
  min-height: 42px;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.login-result {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--warn);
  padding: 9px 10px;
  color: var(--ink);
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfaf7;
  padding: 18px 14px;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.views {
  display: grid;
  gap: 12px;
}

.view-group {
  display: grid;
  gap: 4px;
}

.view-group-title {
  padding: 8px 4px 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.view-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  text-align: left;
}

.view-button.active {
  background: var(--soft);
  border-color: var(--accent);
  color: #0b5f59;
}

.count {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ece8df;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.shell {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.user-badge {
  min-height: 36px;
  display: inline-flex;
  max-width: 220px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
  color: var(--muted);
  font-size: 12px;
  padding: 0 10px;
}

#new-lead-button {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  padding-inline: 14px;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(72px, auto));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.mode-switch button {
  border: 0;
  border-radius: 0;
  min-height: 36px;
  padding-inline: 12px;
}

.mode-switch button.active {
  background: var(--ink);
  color: #fff;
}

#kanban-pipeline-select {
  min-width: 220px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.dashboard-panel {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 190px);
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.dashboard-card {
  min-width: 0;
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 11px 12px;
}

.dashboard-card span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.dashboard-section {
  min-height: 220px;
}

.dashboard-table {
  min-width: 0;
  max-height: 330px;
  overflow: auto;
}

.dashboard-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: #fffdfa;
}

.dashboard-table th,
.dashboard-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-table td:first-child {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-health {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.funnel-health .dashboard-card {
  min-height: 68px;
  padding: 9px 10px;
}

.funnel-health .dashboard-card strong {
  font-size: 17px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  min-height: calc(100vh - 190px);
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 320px);
  gap: 12px;
  min-height: calc(100vh - 190px);
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-column {
  min-height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.kanban-column-head {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.kanban-column-head strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.kanban-column-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.kanban-cards {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: calc(100vh - 280px);
  min-height: 120px;
  overflow-y: auto;
  padding: 10px;
}

.kanban-cards.drag-over {
  background: var(--soft);
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.kanban-column.drag-over {
  border-color: var(--accent);
}

.kanban-column.drag-over .kanban-cards {
  background: var(--soft);
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.kanban-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 11px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(29, 31, 35, 0.08);
}

.kanban-card.is-drag-source {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  cursor: grabbing;
  box-shadow: 0 18px 40px rgba(29, 31, 35, 0.18);
}

.kanban-dragging {
  cursor: grabbing;
  user-select: none;
}

.kanban-task {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.kanban-empty {
  min-height: 80px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.intake-shell {
  width: min(720px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 42px 0;
}

.intake-panel {
  padding: 18px;
}

.intake-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.intake-head h1 {
  font-size: 24px;
}

.intake-head p {
  color: var(--muted);
  margin-top: 2px;
}

.intake-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.student-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f2;
}

.student-fields[hidden] {
  display: none;
}

.student-fields .wide {
  grid-column: 1 / -1;
}

.intake-form button {
  grid-column: 1 / -1;
  min-height: 44px;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.intake-panel .result-box {
  margin-top: 12px;
}

.admin-panel {
  min-height: calc(100vh - 190px);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 14px;
  align-items: start;
}

.admin-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
}

.admin-section > :not(.panel-head) {
  margin-inline: 14px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-status-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fffdfa;
}

.admin-status-card.ok {
  border-color: #a7d7c8;
  background: #f2fbf7;
}

.admin-status-card.warn {
  border-color: #f2cc8f;
  background: var(--warn);
}

.admin-status-card span,
.admin-status-card strong {
  display: block;
}

.admin-status-card span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.daily-alerts {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px;
}

.alerts-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.alert-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.alert-card:hover,
.alert-card:focus-visible {
  border-color: #9aa78b;
  background: #f4f1e8;
  outline: none;
}

.alert-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.alert-card strong {
  font-size: 20px;
}

.alert-card.failed strong {
  color: var(--accent-2);
}

.alert-card.pending strong {
  color: #a16207;
}

.alerts-list {
  display: grid;
  gap: 8px;
}

.alert-bucket {
  display: grid;
  gap: 6px;
}

.alert-row {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #f8f7f2;
  border-radius: 6px;
  padding: 8px;
}

.alert-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.preflight-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px;
}

.preflight-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.preflight-list {
  display: grid;
  gap: 6px;
}

.acceptance-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.acceptance-summary-grid .alert-card {
  min-height: 76px;
}

.acceptance-summary-grid .alert-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.preflight-item {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--line);
  padding: 6px 8px;
  background: #fbfaf7;
}

.preflight-item.fail {
  border-color: var(--accent-2);
}

.preflight-item.warn {
  border-color: #d97706;
}

.preflight-item.info {
  border-color: #2563eb;
}

.preflight-item.pass {
  border-color: var(--accent);
}

.preflight-item strong {
  font-size: 12px;
}

.preflight-item strong small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.preflight-item span {
  color: var(--muted);
  font-size: 12px;
}

.preflight-item code {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  color: #374151;
  padding: 7px 8px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.command-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.command-copy code {
  min-width: 0;
}

.command-copy button {
  min-height: 32px;
  padding-inline: 9px;
  font-size: 12px;
}

.cutover-current {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f2;
  color: var(--muted);
  font-size: 13px;
}

.cutover-current strong {
  color: var(--ink);
}

.cutover-phases {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.cutover-phase {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 8px;
}

.cutover-phase.pass {
  border-left-color: var(--success);
}

.cutover-phase.warn {
  border-left-color: var(--warning);
}

.cutover-phase.fail {
  border-left-color: var(--danger);
}

.phase-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #efebe2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cutover-phase strong,
.cutover-phase span,
.cutover-phase small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cutover-phase strong {
  font-size: 12px;
  white-space: nowrap;
}

.cutover-phase span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.cutover-phase small {
  display: -webkit-box;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cutover-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 0 4px;
}

.cutover-fact {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 9px;
}

.cutover-fact span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cutover-fact strong {
  font-size: 18px;
}

.execution-trail {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 9px;
}

.external-unlock-plan {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 9px;
}

.external-unlock-list {
  display: grid;
  gap: 7px;
}

.external-unlock-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  border-left: 3px solid var(--line);
  padding: 7px 8px;
  background: #fbfaf7;
}

.external-unlock-step.pass {
  border-left-color: var(--success);
}

.external-unlock-step.warn {
  border-left-color: var(--warning);
}

.external-unlock-step.fail {
  border-left-color: var(--danger);
}

.external-unlock-step strong,
.external-unlock-step span,
.external-unlock-step small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.external-unlock-step strong {
  color: var(--ink);
  font-size: 12px;
}

.external-unlock-step span,
.external-unlock-step small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.execution-trail-list {
  display: grid;
  gap: 7px;
}

.execution-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  border-left: 3px solid var(--line);
  padding: 7px 8px;
  background: #fffdfa;
}

.execution-step.pass {
  border-left-color: var(--success);
}

.execution-step.warn {
  border-left-color: var(--warning);
}

.execution-step.fail {
  border-left-color: var(--danger);
}

.execution-step strong,
.execution-step span,
.execution-step small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.execution-step strong {
  font-size: 12px;
}

.execution-step span,
.execution-step small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.readiness-recommendation {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

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

.external-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 9px;
}

.integration-health-live {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 9px;
}

.integration-health-live > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.integration-health-live > strong,
.integration-health-live strong {
  color: var(--ink);
  font-size: 13px;
}

.integration-health-live small,
.integration-health-live > span,
.integration-health-live p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.external-card.pass {
  border-left-color: var(--success);
}

.external-card.warn {
  border-left-color: var(--warning);
}

.external-card.fail {
  border-left-color: var(--danger);
}

.external-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.external-card strong,
.external-card p,
.external-card small,
.external-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.external-card strong {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.external-card p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.external-card small,
.external-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.external-checks {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.external-checks li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.external-checks li > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.external-checks li.pass > span {
  color: var(--success);
}

.external-checks li.warn > span {
  color: var(--warning);
}

.external-checks li.fail > span {
  color: var(--danger);
}

.external-checks p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.role-release {
  display: grid;
  gap: 9px;
}

.role-release-head {
  display: grid;
  gap: 3px;
}

.role-release-head strong {
  color: var(--ink);
  font-size: 13px;
}

.role-release-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.role-release-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.role-release-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 9px;
}

.role-release-card.production_ready {
  border-left-color: var(--success);
}

.role-release-card.pilot_ready {
  border-left-color: var(--warning);
}

.role-release-card.blocked {
  border-left-color: var(--danger);
}

.role-release-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.role-release-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-release-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-release-card p {
  display: -webkit-box;
  min-height: 30px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pilot-package {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px;
}

.pilot-package.production_ready {
  border-left-color: var(--success);
}

.pilot-package.pilot_ready {
  border-left-color: var(--warning);
}

.pilot-package.blocked {
  border-left-color: var(--danger);
}

.pilot-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pilot-status-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pilot-grid section {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pilot-grid section > strong {
  color: var(--ink);
  font-size: 12px;
}

.pilot-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-left: 2px solid var(--line);
  padding-left: 7px;
}

.pilot-row.ready {
  border-left-color: var(--success);
}

.pilot-row.blocked {
  border-left-color: var(--danger);
}

.pilot-row span,
.pilot-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-row span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.pilot-row small,
.pilot-grid p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.pilot-grid p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pilot-score-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pilot-focus-list {
  display: grid;
  gap: 6px;
}

.pilot-focus-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: #fffdfa;
  padding: 8px 10px;
  text-align: left;
}

.pilot-focus-row.fail {
  border-left-color: var(--danger);
}

.pilot-focus-row.warn {
  border-left-color: var(--warning);
}

.pilot-focus-row span,
.pilot-focus-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-focus-row span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.pilot-focus-row small {
  color: var(--muted);
  font-size: 11px;
}

.pilot-check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.meta-event-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pilot-check-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 8px;
}

.pilot-check-card.pass {
  border-left-color: var(--success);
}

.pilot-check-card.warn {
  border-left-color: var(--warning);
}

.pilot-check-card.fail {
  border-left-color: var(--danger);
}

.pilot-check-card strong,
.pilot-check-card span,
.pilot-check-card small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilot-check-card strong,
.pilot-check-card span {
  white-space: nowrap;
}

.pilot-check-card strong {
  color: var(--ink);
  font-size: 12px;
}

.pilot-check-card span {
  font-size: 18px;
  font-weight: 800;
}

.pilot-check-card small {
  display: -webkit-box;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-table {
  min-width: 0;
  overflow: auto;
  max-height: calc(100vh - 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fffdfa;
}

.admin-table th,
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 12px;
}

.admin-table small {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #efebe2;
  color: var(--muted);
  font-size: 12px;
}

.status-pill.sent {
  background: #e6f6ed;
  color: #166534;
}

.status-pill.failed {
  background: #ffe1e7;
  color: var(--accent-2);
}

.status-pill.pending {
  background: #eaf1ff;
  color: #1d4ed8;
}

.plan-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.plan-progress-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 10px;
}

.plan-progress-card span {
  color: var(--muted);
  font-size: 12px;
}

.plan-progress-card strong {
  font-size: 24px;
}

.plan-progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #efebe2;
}

.plan-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.result-box {
  overflow: auto;
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  padding: 12px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.textarea-label {
  color: var(--muted);
  font-size: 13px;
}

.funnel-config-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.funnel-config-form label {
  min-width: 0;
}

.funnel-config-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.funnel-config-form .checkbox-label input {
  width: 16px;
  height: 16px;
}

.funnel-config-form .wide {
  grid-column: 1 / -1;
}

.funnel-config-form textarea {
  min-height: 120px;
}

.student-import-defaults textarea {
  min-height: 72px;
}

textarea {
  min-height: 300px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font: 12px/1.45 "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.funnel-config-form textarea {
  min-height: 120px;
}

.empty.compact {
  min-height: 140px;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-head {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.lead-list {
  overflow: auto;
  max-height: calc(100vh - 240px);
}

.lead-row {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

.lead-row:hover,
.lead-row.active {
  background: #fbfaf7;
}

.lead-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.lead-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #efebe2;
  color: #4b5563;
  font-size: 12px;
  white-space: nowrap;
}

.badge.hot {
  background: #ffe1e7;
  color: var(--accent-2);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-panel {
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 190px);
}

.empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail {
  display: grid;
  gap: 16px;
}

.detail h2 {
  font-size: 22px;
}

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

.detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.detail-form button {
  align-self: end;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.detail-form textarea {
  min-height: 76px;
  font-family: inherit;
}

.student-meta span {
  color: #5f4d21;
  font-weight: 700;
}

.message-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.template-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.template-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.template-empty {
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-actions button {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.form-result {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.task-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.requirements-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--success);
  border-radius: 8px;
  background: #fffdfa;
}

.requirements-panel.warn {
  border-left-color: var(--warning);
}

.requirements-panel.fail {
  border-left-color: var(--danger);
}

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

.requirement-group {
  display: grid;
  gap: 6px;
}

.requirement-group > strong {
  color: var(--muted);
  font-size: 12px;
}

.requirement-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f7f2;
}

.requirement-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--warning);
}

.requirement-item.fail .requirement-dot {
  background: var(--danger);
}

.requirement-item strong {
  display: block;
  font-size: 13px;
}

.requirement-item small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.requirement-item p,
.requirements-empty {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.section-head h3 {
  font-size: 15px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  gap: 8px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f7f2;
  padding: 8px;
}

.task-item.done {
  opacity: 0.72;
}

.field {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fffdfa;
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: #f8f7f2;
  border-radius: 0 6px 6px 0;
}

.capi-lead-list {
  display: grid;
  gap: 8px;
}

.capi-lead-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: #f8f7f2;
  padding: 9px 10px;
}

.capi-lead-item.sent {
  border-left-color: var(--success);
}

.capi-lead-item.failed {
  border-left-color: var(--danger);
}

.capi-lead-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 90px;
}

.capi-error {
  color: var(--danger);
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 4px;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.25);
}

dialog form {
  display: grid;
  gap: 10px;
}

dialog header,
dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--ink);
  background: #fff;
}

.compact-input {
  width: 76px;
  min-height: 36px;
}

#funnel-config-select,
#calendar-config-select {
  width: 180px;
  max-width: 100%;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .views {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace,
  .kpis,
  .dashboard-summary,
  .dashboard-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    grid-template-columns: repeat(2, minmax(86px, 1fr));
  }

  .funnel-health {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cutover-phases,
  .cutover-facts,
  .acceptance-summary-grid,
  .external-grid,
  .role-release-grid,
  .pilot-grid,
  .pilot-score-facts,
  .pilot-check-grid {
    grid-template-columns: 1fr;
  }

  .meta-event-grid {
    grid-template-columns: 1fr;
  }

  .command-copy {
    grid-template-columns: 1fr;
  }

  .pilot-focus-row {
    grid-template-columns: 1fr;
  }

  .detail-form,
  .task-form,
  .detail-grid,
  .quick-actions,
  .intake-form,
  .funnel-config-form,
  .student-fields {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}
