:root {
  --bg: #f3f4f6; --card: #ffffff; --text: #111827; --muted: #6b7280;
  --border: #d1d5db; --accent: #1f4f7a; --accent-dark: #173b5b; --danger: #9f1239;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1rem; background:#111827; color:white; }
.topbar h1 { margin:0; font-size:1.25rem; } .topbar p { margin:.15rem 0 0; font-size:.85rem; opacity:.8; }
.container { max-width:1100px; margin:0 auto; padding:1rem; }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:1rem; margin-bottom:1rem; }
h2 { margin-top:0; font-size:1.15rem; } fieldset { border:0; padding:0; margin:0; } legend { font-weight:700; margin-bottom:.8rem; }
label,.label-text { display:block; font-weight:600; font-size:.9rem; }
input,select,textarea,button { font:inherit; }
input,select,textarea { width:100%; margin-top:.35rem; border:1px solid var(--border); border-radius:10px; padding:.75rem; background:white; color:var(--text); min-height:44px; }
textarea { resize:vertical; }
button { border:0; border-radius:10px; min-height:44px; padding:.7rem 1rem; background:var(--accent); color:white; font-weight:700; cursor:pointer; }
button:hover { background:var(--accent-dark); } button:disabled { opacity:.55; cursor:not-allowed; }
button.secondary { background:white; color:var(--text); border:1px solid var(--border); }
button.danger { background:white; color:var(--danger); border:1px solid #fecdd3; }
.grid { display:grid; grid-template-columns:1fr; gap:.85rem; } .stack { display:grid; gap:.8rem; } .stack-lg { display:grid; gap:1.5rem; }
.section-title-row,.toolbar,.search-row,.sticky-actions { display:flex; gap:.75rem; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.search-row input { flex:1 1 240px; margin-top:0; }
.checkline { display:inline-flex; align-items:center; gap:.55rem; font-weight:500; min-height:44px; }
.checkline input { width:20px; height:20px; min-height:auto; margin:0; }
.checks { display:flex; flex-wrap:wrap; gap:.4rem 1rem; margin-top:.4rem; }
.muted { color:var(--muted); } .small { font-size:.82rem; } .message { color:var(--muted); font-size:.9rem; } .hidden { display:none !important; }
.material-row { border:1px solid var(--border); border-radius:12px; padding:.9rem; background:#fafafa; } .material-row .danger { margin-top:.7rem; }
.record-list { display:grid; gap:.65rem; margin-top:1rem; }
.record-item { width:100%; text-align:left; background:white; color:var(--text); border:1px solid var(--border); padding:.85rem; }
.record-item:hover { background:#f9fafb; }
.record-head { display:flex; justify-content:space-between; gap:.75rem; flex-wrap:wrap; }
.record-target { margin-top:.25rem; } .record-meta { margin-top:.25rem; color:var(--muted); font-size:.84rem; }
.sticky-actions { position:sticky; bottom:0; background:rgba(255,255,255,.96); border-top:1px solid var(--border); padding:.75rem 0; }
code { background:#f3f4f6; padding:.1rem .3rem; border-radius:4px; }
@media (min-width:640px) {
  .grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .material-grid { grid-template-columns:1.5fr .8fr .8fr 1fr 1.4fr; }
}
@media (max-width:639px) {
  .container { padding:.65rem; } .card { padding:.85rem; border-radius:12px; } .topbar { padding:.85rem; }
  .sticky-actions button { width:100%; }
}
