:root { font-family: Arial, sans-serif; color: #211c18; background: #f5efe5; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.shell { width: min(1320px, 96vw); margin: 24px auto 60px; }
.topbar, .section-heading, .actions, .tabs { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { margin-bottom: 22px; }
.topbar h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin: 4px 0; color: #8e4b20; }
.topbar p, .section-heading p, .criteria p, .muted { color: #67594a; }
.eyebrow { color: #a25723; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.topbar p { margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid #a05a2a; border-radius: 10px; background: #aa602e; color: white; text-decoration: none; font-weight: 700; white-space: nowrap; }
.button.light { background: #fffaf4; color: #7d411d; }
.button.dark { background: #60361c; border-color: #60361c; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.tabs { justify-content: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { min-height: 43px; padding: 8px 16px; border: 1px solid #dfc9aa; border-radius: 10px; background: #fff9f0; color: #5f3c25; font-weight: 700; }
.tabs button.active { background: #9f5528; color: #fff; border-color: #9f5528; }
.card { background: #fffdfa; border: 1px solid #e3d2b9; border-radius: 18px; padding: clamp(16px, 3vw, 28px); box-shadow: 0 14px 28px #64432912; }
.section-heading { align-items: flex-start; margin-bottom: 20px; }
.section-heading h2, .section-heading h3 { margin: 4px 0; }
.section-heading p { margin: 6px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label, .filters label, .notes { display: grid; gap: 6px; font-weight: 700; }
.form-grid .wide { grid-column: span 2; }
input[type="text"], input[type="date"], input[type="number"], select, textarea { min-height: 43px; width: 100%; border: 1px solid #d9c5ab; border-radius: 9px; padding: 8px 10px; color: #211c18; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c98952; outline-offset: 1px; }
.criteria { margin: 22px 0; padding: 15px; border: 1px solid #e0cbb1; border-radius: 12px; }
.criteria legend { padding: 0 5px; font-weight: 800; }
.criteria p { margin: 0 0 10px; font-size: .9rem; }
.check-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.check-grid label { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: #f8efe3; border-radius: 8px; }
.check-grid input { width: 17px; height: 17px; accent-color: #9f5528; }
.matrix-heading { margin: 18px 0 8px; }
.matrix-wrap, .table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e0cbb1; border-radius: 10px; }
.matrix, .data-table { width: 100%; border-collapse: collapse; }
.matrix { min-width: 990px; }
.data-table { min-width: 950px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #efe1cf; font-size: .9rem; }
th { background: #f6e9d7; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.matrix select { min-width: 120px; }
.matrix .detail { margin-top: 5px; min-height: 34px; font-size: .8rem; }
.matrix .package { font-weight: 800; white-space: nowrap; }
.sample-summary { margin: 12px 0 20px; font-weight: 700; color: #5b3c27; }
.notes textarea { resize: vertical; }
.actions { justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.reopen-box { margin-top: 14px; padding: 14px; border: 1px solid #dfc9aa; border-radius: 10px; background: #fff8ef; }
.reopen-box label { display: grid; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.audit-panel { margin-top: 16px; padding: 12px; border: 1px solid #e0cbb1; border-radius: 10px; }
.audit-panel summary { cursor: pointer; font-weight: 700; }
.audit-panel li { margin: 8px 0; }
.notice { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: #e5f3e8; color: #1b522d; font-weight: 700; }
.notice.error { background: #fae7e2; color: #812c1a; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 25px; }
.stats > div { background: #f9f0e4; border: 1px solid #e8d5bc; border-radius: 10px; padding: 13px; }
.stats span { display: block; color: #6e5b48; font-size: .85rem; }
.stats strong { display: block; font-size: 1.65rem; margin-top: 4px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.report-grid h3 { margin: 0 0 12px; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 90px; gap: 8px; align-items: center; font-size: .85rem; }
.bar-track { background: #f2e4d2; border-radius: 99px; height: 17px; overflow: hidden; }
.bar-fill { background: #b76935; height: 100%; border-radius: 99px; }
.bar-row strong { text-align: right; }
.data-table .button { min-height: 34px; padding: 4px 10px; }
@media (max-width: 760px) {
  .topbar, .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .form-grid, .report-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) { .filters { grid-template-columns: 1fr; } }
