:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #16202a;
  --muted: #637083;
  --line: #d9e0e7;
  --accent: #1f7a68;
  --accent-2: #a64253;
  --accent-3: #2f5e8e;
  --soft: #edf4f2;
  --warn: #fff2d6;
  --shadow: 0 10px 30px rgba(24, 36, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #e5eaee;
  color: var(--text);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(31, 122, 104, 0.12), transparent 45%),
    linear-gradient(300deg, rgba(166, 66, 83, 0.10), transparent 42%),
    var(--bg);
}

.login-panel {
  width: min(920px, 100%);
  min-height: 420px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 40px;
}

.login-panel h1,
.topbar h1 {
  margin: 4px 0 8px;
  font-size: 34px;
}

.login-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.login-logos img {
  max-width: 170px;
  max-height: 56px;
  object-fit: contain;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.login-form,
.form-panel,
.upload-card {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344154;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 104, 0.13);
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  background: #17202a;
  color: white;
}

.sidebar h2 {
  margin: 6px 0 0;
  font-size: 24px;
}

.company-logo {
  display: block;
  width: 176px;
  max-height: 74px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
}

.company-switcher {
  margin-top: 16px;
  color: #c9d4df;
}

.company-switcher select {
  margin-top: 6px;
  background: #23303d;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  background: transparent;
  color: #dfe6ed;
  text-align: left;
  border: 1px solid transparent;
  padding: 10px 12px;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.12);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.project-logo {
  display: block;
  width: 180px;
  max-height: 62px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 12px;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 800;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #f0d38a;
  border-radius: 8px;
  background: var(--warn);
  color: #765312;
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

.kpi {
  min-height: 112px;
  padding: 16px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.15;
}

.kpi small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.3;
}

.kpi small span {
  display: block;
}

.executive-hero {
  display: grid;
  grid-template-columns: 1.15fr 2fr;
  gap: 14px;
  align-items: stretch;
}

