* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f4f5f7; color: #1f2933; font-size: 16px; }
a { color: #1d4ed8; }
.topbar { background: #1f2933; color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; }
.topbar a { color: #fff; text-decoration: none; padding: 6px 8px; display: inline-block; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.topbar form { margin: 0; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.narrow { max-width: 420px; margin: 16px auto; }
label { display: block; margin-bottom: 12px; font-weight: 600; }
label.check { font-weight: normal; }
input[type=text], input[type=password], input[type=email], select {
    display: block; width: 100%; padding: 10px; margin-top: 4px; font-size: 16px; border: 1px solid #cbd2d9; border-radius: 6px;
}
button, .btn { background: #1d4ed8; color: #fff; border: 0; border-radius: 6px; padding: 10px 16px; font-size: 16px; cursor: pointer; text-decoration: none; display: inline-block; }
button.link { background: none; color: inherit; padding: 6px 8px; text-decoration: underline; }
.container button.link { color: #1d4ed8; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flash { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.flash.ok { background: #d1fae5; }
.flash.bad { background: #fee2e2; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e4e7eb; white-space: nowrap; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.low td { background: #fef3c7; }
.low-tag { color: #b45309; font-weight: 600; }
.archived { opacity: .6; }
.group { margin-bottom: 24px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 12px; background: #fff; border-radius: 8px; margin-top: 8px; }
.inline-form label { margin: 0; }
.inline-form input[type=text], .inline-form input[type=number] { width: 140px; }
input[type=number] { display: block; width: 100%; padding: 10px; margin-top: 4px; font-size: 16px; border: 1px solid #cbd2d9; border-radius: 6px; }
[hidden] { display: none !important; }
.component-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; align-items: end; padding: 12px; margin-bottom: 8px; border: 1px solid #e4e7eb; border-radius: 8px; }
.component-row label { margin: 0; }
