:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand-blue: #244a9b;
  --brand-navy: #173372;
  --brand-sky: #eaf1fb;
  --brand-line: #c7d5ee;
  --brand-soft: #ffffff;
  background: var(--brand-soft);
  color: #151a17;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(18, 27, 23, 0.12);
  padding-bottom: 14px;
  color: #52645c;
  font-size: 0.88rem;
}

.topbar strong {
  color: var(--brand-blue);
  letter-spacing: 0.06em;
}

.brand-lockup {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 178px;
  max-width: 38vw;
  height: auto;
}

.intro {
  max-width: 760px;
  margin: 34px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  color: #3e5149;
  font-size: 1.1rem;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.metric,
.breakdown {
  border: 1px solid rgba(113, 130, 121, 0.25);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(24, 42, 80, 0.1);
}

.dashboard button.metric,
.dashboard button.bar-row {
  width: 100%;
  border: 1px solid rgba(113, 130, 121, 0.25);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.dashboard button.metric:focus-visible,
.dashboard button.bar-row:focus-visible {
  outline: 3px solid rgba(35, 73, 154, 0.22);
  outline-offset: 2px;
}

.dashboard button.metric:hover,
.dashboard button.bar-row:hover {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: #88a1d7;
}

.dashboard .active-filter {
  outline: 3px solid rgba(35, 73, 154, 0.22);
  border-color: var(--brand-blue) !important;
}

.click-cue {
  display: block;
  margin-top: 10px;
  color: var(--brand-blue);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric span {
  display: block;
  color: #60736b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-blue);
  font-size: 2.3rem;
  line-height: 1;
}

.metric.urgent strong {
  color: var(--brand-blue);
}

.metric.warning strong {
  color: var(--brand-blue);
}

.breakdown {
  grid-column: span 2;
}

.breakdown.wide {
  grid-column: span 4;
}

.breakdown-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.breakdown-title h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.breakdown-title span {
  color: var(--brand-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 34px;
  gap: 10px;
  align-items: center;
  margin-top: 9px;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
  background: transparent;
  color: #3e5149;
  font-size: 0.9rem;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8f8;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), #6f90d0);
}

.bar-row b {
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.results-helper {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: -2px 0 18px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #475a52;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(24, 42, 80, 0.08);
}

.results-helper strong {
  color: var(--brand-blue);
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(113, 130, 121, 0.25);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(24, 42, 80, 0.1);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue), #6f90d0);
}

.panel-title p,
.list-header p {
  margin: 0 0 4px;
  color: #6b7c74;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-title h2,
.list-header h2 {
  margin-bottom: 0;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #314039;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 6px;
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid #bdccc2;
  padding: 11px 12px;
  background: #fbfcfa;
  color: #17211b;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(35, 73, 154, 0.16);
  border-color: var(--brand-blue);
}

textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.35;
}

button {
  border: 0;
  padding: 12px 14px;
  background: var(--brand-blue);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--brand-navy);
}

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

.secondary {
  width: auto;
  min-width: 104px;
  border: 1px solid var(--brand-line);
  background: #ffffff;
  color: var(--brand-navy);
}

.message {
  min-height: 1.3em;
  margin: 0;
  color: var(--brand-blue);
  font-weight: 700;
}

.message.error {
  color: #a5332b;
}

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

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

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, 1.1fr) repeat(4, minmax(118px, 1fr)) minmax(104px, 0.75fr);
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid #dce4f3;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(24, 42, 80, 0.06);
}

.filters input,
.filters select,
.filters button {
  min-width: 0;
  height: 44px;
  padding: 9px 10px;
  font-size: 0.92rem;
}

#count {
  color: #63756c;
  font-size: 0.92rem;
}

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

.list-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #dce6df;
}

.print-view {
  display: none;
}

.print-header,
.print-summary,
.print-item {
  break-inside: avoid;
}

@media print {
  body {
    background: #ffffff !important;
    color: #111111;
  }

  .topbar,
  .intro,
  .dashboard,
  .workspace {
    display: none !important;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .print-view {
    display: block;
  }

  .print-header {
    border-bottom: 2px solid #111111;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .print-header p {
    margin: 0 0 4px;
    font-size: 10pt;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-header h1 {
    margin: 0 0 6px;
    font-size: 22pt;
    line-height: 1.1;
  }

  .print-header span {
    color: #444444;
    font-size: 9pt;
  }

  .print-summary {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 6px 12px;
    border: 1px solid #cccccc;
    margin-bottom: 14px;
    padding: 10px;
    font-size: 10pt;
  }

  .print-items {
    display: grid;
    gap: 10px;
  }

  .print-item {
    border: 1px solid #cccccc;
    padding: 10px;
  }

  .print-item h2 {
    margin: 0 0 6px;
    font-size: 13pt;
  }

  .print-item p {
    margin: 3px 0;
    color: #222222;
    font-size: 9.5pt;
    line-height: 1.35;
  }
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
  align-items: start;
  border: 1px solid #dbe5df;
  border-left: 5px solid var(--brand-blue);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 42, 80, 0.09);
}

.item:hover {
  border-color: #c7d5ee;
  box-shadow: 0 16px 34px rgba(24, 42, 80, 0.12);
}

.item-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.item h3 {
  margin-bottom: 4px;
  color: #14231d;
  font-size: 1.05rem;
}

.item p,
.empty {
  margin-bottom: 0;
  color: #63756c;
}

.contact,
.captured,
.contact-row {
  font-size: 0.86rem;
}

.captured {
  color: #7b8d84;
  white-space: nowrap;
}

.title-line {
  margin-top: 8px;
  font-weight: 700;
  color: #2f3d36;
}

.notes {
  margin-top: 8px;
  line-height: 1.45;
  color: #586b62;
}

.notes-editor {
  margin-top: 10px;
  gap: 6px;
  color: #52645c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notes-field {
  min-height: 70px;
  padding: 9px 10px;
  color: #33433c;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
  color: #43574f;
}

.item-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e4ebf7;
  padding: 10px;
}

.controls-title {
  grid-column: 1 / -1;
  margin: 0;
  color: #6b7c74;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-controls label {
  gap: 5px;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.item-controls select {
  padding: 8px 9px;
  font-size: 0.86rem;
  text-transform: none;
  background: #ffffff;
}

@media (max-width: 820px) {
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .breakdown,
  .breakdown.wide {
    grid-column: span 2;
  }

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

  .results-helper {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .filters,
  .item {
    grid-template-columns: 1fr;
  }

  .item-controls {
    grid-template-columns: 1fr;
  }

  .shell {
    padding-top: 28px;
  }
}

@media (max-width: 520px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .breakdown,
  .breakdown.wide {
    grid-column: span 1;
  }

  .bar-row {
    grid-template-columns: 88px 1fr 28px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .brand-logo {
    width: 148px;
  }
}