.exec-health {
  min-height: 160px;
  padding: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #17202a 0%, #1f7a68 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.exec-health span,
.exec-health p {
  color: #c9d4df;
}

.exec-health span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.exec-health strong {
  display: block;
  margin: 20px 0 12px;
  font-size: 32px;
  line-height: 1.1;
}

.exec-health p {
  margin: 0;
  line-height: 1.45;
}

.exec-health.drill-card {
  border: 1px solid transparent;
}

.exec-health-action {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.executive-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.health-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.health-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  line-height: 1.35;
}

.health-legend strong {
  color: var(--ink);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.status-starting {
  background: #64748b;
}

.status-watch {
  background: #c67c13;
}

.status-on-track,
.status-closing {
  background: #1d7f67;
}

.status-attention {
  background: #aa3d4d;
}

.exec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.exec-span-2 {
  grid-column: span 2;
}

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

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

.scorecard-item,
.readiness-item,
.capability-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.scorecard-item {
  display: grid;
  gap: 9px;
  border-left: 5px solid var(--accent);
}

.scorecard-head,
.readiness-item > div,
.capability-item > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.scorecard-head strong,
.readiness-item strong,
.capability-item strong {
  line-height: 1.25;
}

.scorecard-head span,
.readiness-item span,
.capability-item span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e8edf0;
  color: #344154;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.scorecard-score {
  font-size: 22px;
  font-weight: 800;
}

.scorecard-item p,
.readiness-item p,
.capability-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.workflow-action {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(99, 112, 131, 0.18);
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.rag-green,
.readiness-ready {
  border-left-color: var(--accent);
}

.rag-green .scorecard-head span,
.readiness-ready span,
.capability-item span {
  background: var(--soft);
  color: var(--accent);
}

.rag-amber,
.readiness-review,
.readiness-in-progress {
  border-left-color: #c17a16;
  background: #fffaf0;
}

.rag-amber .scorecard-head span,
.readiness-review span,
.readiness-in-progress span {
  background: #fff2d6;
  color: #765312;
}

.rag-red,
.readiness-action-required {
  border-left-color: var(--accent-2);
  background: #fff6f7;
}

.rag-red .scorecard-head span,
.readiness-action-required span {
  background: #f9e1e6;
  color: var(--accent-2);
}

.control-lane {
  display: grid;
  gap: 8px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.control-lane span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.control-lane strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.control-lane small {
  color: var(--muted);
  line-height: 1.35;
}

.lane-attention {
  border-left: 4px solid var(--accent-2);
  background: #fff6f7;
}

.lane-controlled {
  border-left: 4px solid var(--accent);
}

.escalation-card {
  border-left: 4px solid var(--line);
}

.level-3 {
  border-left-color: var(--accent-2);
}

.level-2 {
  border-left-color: #c17a16;
}

.level-1 {
  border-left-color: var(--accent-3);
}

.exec-feature strong {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
}

.exec-feature p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.alert-high {
  border-color: rgba(166, 66, 83, 0.45);
  background: #fff6f7;
}

.alert-medium {
  border-color: #f0d38a;
  background: #fffaf0;
}

.alert-normal {
  border-color: rgba(31, 122, 104, 0.35);
  background: #f4fbf8;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel,
.upload-card {
  padding: 18px;
}

.panel h2,
.upload-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

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

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

.toast-line {
  margin: 14px 0 0;
  min-height: 20px;
  color: var(--accent);
  font-weight: 800;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  color: #516075;
  font-size: 11px;
  text-transform: uppercase;
}

.over-supplied-row {
  background: #fffaf0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8edf0;
  color: #344154;
  font-size: 12px;
  font-weight: 800;
}

.status-over {
  background: #fff2d6;
  color: #765312;
}

td.small {
  width: 92px;
}

.progress-cell {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.progress-bar {
  height: 8px;
  background: #e8edf0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent-3);
}

.inline-form {
  display: grid;
  grid-template-columns: 80px minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  padding: 8px;
}

.schedule-form {
  display: grid;
  gap: 8px;
  min-width: 420px;
}

.evidence-summary {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.evidence-summary strong {
  color: var(--accent-3);
}

.evidence-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.evidence-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  min-width: 240px;
}

.evidence-form input {
  padding: 8px;
}

.schedule-primary-controls {
  display: grid;
  grid-template-columns: 80px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.schedule-primary-controls input {
  padding: 8px;
}

.schedule-date-gate {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.schedule-date-gate summary {
  cursor: pointer;
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 800;
}

.schedule-date-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.schedule-date-controls .date-reason {
  grid-column: 1 / -1;
}

.delivery-form {
  display: grid;
  grid-template-columns: 84px minmax(130px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 320px;
}

.delivery-form input {
  padding: 8px;
}

.delivery-form input[type="file"],
.delivery-form .form-error,
.delivery-form button {
  grid-column: 1 / -1;
}

.form-error {
  min-height: 16px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.delivery-batch-form {
  display: grid;
  gap: 14px;
}

.delivery-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.delivery-actions {
  display: flex;
  justify-content: flex-end;
}

.verification-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #f0d38a;
  border-radius: 8px;
  background: #fffaf0;
}

.verification-panel h3 {
  margin: 0;
  font-size: 15px;
}

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

.verification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.delivery-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.date-range {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}

.dynamic-log-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.log-field-grid label.full {
  grid-column: 1 / -1;
}

.delivery-qty {
  min-width: 92px;
}

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

.list.compact {
  margin-top: 14px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.drill-card {
  cursor: pointer;
}

.exec-feature .drill-card {
  display: block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  margin: -10px;
}

.drill-card:hover,
.drill-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 104, 0.10);
  outline: none;
}

.focus-highlight {
  animation: focusPulse 1.6s ease-out;
}

tr.focus-highlight {
  background: #edf4f2;
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 122, 104, 0.45);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(31, 122, 104, 0);
  }
}

.user-list-item {
  cursor: pointer;
}

.user-list-item:hover {
  border-color: var(--accent);
}

.list-item strong {
  display: block;
  margin-bottom: 4px;
}

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

.report-panel {
  max-width: 820px;
}

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

.controls-panel {
  margin-top: 18px;
}

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

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

.contact-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.contact-card strong {
  display: block;
  margin-bottom: 8px;
}

.contact-card div,
.contact-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.contact-card p {
  margin-top: 10px;
}

.change-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 16px;
}

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

.workflow-group {
  display: grid;
  gap: 10px;
}

.workflow-group h3 {
  margin: 0;
  font-size: 14px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.workflow-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.workflow-step p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.report-result {
  margin-top: 16px;
}

.report-result a {
  color: var(--accent);
  font-weight: 800;
}

.users-layout h3 {
  margin: 8px 0 10px;
  font-size: 14px;
}

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

.check-item {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  font-weight: 700;
}

.check-item input {
  width: auto;
}

@media (max-width: 1100px) {
  .kpi-grid,
  .grid-forms,
  .executive-kpis,
  .exec-grid,
  .control-lanes,
  .scorecard-grid,
  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exec-span-2 {
    grid-column: span 2;
  }

  .two-col,
  .executive-hero,
  .reports-grid,
  .change-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .login-panel,
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .kpi-grid,
  .grid-forms,
    .executive-kpis,
    .exec-grid,
    .control-lanes,
    .scorecard-grid,
    .capability-grid,
    .delivery-controls,
  .contact-grid,
  .schedule-primary-controls,
  .schedule-date-controls {
    grid-template-columns: 1fr;
  }

  .exec-span-2 {
    grid-column: span 1;
  }

  .schedule-form {
    min-width: 280px;
  }
}
