:root { --blue: #1f4e79; --line: #d5dbe3; --bg: #f4f6f9; --red: #b42318; --amber: #9a6700; --green: #1a7f37; font-size: 15px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Roboto, Arial, sans-serif; color: #1d2733; background: var(--bg); }
a { color: var(--blue); }
.side { position: fixed; inset: 0 auto 0 0; width: 200px; background: var(--blue); padding: 12px 0; overflow-y: auto; }
.side .brand { color: #fff; font-weight: 700; font-size: 1.15rem; padding: 4px 18px 14px; }
.side a { display: block; color: #dbe7f3; text-decoration: none; padding: 9px 18px; }
.side a:hover { background: #2a5f91; color: #fff; }
.side a.on { background: #fff; color: var(--blue); font-weight: 600; }
.top { position: sticky; top: 0; z-index: 5; margin-left: 200px; display: flex; gap: 14px; align-items: center; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 20px; }
.top #hh { font-weight: 600; }
.grow { flex: 1; }
main { margin-left: 200px; padding: 18px 22px 60px; }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 22px 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
.muted { color: #66717f; }
.small { font-size: .87rem; }
.red { color: var(--red); } .amber { color: var(--amber); } .green { color: var(--green); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.card .k { color: #66717f; font-size: .85rem; }
.card .v { font-size: 1.35rem; font-weight: 700; margin-top: 4px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: #3b4754; border-radius: 6px 6px 0 0; }
.tabs a.on { background: var(--blue); color: #fff; }
button, .btn { font: inherit; padding: 6px 13px; border: 1px solid #b9c3cf; border-radius: 6px; background: #fff; cursor: pointer; color: #1d2733; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #eef3f8; }
button.pri { background: var(--blue); color: #fff; border-color: var(--blue); }
button.pri:hover { background: #2a5f91; }
button.danger { color: var(--red); border-color: #e3b5b1; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 5px 8px; border: 1px solid #b9c3cf; border-radius: 5px; background: #fff; max-width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: middle; }
input.num { text-align: right; width: 140px; }
label { display: inline-flex; gap: 6px; align-items: center; }
.form { display: grid; grid-template-columns: 190px 1fr; gap: 8px 12px; align-items: center; }
.form > .full { grid-column: 1 / -1; }
.form > * { min-width: 0; }
.form .hint { grid-column: 2; margin-top: -4px; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }
th { background: #eef2f6; font-weight: 600; text-align: center; }
thead th { position: sticky; top: 49px; z-index: 1; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.c { text-align: center; }
tr.sum td { font-weight: 700; background: #f7f9fb; }
tr.grp td { font-weight: 600; background: #f1f5f9; }
tbody tr.click:hover { background: #f3f8fd; cursor: pointer; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: .8rem; background: #e7edf3; color: #33404d; white-space: nowrap; }
.badge.kv { background: #e3f1ff; color: #0b5cad; }
.badge.ok { background: #dcf3e3; color: var(--green); }
.badge.warn { background: #fff1d6; color: var(--amber); }
.badge.do { background: #fde3e1; color: var(--red); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 7px 10px; border-left: 4px solid #9aa6b2; background: #fff; margin-bottom: 6px; border-radius: 4px; }
.checks li.do { border-color: var(--red); } .checks li.warn { border-color: #e0a500; } .checks li.info { border-color: #5b8fd0; }
.progress { height: 8px; background: #e5eaf0; border-radius: 4px; overflow: hidden; width: 260px; display: inline-block; vertical-align: middle; }
.progress > i { display: block; height: 100%; background: var(--blue); }
dialog { border: none; border-radius: 10px; padding: 0; width: min(980px, 96vw); max-height: 92vh; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 30, 45, .45); }
dialog form { padding: 16px 20px; max-height: 92vh; overflow-y: auto; }
dialog h2 { margin-top: 0; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; position: sticky; bottom: -16px; background: #fff; padding: 10px 0; border-top: 1px solid var(--line); }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 6px; }
#toast div { background: #1d2733; color: #fff; padding: 9px 14px; border-radius: 6px; max-width: 460px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#toast div.err { background: var(--red); }
.lines td input { width: 100%; }
.scroll { max-height: 420px; overflow: auto; }
.note { background: #f6f9fc; border: 1px solid #dbe5ef; border-radius: 6px; padding: 9px 12px; margin: 8px 0; }
details summary { cursor: pointer; color: var(--blue); }

/* ---------- Trang in: sổ kế toán, tờ khai ---------- */
.paper { background: #fff; border: 1px solid var(--line); padding: 22px 26px; margin-bottom: 18px; font-family: "Times New Roman", serif; font-size: 13.5px; }
.paper .ph { display: flex; justify-content: space-between; gap: 20px; }
.paper .ph .form-code { text-align: center; font-size: 12px; max-width: 300px; }
.paper .title { text-align: center; font-weight: 700; font-size: 17px; margin: 14px 0 4px; }
.paper .sub { text-align: center; margin: 2px 0; }
.paper table { font-size: 13px; }
.paper th { background: #fff; }
.paper .sign { display: flex; justify-content: flex-end; margin-top: 18px; }
.paper .sign div { text-align: center; min-width: 320px; }
.paper .sign .name { margin-top: 64px; font-weight: 700; }
@media print {
  body { background: #fff; }
  .no-print, .side, .top, .bar, .tabs, .box, .cards, h1, #toast, dialog { display: none !important; }
  main { margin: 0; padding: 0; }
  .paper { border: none; padding: 0; margin: 0; page-break-after: always; }
  .paper:last-child { page-break-after: auto; }
  thead th { position: static; }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; }
}
.cap { display: inline-flex; gap: 6px; align-items: center; } .cap img { height: 40px; width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 4px; } .cap input { width: 150px; }
