:root {
  --bg: #f4f6f9; --card: #fff; --text: #1f2933; --muted: #6b7785; --line: #dde3ea;
  --primary: #1d5fa8; --primary-dark: #154a85; --danger: #c0392b; --success: #1e8e4e; --warning: #b7791f;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; background: #102a43; color: #fff; flex-wrap: wrap; }
.topbar a { color: #d9e2ec; }
.topbar .brand { font-weight: 700; color: #fff; font-size: 1.1rem; }
.topbar .ver { font-weight: 400; font-size: .8rem; color: #9fb3c8; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a.on { color: #fff; border-bottom: 2px solid #fff; }
.topbar .me { display: flex; gap: .75rem; align-items: center; }
main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }
main.narrow { max-width: 420px; margin-top: 8vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
.card.form { max-width: 560px; }
.login h1 { margin-bottom: .25rem; }
label { display: block; margin-bottom: .8rem; font-weight: 500; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
button, .btn { display: inline-block; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; cursor: pointer; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--primary-dark); text-decoration: none; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: none; color: #d9e2ec; padding: 0; }
form.inline { display: inline; }
.actions form { margin-right: .5rem; }
.alert { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; }
.alert.danger { background: #fdecea; border-color: #f5c6c0; color: var(--danger); }
.alert.success { background: #e8f6ee; border-color: #b9e3c9; color: var(--success); }
.alert.warning { background: #fdf6e3; border-color: #f2dfa8; color: var(--warning); }
.muted { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.table th { background: #eef2f6; font-weight: 600; }
.table.small { font-size: .9rem; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .9rem; border-radius: 6px 6px 0 0; color: var(--muted); }
.tabs a.on { background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); color: var(--text); margin-bottom: -1px; }
dl.grid { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; }
dl.grid dt { color: var(--muted); }
dl.grid dd { margin: 0; }
.qr { width: 200px; height: 200px; display: block; margin: 1rem 0; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 0; }
@media (max-width: 700px) { .table { display: block; overflow-x: auto; } }

/* v1.10 */
.topbar .search input { margin: 0; width: 260px; padding: .35rem .6rem; border-radius: 6px; border: 0; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagehead h1 { margin: 0; }
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 220px; margin: 0; display: inline-block; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; color: #fff; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.stage-row td:first-child { border-left: 4px solid; border-left-color: inherit; }
.num { text-align: right; white-space: nowrap; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-line; }
.warn { color: var(--danger); font-size: .8rem; margin-left: .5rem; }
.inactive td { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; display: flex; flex-direction: column; }
.kpi span { color: var(--muted); font-size: .9rem; }
.kpi strong { font-size: 1.6rem; }
.kpi small { color: var(--muted); }
.stagebar { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-bottom: 1.5rem; }
.stagecell { background: var(--card); border: 1px solid var(--line); border-top: 4px solid; border-radius: 6px; padding: .6rem .8rem; display: flex; flex-direction: column; color: var(--text); }
.stagecell:hover { text-decoration: none; background: #f9fbfd; }
.stagecell span { font-size: .85rem; color: var(--muted); }
.stagecell small { color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; }
.table.items input, .table.items select { margin: 0; }
.table.items td { padding: .3rem; }
.link-danger { border: none; background: none; color: var(--danger); }
.stageform { display: flex; gap: .5rem; flex-wrap: wrap; }
.stageform select, .stageform input { width: auto; margin: 0; flex: 1; }
details.card > summary { cursor: pointer; }
details.version table { margin: .75rem 0; }
.inline-upload input { display: inline-block; width: auto; }
.small { font-size: .85rem; }
h2 { margin-top: 1.5rem; }
.card h2:first-child { margin-top: 0; }
@media (max-width: 900px) { .cols, .row2, .row3 { grid-template-columns: 1fr; } .stagebar { grid-template-columns: repeat(2, 1fr); } .topbar .search input { width: 100%; } }
.table.items th:nth-child(1) { width: 18%; }
.table.items th:nth-child(2) { width: 40%; }
.table.items th:nth-child(3) { width: 8%; }
.table.items th:nth-child(4) { width: 12%; }
