:root {
  color-scheme: light;
  font-family: "Segoe UI", sans-serif;
  color: #14223a;
  background: #f1f4f8;
  line-height: 1.5;
  --border: #d5dde8;
  --muted: #54657c;
  --blue: #164db7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { background: #142947; color: #fff; }
.topbar-inner, main { width: min(1200px, calc(100% - 36px)); margin: auto; }
.topbar-inner, .section-head, .pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-inner { min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #2365d4; font-weight: 800; }
main { padding: 28px 0 48px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; }
.section-head h1, .section-head h2 { margin: 0; }
.section-head { margin-bottom: 20px; }
.card, dialog { background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.card { padding: 18px; }
.login { max-width: 420px; margin: 32px auto 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--blue); border-radius: 7px; padding: 8px 13px; background: var(--blue); color: white; cursor: pointer; font-weight: 600; }
button.secondary { background: #fff; color: var(--blue); border-color: #acbfdf; }
button.quiet { background: transparent; color: inherit; border-color: var(--border); }
button:disabled { opacity: .46; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #387af3; outline-offset: 2px; }
input, select, textarea { display: block; width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 7px; color: inherit; background: #fff; }
label { display: block; font-weight: 600; }
label > :is(input, select, textarea) { margin-top: 3px; font-weight: 400; }
form { display: grid; gap: 12px; }
form > button { justify-self: start; }
.search { margin-bottom: 14px; }
.search input { width: min(480px, 100%); }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .94rem; }
th { background: #f5f7fb; color: #3c516e; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
td:first-child { white-space: nowrap; }
.serial-button { background: transparent; color: var(--blue); border: 0; padding: 0; font: 600 .94rem ui-monospace, monospace; }
.serial-button:hover { text-decoration: underline; }
.pagination, .facts dt { color: var(--muted); }
.pagination { padding-top: 12px; }
#notice, .dialog-notice { background: #eaf2ff; border-left: 4px solid var(--blue); padding: 10px 13px; border-radius: 4px; }
#notice.error, .dialog-notice.error { background: #fff0ee; border-color: #ab3026; color: #86261f; }
dialog { width: min(760px, calc(100% - 24px)); max-height: 90vh; padding: 22px; box-shadow: 0 18px 54px #1a2e5240; }
dialog::backdrop { background: #0c1d3d77; }
dialog form + form, dialog h3, #import-preview { margin-top: 18px; }
.form-grid, .facts { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.facts { background: #f5f7fb; padding: 12px; border-radius: 8px; }
.facts dt { font-size: .86rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.history { padding-left: 20px; }
.history li { margin-bottom: 7px; }
#commit-import { margin-top: 14px; }
@media (max-width: 600px) {
  .topbar-inner, main { width: calc(100% - 24px); }
  .search .actions > button { width: 100%; }
  .inventory { padding: 10px; }
}
