:root {
  --ink: #162536;
  --muted: #617085;
  --line: #d6dde4;
  --soft: #f4f7fa;
  --panel: #ffffff;
  --brand: #2d3e50;
  --brand-2: #2d3e50;
  --accent: #f5b51b;
  --accent-2: #d99b10;
  --accent-soft: #fff6dc;
  --red: #9f3b35;
  --blue: #2f6089;
  --logo-white: #eef3f7;
  --shadow: 0 12px 28px rgba(22, 37, 54, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f8fafc;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

button, input, select, textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

button {
  min-height: 36px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 7px 12px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

button.secondary {
  color: var(--brand-2);
  background: #fff;
}

button.warning {
  border-color: var(--red);
  background: var(--red);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

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

textarea {
  min-height: 96px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  color: var(--logo-white);
  background: #2d3e50;
  border-bottom: 4px solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.brand p, .userline {
  margin: 2px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 13px;
}

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

.wrap {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.auth {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 24px;
  align-items: start;
}

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

.panel {
  padding: 20px;
}

.panel h2, .section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.panel p {
  color: var(--muted);
  line-height: 1.5;
}

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

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

.grid.full > * {
  grid-column: 1 / -1;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  border: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.tabs button.active {
  color: #fff;
  background: var(--brand);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

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

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.card {
  padding: 14px;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.badge.pending { background: var(--accent); }
.badge.active { background: var(--brand); }
.badge.suspended, .badge.cancelled { background: var(--red); }

.notice {
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  background: #fff8e8;
  color: #4d3714;
}

.error {
  border-left-color: var(--red);
  background: #fff0f0;
  color: var(--red);
}

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

.readonly input,
.readonly select,
.readonly textarea {
  background: var(--soft);
  pointer-events: none;
}

.document {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 38px;
  background: #fff;
}

.document h1 {
  color: var(--brand-2);
}

@media (max-width: 760px) {
  .auth, .grid, .grid.three {
    grid-template-columns: 1fr;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .wrap {
    padding: 14px;
  }
}

@media print {
  body {
    background: #fff;
  }
  .document {
    padding: 0;
  }
}


.ncc-logo-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 118px;
  height: 48px;
  color: var(--logo-white);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -8px;
  text-shadow:
    0 1px 0 #ffffff,
    1px 0 0 #ffffff,
    -1px 0 0 #ffffff,
    0 -1px 0 #ffffff;
}

.ncc-logo-mark .logo-c {
  margin-left: 1px;
}

.ncc-logo-mark i {
  position: absolute;
  left: 49px;
  top: 10px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
}

.brand h1 {
  color: var(--logo-white);
}

.brand p,
.userline {
  color: rgba(238, 243, 247, .82);
}

button {
  border-color: var(--brand);
  background: var(--brand);
}

button:hover {
  border-color: var(--brand-2);
  background: #2d3e50;
}

button.secondary {
  color: var(--brand-2);
  border-color: var(--line);
  background: #fff;
}

button.secondary:hover {
  color: var(--brand-2);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tabs button.active {
  color: var(--brand-2);
  background: var(--accent);
}

.badge.pending {
  color: var(--brand-2);
  background: var(--accent);
}


.ncc-logo {
  display: block;
  width: 110px;
  max-width: 24vw;
  height: auto;
  flex: 0 0 auto;
}

.brand {
  gap: 16px;
}

.brand h1 {
  color: var(--logo-white);
}

.brand p,
.userline {
  color: rgba(238, 243, 247, .82);
}

button {
  border-color: var(--brand);
  background: var(--brand);
}

button:hover {
  border-color: var(--brand-2);
  background: #2d3e50;
}

button.secondary {
  color: var(--brand-2);
  border-color: var(--line);
  background: #fff;
}

button.secondary:hover {
  color: var(--brand-2);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tabs button.active {
  color: var(--brand-2);
  background: var(--accent);
}

.badge.pending {
  color: var(--brand-2);
  background: var(--accent);
}

@media (max-width: 760px) {
  .ncc-logo {
    width: 96px;
    max-width: 42vw;
  }
}


.danger-link {
  min-height: 28px;
  width: fit-content;
  border: 0;
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--red);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.danger-link:hover {
  color: var(--red);
  background: #fff0ed;
}

.values-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  min-height: 560px;
  overflow: hidden;
}

.values-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--line);
  padding: 18px;
  background: var(--soft);
}

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

.values-sidebar h2,
.value-form h2 {
  margin: 0;
}

.values-sidebar p,
.value-form p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.new-row-button {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.value-nav {
  display: grid;
  gap: 6px;
}

.value-nav-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.value-nav-item:hover {
  border-color: var(--line);
  background: #fff;
}

.value-nav-item.active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.value-nav-item span {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.value-nav-item small {
  color: var(--muted);
}

.value-editor {
  padding: 20px;
}

.value-form {
  display: grid;
  gap: 18px;
}

.value-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.value-form textarea {
  min-height: 78px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.65);
}

.empty-state.large {
  display: grid;
  place-items: center;
  min-height: 320px;
}

@media (max-width: 860px) {
  .values-workspace {
    grid-template-columns: 1fr;
  }

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


.value-field-layout {
  display: grid;
  gap: 16px;
}

.value-top-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 14px;
  align-items: end;
}

.value-full-row {
  display: grid;
}

.value-full-row textarea {
  width: 100%;
  min-height: 78px;
}

@media (max-width: 860px) {
  .value-top-row {
    grid-template-columns: 1fr;
  }
}


.vision-mission-panel {
  gap: 22px;
}

.vm-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.vm-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.vm-section h3 {
  margin: 0;
  font-size: 20px;
}

.vm-section textarea {
  min-height: 78px;
}

.value-picker-summary {
  display: grid;
  gap: 8px;
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand-2);
  background: var(--accent-soft);
  border: 1px solid rgba(245, 181, 27, .45);
  font-size: 13px;
  font-weight: 700;
}

.muted-text {
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 37, 54, .42);
}

.modal {
  width: min(560px, 100%);
  max-height: min(720px, 88vh);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 20px 60px rgba(22, 37, 54, .26);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #fff;
}

.modal-head h2 {
  margin: 0;
}

.picker-list {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.picker-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  text-transform: none;
  font-size: 14px;
}

.picker-row:hover {
  background: var(--soft);
}

.picker-row input {
  width: 18px;
  min-height: 18px;
}

.picker-row span {
  display: grid;
  gap: 2px;
}

.picker-row small {
  color: var(--muted);
}


.goals-workspace {
  min-height: 640px;
}

.goal-editor {
  min-width: 0;
}

.goal-form,
.goal-field-layout,
.action-form {
  display: grid;
  gap: 16px;
}

.goal-row,
.action-row {
  display: grid;
  gap: 14px;
}

.goal-row-3,
.action-row-3 {
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) minmax(180px, 1fr);
}

.goal-form textarea,
.action-form textarea {
  min-height: 78px;
}

.action-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.action-section-head h3 {
  margin: 0;
}

.action-section-head p {
  margin: 0;
}

.action-form {
  box-shadow: none;
}

input[readonly] {
  color: var(--muted);
  background: var(--soft);
}

@media (max-width: 980px) {
  .goal-row-3,
  .action-row-3 {
    grid-template-columns: 1fr;
  }
}


/* Forced Goals/Actions layout */
.goal-field-layout {
  display: grid;
  gap: 16px;
}

.goal-row,
.action-row {
  display: grid !important;
  gap: 14px;
  width: 100%;
}

.goal-row-3,
.action-row-3 {
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) minmax(180px, 1fr) !important;
  align-items: end;
}

.goal-row > label,
.action-row > label,
.goal-row .value-picker-summary {
  min-width: 0;
}

.goal-row textarea,
.action-row textarea,
.goal-form textarea,
.action-form textarea {
  min-height: 78px !important;
  width: 100%;
}

.action-form {
  display: grid !important;
  gap: 16px;
}

.action-form .row-actions {
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .goal-row-3,
  .action-row-3 {
    grid-template-columns: 1fr !important;
  }
}


/* Exact requested Goals/Actions row layout */
.exact-goal-form,
.exact-action-form {
  display: grid;
  gap: 16px;
}

.exact-goal-row,
.exact-action-row {
  display: grid;
  gap: 14px;
  width: 100%;
}

.exact-three {
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) minmax(180px, 1fr);
  align-items: end;
}

.exact-full {
  grid-template-columns: 1fr;
}

.exact-goal-row > label,
.exact-action-row > label,
.exact-full > label,
.exact-full .value-picker-summary {
  min-width: 0;
  width: 100%;
}

.exact-goal-row textarea,
.exact-action-row textarea {
  min-height: 78px;
  width: 100%;
}

.exact-goal-row input,
.exact-goal-row select,
.exact-action-row input,
.exact-action-row select {
  min-height: 36px;
}

@media (max-width: 820px) {
  .exact-three {
    grid-template-columns: 1fr;
  }
}


.overview-plan {
  display: grid;
  gap: 18px;
}

.overview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.overview-toolbar h2,
.overview-toolbar p {
  margin: 0;
}

.smp-document-view {
  display: grid;
  gap: 24px;
}

.smp-title-block {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 16px;
}

.smp-title-block h1 {
  margin: 0;
  color: var(--brand-2);
  font-size: 34px;
}

.smp-title-block h2 {
  margin: 6px 0;
  font-size: 24px;
}

.smp-title-block p {
  margin: 3px 0;
  color: var(--muted);
}

.smp-document-view section {
  display: grid;
  gap: 10px;
}

.smp-document-view h3 {
  margin: 0;
  color: var(--brand-2);
  font-size: 21px;
}

.smp-document-view h4 {
  margin: 0;
  font-size: 18px;
}

.smp-document-view p {
  margin: 0;
  line-height: 1.5;
}

.lead-copy {
  font-weight: 700;
}

.overview-definition-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.overview-definition-list div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
}

.overview-definition-list dt {
  color: var(--muted);
  font-weight: 800;
}

.overview-definition-list dd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
}

.overview-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.overview-card,
.overview-goal {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

@media (max-width: 760px) {
  .overview-toolbar,
  .overview-definition-list div {
    grid-template-columns: 1fr;
  }

  .overview-toolbar {
    display: grid;
  }
}


/* Print/PDF export mirrors the SMP Overview document */
.print {
  background: #ffffff;
}

.print .document.print-overview {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 34px;
  box-shadow: none;
}

.print .overview-card,
.print .overview-goal {
  break-inside: avoid;
  page-break-inside: avoid;
}

.print .overview-card-grid {
  grid-template-columns: 1fr 1fr;
}

.print table {
  break-inside: auto;
}

.print tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

@media print {
  @page {
    margin: 0.55in;
  }

  body.print {
    color: #162536;
    background: #ffffff;
    font-size: 11pt;
  }

  .print .document.print-overview {
    width: 100%;
    padding: 0;
  }

  .print .smp-title-block {
    margin-bottom: 4px;
  }

  .print .smp-title-block h1 {
    font-size: 26pt;
  }

  .print .smp-title-block h2 {
    font-size: 17pt;
  }

  .print .smp-document-view {
    gap: 18px;
  }

  .print .smp-document-view h3 {
    font-size: 15pt;
  }

  .print .overview-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .print .overview-card,
  .print .overview-goal {
    padding: 10px;
  }

  .print .chip-row {
    border: 1px solid #d6dde4;
    padding: 6px;
  }

  .print .chip {
    border-color: #d6dde4;
    background: #fff6dc;
  }
}


/* Users can add updates even when the rest of the plan is read-only. */
.readonly .update-entry input {
  pointer-events: auto;
  background: #fff;
}

.readonly .update-entry button {
  pointer-events: auto;
}


.goal-update-section,
.action-update-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.update-log {
  display: grid;
  gap: 8px;
}

.update-log h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.update-log ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-log li {
  border-left: 3px solid var(--accent);
  padding: 7px 10px;
  background: var(--soft);
}

.update-log time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.update-log p {
  margin: 2px 0 0;
  color: var(--ink);
  line-height: 1.4;
}


.overview-update-log {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: var(--soft);
}

.overview-update-log h5 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.overview-update-log ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.overview-update-log li {
  display: grid;
  gap: 2px;
}

.overview-update-log time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-update-log span {
  line-height: 1.4;
}


.overview-actions-table .action-updates-row td {
  border-bottom: 1px solid var(--line);
  padding-top: 0;
  padding-left: 14px;
}

.overview-actions-table .action-updates-row .overview-update-log {
  margin-top: 0;
}

.overview-actions-table .action-summary-row td {
  border-bottom: 0;
}


.unassociated-values-warning {
  color: var(--red);
  border: 1px solid #efc6c1;
  border-left: 4px solid var(--red);
  background: #fff5f4;
  padding: 14px 16px;
}

.unassociated-values-warning h3,
.unassociated-values-warning p {
  color: var(--red);
}

.unassociated-values-warning ul {
  margin: 8px 0 0;
  padding-left: 20px;
}


body.busy {
  cursor: wait;
}

body.busy button,
body.busy input,
body.busy select,
body.busy textarea {
  cursor: wait;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: rgba(245, 248, 251, 0.45);
}

.busy-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-2);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 18px 45px rgba(16, 39, 65, 0.18);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #d7e0eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
