:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: #17324d;
  background: #f5f7fa;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: #17324d;
  color: white;
}
header div { display: flex; gap: 22px; flex-wrap: wrap; }
header a { color: white; text-decoration: none; }
main { max-width: 1440px; padding: 24px; margin: auto; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 16px; }
p { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #e8eef4;
  color: #17324d;
  padding: 10px 13px;
  font-weight: 650;
  cursor: pointer;
}
button:hover { background: #d9e5ef; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: #2f75b5; color: white; border-color: #2f75b5; }
.primary:hover { background: #246195; }
button:focus-visible, a:focus-visible { outline: 3px solid #4fa2df; outline-offset: 3px; }
input, select, textarea {
  width: 100%;
  padding: 10px;
  color: inherit;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-width: 0;
}
input[type=checkbox] { width: 18px; height: 18px; }
label { display: grid; gap: 6px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; }
.heading, .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.actions { justify-content: flex-end; }
#tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0 18px; }
#tabs button { background: transparent; }
#tabs [aria-pressed=true] { color: white; background: #17324d; border-color: #17324d; }
.panel { padding: 20px; background: white; border: 1px solid #dbe2ea; border-radius: 12px; margin-bottom: 18px; }
.summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.summary article { background: white; border: 1px solid #dbe2ea; border-radius: 12px; padding: 16px; }
.summary strong { display: block; font-size: 28px; margin-top: 8px; }
.muted, small { color: #66758a; font-size: 13px; }
.error { color: #b91c1c; }
#notice:empty, #preview:empty { display: none; }
.table-scroll { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 12px 10px; text-align: left; border-bottom: 1px solid #dbe2ea; vertical-align: top; }
th { background: #f1f5f9; font-size: 13px; white-space: nowrap; }
td { min-width: 100px; }
td small { display: block; margin-top: 5px; }
.empty { padding: 30px 14px; color: #66758a; text-align: center; }
.badge { display: inline-block; border-radius: 99px; padding: 4px 8px; background: #fff3cd; color: #8a5a00; font-size: 12px; }
.ready { color: #166534; background: #dcfce7; }
.inactive { color: #475569; background: #e8eef4; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 20px 0; }
.wide { grid-column: 1/-1; }
.section-note { margin: 12px 0 0; color: #66758a; font-size: 14px; }
dialog {
  width: min(800px,calc(100% - 24px));
  max-height: 92vh;
  padding: 22px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 16px 60px #17324d40;
  color: #17324d;
}
dialog::backdrop { background: #17324d80; }
.dose-row { padding: 14px; border: 1px solid #dbe2ea; border-radius: 10px; margin: 12px 0; }
.dose-row .form-grid { margin: 12px 0 0; }
.program-checks { display: grid; gap: 12px; margin: 16px 0; }
.program-checks label { background: #f4f7fa; padding: 10px; border-radius: 8px; }
.cost-details { padding: 16px; background: #f4f7fa; border-radius: 10px; margin: 16px 0; }
.cost-details dl { display: grid; grid-template-columns: 1fr auto; gap: 9px 16px; }
.cost-details dd { margin: 0; }
.cost-details ul { margin: 12px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
[hidden] { display: none !important; }
@media(max-width:750px) {
  main { padding: 15px; }
  header { padding: 15px; align-items: start; }
  header div { gap: 10px; }
  .summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel { padding: 15px; }
  #tabs { gap: 5px; }
  #tabs button { padding: 9px; font-size: 13px; }
}
@media(max-width:460px) {
  h1 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  dialog { padding: 16px; }
}
