:root {
  --bg: #f4f6f6; --surface: #ffffff; --surface-2: #f8faf9; --line: #e2e7e6; --line-2: #cfd7d5;
  --ink: #14201f; --ink-2: #4a5856; --ink-3: #75817f;
  --pri: #0f5c63; --pri-2: #0b474d; --pri-soft: #e3f0f0; --focus: #2a78d6;
  --red: #b42318; --red-bg: #fdecea; --orange: #b54708; --orange-bg: #fff0e1; --amber: #866400; --amber-bg: #fff7d1;
  --blue: #175cd3; --blue-bg: #e7effd; --violet: #5925dc; --violet-bg: #efeafd; --green: #067647; --green-bg: #e2f5ea;
  --gray-bg: #eef1f0;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --side: 232px;
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 14.5px; line-height: 1.45; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; }
.req { color: var(--red); }
.right { text-align: right; }
.hidden { display: none !important; }

/* ===== Bố cục ===== */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: #0e2f33; color: #d8e6e5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: .6rem; align-items: center; padding: 1rem 1rem .9rem; font-weight: 700; color: #fff; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: #1b8a8f; display: grid; place-items: center; }
.brand small { display: block; font-weight: 400; color: #9fbcba; font-size: .75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: .25rem .6rem; flex: 1; overflow: auto; }
.nav a { color: #cfe0df; padding: .55rem .7rem; border-radius: 8px; display: flex; gap: .6rem; align-items: center; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: #1b6f74; color: #fff; font-weight: 600; }
.nav .ic { width: 20px; text-align: center; opacity: .9; }
.nav .count { margin-left: auto; background: #d9534f; color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.side-foot { padding: .8rem 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot button { background: none; border: 1px solid rgba(255,255,255,.2); color: #d8e6e5; border-radius: 6px; padding: .2rem .55rem; cursor: pointer; margin-top: .4rem; }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3cc68a; margin-right: .35rem; }
.sync-dot.off { background: #e5534b; }
.main { min-width: 0; padding: 1.2rem 1.6rem 3rem; }
.topbar { display: none; }
.page-h { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.page-h .sub { color: var(--ink-3); margin-top: .2rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: .35rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.crumbs a { color: var(--ink-2); }
.banner { background: var(--amber-bg); border: 1px solid #f0d77a; color: #5d4600; padding: .55rem .8rem; border-radius: 8px; margin-bottom: 1rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.banner.info { background: var(--blue-bg); border-color: #bcd0f7; color: #133e8a; }
.banner.err { background: var(--red-bg); border-color: #f3b8b2; color: #7a1b13; }

/* ===== Thành phần ===== */
.btn { border: 1px solid var(--line-2); background: var(--surface); padding: .45rem .85rem; border-radius: 8px; cursor: pointer; font-weight: 550; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn-primary:hover { background: var(--pri-2); }
.btn-danger { color: var(--red); border-color: #f0b7b1; }
.btn-danger.solid { background: var(--red); color: #fff; }
.btn-sm { padding: .25rem .55rem; font-size: .85rem; border-radius: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary).busy::after { border-color: var(--pri); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 0; cursor: pointer; padding: .3rem .45rem; border-radius: 6px; color: var(--ink-2); }
.icon-btn:hover { background: var(--gray-bg); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.card + .card { margin-top: 1rem; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .75rem; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tag { display: inline-block; background: var(--gray-bg); border-radius: 6px; padding: 0 .45rem; font-size: .82rem; color: var(--ink-2); }
.demo-badge { display: inline-block; background: #fff1c2; color: #6b4e00; border: 1px dashed #d4a800; font-size: .7rem; font-weight: 700; letter-spacing: .04em; border-radius: 5px; padding: 0 .35rem; margin-left: .35rem; vertical-align: middle; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-3); }
.loc { color: var(--ink-2); }
.loc::before { content: "📍 "; }

/* Trạng thái: màu + biểu tượng + chữ */
.st { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .08rem .55rem .08rem .4rem; font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st-ic { font-size: .78rem; width: 1em; text-align: center; }
.st-overdue { background: var(--red-bg); color: var(--red); border-color: #f5c2bd; }
.st-due { background: var(--orange-bg); color: var(--orange); border-color: #f8cf9f; }
.st-upcoming { background: var(--amber-bg); color: var(--amber); border-color: #ecd77b; }
.st-not_due { background: var(--gray-bg); color: var(--ink-2); }
.st-sampled { background: var(--blue-bg); color: var(--blue); border-color: #c3d5fa; }
.st-in_entry { background: var(--violet-bg); color: var(--violet); border-color: #d3c5fb; }
.st-completed { background: var(--green-bg); color: var(--green); border-color: #b5e3c9; }
.ev { display: inline-flex; gap: .25rem; align-items: center; font-size: .8rem; font-weight: 600; border-radius: 5px; padding: 0 .4rem; white-space: nowrap; }
.ev-pass { color: var(--green); background: var(--green-bg); }
.ev-fail { color: #fff; background: var(--red); }
.ev-na { color: var(--ink-2); background: repeating-linear-gradient(135deg, #eef1f0 0 6px, #e3e8e6 6px 12px); }
.ev-missing { color: var(--ink-3); background: var(--gray-bg); }
.cond { display: inline-block; font-size: .8rem; border-radius: 6px; padding: 0 .45rem; border-left: 4px solid; background: var(--surface-2); color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.cond-vkh { border-color: #d97706; } .cond-thuong { border-color: #2a78d6; } .cond-tulanh { border-color: #1baf7a; } .cond-khac { border-color: #8a8a8a; }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: .25rem .75rem; cursor: pointer; font-size: .88rem; }
.chip.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.chip:disabled { opacity: .45; cursor: default; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--pri); border-color: var(--pri); font-weight: 600; }
.progress { height: 8px; border-radius: 99px; background: var(--gray-bg); overflow: hidden; min-width: 70px; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.warn { color: var(--red); font-weight: 600; }
.warn::before { content: "⚠ "; }

/* Bảng */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tbl th, .tbl td { padding: .5rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: .82rem; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f6faf9; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.voided td { color: var(--ink-3); text-decoration: line-through; }

/* Ma trận kết quả */
.matrix th.tp-col { min-width: 120px; text-align: center; }
.matrix td.cell { text-align: center; min-width: 110px; }
.matrix td.cell.fail { background: #fff3f1; box-shadow: inset 3px 0 0 var(--red); }
.matrix td.cell.missing { color: var(--ink-3); }
.matrix .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.matrix .reps { display: block; font-size: .75rem; color: var(--ink-3); }
.matrix th.param { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 170px; }
.matrix td.param { position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 600; }

/* Thẻ nhắc việc */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; text-decoration: none; color: var(--ink); border-top: 4px solid var(--line-2); }
.kpi:hover { text-decoration: none; box-shadow: var(--shadow); }
.kpi b { font-size: 1.6rem; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-2); font-size: .85rem; }
.kpi.k-overdue { border-top-color: var(--red); } .kpi.k-due { border-top-color: #e07b1a; } .kpi.k-up7 { border-top-color: #d4a800; }
.kpi.k-up30 { border-top-color: #c9c3a0; } .kpi.k-wait { border-top-color: var(--blue); } .kpi.k-fail { border-top-color: #7a1b13; } .kpi.k-short { border-top-color: var(--violet); }
.sect { margin-bottom: 1.5rem; }
.sect-h { display: flex; align-items: baseline; gap: .6rem; margin: 0 0 .6rem; }
.sect-h h2 .n { color: var(--ink-3); font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .8rem; }
.task { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: var(--radius); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .45rem; box-shadow: var(--shadow); }
.task.b-overdue { border-left-color: var(--red); } .task.b-due { border-left-color: #e07b1a; } .task.b-upcoming { border-left-color: #d4a800; }
.task.b-not_due { border-left-color: #b9c2c0; } .task.b-sampled { border-left-color: var(--blue); } .task.b-in_entry { border-left-color: var(--violet); } .task.b-fail { border-left-color: #7a1b13; } .task.b-short { border-left-color: var(--violet); }
.task-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }
.task-title { font-weight: 650; }
.task-title .tpl { color: var(--pri); }
.task dl { display: grid; grid-template-columns: 92px 1fr; gap: .15rem .6rem; margin: 0; font-size: .87rem; }
.task dt { color: var(--ink-3); }
.task dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.task-foot { display: flex; gap: .4rem; margin-top: .2rem; flex-wrap: wrap; }
.remind { font-size: .75rem; font-weight: 700; color: #6b4e00; background: #fff1c2; border-radius: 5px; padding: 0 .4rem; }
.due-note { font-size: .82rem; color: var(--ink-2); }
.due-note.late { color: var(--red); font-weight: 600; }

/* Lịch tháng */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: .4rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); text-align: center; }
.cal .day { background: var(--surface); min-height: 112px; padding: .3rem; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.other { background: #fafbfb; color: var(--ink-3); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--pri); }
.cal .dnum { font-size: .8rem; font-weight: 600; }
.cal .ev-chip { display: block; font-size: .74rem; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; border-left: 3px solid; }
.cal .ev-chip:hover { text-decoration: none; filter: brightness(.96); }
.ev-chip.st-overdue { border-left-color: var(--red); } .ev-chip.st-due { border-left-color: #e07b1a; } .ev-chip.st-upcoming { border-left-color: #d4a800; }
.ev-chip.st-not_due { border-left-color: #9aa6a4; } .ev-chip.st-sampled { border-left-color: var(--blue); } .ev-chip.st-in_entry { border-left-color: var(--violet); } .ev-chip.st-completed { border-left-color: var(--green); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }

/* Bộ lọc */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; font-size: .78rem; color: var(--ink-3); gap: .15rem; }
.filters select, .filters input { min-width: 150px; }
input[type=text], input[type=password], input[type=search], select, textarea { border: 1px solid var(--line-2); border-radius: 8px; padding: .42rem .6rem; background: #fff; width: 100%; }
input.invalid { border-color: var(--red); background: #fff6f5; }
textarea { resize: vertical; }
.search { position: relative; }
.search input { padding-left: 2rem; }
.search::before { content: "⌕"; position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 1.1rem; }

/* Form */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem 1rem; }
.fld { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld .lbl { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.fld.chk { flex-direction: row; align-items: center; gap: .5rem; }
.fld.chk input { width: auto; }
.help { color: var(--ink-3); font-size: .78rem; }
.date-in { display: flex; position: relative; }
.date-in input[data-date] { padding-right: 2.2rem; }
.date-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; right: 0; bottom: 0; }
.date-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: .95rem; padding: .2rem; }
.rows-editor .row { display: grid; grid-template-columns: 1.3fr .7fr .9fr .8fr auto; gap: .4rem; margin-bottom: .35rem; align-items: center; }
.rows-editor .row.head { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.test-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .3rem .8rem; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; }
.test-pick label { display: flex; gap: .4rem; align-items: center; font-size: .9rem; }
.test-pick .reqbox { margin-left: auto; font-size: .75rem; color: var(--ink-3); display: flex; gap: .2rem; align-items: center; }
.test-pick input { width: auto; }

/* Modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(16,24,32,.45); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: var(--surface); border-radius: 12px; width: min(640px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal-b { padding: 1rem 1.1rem; overflow: auto; }
.modal-f { padding: .75rem 1.1rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .5rem; }

#toasts { position: fixed; right: 1rem; top: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 80; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: #12302f; color: #fff; padding: .65rem .9rem; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .3s, transform .3s; }
.toast-err { background: #8a1c12; }
.toast.out { opacity: 0; transform: translateY(-8px); }

/* Nhập kết quả */
.entry-tbl td { vertical-align: top; }
.entry-tbl .new-in { display: flex; flex-direction: column; gap: .3rem; min-width: 200px; }
.rep { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.rep:last-child { border-bottom: 0; }
.rep .val { font-weight: 650; font-variant-numeric: tabular-nums; }
.rep .meta { color: var(--ink-3); font-size: .78rem; width: 100%; }
.shared-note { font-size: .78rem; color: var(--blue); }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: .7rem 1rem; display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 1rem -1.6rem -3rem; backdrop-filter: blur(4px); }
.hist { font-size: .85rem; }
.hist li { margin-bottom: .35rem; }
.diff-old { color: var(--red); text-decoration: line-through; }
.diff-new { color: var(--green); font-weight: 600; }

/* Cây vị trí */
.tree ul { list-style: none; margin: 0; padding-left: 1.2rem; border-left: 1px dashed var(--line-2); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: .2rem 0; }
.tree .node { display: flex; align-items: center; gap: .45rem; padding: .25rem .4rem; border-radius: 6px; flex-wrap: wrap; }
.tree .node:hover { background: var(--surface-2); }
.tree .lvl { font-size: .72rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; }
.tree .cnt { font-size: .78rem; color: var(--ink-3); }
.tree .node .act { margin-left: auto; display: flex; gap: .2rem; opacity: .6; }
.tree .node:hover .act { opacity: 1; }
.tree .smp { font-size: .8rem; background: var(--pri-soft); border-radius: 4px; padding: 0 .35rem; }

/* Biểu đồ */
.chart-box { position: relative; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: .4rem .6rem; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; z-index: 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; margin-top: .4rem; }
.chart-legend span { display: inline-flex; gap: .35rem; align-items: center; }

/* Đăng nhập */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #0e2f33, #1b6f74); }
.auth .card { width: min(420px, 100%); padding: 1.5rem; }
.auth h1 { margin-bottom: .3rem; }
.auth form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }

/* ===== Điện thoại ===== */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: #0e2f33; color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 1.35rem; cursor: pointer; }
  .topbar .t { font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main { padding: .9rem .8rem 3rem; }
  .grid2, .grid3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .entry-tbl thead { display: none; }
  .entry-tbl, .entry-tbl tbody, .entry-tbl tr, .entry-tbl td { display: block; width: 100%; }
  .entry-tbl tr { border-bottom: 2px solid var(--line); padding: .4rem 0; }
  .entry-tbl td { border: 0; padding: .25rem .7rem; }
  .entry-tbl td:empty { display: none; }
  .entry-tbl .new-in { min-width: 0; }
  .cards { grid-template-columns: 1fr; }
  .cal .day { min-height: 64px; }
  .cal .ev-chip .lbl-long { display: none; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 45%; }
  .rows-editor .row { grid-template-columns: 1fr 1fr; }
  .sticky-bar { margin: 1rem -.8rem -3rem; }
  h1 { font-size: 1.25rem; }
  .kv { grid-template-columns: 1fr; gap: 0 .5rem; }
  .kv dt { margin-top: .4rem; }
}
@media print {
  .side, .topbar, .actions, .filters, .btn, .sticky-bar { display: none !important; }
  .layout { display: block; } .main { padding: 0; }
}
