:root {
  color-scheme: light;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f8fafc;
  font-size: 15px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f8fafc; }
button, input, select { font: inherit; }
.page-shell { width: min(1200px, 100%); margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; box-shadow: 0 1px 2px rgb(15 23 42 / 4%); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1 { margin: 0; font-size: 20px; line-height: 1.35; }
.page-header p { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.field-row { display: grid; gap: 12px; margin-bottom: 14px; }
.field-row.single { grid-template-columns: minmax(0, 1fr); }
.field-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field, .search-field { display: grid; gap: 7px; min-width: 0; }
.field > span, .search-field > span { color: #334155; font-weight: 600; font-size: 13px; }
input, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #111827; padding: 9px 10px; outline: none; }
input:focus, select:focus { border-color: #64748b; box-shadow: 0 0 0 3px rgb(100 116 139 / 16%); }
.search-line { display: flex; flex-wrap: wrap; gap: 8px; }
.search-line > input { min-width: 220px; flex: 1 1 320px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid transparent; border-radius: 7px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.button:disabled { cursor: wait; opacity: .55; }
.button-primary { color: #fff; background: #334155; border-color: #334155; }
.button-secondary { color: #334155; background: #f1f5f9; border-color: #e2e8f0; }
.button-outline { color: #334155; background: #fff; border-color: #cbd5e1; text-decoration: none; }
.hint, .status, .privacy-note { color: #64748b; font-size: 13px; }
.hint { min-height: 18px; margin: 0; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-scroll { overflow: auto; max-height: 330px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: #f1f5f9; color: #334155; font-weight: 600; }
th, td { padding: 9px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
tbody tr.is-selected { background: #e0e7ff; }
tbody tr.is-abnormal { background: #fee2e2; color: #991b1b; }
.row-button { border: 0; color: #334155; background: transparent; cursor: pointer; padding: 4px 6px; }
.row-button:hover { text-decoration: underline; }
.quantity-input { width: 72px; padding: 6px 8px; }
.condition-select { width: 74px; padding: 6px 7px; }
.empty-row { padding: 28px; color: #94a3b8; text-align: center; }
.privacy-note { margin: -4px 0 0; text-align: center; }
@media (max-width: 760px) {
  .page-shell { padding: 8px; gap: 10px; }
  .panel { padding: 12px; border-radius: 9px; }
  .page-header { align-items: flex-start; }
  .field-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-line > input { flex-basis: 100%; }
  .search-line .button { flex: 1 1 120px; }
  .list-heading { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; }
  .actions .button { flex: 1 1 120px; }
}
@media (max-width: 440px) {
  .field-row.four { grid-template-columns: 1fr; }
  .page-header .button { min-width: 70px; }
}
