:root { --ink: #15202B; --muted: #56616B; --line: #E2E6E4; --line2: #EEF1EF; --bg: #F4F6F5; --accent: #0E6E66; --accent-d: #0A5A53; --warn: #9A3412; --ok: #1F6B35; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-size: 15px; }
a { color: var(--accent); }
h2 { margin: 0; font-size: 22px; } h3 { margin: 0; font-size: 16px; }
.hidden { display: none !important; }
.center { padding: 80px 20px; text-align: center; }
.muted { color: var(--muted); } .small { font-size: 13px; } .b { font-weight: 600; } .r { text-align: right; } .big { font-size: 22px; font-weight: 700; }
.c-warn { color: var(--warn); } .c-ok { color: var(--ok); }
.pad { padding: 12px; } .pad-y { padding: 10px 0; } .empty { padding: 16px 0; }

/* Khung */
.top { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--ink); color: #fff; }
.brand-sm { font-weight: 700; font-size: 17px; } .sub { font-size: 12px; color: #B9C4CC; }
.top-right { gap: 10px; } .who { font-size: 13px; color: #DCE3E8; }
.btn-ghost { font: inherit; font-size: 13px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid #4A5864; background: transparent; color: #E3E9ED; cursor: pointer; }
.kho-sel { background: #fff; min-height: 36px; } .kho-one { font-size: 13px; padding: 6px 12px; border: 1px solid #4A5864; border-radius: 999px; }
.layout { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px; max-width: 1440px; margin: 0 auto; align-items: flex-start; }
.side { flex: 1 1 190px; display: flex; flex-direction: column; gap: 2px; }
.nav { display: block; padding: 11px 14px; border-radius: 8px; color: #2B3640; text-decoration: none; font-size: 15px; }
.nav:hover { background: #E9EEEB; } .nav.on { background: #E3F2EF; color: #0B5650; font-weight: 700; }
.main { flex: 999 1 560px; min-width: 0; }
.page, .stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) { .side { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; } .nav { white-space: nowrap; } .layout { padding: 12px; gap: 12px; } }

/* Thành phần */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.hl { border-color: var(--accent); box-shadow: 0 0 0 2px #E3F2EF; }
.row { display: flex; gap: 6px; align-items: center; } .row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .row-wrap.end { align-items: flex-end; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.row-end { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.grow { flex: 1 1 240px; } .grow2 { flex: 2 1 480px; min-width: 0; } .w480 { max-width: 480px; width: 100%; } .full { grid-column: 1 / -1; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; } .cols > * { flex: 1 1 300px; min-width: 0; }
.cols-cart > .stack { flex: 3 1 440px; } .cols-cart > .cart { flex: 2 1 300px; position: sticky; top: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { gap: 4px; } .stat-v { font-size: 24px; font-weight: 700; }
.boxed { padding: 12px; border: 1px solid var(--accent); border-radius: 10px; } .boxed-soft { padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.summary { font-size: 13px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line2); align-items: baseline; }
.big-line { padding-top: 12px; border-top: 1px solid var(--line); border-bottom: 0; }
.steps { margin: 0; padding-left: 20px; line-height: 1.9; }

.btn { font: inherit; font-size: 14px; font-weight: 600; min-height: 42px; padding: 8px 14px; border-radius: 8px; border: 1px solid #CBD3CF; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { background: #F1F4F2; } .btn:disabled { opacity: .55; cursor: wait; }
.btn-p { background: var(--accent); border-color: var(--accent); color: #fff; } .btn-p:hover { background: var(--accent-d); }
.btn-lg { min-height: 50px; font-size: 16px; } .btn-sm { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.btn-unit { text-align: left; font-size: 13px; }
.chip { font: inherit; font-size: 13px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid #CBD3CF; background: #fff; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); } .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.inp { font: inherit; font-size: 15px; min-height: 42px; padding: 8px 10px; border: 1px solid #CBD3CF; border-radius: 8px; width: 100%; background: #fff; color: var(--ink); }
.inp:focus { outline: 2px solid #9FD3CC; border-color: var(--accent); } .inp-auto { width: auto; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #3D4852; font-weight: 500; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tag-tp { background: #E3F2EF; color: #0B5650; } .tag-ts { background: #E4EEF8; color: #1D4F86; } .tag-nl { background: #EEF0F1; color: #3D4852; }
.tag-ok { background: #E6F4EA; color: #1F6B35; } .tag-warn { background: #FBEADF; color: #9A3412; } .tag-blue { background: #E4EEF8; color: #1D4F86; }
.tag-gray { background: #EEF0F1; color: #3D4852; } .tag-purple { background: #F1E8FA; color: #5B2A82; } .tag-dark { background: #15202B; color: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabb { font: inherit; font-size: 15px; font-weight: 600; min-height: 44px; padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #3D4852; cursor: pointer; }
.tabb.on { border-bottom-color: var(--accent); color: #0B5650; }

.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tr { display: grid; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line2); align-items: center; font-size: 14px; min-width: 720px; }
.tr:last-child { border-bottom: 0; }
.th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #F8FAF9; }

.picker { position: relative; width: 100%; }
.dropdown { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid #CBD3CF; border-radius: 10px; box-shadow: 0 8px 24px rgba(21,32,43,.12); max-height: 320px; overflow-y: auto; z-index: 30; min-width: 260px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; font-size: 14px; min-height: 44px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line2); background: #fff; color: var(--ink); cursor: pointer; }
.opt:hover { background: #F1F4F2; } .opt.on { background: #E3F2EF; font-weight: 600; }
.list { border: 1px solid var(--line); border-radius: 10px; max-height: 480px; overflow-y: auto; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cart-line { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line2); }
.nhap-row { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line2); }
.dvb-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 10px; align-items: end; }
@media (max-width: 760px) { .nhap-row, .dvb-row { grid-template-columns: 1fr 1fr; } }
.qr-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; border-color: var(--accent); }
.qr { width: 200px; height: auto; border-radius: 8px; } .qr-empty { height: 160px; border: 2px dashed var(--accent); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; padding: 10px; color: #0B5650; }

.login-wrap { max-width: 420px; margin: 60px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.brand { font-size: 24px; font-weight: 700; text-align: center; }
.overlay { position: fixed; inset: 0; background: rgba(21,32,43,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.dialog { max-width: 380px; width: 100%; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center; max-width: min(640px, calc(100vw - 24px)); padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(21,32,43,.18); }
.toast-ok { background: #E6F4EA; color: #14532D; border: 1px solid #B7DFC3; } .toast-err { background: #FBEADF; color: #7C2D12; border: 1px solid #F0C5A8; }
