:root {
  --blue: #009DE7;
  --blue-dark: #0086C5;
  --blue-tint: #EAF7FF;
  --green: #5D9725;
  --green-tint: #EEF6E4;
  --red: #DB232A;
  --red-tint: #FDEDEE;
  --amber: #A5730C;
  --amber-tint: #FFF6E0;
  --grey: #9A9A9A;
  --grey-dark: #6B6B6B;
  --border: #EAEAEA;
  --bg-page: #FAFBFC;
  --bg-card: #FFFFFF;
  --bg-well: #F7F9FA;
  --text: #1A1A1A;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 6px rgba(16,24,40,.04);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

header.topbar {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 22px 32px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand-logo { height: 28px; width: auto; }
.brand-sub { font-size: 13px; color: var(--grey); font-weight: 500; }

main.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 20px 100px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 28px;
}

h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.lede { color: var(--grey-dark); font-size: 13.5px; margin: 0 0 24px; line-height: 1.5; }

.year-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .year-grid { grid-template-columns: 1fr; }
}

.year-col-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-tint);
}
.req, .opt {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}
.req { background: var(--blue-tint); color: var(--blue-dark); }
.opt { background: var(--bg-well); color: var(--grey-dark); }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--grey-dark);
  margin: 16px 0 6px;
}
label:first-of-type { margin-top: 0; }

.file-drop {
  position: relative;
  border: 1.5px dashed #D6DBDF;
  border-radius: 9px;
  background: var(--bg-well);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.file-drop:hover, .file-drop.drag-over { border-color: var(--blue); background: var(--blue-tint); }
.file-drop.has-file { border-style: solid; border-color: var(--green); background: var(--green-tint); }
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-drop-label { font-size: 12.5px; color: var(--grey-dark); pointer-events: none; }
.file-drop.has-file .file-drop-label { color: #3E6B18; font-weight: 600; }

input[type="text"], input[type="email"], select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 22px;
  transition: background .15s, transform .1s;
}
button[type="submit"]:hover { background: var(--blue-dark); }
button[type="submit"]:active { transform: scale(.98); }
button[type="submit"]:disabled { background: #C7CCD1; cursor: not-allowed; }

.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

button.linklike { background: none; border: none; color: var(--blue); text-decoration: none; font-weight: 600; cursor: pointer; padding: 4px 10px; font: inherit; border-radius: 6px; }
button.linklike:hover { background: var(--blue-tint); }

.error-text { color: var(--red); font-size: 13px; margin-top: 12px; }
.hint { color: var(--grey); font-size: 12.5px; margin-top: 12px; }

.empty-state {
  color: var(--grey);
  font-size: 13.5px;
  text-align: center;
  padding: 32px 0;
}

table.reports { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.reports th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--grey); border-bottom: 1px solid var(--border); padding: 8px 10px;
}
table.reports td { padding: 12px 10px; border-bottom: 1px solid #F2F3F4; vertical-align: top; }
table.reports tr:last-child td { border-bottom: none; }
table.reports .clinic-name { font-weight: 600; }
table.reports .timestamp { color: var(--grey-dark); font-size: 12.5px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending, .status-running { background: var(--amber-tint); color: var(--amber); }
.status-done { background: var(--green-tint); color: var(--green); }
.status-error { background: var(--red-tint); color: var(--red); }

.progress-track {
  width: 120px;
  height: 6px;
  border-radius: 4px;
  background: #EDEFF1;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width .4s ease;
}
.progress-label {
  font-size: 11px;
  color: var(--grey-dark);
  margin-top: 4px;
}

.finding { font-size: 12px; margin-top: 2px; }
.finding.fault { color: var(--red); font-weight: 600; }
.finding.warning { color: var(--amber); }
.finding.info { color: var(--grey); }

.hidden { display: none !important; }
