:root {
  --bg: #f4f7f8;
  --panel: #ffffff;
  --ink: #182227;
  --muted: #62717a;
  --line: #dce5e8;
  --brand: #005b7f;
  --brand-dark: #07364c;
  --accent: #11a3a3;
  --warn: #c54832;
  --shadow: 0 14px 35px rgba(15, 42, 56, 0.09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #eaf2f5 0%, var(--bg) 42%);
  color: var(--ink);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 32px clamp(18px, 4vw, 48px) 22px;
  background: radial-gradient(circle at 10% 0%, rgba(17, 163, 163, 0.22), transparent 32%), linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
}

.eyebrow { margin: 0 0 6px; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.75rem; opacity: 0.86; }
h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; }
.subtitle { margin: 12px 0 0; color: rgba(255,255,255,0.82); max-width: 780px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

main { padding: 22px clamp(14px, 3vw, 42px) 42px; }
.status-strip { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.status-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.status-card .label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.status-card strong { font-size: 1.25rem; }
.status-card.warn strong { color: var(--warn); }

.controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  background: var(--panel);
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; font-weight: 700; color: #2a3b45; }
input, select {
  height: 40px;
  border: 1px solid #cfdade;
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.checkline { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 8px; }
.checkline input { width: 18px; height: 18px; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(17, 163, 163, 0.24); }
.btn.secondary { background: #fff; color: var(--brand-dark); border: 1px solid rgba(255,255,255,0.5); }
.controls .btn.secondary { border-color: var(--line); }
.btn.ghost { background: #eef4f6; color: var(--brand-dark); }

.report-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.86rem;
}
.pill strong { color: var(--ink); }

.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 1160px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 0.9rem; }
th { position: sticky; top: 0; background: #eaf3f5; color: #24424f; z-index: 1; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr.late td:first-child { color: var(--warn); font-weight: 900; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef4f6; font-weight: 800; font-size: 0.78rem; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
a { color: var(--brand); font-weight: 800; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.print-only { display: none; }
dialog { border: 0; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.24); padding: 0; }
dialog::backdrop { background: rgba(5, 27, 38, 0.52); }
.dialog-card { padding: 24px; width: min(440px, 90vw); display: grid; gap: 14px; }
.dialog-card h2 { margin: 0; }
.dialog-card p { margin: 0; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

@media (max-width: 980px) {
  .app-header { flex-direction: column; align-items: flex-start; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  :root { --ink: #000; --line: #999; }
  body { background: #fff; font-size: 10pt; }
  .no-print, .app-header, .controls, .status-strip, .report-summary .screen-only { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; }
  .print-title h1 { font-size: 18pt; margin: 0 0 4px; }
  .print-title p { margin: 0 0 12px; color: #333; }
  .table-wrap { box-shadow: none; border: 0; overflow: visible; }
  table { min-width: 0; font-size: 8.5pt; }
  th, td { padding: 5px 6px; border: 1px solid #aaa; }
  th { background: #eee !important; position: static; color: #000; }
  .no-print { display: none !important; }
  a { color: #000; text-decoration: none; }
  @page { margin: 0.35in; size: landscape; }
}
