:root {
    --c-primary: #0b5c8c;
    --c-primary-dark: #08476d;
    --c-accent: #12a39a;
    --c-bg: #f3f6f9;
    --c-surface: #ffffff;
    --c-border: #dfe6ee;
    --c-text: #1f2d3d;
    --c-muted: #6b7a8c;
    --c-near: #ffe08a;
    --c-near-bg: #fff6d6;
    --c-expired-bg: #fde2e2;
    --c-done-bg: #d9f5df;
    --topbar-h: 56px;
    --sidebar-w: 236px;
}
body { background: var(--c-bg); color: var(--c-text); font-size: .925rem; }
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); background: linear-gradient(90deg, var(--c-primary-dark), var(--c-primary)); color: #fff; z-index: 1030; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.brand { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.15); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.brand-title { font-weight: 700; letter-spacing: .04em; font-size: .9rem; line-height: 1.1; }
.brand-sub { font-size: .72rem; opacity: .75; }
.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); background: var(--c-surface); border-right: 1px solid var(--c-border); overflow-y: auto; padding: .5rem 0 2rem; z-index: 1020; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); padding: .9rem 1.1rem .3rem; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .45rem 1.1rem; color: var(--c-text); text-decoration: none; border-left: 3px solid transparent; }
.nav-item:hover { background: #eef4f9; color: var(--c-primary); }
.nav-item.active { background: #e3eff8; color: var(--c-primary); border-left-color: var(--c-primary); font-weight: 600; }
.nav-item i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.nav-item kbd { margin-left: auto; font-size: .65rem; background: #e8edf2; color: var(--c-muted); padding: .1rem .3rem; }
.main { margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 1rem) 1.25rem 2rem; min-height: 100vh; }
.main-full { margin-left: 0; padding: 0; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 12px rgba(0,0,0,.1); }
    body.nav-open .sidebar { transform: none; }
    .main { margin-left: 0; padding-left: 1rem; padding-right: 1rem; }
}
.page-title { font-size: 1.3rem; font-weight: 700; color: var(--c-primary-dark); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-title .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.card { border: 1px solid var(--c-border); border-radius: 10px; box-shadow: 0 1px 2px rgba(16,40,70,.04); }
.card-header { background: #f8fafc; font-weight: 600; color: var(--c-primary-dark); border-bottom: 1px solid var(--c-border); }
.section-label { font-weight: 700; color: var(--c-primary-dark); font-size: .95rem; margin: .25rem 0 .5rem; }
.form-label { font-weight: 600; font-size: .82rem; color: #3b4b5c; margin-bottom: .2rem; }
.table { font-size: .86rem; }
.table thead th { background: #eef3f8; color: #34495e; font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; }
.table-wrap .table { margin: 0; }
tr.row-near > * { background: var(--c-near-bg) !important; }
tr.row-near td.exp-cell { background: var(--c-near) !important; font-weight: 600; }
tr.row-expired > * { background: var(--c-expired-bg) !important; color: #8a1c1c; }
tr.row-done > * { background: var(--c-done-bg) !important; }
tr.row-new > * { animation: flashrow 1.2s ease-out; }
@keyframes flashrow { from { background: #bfe3ff; } }
.scan-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; border: 2px solid var(--c-accent); }
.scan-input:focus { box-shadow: 0 0 0 .2rem rgba(18,163,154,.25); border-color: var(--c-accent); }
.badge-status { font-weight: 600; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.tile { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 1.2rem 1rem; text-align: center; text-decoration: none; color: var(--c-text); transition: transform .12s, box-shadow .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(11,92,140,.12); border-color: var(--c-primary); color: var(--c-primary); }
.tile i { font-size: 2.3rem; display: block; margin-bottom: .4rem; color: var(--c-primary); }
.tile .t-name { font-weight: 700; }
.tile .t-desc { font-size: .75rem; color: var(--c-muted); }
.alert-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.alert-pill { border-radius: 10px; padding: .75rem 1rem; color: #fff; text-decoration: none; display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.alert-pill .num { font-size: 1.5rem; line-height: 1; }
.alert-pill.red { background: #d64545; } .alert-pill.orange { background: #e8892b; } .alert-pill.green { background: #2c9f61; } .alert-pill.blue { background: var(--c-primary); }
.alert-pill:hover { filter: brightness(1.07); color: #fff; }
.toast-zone { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.app-toast { min-width: 280px; max-width: 420px; padding: .75rem 1rem; border-radius: 8px; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.18); font-weight: 500; }
.app-toast.success { background: #2c9f61; } .app-toast.danger { background: #c93636; } .app-toast.warning { background: #d9861f; } .app-toast.info { background: var(--c-primary); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: linear-gradient(135deg, var(--c-primary-dark), var(--c-accent)); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 3rem; }
.login-art h1 { font-weight: 800; font-size: 2rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
@media (max-width: 767.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { padding: 2rem; } }
.json-view { background: #0f1b2a; color: #d6e6f5; padding: .75rem; border-radius: 8px; font-size: .8rem; white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; }
.perm-matrix td, .perm-matrix th { vertical-align: middle; }
.flash-zone .alert { margin-bottom: .75rem; }
/* ===== trang in ===== */
.print-page { background: #fff; max-width: 1100px; margin: 0 auto; padding: 1.5rem 2rem; font-family: "Times New Roman", serif; color: #000; }
.print-page table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-page th, .print-page td { border: 1px solid #333; padding: 3px 5px; }
.print-page th { background: #f0f0f0; text-align: center; }
.print-head { display: flex; justify-content: space-between; font-size: 13px; border-bottom: 1px solid #000; padding-bottom: .3rem; margin-bottom: .6rem; }
.print-title { text-align: center; font-size: 19px; font-weight: 700; margin: .4rem 0 .1rem; text-transform: uppercase; }
.print-sub { text-align: center; font-size: 13px; margin-bottom: .8rem; }
.print-group td { font-weight: 700; font-style: italic; background: #fafafa; }
.sign-row { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 1.5rem; font-size: 13px; }
.sign-row b { display: block; margin-bottom: 4.5rem; }
@media print {
    .no-print, .topbar, .sidebar, .flash-zone, .toast-zone { display: none !important; }
    .main { margin: 0; padding: 0; }
    body { background: #fff; }
    .print-page { padding: 0; max-width: none; }
    @page { size: A4 landscape; margin: 12mm; }
}
