@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url(../fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url(../fonts/be-vietnam-pro-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 500; font-display: swap; src: url(../fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 500; font-display: swap; src: url(../fonts/be-vietnam-pro-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 600; font-display: swap; src: url(../fonts/be-vietnam-pro-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 600; font-display: swap; src: url(../fonts/be-vietnam-pro-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 700; font-display: swap; src: url(../fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 700; font-display: swap; src: url(../fonts/be-vietnam-pro-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 800; font-display: swap; src: url(../fonts/be-vietnam-pro-vietnamese-800-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 800; font-display: swap; src: url(../fonts/be-vietnam-pro-latin-800-normal.woff2) format('woff2'); }
/* ES ACCOUNTING – giao diện chuẩn ES GROUP */

:root {
  --es-blue: #005ca1; --es-blue-d: #004a82; --es-blue-dd: #003a66; --es-blue-l: #e6f0f8; --es-blue-ll: #f3f8fc;
  --es-gray: #838280; --es-gray-l: #e4e3e1; --es-orange: #f0aa1d; --es-orange-l: #fdf3dd;
  --ink: #000; --ink-2: #1a1a1a; --mute: #4a4a4a; --line: #d9dee4; --line-2: #eceff2; --bg: #f2f4f7; --white: #fff;
  --ok: #1e8e4f; --err: #c8382b; --row-h: 30px;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { font: 400 13px/1.4 'Segoe UI', Tahoma, 'Helvetica Neue', Arial, sans-serif; /* giống MISA SME 2026 */ color: var(--ink); background: var(--bg); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--mute); }
.neg { color: var(--err); }

/* ---------- Đăng nhập ---------- */
.login { display: flex; height: 100%; }
.login-brand { flex: 1.1; background: linear-gradient(150deg, var(--es-blue) 0%, var(--es-blue-dd) 100%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(240,170,29,.18); }
.login-brand h1 { font-weight: 800; font-size: 40px; letter-spacing: .5px; margin: 0; }
.login-brand h1 span { color: var(--es-orange); }
.login-brand p { font-size: 15px; opacity: .85; max-width: 420px; line-height: 1.6; }
.login-brand .foot { font-size: 12px; opacity: .7; }
.login-form { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; }
.login-card { width: 360px; }
.login-card h2 { font-weight: 700; font-size: 22px; margin: 0 0 4px; }
.login-card .sub { color: var(--mute); margin-bottom: 26px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { height: 34px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--es-blue); box-shadow: 0 0 0 3px rgba(0,92,161,.12); }
.login .err { color: var(--err); min-height: 18px; margin: -4px 0 10px; font-size: 12px; }

/* ---------- Nút ---------- */
.btn { height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--es-blue-ll); border-color: #b9cfe2; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--es-blue); border-color: var(--es-blue); color: #fff; }
.btn.primary:hover { background: var(--es-blue-d); }
.btn.accent { background: var(--es-orange); border-color: var(--es-orange); color: #2b2000; }
.btn.accent:hover { filter: brightness(.96); }
.btn.danger:hover { color: var(--err); border-color: #e7b3ad; background: #fdf1f0; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn.block { width: 100%; justify-content: center; height: 38px; font-size: 14px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- Khung chính ---------- */
.shell { display: grid; grid-template-rows: 48px 1fr 24px; grid-template-columns: 230px 1fr; height: 100%; }
.topbar { grid-column: 1 / 3; background: var(--es-blue); color: #fff; display: flex; align-items: center; padding: 0 12px 0 0; gap: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.15); z-index: 5; }
.brand { width: 230px; display: flex; align-items: center; gap: 10px; padding-left: 16px; font-weight: 800; letter-spacing: .4px; font-size: 15px; }
.brand .mark { width: 30px; height: 30px; border-radius: 6px; background: #fff; color: var(--es-blue); display: grid; place-items: center; font-weight: 800; font-size: 13px; position: relative; }
.brand .mark::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 2px; background: var(--es-orange); }
.brand b { color: var(--es-orange); font-weight: 800; }
.brand img.logo { height: 24px; width: auto; display: block; }
.client-pick { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-radius: 4px; background: rgba(255,255,255,.1); cursor: pointer; min-width: 320px; max-width: 560px; }
.client-pick svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.client-pick:hover { background: rgba(255,255,255,.18); }
.client-pick .cname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-pick .cmeta { font-size: 11px; opacity: .8; white-space: nowrap; }
.chip { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--es-orange); color: #2b2000; letter-spacing: .3px; }
.chip.gray { background: var(--es-gray-l); color: var(--ink-2); }
.chip.blue { background: var(--es-blue-l); color: var(--es-blue); }
.chip.green { background: #e3f4ea; color: var(--ok); }
.topbar .sp { flex: 1; }
.userbox { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.userbox:hover { background: rgba(255,255,255,.12); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--es-orange); color: #2b2000; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.userbox .u1 { font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.userbox .u2 { font-size: 11px; opacity: .8; }

.nav { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 0; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 16px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-left: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.nav a svg { width: 18px; height: 18px; color: var(--mute); flex: none; }
.nav a:hover { background: var(--es-blue-ll); color: var(--es-blue); }
.nav a:hover svg { color: var(--es-blue); }
.nav a.on { background: var(--es-blue-l); color: var(--es-blue); border-left-color: var(--es-orange); }
.nav a.on svg { color: var(--es-blue); }
.nav .sep { height: 1px; background: var(--line-2); margin: 8px 14px; }
.nav .soon { margin-left: auto; font-size: 9px; font-weight: 700; color: var(--mute); background: var(--line-2); padding: 1px 6px; border-radius: 8px; }

.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.statusbar { grid-column: 1 / 3; background: #fff; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); display: flex; align-items: center; gap: 18px; padding: 0 12px; }
.statusbar b { color: var(--ink-2); font-weight: 600; }

/* ---------- Trang ---------- */
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 0 16px; display: flex; align-items: flex-end; gap: 4px; height: 46px; flex: none; }
.page-head h1 { font-size: 16px; font-weight: 700; margin: 0 18px 12px 0; white-space: nowrap; }
.tabs { display: flex; gap: 2px; align-self: stretch; align-items: flex-end; }
.tab { padding: 0 14px; height: 36px; display: flex; align-items: center; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--es-blue); }
.tab.on { color: var(--es-blue); border-bottom-color: var(--es-blue); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.toolbar .sp { flex: 1; }
.toolbar .search { position: relative; }
.toolbar .search input { height: 32px; width: 240px; padding-left: 30px; }
.toolbar .search svg { position: absolute; left: 9px; top: 8px; width: 16px; height: 16px; color: var(--mute); }
.content { flex: 1; overflow: auto; padding: 14px 16px; min-height: 0; }
.content.flush { padding: 0; display: flex; flex-direction: column; }

/* Kỳ (lịch chuẩn ES) */
.period { display: flex; align-items: center; gap: 6px; }
.period-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--es-blue); border-radius: 6px; background: #fff; color: var(--es-blue); font-weight: 700; cursor: pointer; white-space: nowrap; }
.period-btn:hover { background: var(--es-blue-ll); }
.period-btn .cal { display: inline-flex; color: var(--es-blue); } .period-btn .cal svg { width: 16px; height: 16px; }
.period-btn .caret { color: var(--mute); font-size: 11px; }
.period-pop { position: fixed; z-index: 95; width: 440px; background: #fff; border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.2); border: 1px solid var(--line); padding: 16px; }
.period-pop .pp-top { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 12px; }
.period-pop .pp-top input { height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; font-size: 13.5px; }
.period-pop .pp-top .btn { height: 36px; padding: 0 16px; font-weight: 700; }
.period-pop .pp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.period-pop .pp-b { min-height: 30px; padding: 4px 6px; border: 1px solid #b8bec6; border-radius: 3px; background: #f1f2f4; color: var(--ink); font-size: 12.5px; font-weight: 500; line-height: 1.2; cursor: pointer; }
.period-pop .pp-b:hover { background: var(--es-blue-l); border-color: var(--es-blue); color: var(--es-blue); }
.period-pop .pp-b.on { background: var(--es-blue); border-color: var(--es-blue); color: #fff; }
.period-pop .pp-foot { text-align: right; margin-top: 12px; }
.period-pop .pp-foot a { color: var(--mute); text-decoration: underline; cursor: pointer; font-size: 12.5px; }
.period-pop .pp-foot a:hover { color: var(--es-blue); }

/* ---------- Lưới dữ liệu ---------- */
.grid-wrap { flex: 1; overflow: auto; background: #fff; min-height: 0; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
table.grid th { position: sticky; top: 0; z-index: 2; background: #eef2f6; color: var(--ink-2); font-weight: 700; text-align: left; height: 34px; padding: 0 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2); white-space: nowrap; font-size: 12px; }
table.grid th.num { text-align: right; }
table.grid td { height: var(--row-h); padding: 0 8px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 460px; }
table.grid tbody tr:nth-child(even) td { background: #fafbfc; }
table.grid tbody tr:hover td { background: var(--es-blue-ll); }
table.grid tbody tr.sel td { background: #d7e7f4 !important; }
table.grid tbody tr.lv1 td { font-weight: 700; }
table.grid tbody tr.unposted td { font-style: normal; }
table.grid tfoot td { position: sticky; bottom: 0; background: #fff7e6; font-weight: 700; height: 32px; padding: 0 8px; border-top: 1px solid #f1d9a6; border-right: 1px solid var(--line-2); }
table.grid .link { color: var(--es-blue); font-weight: 600; cursor: pointer; }
table.grid .link:hover { text-decoration: underline; }
.empty { padding: 48px; text-align: center; color: var(--mute); }
.empty svg { width: 46px; height: 46px; color: var(--line); display: block; margin: 0 auto 10px; }
.gridinfo { flex: none; display: flex; justify-content: space-between; padding: 6px 16px; font-size: 12px; color: var(--mute); background: #fff; border-top: 1px solid var(--line); }
.gridinfo b { color: var(--ink); }

/* ---------- Thẻ, bảng làm việc ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.card .k { color: var(--mute); font-size: 12px; font-weight: 600; }
.card .v { font-size: 22px; font-weight: 800; margin-top: 4px; color: var(--es-blue); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.panel > .ph { padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel > .ph .sp { flex: 1; }
.flow { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 0 18px; }
.flow .step { width: 150px; height: 104px; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 600; text-align: center; padding: 8px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.flow .step svg { width: 30px; height: 30px; color: var(--es-blue); }
.flow .step:hover { border-color: var(--es-blue); box-shadow: 0 4px 14px rgba(0,92,161,.12); transform: translateY(-1px); }
.flow .arrow { align-self: center; color: var(--mute); }

/* ---------- Cửa sổ chứng từ / hộp thoại ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16,30,46,.42); z-index: 50; display: flex; align-items: center; justify-content: center; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.win { background: #fff; border-radius: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.28); display: flex; flex-direction: column; max-height: 94vh; max-width: 96vw; animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: .6 } to { transform: none; opacity: 1 } }
.win.full { width: 96vw; height: 92vh; }
.win-title { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.win-title h3 { margin: 0; font-size: 15px; font-weight: 700; }
.win-title .sp { flex: 1; }
.win-title .x { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; color: var(--mute); font-size: 20px; }
.win-title .x:hover { background: #fdecea; color: var(--err); }
.win-body { padding: 16px; overflow: auto; flex: 1; min-height: 0; }
.win-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fafbfc; flex: none; border-radius: 0 0 6px 6px; }
.win-foot .sp { flex: 1; }
.win-foot .total { font-weight: 700; font-size: 14px; }
.win-foot .total b { color: var(--es-blue); font-size: 16px; margin-left: 6px; }
.kbd { font-size: 10.5px; color: var(--mute); font-weight: 600; margin-left: 2px; }

.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px 14px; }
.form-grid .field { margin: 0; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }
.vhead { display: grid; grid-template-columns: 1fr 300px; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; }
.vhead .right { background: var(--es-blue-ll); border: 1px solid #dbe8f3; border-radius: 6px; padding: 12px 14px; }
.vhead .right .field input { font-weight: 700; }
.section-t { font-weight: 700; color: var(--es-blue); margin: 2px 0 8px; display: flex; align-items: center; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.check input { width: 15px; height: 15px; accent-color: var(--es-blue); }

/* Lưới nhập liệu (dòng hạch toán) */
table.edit { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.edit th { background: #eef2f6; font-weight: 700; color: var(--ink-2); text-align: left; padding: 0 6px; height: 32px; border: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
table.edit td { border: 1px solid var(--line); padding: 0; height: 30px; position: relative; }
table.edit td input { width: 100%; height: 29px; border: 0; padding: 0 6px; outline: none; background: transparent; }
table.edit td input:focus { background: #fff8e8; box-shadow: inset 0 0 0 2px var(--es-orange); }
table.edit td.idx { width: 34px; text-align: center; color: var(--mute); background: #fafbfc; }
table.edit td.act { width: 30px; text-align: center; }
table.edit td.act button { border: 0; background: transparent; cursor: pointer; color: var(--mute); width: 28px; height: 28px; border-radius: 4px; }
table.edit td.act button:hover { color: var(--err); background: #fdecea; }
table.edit tfoot td { background: #fff7e6; font-weight: 700; padding: 0 6px; }
.addrow { margin-top: 8px; }

/* Ô chọn có gợi ý (tài khoản, đối tượng) */
.combo-pop { position: fixed; z-index: 80; background: #fff; border: 1px solid #b9cfe2; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.16); max-height: 300px; overflow: auto; min-width: 360px; font-size: 12.5px; }
.combo-pop table { width: 100%; border-collapse: collapse; }
.combo-pop th { position: sticky; top: 0; background: #eef2f6; text-align: left; padding: 6px 8px; font-size: 11.5px; color: var(--ink-2); }
.combo-pop td { padding: 5px 8px; border-top: 1px solid var(--line-2); white-space: nowrap; }
.combo-pop tr.on td { background: var(--es-blue); color: #fff; }
.combo-pop tr.parent td { color: var(--mute); }
.combo-pop .none { padding: 10px; color: var(--mute); }

/* Thông báo */
.toasts { position: fixed; right: 18px; bottom: 34px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 440px; background: #fff; border-left: 4px solid var(--ok); box-shadow: 0 6px 20px rgba(0,0,0,.18); border-radius: 4px; padding: 10px 14px; font-weight: 600; animation: pop .15s ease-out; }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--es-orange); }
.msgbox { width: 420px; }
.msgbox .win-body { display: flex; gap: 14px; align-items: flex-start; }
.msgbox .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--es-orange-l); color: #a36a00; flex: none; font-weight: 800; font-size: 18px; }
.msgbox .ic.err { background: #fdecea; color: var(--err); }
.msgbox .ic.ok { background: #e7f6ec; color: #15803d; }

/* Báo cáo */
.report { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 22px 26px; min-width: 900px; font-family: 'Times New Roman', Times, serif; font-size: 14px; font-weight: 400; color: #000; }
.report table.grid { font-family: 'Times New Roman', Times, serif; font-size: 13.5px; font-weight: 400; }
.report table.grid th { font-weight: 700; color: #000; }
.report .rh { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 14px; }
.report .rh b { font-size: 13px; }
.report h2 { text-align: center; margin: 4px 0 2px; font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.report .rsub { text-align: center; color: var(--ink-2); margin-bottom: 14px; font-style: italic; }
.report table.grid th { position: static; text-align: center; white-space: normal; height: 30px; }
.report table.grid td, .report table.grid th { border: 1px solid #cfd6dd; }
.report table.grid tfoot td { position: static; }
.badge-ok { color: var(--ok); font-weight: 700; }
.badge-err { color: var(--err); font-weight: 700; }

/* Cây tài khoản */
.indent-2 { padding-left: 24px !important; } .indent-3 { padding-left: 42px !important; } .indent-4 { padding-left: 60px !important; }

.menu { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 220px; padding: 6px 0; }
.menu a { display: block; padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--ink); }
.menu a:hover { background: var(--es-blue-ll); color: var(--es-blue); }
.menu .sep { height: 1px; background: var(--line-2); margin: 4px 0; }

@media print {
  body, .report, .report table.grid, table.grid { font-family: 'Times New Roman', Times, serif !important; color: #000; }
  .topbar, .nav, .statusbar, .toolbar, .page-head, .gridinfo { display: none !important; }
  .shell { display: block; } body { overflow: visible; background: #fff; } .content { overflow: visible; padding: 0; }
  .report { border: 0; padding: 0; min-width: 0; }
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #c9d1d9; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b4bf; background-clip: padding-box; border: 3px solid transparent; }
/* v0.3 – Hóa đơn điện tử */
.content.drop { outline: 2px dashed var(--es-blue); outline-offset: -6px; background: var(--es-blue-l); }
.grid td > select, .grid td > input:not([type=checkbox]) { height: 26px; border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; font: inherit; font-size: 12.5px; background: #fff; }
.grid td > input:not([type=checkbox]):focus, .grid td > select:focus { outline: none; border-color: var(--es-orange); box-shadow: 0 0 0 2px rgba(240,170,29,.25); }
.grid.hd td > input { width: 100%; min-width: 80px; }
table.grid tbody tr.sub td { font-weight: 700; background: #f6f8fb; font-style: italic; }
/* v0.3.2 – form chứng từ kiểu MISA */
.optbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: -4px 0 12px; background: #f4f7fb; border: 1px solid #dbe8f3; border-radius: 6px; flex-wrap: wrap; }
.optbar select, .optbar input { height: 30px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; background: #fff; font: inherit; }
.optbar select:first-child { font-weight: 700; color: var(--es-blue); }
.optbar .sp { flex: 1; }
.field input.ro { background: #f7f8fa; color: var(--ink-2); }
.hdgroup { margin-top: 12px; border: 1px dashed #c9d8e6; border-radius: 6px; padding: 8px 12px 10px; position: relative; }
.hdcap { position: absolute; top: -9px; left: 10px; background: #fff; padding: 0 6px; font-size: 11.5px; font-weight: 700; color: var(--es-blue); }
table.edit td.rocell { padding: 0 6px; background: #f8f9fb; color: var(--ink-2); white-space: nowrap; }
table.edit td select { width: 100%; height: 29px; border: 0; background: transparent; font: inherit; font-size: 12.5px; }
.cpbox { display: flex; gap: 16px; margin-bottom: 4px; }
.win.full .vhead .form-grid { gap: 8px 12px; }
.win.full .vhead .field input, .win.full .vhead .field select { height: 30px; }
.win.full .vhead .field label { font-size: 11.5px; }
.win.full .vhead .right .field { margin-bottom: 8px; }
/* v0.4 – giá thành */
table.grid.gt td.cellin { padding: 2px 4px; background: #fff; }
table.grid.gt td.cellin input { width: 110px; height: 26px; border: 1px solid var(--line); border-radius: 3px; text-align: right; padding: 0 6px; font: inherit; }
table.grid.gt td.cellin input.tay { border-color: var(--es-orange); background: #fff8e8; }
table.grid.gt td.b { font-weight: 700; color: var(--es-blue); }
table.grid.gt th { white-space: normal; line-height: 1.25; min-width: 96px; padding: 6px 8px; height: auto; }
table.grid.gt th:nth-child(-n+3) { min-width: 70px; }
.page-head .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.page-head .tab { white-space: nowrap; padding: 0 11px; }

/* v0.5.0 – trung tâm báo cáo kiểu MISA */
.repwrap { display: flex; flex: 1; min-height: 0; }
.repnav { width: 272px; flex: none; border-right: 1px solid var(--line); background: #f6f8fb; display: flex; flex-direction: column; min-height: 0; }
.repnav .rn-top { position: relative; padding: 12px 12px 8px; border-bottom: 1px solid var(--line-2); background: #f6f8fb; }
.repnav .rn-sic { position: absolute; left: 22px; top: 21px; color: var(--mute); display: flex; } .repnav .rn-sic svg { width: 15px; height: 15px; }
.repnav .rn-search { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px 0 32px; background: #fff; outline: none; }
.repnav .rn-search:focus { border-color: var(--es-blue); box-shadow: 0 0 0 3px rgba(0,92,161,.12); }
.repnav .rn-list { overflow-y: auto; padding: 6px 8px 16px; flex: 1; }
.repnav .rn-g { margin-top: 4px; }
.repnav .rn-gh { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 6px; cursor: pointer; user-select: none; color: var(--es-blue); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.repnav .rn-gh:hover { background: #e9f1f8; }
.repnav .rn-ic { width: 26px; height: 26px; border-radius: 6px; background: var(--es-blue-l); display: grid; place-items: center; flex: none; } .repnav .rn-ic svg { width: 15px; height: 15px; }
.repnav .rn-g.co-on .rn-ic { background: var(--es-blue); color: #fff; }
.repnav .rn-gt { flex: 1; }
.repnav .rn-n { font-size: 11px; font-weight: 700; color: var(--mute); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; letter-spacing: 0; }
.repnav .rn-car { color: var(--mute); font-size: 11px; transition: transform .15s; }
.repnav .rn-g.dong .rn-car { transform: rotate(-90deg); }
.repnav .rn-items { margin: 2px 0 6px 20px; border-left: 1px solid #dfe5ec; padding-left: 6px; }
.repnav .rn-i { position: relative; padding: 7px 10px; margin: 1px 0; border-radius: 6px; cursor: pointer; font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.repnav .rn-i:hover { background: #e9f1f8; color: var(--es-blue); }
.repnav .rn-i.on { background: #fff; color: var(--es-blue); font-weight: 700; box-shadow: 0 1px 3px rgba(16,30,46,.12); }
.repnav .rn-i.on::before { content: ''; position: absolute; left: -7px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--es-orange); }
.repnav .rn-empty { padding: 16px; color: var(--mute); text-align: center; }
.repbody { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.repbody > .content { overflow: auto; flex: 1; }
.report table.grid tr.sub td { background: #f6f8fa; font-weight: 600; }
@media print { .repnav { display: none; } }

/* v0.6.0 – tiện ích */
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; max-width: 1100px; }
.tool-card { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; cursor: pointer; }
.tool-card:hover { border-color: var(--es-blue, #005ca1); box-shadow: 0 2px 8px rgba(0,92,161,.12); }
.tool-card svg { width: 26px; height: 26px; color: var(--es-blue, #005ca1); flex: none; }
.tool-card b { display: block; margin-bottom: 3px; }
.chk-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 12px; margin: 6px 0; }

/* v0.7.0 – danh sách chứng từ kiểu MISA */
table.grid tr.filter-row th { top: 34px; height: 28px; padding: 2px 4px; background: #f7f9fb; }
table.grid input.colf { width: 100%; height: 22px; border: 1px solid #d5dde5; border-radius: 3px; padding: 0 5px; font-size: 12px; background: #fff; }
table.grid input.colf:focus { outline: none; border-color: var(--es-blue, #005ca1); }
.list-detail .grid-wrap:first-child { flex: 3; }
.detail-pane { flex: 2; min-height: 140px; display: flex; flex-direction: column; border-top: 3px solid #dfe6ee; background: #fff; }
.detail-pane .detail-t { padding: 5px 12px; font-size: 12px; background: #eef4fa; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.detail-pane .grid-wrap { flex: 1; }

/* v0.10.0 – kiểm tra sổ sách, tìm nhanh */
.kt-row { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; background: #fff; }
.kt-row .kt-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; }
.kt-row .kt-ic { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: #2e9b57; font-size: 12px; flex: none; }
.kt-row.loi .kt-ic { background: #d64545; } .kt-row.canh_bao .kt-ic { background: #e69a1d; }
.kt-row .kt-det { padding: 0 12px 10px; max-height: 260px; overflow: auto; }
.chip.red { background: #fde8e8; color: #b42318; }
.qf-list { margin-top: 8px; max-height: 50vh; overflow: auto; }
.qf-i { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.qf-i.on, .qf-i:hover { background: #e1eef8; }

/* v0.12.0 – biên bản đối chiếu công nợ (xem trên màn hình) */
.report.bbdc { font-family: 'Times New Roman', serif; font-size: 14px; }
.report.bbdc .hd { display: flex; justify-content: space-between; } .report.bbdc .hd .r { text-align: center; }
.report.bbdc h1 { text-align: center; font-size: 18px; margin: 14px 0 2px; }
.report.bbdc .c { text-align: center; } .report.bbdc .i { font-style: italic; } .report.bbdc .n { text-align: right; } .report.bbdc .ln { margin: 5px 0; }
.report.bbdc table { width: 100%; border-collapse: collapse; margin: 8px 0; } .report.bbdc td, .report.bbdc th { border: 1px solid #555; padding: 3px 6px; }
.report.bbdc .sig { display: flex; justify-content: space-around; text-align: center; margin: 20px 0 60px; } .report.bbdc .sig b, .report.bbdc .sig i { display: block; }

/* v0.19.0 – nhắc việc */
.nhac-viec { display: grid; gap: 6px; max-width: 900px; margin-bottom: 8px; }
.nv-i { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.nv-i:hover { border-color: var(--es-blue, #005ca1); }
.nv-i .kt-ic { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: #e69a1d; font-size: 12px; flex: none; }
.nv-i.loi .kt-ic { background: #d64545; } .nv-i.thong_tin .kt-ic { background: #005ca1; }

.sig-row { display: flex; justify-content: space-around; text-align: center; margin: 18px 0 40px; }

/* v0.39 thanh công cụ chứng từ kiểu MISA */
.ct-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: #f7f9fc; flex: none; flex-wrap: wrap; }
.ct-toolbar .btn { height: 30px; padding: 0 10px; }
.ct-toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.win.che-do-xem .win-body input:disabled, .win.che-do-xem .win-body select:disabled, .win.che-do-xem .win-body textarea:disabled { background: #fff; color: var(--ink, #1f2a36); opacity: 1; cursor: default; -webkit-text-fill-color: currentColor; }
.chip.orange { background: #fff4e0; color: #b46f00; }
/* v0.39: chứng từ bỏ ghi / chưa ghi sổ – chữ vàng ES để phân biệt */
tr.unposted td, tr.unposted td a, tr.unposted td .link { color: #f0aa1d !important; font-weight: 600; }
tr.unposted.sel td, tr.unposted.sel td a { color: #c98800 !important; }
tr.unposted td .chip { color: #b46f00 !important; background: #fff4e0; }
/* v0.39: Báo cáo – giao diện như MISA SME */
.bc-thanh { display: flex; align-items: flex-end; gap: 2px; padding: 0 16px; background: #fff; border-bottom: 2px solid var(--es-blue); flex: none; }
.bc-thanh .sp { flex: 1; }
.bc-tab { padding: 9px 18px; cursor: pointer; font-weight: 600; color: var(--mute); border-radius: 6px 6px 0 0; user-select: none; }
.bc-tab:hover { color: var(--es-blue); background: #eef4fa; }
.bc-tab.on { background: var(--es-blue); color: #fff; }
.bc-tim { width: 320px; height: 32px; margin: 6px 0; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; outline: none; }
.bc-tim:focus { border-color: var(--es-blue); box-shadow: 0 0 0 3px rgba(0,92,161,.12); }
.bc-wrap { display: flex; flex: 1; min-height: 0; }
.bc-trai { width: 250px; flex: none; border-right: 1px solid var(--line); background: #fff; overflow-y: auto; padding: 8px 0; }
.bc-nhom { display: flex; align-items: center; gap: 10px; padding: 9px 16px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.bc-nhom svg { width: 18px; height: 18px; color: var(--es-blue); flex: none; }
.bc-nhom:hover { background: #eef4fa; }
.bc-nhom.on { background: #fdf1d9; font-weight: 700; box-shadow: inset 3px 0 0 var(--es-orange); }
.bc-giua { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 28px 28px; background: #f2f5f9; }
.bc-tieude { font-size: 24px; font-weight: 800; margin: 0 0 16px; color: var(--ink); }
.bc-khung { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 18px; }
.bc-luoi { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; }
.bc-the { display: flex; align-items: center; gap: 8px; min-height: 52px; border-bottom: 1px solid var(--line-2); }
.bc-ten { flex: 1; cursor: pointer; font-size: 13.5px; line-height: 1.35; padding: 8px 0; }
.bc-ten:hover { color: var(--es-blue); text-decoration: underline; }
.bc-nut { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--es-blue); display: grid; place-items: center; font-size: 19px; line-height: 1; }
.bc-nut svg { width: 18px; height: 18px; }
.bc-nut:hover { background: #eef4fa; }
.bc-nut.sao { color: #9aa6b2; } .bc-nut.sao.on { color: var(--es-orange); }
@media (max-width: 1100px) { .bc-luoi { grid-template-columns: 1fr; } }
.win.full.baocao { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
.overlay:has(> .win.baocao) { padding: 0; align-items: stretch; justify-content: stretch; }
.bc-win { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.win.baocao .win-body { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.bc-win > .content { flex: 1; overflow: auto; background: #e9edf2; }
.bc-win > .content { display: block; padding: 12px; }
/* trang báo cáo giãn theo bảng (không để bảng tràn ra ngoài), tối thiểu bằng bề ngang cửa sổ (tối đa 1400) – bảng rộng thì cuộn ngang từ mép trái */
.bc-win > .content .report { background: #fff; box-sizing: border-box; width: fit-content; min-width: min(100%, 1400px); max-width: none; margin: 0 auto; box-shadow: 0 1px 6px rgba(16,30,46,.15); padding: 28px 36px; }
.bc-win > .content .report > * { max-width: none; }
.bc-win > .toolbar { position: sticky; top: 0; z-index: 2; }
@media print {
  body:has(.win.baocao) > *:not(.overlay) { display: none !important; }
  .overlay:has(.win.baocao) { position: static; background: none; }
  .win.baocao { box-shadow: none; width: auto; height: auto; }
  .win.baocao .win-title, .win.baocao .toolbar { display: none !important; }
  .bc-win > .content { background: #fff; overflow: visible; } .bc-win > .content .report { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}
/* v0.39: chữ trong bảng báo cáo được xuống dòng như MISA (tên khách, diễn giải…), số giữ 1 dòng → báo cáo vừa bề ngang màn hình */
.report table.grid td { white-space: normal; overflow: visible; text-overflow: clip; height: auto; padding-top: 3px; padding-bottom: 3px; }
.report table.grid td.num, .report table.grid th.num { white-space: nowrap; }

/* v0.41 – ô chọn như MISA: nút + (thêm nhanh) và ▾ (danh sách) */
.cb-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.cb-wrap > input { width: 100%; }
.cb-wrap.b1 > input { padding-right: 22px !important; }
.cb-wrap.b2 > input { padding-right: 42px !important; }
.cb-btns { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: flex; gap: 1px; z-index: 1; }
.cb-btn { width: 19px; height: 19px; border: 0; padding: 0; border-radius: 3px; background: transparent; color: var(--es-blue); font-size: 13px; line-height: 19px; cursor: pointer; font-weight: 700; }
.cb-btn.down { color: #4b5563; font-size: 11px; }
.cb-btn:hover { background: #dde8f3; }
/* trong lưới: chỉ hiện nút khi rê chuột / đang nhập ô, không chiếm chỗ chữ */
td .cb-wrap .cb-btns { visibility: hidden; background: #fff; border-radius: 3px; }
td:hover .cb-wrap .cb-btns, td .cb-wrap:focus-within .cb-btns { visibility: visible; }
td .cb-wrap.b1 > input, td .cb-wrap.b2 > input { padding-right: 4px !important; }
.toolbar .cb-wrap, .tbar .cb-wrap { display: inline-block; width: auto; vertical-align: middle; }
.menu a.dis { color: #8c8c8c; cursor: default; }
.menu a .kb { float: right; margin-left: 28px; color: #4a4a4a; font-size: 11.5px; }

/* v0.43 – lịch chọn ngày (tiếng Việt, tuần bắt đầu Thứ Hai) */
.lich-pop { position: fixed; z-index: 85; background: #fff; border: 1px solid #b9cfe2; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); width: 262px; padding: 8px; font-size: 12.5px; user-select: none; }
.lich-h { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.lich-h select { flex: 1; height: 26px; border: 1px solid var(--line); border-radius: 4px; font-size: 12.5px; padding: 0 4px; }
.lich-h button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--es-blue); }
.lich-pop table { width: 100%; border-collapse: collapse; }
.lich-pop th { font-size: 11.5px; color: var(--ink-2); font-weight: 600; padding: 3px 0; text-align: center; }
.lich-pop td { text-align: center; padding: 5px 0; cursor: pointer; border-radius: 4px; }
.lich-pop td:hover { background: #e6eef6; }
.lich-pop td.ngoai { color: #b0b7bf; }
.lich-pop td.cn { color: #c0392b; }
.lich-pop td.hn { outline: 1px solid #f0aa1d; font-weight: 700; }
.lich-pop td.on { background: var(--es-blue); color: #fff; font-weight: 700; }
.lich-f { text-align: center; margin-top: 6px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.lich-f a { color: var(--es-blue); cursor: pointer; font-weight: 600; }

/* v0.44 – chứng từ ở chế độ xem / đã ghi sổ: ô chỉ đọc vẫn chọn & sao chép được */
.che-do-xem input[readonly], .che-do-xem textarea[readonly] { background: #f7f8fa; color: var(--ink); cursor: text; }
.che-do-xem input[readonly]:focus { outline: none; box-shadow: none; border-color: #b9cfe2; }
.che-do-xem .cb-btns { display: none; }

/* v0.45 – số dư đầu kỳ chế độ xem; tìm kiếm chứng từ */
.che-do-xem td.act button { visibility: hidden; }
.tim-ct .tim-tren { display: flex; gap: 12px; align-items: stretch; margin-bottom: 10px; flex-wrap: wrap; }
.tim-ct fieldset { border: 1px solid #c9d6e3; border-radius: 6px; padding: 8px 12px; margin: 0; background: #fff; }
.tim-ct legend { font-weight: 700; color: #005ca1; padding: 0 4px; }
.tim-ct .tim-chon { min-width: 340px; }
.tim-ct .tim-da { flex: 1; min-width: 420px; }
.tim-ct .tim-dong, .tim-ct .tim-gt { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.tim-ct .tim-dong label, .tim-ct .tim-gt label { width: 72px; color: #555; }
.tim-ct .tim-dong .input, .tim-ct .tim-gt .input { width: 220px; }
.tim-ct .tim-nut { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.tim-ct .tim-ds { max-height: 170px; overflow: auto; }
.tim-ct .tim-ds tr.on td { background: #fdecc8; }
.tim-ct .tim-radio { display: flex; gap: 14px; }
.tim-ct .tim-luoi { overflow: auto; max-height: 56vh; }
.tim-ct .tim-luoi td { white-space: nowrap; }
/* v0.48 – lấy hóa đơn từ trang tải hóa đơn */
.hw-bar { height: 8px; background: #e8eef5; border-radius: 4px; overflow: hidden; margin: 6px 0; }
.hw-bar i { display: block; height: 100%; width: 0; background: #005ca1; transition: width .3s; }
.hw-log { max-height: 180px; min-height: 60px; overflow: auto; font-size: 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.hd-tong { display: flex; gap: 8px; padding: 8px 14px; flex-wrap: wrap; background: #f5f8fb; border-bottom: 1px solid var(--line); }
.hd-tong .hd-o { min-width: 120px; padding: 6px 10px; border: 1px solid #d6e2ee; border-radius: 6px; background: #fff; cursor: pointer; }
.hd-tong .hd-o:hover { border-color: #005ca1; }
.hd-tong .hd-o.on { border-color: #005ca1; box-shadow: inset 0 -3px 0 #005ca1; }
.hd-tong .hd-o.warn b { color: #b42318; }
.hd-tong .k { font-size: 11.5px; color: #666; }
.hd-tong b { font-size: 16px; color: #005ca1; margin-right: 6px; }
.hd-tong .v { font-size: 11.5px; color: #333; }
/* nút Hiện / Ẩn mật khẩu */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; padding-right: 46px !important; box-sizing: border-box; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #005ca1; font-size: 12px; cursor: pointer; padding: 2px 6px; }
.pw-eye:hover { text-decoration: underline; }
/* v0.49 – bộ lọc + sắp xếp như MISA trên mọi lưới */
table.grid tr.filter-row th { position: sticky; }
.loc-o { display: flex; align-items: center; gap: 2px; min-width: 60px; }
.loc-o .colf { flex: 1; min-width: 30px; }
.loc-op, .loc-ds { border: 1px solid #d5dde5; background: #fff; border-radius: 3px; height: 22px; min-width: 20px; padding: 0 3px; font-size: 11px; color: #005ca1; cursor: pointer; flex: none; }
.loc-ds.on { background: #005ca1; color: #fff; }
table.grid th.sap-duoc { cursor: pointer; user-select: none; }
table.grid th.sap-tang::after { content: ' ▲'; font-size: 9px; color: #005ca1; }
table.grid th.sap-giam::after { content: ' ▼'; font-size: 9px; color: #005ca1; }
table.grid.dang-loc tr.filter-row th { background: #fff7e0; }
.loc-pop { position: fixed; z-index: 3000; width: 310px; background: #fff; border: 1px solid #c9d6e3; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px; }
.loc-pop .colf { width: 100%; height: 26px; border: 1px solid #d5dde5; border-radius: 3px; padding: 0 6px; }
.loc-pop-ds { max-height: 300px; overflow: auto; margin: 6px 0; }
.loc-pop-ds label { display: block; padding: 2px 4px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.loc-pop-ds label:hover { background: #f0f5fa; }
.loc-pop-ft { display: flex; justify-content: flex-end; gap: 6px; }
/* v0.50 – hóa đơn đã hạch toán / bỏ qua: làm mờ, vẫn hiện trong danh sách */
.grid tr.da-ht td { color: #6e7781; }
.grid tr.da-ht td .chip { opacity: .85; }
.grid tr.da-ht:hover td { color: inherit; }
.grid tr.da-ht.sel td { color: inherit; }

/* v0.53 – chữ đậm, đen như MISA */
table.grid, table.edit, table.edit td input, table.edit td select { color: #000; }
table.grid th, table.edit th { color: #000; font-weight: 600; }
.field input, .field select, .field textarea, .input { color: #000; }
.toolbar, .page-head, .tab { color: #000; }
.tab.on { color: var(--es-blue); }
/* v0.53 – ô MST có nút tra cứu */
.mst-o { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mst-row { display: flex; gap: 4px; }
.mst-row > input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; background: #fff; outline: none; color: #000; }
.mst-row > input:focus { border-color: var(--es-blue); box-shadow: 0 0 0 3px rgba(0,92,161,.12); }
.mst-row > input:disabled { background: #f4f5f7; }
.btn.mst-tra { height: 34px; width: 36px; padding: 0; justify-content: center; color: var(--es-blue); border-color: #b9cfe2; }
.btn.mst-tra svg { width: 17px; height: 17px; }
.btn.mst-tra.quay svg { animation: mstquay 1s linear infinite; }
@keyframes mstquay { to { transform: rotate(360deg); } }
.mst-tt { font-size: 11.5px; line-height: 1.3; min-height: 0; }
.mst-tt:empty { display: none; }
.mst-ok { color: var(--ok); }

/* =====================================================================
   v0.54 – GIAO DIỆN NHƯ MISA SME 2026 (đo màu từ MISA SME 2026 R6)
   Nền #d7e1fa · dải tab #5d6b98, tab chọn cam · tiêu đề lưới #c1cef8 · dòng chọn #fdf4cb
   ===================================================================== */
:root { --m-bg: #d7e1fa; --m-bg2: #e3eafc; --m-strip: #5d6b98; --m-title: #6a7cab; --m-head: #c1cef8; --m-line: #b3c1e4; --m-cell: #dfe3ea;
  --m-sel: #fdf4cb; --m-sel-b: #e4c86b; --m-tab: #f6cf6a; --m-tab-b: #d9a933; --m-ro: #f0f0f0; --m-add: #ffffe0; --m-sum: #f0f0f0; --row-h: 22px; }
body { font: 400 12px/1.3 Tahoma, 'Segoe UI', Arial, sans-serif; }
.btn { height: 24px; padding: 0 8px; border-radius: 2px; border: 1px solid #9fb0d8; background: linear-gradient(#fdfdff, #e6ecfb); font-weight: 400; gap: 4px; }
.btn:hover { background: linear-gradient(#fff8e1, #fde7a8); border-color: #e2b84a; }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: linear-gradient(#5f86c9, #3a62a8); border-color: #34579a; color: #fff; }
.btn.primary:hover { background: linear-gradient(#6f95d6, #4570b8); border-color: #34579a; }
.input, .field input, .field select, .field textarea { height: 22px; border: 1px solid var(--m-line); border-radius: 0; padding: 0 4px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #e2b84a; box-shadow: none; background: #fffef3; }

/* ---- trang danh sách: dải tab xanh xám, tab chọn cam như MISA ---- */
.page-head { background: var(--m-strip); border: 0; height: 22px; padding: 0 0 0 4px; align-items: stretch; }
.page-head h1 { display: none; }
.page-head .tab { height: 22px; padding: 0 9px; color: #fff; font-weight: 400; border: 0; font-size: 12px; }
.page-head .tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.page-head .tab.on { background: var(--m-tab); color: #000; font-weight: 700; border-bottom: 2px solid var(--m-tab-b); }
.toolbar { background: var(--m-bg); border-bottom: 1px solid var(--m-line); padding: 2px 4px; gap: 2px; }
.toolbar .btn, .tbar .btn { border-color: transparent; background: transparent; height: 22px; padding: 0 5px; }
.toolbar .btn:hover, .tbar .btn:hover { border-color: #e2b84a; background: linear-gradient(#fff8e1, #fde7a8); }
.toolbar .btn.primary { color: #000; }
.toolbar .btn svg { color: #2d5ea8; }
.toolbar .btn.danger svg, .toolbar .btn[data-ic=xoa] svg { color: #c8382b; }
.toolbar .search input { height: 22px; width: 200px; }
.toolbar .search svg { top: 4px; width: 14px; height: 14px; }
.m-loc { display: flex; align-items: center; gap: 6px; padding: 3px 8px; background: var(--m-bg); border-bottom: 1px solid var(--m-line); flex: none; flex-wrap: wrap; }
.m-loc label { margin-left: 6px; }
.m-loc select, .m-loc input { height: 21px; border: 1px solid var(--m-line); background: #fff; padding: 0 3px; }
.m-loc .btn { height: 22px; background: linear-gradient(#f4f7ff, #d8e2fb); border-color: #8fa3d3; }
.m-loc .sp { flex: 1; }
.content.flush { background: var(--m-bg); }

/* ---- lưới như MISA ---- */
table.grid { font-size: 12px; }
table.grid th { background: var(--m-head); color: #000; font-weight: 400; height: 21px; padding: 0 4px; border-bottom: 1px solid #9fb0d8; border-right: 1px solid #9fb0d8; text-align: center; }
table.grid th.num { text-align: center; }
table.grid td { height: var(--row-h); padding: 0 4px; border-bottom: 1px solid var(--m-cell); border-right: 1px solid var(--m-cell); }
table.grid tbody tr:nth-child(even) td { background: #fff; }
table.grid tbody tr:hover td { background: #fffbe6; }
table.grid tbody tr.sel td { background: var(--m-sel) !important; border-top: 1px solid var(--m-sel-b); border-bottom: 1px solid var(--m-sel-b); }
table.grid tfoot td { background: var(--m-sum); font-weight: 400; height: 21px; border-top: 1px solid #c9cdd4; padding: 0 4px; }
table.grid tr.filter-row th { top: 21px; height: 19px; padding: 0 1px; background: #fff; border-bottom: 1px solid #c9cdd4; }
table.grid input.colf { height: 18px; border: 0; border-radius: 0; font-size: 12px; }
table.grid .link { color: inherit; font-weight: 400; }
.grid-wrap { background: #fff; }
.gridinfo { display: none; }
.list-detail .grid-wrap:first-child { flex: 3; border-bottom: 1px solid var(--m-line); }
.detail-pane { border-top: 4px solid var(--m-bg); background: var(--m-bg); }
.detail-pane .detail-t { background: transparent; border: 0; padding: 0 0 0 2px; height: 20px; display: flex; align-items: flex-end; }
.detail-pane .detail-t .m-tab1 { background: var(--m-tab); border: 1px solid var(--m-tab-b); border-bottom: 0; padding: 2px 10px; font-weight: 700; text-decoration: underline; color: #000; }
.detail-pane .detail-t .muted { margin-left: 10px; font-size: 11px; }
tr.unposted td, tr.unposted td a, tr.unposted td .link { color: #2a9a3c !important; font-weight: 400; }
tr.unposted.sel td, tr.unposted.sel td a { color: #1f7f2f !important; }
tr.unposted td .chip { color: #1f7f2f !important; background: transparent; }
table.grid .chip { background: transparent !important; padding: 0; font-weight: 400; font-size: 12px; color: inherit; letter-spacing: 0; }

/* ---- cửa sổ chứng từ như MISA: thanh tiêu đề, kéo, phóng to, nhớ kích thước ---- */
.overlay.m-ov { background: transparent; align-items: flex-start; justify-content: flex-start; }
.overlay.m-ov + .overlay.m-ov, .overlay.m-ov.m-ov2 { background: rgba(0,0,0,.08); }
.win.m-win { border-radius: 0; box-shadow: 0 6px 24px rgba(0,0,0,.35); border: 1px solid #56679a; background: var(--m-bg); position: absolute; max-width: none; max-height: none; animation: none; min-width: 520px; min-height: 320px; }
.win.m-win.m-max { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border: 0; }
.win.m-win > .win-title { height: 24px; background: linear-gradient(#7486b5, #5d6e9f); color: #fff; padding: 0 0 0 6px; border: 0; gap: 6px; cursor: default; user-select: none; }
.win.m-win > .win-title h3 { font-size: 12px; font-weight: 400; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win.m-win > .win-title .chip { display: none; }
.win.m-win > .win-title .x, .win.m-win > .win-title .m-mx { width: 30px; height: 24px; color: #fff; font-size: 15px; border-radius: 0; background: transparent; border: 0; cursor: pointer; }
.win.m-win > .win-title .x:hover { background: #d9443a; color: #fff; }
.win.m-win > .win-title .m-mx:hover { background: rgba(255,255,255,.18); }
.win.m-win > .win-body { padding: 4px 8px 4px; background: var(--m-bg); }
.win.m-win > .win-foot { background: var(--m-bg); border-top: 0; padding: 4px 10px 6px; border-radius: 0; }
.win.m-win .m-grip { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #8a99c4 50%, #8a99c4 60%, transparent 60%, transparent 70%, #8a99c4 70%, #8a99c4 80%, transparent 80%); }
.win.m-win.m-max .m-grip { display: none; }
.win.m-win .m-hint { height: 18px; line-height: 18px; padding: 0 6px; font-size: 11px; background: var(--m-bg); border-top: 1px solid #c5d1f2; color: #000; flex: none; }

/* thanh công cụ chứng từ: biểu tượng trên – chữ dưới */
.win.m-win .ct-toolbar { background: linear-gradient(#e9effc, #c9d6f3); border-bottom: 1px solid #a9b9e0; padding: 1px 4px; gap: 0; flex-wrap: nowrap; overflow-x: auto; }
.win.m-win .ct-toolbar .btn { flex-direction: column; height: 40px; min-width: 38px; padding: 2px 5px; gap: 1px; border: 1px solid transparent; background: transparent; font-size: 12px; justify-content: center; }
.win.m-win .ct-toolbar .btn svg { width: 18px; height: 18px; color: #2d6ac4; }
.win.m-win .ct-toolbar .btn:hover { border-color: #e2b84a; background: linear-gradient(#fff8e1, #fde7a8); }
.win.m-win .ct-toolbar .btn:disabled { opacity: .38; }
.win.m-win .ct-toolbar .btn.primary, .win.m-win .ct-toolbar .btn.accent { color: #000; background: transparent; border-color: transparent; }
.win.m-win .ct-toolbar .btn[data-k=dong] svg, .win.m-win .ct-toolbar .btn[data-k=xoa] svg, .win.m-win .ct-toolbar .btn[data-k=boGhi] svg { color: #d23c3c; }
.win.m-win .ct-toolbar .btn[data-k=ghi] svg { color: #2a9a3c; }
.win.m-win .ct-toolbar .sep { width: 1px; height: 34px; background: #a9b9e0; margin: 0 3px; }
.win.m-win .ct-toolbar .es-g { display: flex; align-items: center; margin-left: 6px; padding-left: 6px; border-left: 1px solid #a9b9e0; gap: 2px; }
.m-cthead { display: flex; align-items: center; gap: 14px; padding: 2px 2px 4px; }
.m-cthead h2 { margin: 0; font-size: 17px; font-weight: 700; color: #000; white-space: nowrap; }
.m-cthead .sp { flex: 1; }
.m-stamp { border: 2px solid #c8102e; color: #c8102e; font-weight: 700; padding: 1px 12px; font-size: 12px; letter-spacing: .3px; background: transparent; }
.m-stamp.xanh { border-color: #2a9a3c; color: #2a9a3c; }
.m-stamp.xam { border-color: #8f8f8f; color: #6f6f6f; }

/* thân chứng từ: nhãn bên trái, ô bên phải, khung nhóm như MISA */
.win.m-win .vhead { grid-template-columns: 1fr 190px; gap: 8px; padding: 0; border: 0; margin-bottom: 4px; }
.win.m-win .vhead > div:first-child, .win.m-win .vhead .right { position: relative; border: 1px solid var(--m-line); border-radius: 0; background: #dde6fb; padding: 14px 8px 6px; margin-top: 6px; }
.win.m-win .vhead > div:first-child::before, .win.m-win .vhead .right::before { content: 'Thông tin chung'; position: absolute; top: -8px; left: 6px; background: var(--m-bg); padding: 0 3px; font-weight: 700; color: #000; }
.win.m-win .vhead .right::before { content: 'Chứng từ'; }
.win.m-win .vhead .form-grid { gap: 3px 10px; }
.win.m-win .vhead .field, .win.m-win .vhead .right .field { flex-direction: row; align-items: center; gap: 4px; margin: 0 0 3px; }
.win.m-win .vhead .field > label { flex: none; width: 92px; font-size: 12px; font-weight: 400; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win.m-win .vhead .right .field > label { width: 82px; }
.win.m-win .vhead .field > input, .win.m-win .vhead .field > select, .win.m-win .vhead .field > .cb-wrap, .win.m-win .vhead .field > div { flex: 1; min-width: 0; }
.win.m-win .vhead .field input, .win.m-win .vhead .field select { height: 21px; font-size: 12px; }
.win.m-win .vhead .right .field input { font-weight: 400; }
.win.m-win .hdgroup { border: 1px solid var(--m-line); border-radius: 0; background: #dde6fb; margin-top: 10px; }
.win.m-win .hdcap { background: var(--m-bg); color: #000; font-size: 12px; }
.win.m-win.che-do-xem .win-body input:disabled, .win.m-win.che-do-xem .win-body select:disabled, .win.m-win.che-do-xem .win-body textarea:disabled,
.win.m-win.che-do-xem .win-body input[readonly], .win.m-win.che-do-xem .win-body textarea[readonly] { background: var(--m-ro); color: #000; }
.win.m-win .tabs { border-bottom: 1px solid var(--m-line) !important; margin: 4px 0 0 !important; gap: 1px; }
.win.m-win .tabs .tab { height: 20px; padding: 0 9px; font-weight: 400; color: #000; border: 1px solid var(--m-line); border-bottom: 0; background: #e8eefc; font-size: 12px; }
.win.m-win .tabs .tab.on { background: var(--m-tab); border-color: var(--m-tab-b); font-weight: 700; text-decoration: underline; }
.win.m-win .section-t { color: #000; font-weight: 700; margin: 4px 0 2px; }
table.edit th { background: var(--m-head); color: #000; font-weight: 400; height: 21px; border: 1px solid #9fb0d8; padding: 0 4px; text-align: center; }
table.edit td { height: 22px; border: 1px solid var(--m-cell); background: #fff; }
table.edit tr.m-add td { background: var(--m-add); color: #333; height: 20px; cursor: pointer; }
.win.m-win .win-foot .total { font-weight: 700; font-size: 12px; color: #000; display: grid; grid-template-columns: 140px 110px; text-align: left; }
.win.m-win .win-foot .total b { color: #000; font-size: 12px; margin: 0; text-align: right; font-weight: 400; }
.toolbar .m-vach { width: 1px; height: 18px; background: #a9b9e0; margin: 0 4px; }
.win.m-win .optbar.m-inhead { background: transparent; border: 0; padding: 0; margin: 0; gap: 8px; flex: 1; }
.win.m-win .optbar select, .win.m-win .optbar input { height: 21px; border: 1px solid var(--m-line); border-radius: 0; padding: 0 3px; font-size: 12px; }
.win.m-win .optbar select:first-child { font-weight: 400; color: #000; min-width: 210px; }
.win.m-win .vhead { grid-template-columns: 1fr 240px; }
.win.m-win .vhead .right .field > label { width: 84px; }
.win.m-win .addrow { margin: 0; }
.win.m-win .addrow .btn { width: 100%; justify-content: flex-start; height: 20px; border: 1px solid var(--m-cell); border-top: 0; background: var(--m-add); color: #333; border-radius: 0; font-size: 0; padding: 0 6px; }
.win.m-win .addrow .btn svg { display: none; }
.win.m-win .addrow .btn::before { content: 'Bấm vào đây để thêm mới'; color: #333; font-size: 12px; }
.win.m-win .addrow .btn:hover { background: #fff3b8; border-color: #e2b84a; }
.win.m-win .win-foot { display: grid; grid-template-columns: repeat(2, 300px); justify-content: end; gap: 3px 40px; }
.win.m-win .win-foot .sp { display: none; }
.win.m-win .win-foot .total { grid-template-columns: 160px 1fr; }
.win.m-win .win-foot .total b, .win.m-win .win-foot .total span { text-align: right; }
/* ô chọn nhiều cột như MISA */
.combo-pop { border: 1px solid #8fa3d3; border-radius: 0; box-shadow: 2px 3px 8px rgba(0,0,0,.25); min-width: 420px; max-width: 900px; font-size: 12px; }
.combo-pop th { background: var(--m-head); color: #000; font-weight: 400; padding: 2px 6px; font-size: 12px; border-right: 1px solid #9fb0d8; }
.combo-pop td { padding: 2px 6px; border-top: 0; border-right: 1px solid #eef0f4; max-width: 260px; overflow: hidden; text-overflow: ellipsis; height: 19px; }
.combo-pop tr.on td { background: #3399ff; color: #fff; }
.combo-pop tbody tr:hover td { background: #dbe8ff; }
.cb-btn { border-radius: 0 !important; }
.cb-btn.add { color: #2d6ac4 !important; font-weight: 700; }
.cb-btn.down { background: #f6cf6a !important; color: #000 !important; }
.win.m-win .section-t.m-ht { border-bottom: 1px solid var(--m-line); margin: 6px 0 0; gap: 12px; }
.win.m-win .m-httab { background: var(--m-tab); border: 1px solid var(--m-tab-b); border-bottom: 0; padding: 2px 10px; text-decoration: underline; }
.overlay.m-ov, .win.m-win { animation: none !important; }

/* v0.54b – theo anh Linh: thanh tiêu đề cửa sổ + tiêu đề cột lưới màu xanh ES; nền xanh MISA nhạt hơn 1 tông */
:root { --m-bg: #e6edfd; --m-head: #005ca1; }
.win.m-win > .win-title { background: #005ca1; }
.win.m-win > .win-title .m-mx:hover { background: #004a82; }
table.grid th, table.edit th, .combo-pop th { background: #005ca1 !important; color: #fff !important; border-right-color: #2f7bb5 !important; border-bottom-color: #004a82 !important; }
table.grid th.sap-tang::after, table.grid th.sap-giam::after { color: #fff; }
table.grid tr.filter-row th { background: #fff !important; color: #000 !important; border-right-color: var(--m-cell) !important; border-bottom-color: #c9cdd4 !important; }
table.grid th .pin, table.edit th .pin { color: #fff; }
.win.m-win .vhead > div:first-child, .win.m-win .vhead .right, .win.m-win .hdgroup { background: #eef3fe; }
.win.m-win .ct-toolbar { background: linear-gradient(#f3f6fe, #dbe4f8); }
.win.m-win .tabs .tab { background: #f1f5fe; }
.m-loc, .toolbar { background: var(--m-bg); }
.m-loc .btn.primary { background: linear-gradient(#2f7bc0, #005ca1); border-color: #004a82; color: #fff; }
/* v0.58b – ô đang chọn để copy (Ctrl+C / chuột phải → Copy) */
table td.o-chon { outline: 2px solid #005ca1; outline-offset: -2px; }
table.grid td { -webkit-user-select: text; user-select: text; }
/* v0.58c – dòng chứng từ theo ĐVT chuyển đổi */
tr.dong-cd > td.idx { box-shadow: inset 3px 0 0 #f0aa1d; }
table.bang-dvcd td input, table.bang-dvcd td select { width: 100%; box-sizing: border-box; min-width: 0; }
table.bang-dvcd th { white-space: normal; line-height: 1.2; }
/* v0.62 – chọn nhiều ô & thanh tổng (như MISA / Excel) */
table td.o-nhieu { background: #dbeafb !important; box-shadow: inset 0 0 0 1px #6aa3d8; }
.o-tong { position: fixed; right: 14px; bottom: 30px; z-index: 90; background: #fff; border: 1px solid #b9cfe2; border-radius: 6px; padding: 5px 12px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0,0,0,.15); color: #1f2937; }
.o-tong b { color: #005ca1; }
/* v0.65 – Số dư đầu kỳ như MISA */
.sdd-luu-y { background: #fff8e6; border: 1px solid #f0aa1d; border-radius: 4px; padding: 6px 10px; margin: 0 0 8px; font-size: 12.5px; }
.sdd-hd { border: 1px solid #c9d6e3; border-radius: 4px; padding: 8px 12px; margin: 0 0 8px; display: grid; gap: 6px; background: #f6f9fc; }
.sdd-hd .tabs-mini span { display: inline-block; padding: 4px 12px; background: #f0aa1d; color: #fff; border-radius: 4px 4px 0 0; font-weight: 600; font-size: 12.5px; }
.sdd-trong { text-align: center; padding: 80px 20px; color: #374151; }
.sdd-trong .btn { margin: 0 6px; }
table.sdd-xem tbody tr { cursor: default; }
table.sdd-xem tbody tr.on td, table.edit tbody tr.on td { background: #fde9b8; }
table.edit tr.loc-dong th { background: #fff; padding: 2px 3px; }
table.edit tr.loc-dong input { height: 22px; font-size: 12px; border: 1px solid #d5dde6; }
