:root {
  --red: #c8102e;
  --black: #1a1a1a;
  --dark: #333333;
  --gray: #666666;
  --line: #d0d0d0;
  --light: #f2f2f2;
  --white: #ffffff;
  --green: #1e8449;
  --gold: #d17a00;
  --blue: #1e5bba;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--dark);
  background: #f7f7f7;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: var(--red);
  color: var(--white);
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  border-color: var(--line);
  background: var(--white);
  color: var(--black);
}

button:hover {
  filter: brightness(0.96);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--black);
  padding: 8px;
  min-height: 34px;
}

textarea {
  resize: vertical;
}

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

label input,
label select,
label textarea {
  font-size: 14px;
  font-weight: 400;
}

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

h1 {
  color: var(--black);
  font-size: 20px;
  line-height: 1.1;
}

h2 {
  color: var(--black);
  font-size: 16px;
}

h3 {
  margin: 18px 0 8px;
  color: var(--black);
  font-size: 13px;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  border-top: 5px solid var(--red);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 12px 22px;
}

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

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.eyebrow {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.actionStatus {
  min-width: 108px;
  color: var(--gray);
  font-size: 12px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 94px;
  align-self: start;
  display: grid;
  gap: 14px;
}

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

.summaryPanel,
.saveState {
  padding: 14px;
}

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

.statusBadge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 5px;
  background: var(--light);
  color: var(--black);
  padding: 4px 10px;
  font-weight: 700;
}

.statusBadge.approved {
  background: #e7f3ec;
  color: var(--green);
}

.statusBadge.warn {
  background: #fff4df;
  color: var(--gold);
}

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

.metricList div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.metricList dt {
  color: var(--gray);
  font-size: 11px;
}

.metricList dd {
  margin: 2px 0 0;
  color: var(--black);
  font-size: 20px;
  font-weight: 700;
}

.completion {
  display: grid;
  gap: 6px;
}

.completionLabel {
  display: flex;
  justify-content: space-between;
  color: var(--gray);
  font-size: 12px;
}

.completionLabel strong {
  color: var(--black);
}

.bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--light);
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
}

.sectionNav {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.sectionNav a {
  border-bottom: 1px solid var(--line);
  color: var(--black);
  padding: 11px 14px;
  text-decoration: none;
  font-weight: 700;
}

.sectionNav a:last-child {
  border-bottom: 0;
}

.sectionNav a:hover {
  background: var(--light);
}

.saveState {
  color: var(--gray);
  font-size: 12px;
}

.saveState h2 {
  margin-bottom: 5px;
  font-size: 13px;
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.sectionTitle {
  display: flex;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.sectionTitle span {
  min-width: 28px;
  color: var(--red);
  font-size: 20px;
  font-weight: 700;
}

.sectionTitle h2 {
  font-size: 19px;
}

.sectionIntro {
  max-width: 900px;
  margin: 10px 0 14px;
  color: var(--gray);
  font-style: italic;
}

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

.formGrid.compact {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.formGrid .fullRow {
  grid-column: 1 / -1;
}

.callout {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  border-left: 4px solid var(--red);
  background: var(--light);
  padding: 12px 14px;
}

.callout strong {
  color: var(--red);
  text-transform: uppercase;
}

.kitTools,
.customItemBar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 10px 0;
}

.kitTools label {
  min-width: 180px;
}

.kitTools .searchBox {
  flex: 1 1 260px;
}

.customItemBar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
  padding: 10px;
}

.customItemBar label {
  flex: 1 1 220px;
}

.tableWrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entryTable {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--white);
}

.entryTable th,
.entryTable td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px;
  text-align: left;
  vertical-align: middle;
}

.entryTable th:last-child,
.entryTable td:last-child {
  border-right: 0;
}

.entryTable tr:last-child td {
  border-bottom: 0;
}

.entryTable th {
  background: var(--light);
  color: var(--black);
  font-size: 12px;
}

.entryTable td:first-child {
  color: var(--black);
  font-weight: 700;
}

.entryTable input,
.entryTable select {
  min-width: 90px;
  border-color: transparent;
  background: #fbfbfb;
}

.entryTable input:focus,
.entryTable select:focus,
.entryTable textarea:focus {
  outline: 2px solid rgba(30, 91, 186, 0.22);
  border-color: var(--blue);
  background: var(--white);
}

.entryTable.dense {
  min-width: 1040px;
}

.entryTable.dense td:nth-child(2) {
  min-width: 210px;
}

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

.approvalOption {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.approvalOption input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.approvalOption strong,
.approvalOption span {
  grid-column: 2;
}

.approvalOption span {
  color: var(--gray);
  font-weight: 400;
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .formGrid,
  .formGrid.compact,
  .approvalGrid {
    grid-template-columns: 1fr;
  }

  .callout {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .topbar,
  .sidebar,
  .toolbar,
  .kitTools,
  .customItemBar {
    display: none !important;
  }

  .layout {
    display: block;
    max-width: none;
    padding: 0;
  }

  .content {
    gap: 0;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 18px 0;
  }

  .tableWrap {
    overflow: visible;
  }

  .entryTable {
    min-width: 0;
  }

  input,
  select,
  textarea {
    border-color: transparent;
    padding: 2px;
  }
}
