.unit-hero { min-height: 190px; }

.unit-hero-score {
  min-width: 180px;
  display: grid;
  gap: 2px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
}

.unit-hero-score span,
.unit-hero-score small { color: rgba(255,255,255,.76); }
.unit-hero-score strong { font-size: 56px; line-height: 1; }

.unit-level-toolbar { grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.3fr) auto; }
.unit-print-button {
  min-width: 190px;
  height: 42px;
  align-self: end;
  justify-content: center;
  border: 2px solid var(--cyan);
  padding: 0 18px;
  color: #062a27;
  background: var(--cyan);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--cyan) 28%, transparent);
  font-size: 14px;
  cursor: pointer;
}
.unit-print-button:hover,
.unit-print-button:focus-visible {
  text-decoration: none;
  filter: brightness(1.08);
  transform: translateY(-1px);
  outline: 3px solid color-mix(in srgb, var(--cyan) 30%, transparent);
  outline-offset: 2px;
}

@media (prefers-color-scheme: light) {
  .unit-print-button { color: #ffffff; }
}
.unit-dashboard-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin-top: 18px; }

.driver-list,
.metric-list { display: grid; gap: 12px; }

.driver-row,
.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.driver-row:last-child,
.metric-row:last-child { border-bottom: 0; }
.driver-row p,
.metric-row p { margin: 3px 0 0; color: var(--muted); }

.driver-status {
  min-width: 82px;
  padding: 6px 9px;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
}
.driver-status.met { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.driver-status.gap { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }

.rate-bar { width: 150px; height: 9px; overflow: hidden; border-radius: 999px; background: var(--track); }
.rate-bar > span { display: block; height: 100%; background: var(--cyan); }
.metric-value { display: grid; justify-items: end; gap: 6px; font-weight: 800; }

.profile-list { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 12px 20px; margin: 0; }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; font-weight: 700; }
.renewal-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.renewal-summary div { padding: 14px; background: var(--panel-2); border-radius: 7px; }
.renewal-summary span { display: block; color: var(--muted); font-size: 12px; }
.renewal-summary strong { display: block; margin-top: 4px; font-size: 24px; }
.renewal-dates { margin: 16px 0 0; padding-left: 18px; color: var(--muted); }
.member-table-wrap { margin-top: 16px; overflow-x: auto; }
.member-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 12px; }
.member-table th,
.member-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.member-table th { color: var(--muted); background: var(--panel-2); font-size: 11px; text-transform: uppercase; }
.renewal-status { display: inline-block; padding: 3px 7px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.renewal-status.past { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.renewal-status.upcoming { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.print-notes,
.print-footer { display: none; }

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

@media (max-width: 700px) {
  .unit-hero { align-items: stretch; }
  .unit-hero-score { min-width: 0; }
  .unit-level-toolbar { grid-template-columns: 1fr; }
  .renewal-summary { grid-template-columns: 1fr; }
  .profile-list { grid-template-columns: 1fr; gap: 3px; }
  .profile-list dd { margin-bottom: 10px; }
}

@page {
  size: letter landscape;
  margin: .38in;
}

@media print {
  :root {
    color-scheme: light;
    --ink: #172033;
    --muted: #536174;
    --line: #cbd5e1;
    --soft: #ffffff;
    --panel: #ffffff;
    --panel-2: #f3f6f9;
    --track: #d9e4ef;
    --cyan: #0f766e;
    --green: #047857;
    --orange: #b45309;
    --red: #be123c;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    margin: 0;
    background: #ffffff;
    color: var(--ink);
    font-size: 9pt;
  }

  .app-shell { display: block; min-height: 0; }
  .sidebar,
  .unit-level-toolbar { display: none !important; }

  main { padding: 0; }

  .unit-hero {
    min-height: 0;
    padding: 14px 16px;
    color: var(--ink);
    background: #ffffff;
    border: 2px solid var(--cyan);
    box-shadow: none;
  }

  .unit-hero .eyebrow,
  .unit-hero .lede,
  .unit-hero-score span,
  .unit-hero-score small { color: var(--muted); }

  .unit-hero h1 { margin-bottom: 5px; font-size: 26pt; color: var(--ink); }
  .unit-hero .lede { font-size: 9pt; }
  .unit-hero-score {
    min-width: 120px;
    padding: 9px 14px;
    color: var(--ink);
    background: var(--panel-2);
    border-color: var(--line);
  }
  .unit-hero-score strong { font-size: 32pt; }

  .kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 9px 0;
  }
  .kpi {
    min-height: 72px;
    padding: 9px;
    background: #ffffff;
    box-shadow: none;
    break-inside: avoid;
  }
  .kpi-label { font-size: 7.5pt; }
  .kpi-value { margin: 5px 0 2px; font-size: 18pt; }
  .kpi-sub { font-size: 7.5pt; }

  .unit-dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 10px;
    margin-top: 9px;
  }
  .panel {
    margin: 0;
    padding: 11px 13px;
    background: #ffffff;
    box-shadow: none;
    break-inside: avoid;
  }
  .panel-head { margin-bottom: 7px; }
  .section-kicker { margin-bottom: 3px; font-size: 7.5pt; }
  h2 { font-size: 14pt; }
  .driver-list,
  .metric-list { gap: 0; }
  .driver-row,
  .metric-row { padding: 6px 0; gap: 8px; }
  .driver-row p,
  .metric-row p { margin-top: 1px; font-size: 7.5pt; }
  .driver-status { min-width: 60px; padding: 3px 6px; }
  .rate-bar { width: 105px; height: 6px; }

  .unit-dashboard-grid > .panel:nth-child(3) {
    break-before: page;
  }
  .renewal-summary div { padding: 9px; }
  .renewal-summary strong { font-size: 18pt; }
  .renewal-dates { margin-top: 10px; }
  .member-table-wrap { margin-top: 9px; overflow: visible; }
  .member-table { min-width: 0; font-size: 7.5pt; }
  .member-table th,
  .member-table td { padding: 5px 6px; }
  .member-table thead { display: table-header-group; }
  .member-table tr { break-inside: avoid; }
  .renewal-status { padding: 2px 5px; }
  .profile-list { gap: 7px 14px; }

  .print-notes {
    display: block;
    min-height: 3.8in;
    margin-top: 10px;
  }
  .note-lines { display: grid; gap: .42in; margin-top: .22in; }
  .note-lines span { display: block; border-bottom: 1px solid #94a3b8; }

  .print-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 7.5pt;
  }
}
