:root {
  color-scheme: light;
  --ink: #071A2D; --ink-2: #0E2C4A; --text: #1c2833; --muted: #5d6b78; --muted-2: #8a96a2;
  --bg: #F3F5F7; --surface: #FFFFFF; --line: #E3E8EC; --line-2: #EEF1F4; --hover: #F6F8FA;
  --accent: #E8461E; --accent-d: #C93A15; --blue: #2a78d6; --ok: #0ca30c; --ok-t: #006300; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --grid: #E9EDF0; --axis: #C7CFD6;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 8px; --side: 248px;
  --shadow: 0 1px 2px rgba(7, 26, 45, .05), 0 4px 16px rgba(7, 26, 45, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; }
.boot { height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.boot img { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(60% 70% at 70% 40%, rgba(42, 120, 214, .35), transparent 70%), linear-gradient(130deg, #061424, #0B2540); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(143, 211, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 211, 255, .07) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(70% 70% at 70% 50%, #000, transparent); }
.login-art img.render { position: absolute; right: -8%; bottom: 8%; width: 82%; z-index: 1; }
.login-art h1 { color: #fff; font-size: 38px; line-height: 1.15; max-width: 14ch; position: relative; z-index: 2; }
.login-art p { color: #9FB0C0; max-width: 40ch; position: relative; z-index: 2; }
.login-box { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-box form { width: 100%; max-width: 380px; }
.demo-accts { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 12.5px; color: var(--muted); }
.demo-accts button { display: flex; justify-content: space-between; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; text-align: left; }
.demo-accts button:hover { background: var(--hover); }
.demo-accts b { color: var(--ink); font-weight: 500; }

/* layout */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #C3CFDA; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.side .brand img { width: 34px; }
.side .brand small { display: block; font-family: var(--mono); font-size: 9.5px; color: #8BA0B4; font-weight: 400; letter-spacing: .12em; }
.side nav { padding: 6px 10px 20px; flex: 1; }
.side .grp { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6F86A0; padding: 16px 10px 6px; }
.side a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; font-size: 13.5px; transition: background .15s, color .15s; }
.side a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side a.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side a .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.side .me { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 16px; font-size: 12.5px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(243, 245, 247, .92); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 19px; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); }
.topbar .sp { flex: 1; }
.content { padding: 24px 28px 60px; }
.burger { display: none; }

/* components */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--hover); border-color: #d3dae0; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { background: var(--accent-d); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--crit); }
.btn.danger:hover { background: #fdeeee; border-color: #f3c7c7; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 14.5px; }
.card-h .sub { font-size: 12px; color: var(--muted); font-weight: 400; display: block; margin-top: 2px; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.t td.mono, .t .mono b { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

.kpi { padding: 16px 18px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 600; color: var(--ink); margin: 8px 0 4px; letter-spacing: -.02em; }
.kpi .d { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .d.up { color: var(--ok-t); }
.kpi .d.down { color: var(--crit); }
.kpi .d.flat { color: var(--muted); }
.kpi.hl { background: var(--ink); border-color: var(--ink); }
.kpi.hl .lbl { color: #9FB0C0; }
.kpi.hl .val { color: #fff; }
.kpi.hl .d { color: #9fe1a4; }
.chart { width: 100%; height: 300px; }
.chart.sm { height: 230px; }
.chart.lg { height: 340px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFC; position: sticky; top: 0; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr { transition: background .1s; }
.t tbody tr:hover { background: var(--hover); }
.t tr.click { cursor: pointer; }
.t .thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 4px; background: #0B2540; }
.t .thumb.contain { object-fit: contain; }
.tbl-wrap { overflow: auto; max-height: 70vh; }
.tbl-wrap.short { max-height: 380px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; background: var(--line-2); color: var(--text); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.nodot::before { display: none; }
.pill.HOT { background: #fde9e9; color: #b42b2b; }
.pill.WARM { background: #fff2dc; color: #8a5a00; }
.pill.NURTURE { background: #e6f0fb; color: #1c5cab; }
.pill.SPAM { background: #eceff2; color: #6b7783; }
.pill.st-new { background: #e6f0fb; color: #1c5cab; }
.pill.st-qualified, .pill.st-technical, .pill.st-costing { background: #efeafc; color: #4a3aa7; }
.pill.st-need_info { background: #fff2dc; color: #8a5a00; }
.pill.st-quoted, .pill.st-negotiation { background: #fff0e9; color: #a8441c; }
.pill.st-won, .pill.st-repeat, .pill.published { background: #e3f5e3; color: #006300; }
.pill.st-lost, .pill.archived { background: #eceff2; color: #6b7783; }
.pill.draft { background: #fff2dc; color: #8a5a00; }
.pill.scheduled { background: #e6f0fb; color: #1c5cab; }

/* forms */
.f { display: grid; gap: 6px; margin-bottom: 14px; }
.f > label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.f .hint { font-size: 12px; color: var(--muted-2); }
.in, .sel, .ta { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #d5dce2; border-radius: 6px; background: #fff; font-size: 13.5px; transition: border-color .15s, box-shadow .15s; }
.ta { height: auto; min-height: 90px; padding: 9px 11px; line-height: 1.55; resize: vertical; }
.ta.code { font-family: var(--mono); font-size: 12.5px; min-height: 420px; }
.in:focus, .sel:focus, .ta:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(7, 26, 45, .08); }
.in.sm, .sel.sm { height: 32px; font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; user-select: none; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: #cfd6dc; position: relative; transition: background .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.filters .in, .filters .sel { width: auto; min-width: 140px; height: 34px; font-size: 13px; }
.filters .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; font-size: 12.5px; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-layout .side-col { display: grid; gap: 18px; position: sticky; top: 76px; }
.ql-toolbar.ql-snow { border-color: #d5dce2; border-radius: 6px 6px 0 0; background: #FAFBFC; position: sticky; top: 66px; z-index: 5; }
.ql-container.ql-snow { border-color: #d5dce2; border-radius: 0 0 6px 6px; font-family: var(--font); font-size: 15px; }
.ql-editor { min-height: 420px; line-height: 1.7; }
.ql-editor h2 { font-size: 22px; margin: 1em 0 .4em; }
.ql-editor h3 { font-size: 18px; }
.img-field { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.img-field .pv { width: 120px; height: 84px; border-radius: 6px; background: radial-gradient(70% 80% at 60% 45%, #123354, #071A2D); overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); }
.img-field .pv img { width: 100%; height: 100%; object-fit: contain; }
.img-field .pv.photo img { object-fit: cover; }
.kv-rows { display: grid; gap: 8px; }
.kv-row { display: grid; grid-template-columns: 1fr 1.4fr 32px; gap: 8px; align-items: start; }
.kv-row.obj { grid-template-columns: 1fr 32px; }
.kv-row .stack { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #FAFBFC; }
.tags-in { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #d5dce2; border-radius: 6px; min-height: 38px; background: #fff; }
.tags-in span { background: var(--line-2); border-radius: 4px; padding: 3px 8px; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.tags-in span button { border: 0; background: none; padding: 0; color: var(--muted); }
.tags-in input { border: 0; outline: 0; flex: 1; min-width: 120px; font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }

/* modal & drawer */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4, 14, 25, .5); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
/* hộp thoại không rộng quá màn hình khi nội dung có ô / bảng rộng (điện thoại) — bảng dòng cuộn ngang bên trong */
.overlay { grid-template-columns: minmax(0, 1fr); } .overlay > .modal { min-width: 0; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: #fff; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop .25s cubic-bezier(.2, .7, .1, 1); }
.modal.lg { max-width: 980px; }
.modal.xl { max-width: 1200px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: flex; gap: 10px; align-items: center; animation: pop .3s; max-width: 380px; }
.toast.err { background: #8f1f1f; }
.toast.ok .ico { color: #7be07f; }

/* media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.media-item:hover { border-color: var(--ink); }
.media-item.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.media-item .im { aspect-ratio: 4 / 3; background: radial-gradient(70% 80% at 60% 45%, #123354, #071A2D); display: grid; place-items: center; }
.media-item .im img { width: 100%; height: 100%; object-fit: cover; }
.media-item .im.contain img { object-fit: contain; }
.media-item .cap { padding: 7px 9px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop { border: 1.5px dashed #c5ced6; border-radius: 8px; padding: 22px; text-align: center; color: var(--muted); background: #FAFBFC; transition: all .2s; cursor: pointer; position: relative; }
.drop.on, .drop:hover { border-color: var(--accent); background: #fff6f3; color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 270px; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: #E9EDF1; border-radius: 8px; padding: 10px; min-height: 200px; transition: background .15s; }
.kcol.over { background: #dde6ee; outline: 2px dashed var(--blue); }
.kcol h4 { font-size: 12.5px; display: flex; justify-content: space-between; margin: 2px 4px 10px; color: var(--ink); }
.kcol h4 span { color: var(--muted); font-weight: 400; }
.kcard { background: #fff; border-radius: 7px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); cursor: grab; font-size: 12.5px; box-shadow: 0 1px 2px rgba(7, 26, 45, .05); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard b { display: block; color: var(--ink); font-size: 13px; margin: 4px 0 2px; }

/* rfq detail */
.timeline { display: grid; gap: 0; }
.tl-i { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.tl-i::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: -8px; width: 1px; background: var(--line); }
.tl-i:last-child::before { display: none; }
.tl-i .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; color: var(--muted); }
.tl-i .dot .ico { width: 13px; height: 13px; }
.tl-i small { color: var(--muted-2); font-size: 11.5px; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); word-break: break-word; white-space: pre-line; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.realtime { display: flex; align-items: center; gap: 12px; }
.realtime .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(12, 163, 12, .5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; margin-bottom: 10px; }
.progress-row .bar { grid-column: 1 / -1; height: 6px; }
.progress-row .bar i { background: var(--s1); }

@media (max-width: 1200px) { .g5 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } .editor-layout { grid-template-columns: 1fr; } .editor-layout .side-col { position: static; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 90; transform: translateX(-100%); transition: transform .3s; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .burger { display: inline-flex; }
  .g2, .g3, .span2 { grid-template-columns: 1fr; grid-column: auto; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .dl { grid-template-columns: 1fr; }
}

/* ================= ABC production module ================= */
.ws { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 12px 4px; padding: 4px; background: rgba(255, 255, 255, .06); border-radius: 8px; }
.ws button { border: 0; background: none; color: #9FB0C0; border-radius: 6px; padding: 7px 6px; font-size: 12px; font-weight: 600; text-align: left; line-height: 1.25; }
.ws button small { display: block; font-weight: 400; font-size: 10.5px; color: #6F86A0; }
.ws button.on { background: #fff; color: var(--ink); }
.ws button.on small { color: var(--muted); }
.pill.t-muted { background: #eceff2; color: #5d6b78; }
.pill.t-info { background: #e6f0fb; color: #1c5cab; }
.pill.t-warn { background: #fff2dc; color: #8a5a00; }
.pill.t-ok { background: #e3f5e3; color: #006300; }
.pill.t-crit { background: #fde9e9; color: #b42b2b; }
.pill.t-violet { background: #efeafc; color: #4a3aa7; }
.lnk { color: var(--blue); }
.lnk:hover { text-decoration: underline; }
.neg { color: var(--crit); font-weight: 500; }
.warn-t { color: #8a5a00; font-weight: 500; }
.ok-i { color: var(--ok); width: 16px; height: 16px; }
.mb { margin-bottom: 18px; }
.mtop { margin-top: 18px; }
.mbar { position: relative; height: 18px; border-radius: 4px; background: var(--line-2); overflow: hidden; min-width: 90px; }
.mbar i { position: absolute; inset: 0 auto 0 0; background: #b7d3f6; border-radius: 4px; }
.mbar.hi i { background: #f6d48a; }
.mbar.over i { background: #f2a7a7; }
.mbar span { position: relative; font-size: 11.5px; padding-left: 7px; line-height: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.btn.locked { color: var(--muted-2); background: #f6f7f9; }
.btn.locked .ico { color: var(--muted-2); }
.btn.loading { opacity: .6; pointer-events: none; }
.btn .hintdot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn); color: #3a2a00; font-size: 11px; font-weight: 700; }
.blockmsg { display: flex; gap: 12px; padding: 14px; border-radius: 8px; align-items: flex-start; }
.blockmsg .ico { width: 22px; height: 22px; margin-top: 1px; }
.blockmsg p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.blockmsg.b-block { background: #fdf1f1; border: 1px solid #f3c7c7; color: var(--crit); }
.blockmsg.b-perm { background: #f4f6f8; border: 1px solid var(--line); color: var(--muted); }
/* forms */
.fgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
/* ô chọn có nhãn dài (hợp đồng, đề xuất đặt hàng…) không được đẩy form rộng quá màn hình điện thoại */
.fgrid .f { min-width: 0; } .fgrid .sel { max-width: 100%; }
.fgrid .span2 { grid-column: 1 / -1; }
.fgrid .f.err .in, .fgrid .f.err .sel, .fgrid .f.err .ta { border-color: var(--crit); }
.ferr { color: var(--crit); font-size: 12px; }
.req { color: var(--crit); }
.finfo { display: flex; gap: 8px; align-items: flex-start; background: #eef4fc; border: 1px solid #d3e3f7; color: #1c4f8f; border-radius: 7px; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }
.finfo .ico { width: 16px; height: 16px; margin-top: 1px; }
.fsec { font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); padding-top: 12px; margin: 4px 0 10px; font-size: 13px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; font-size: 13px; }
.checks label { display: flex; gap: 8px; align-items: center; }
.lines .tbl-x { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; }
.t.lt th { position: static; font-size: 11.5px; padding: 7px 8px; }
.t.lt td { padding: 5px 6px; }
.t.lt td.ro { font-size: 12.5px; color: var(--ink); }
.t.lt td.c { text-align: center; }
.t.lt .in.sm, .t.lt .sel.sm { height: 38px; min-width: 84px; font-size: 14px; }
.t.lt .in.sm[type=number], .t.lt .in.sm[data-vnum], .t.lt .in.sm[data-vmoney] { min-width: 96px; }
/* ô số kiểu Việt (numfmt.js): chữ số đều để dễ đọc số lớn */
input[data-vnum], input[data-vmoney] { font-variant-numeric: tabular-nums; }
.t.lt td.ro { min-width: 80px; white-space: nowrap; }
.t.lt td.ro.wrap { white-space: normal; min-width: 150px; line-height: 1.35; } /* ts2111: cột chỉ đọc dài (kiểm kê tài sản) xuống dòng */
.fgrid .in, .fgrid .sel { min-height: 40px; font-size: 14.5px; }
.lines .zc-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; font-size: 13.5px; margin: 6px 2px; }
.lines .zc-sum b { font-variant-numeric: tabular-nums; }
.lsum { float: right; font-size: 13px; margin-top: 6px; }
/* lists */
.filters .sp { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 12px; font-size: 12.5px; color: var(--muted); }
.chip:hover { border-color: #c7cfd6; color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs .tn { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
tr.foot td { background: #FAFBFC; border-top: 1px solid var(--line); }
/* record page */
.dochead { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.dochead h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dochead .crumb { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.dh-r { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 780px; }
.stepper { display: flex; margin-bottom: 14px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stp { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; flex: 1; min-width: 120px; padding-right: 10px; }
.stp:not(:last-child)::after { content: ''; flex: 1; height: 2px; background: var(--line); min-width: 14px; }
.stp .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--muted); font-size: 11.5px; font-weight: 600; flex: none; }
.stp .dot .ico { width: 13px; height: 13px; }
.stp.done { color: var(--ok-t); }
.stp.done .dot { background: #e3f5e3; color: var(--ok-t); }
.stp.done::after { background: #9fd59f; }
.stp.current { color: var(--ink); font-weight: 600; }
.stp.current .dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(232, 70, 30, .15); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; line-height: 1.5; border: 1px solid; }
.alert .ico { width: 17px; height: 17px; margin-top: 1px; }
.alert.a-crit { background: #fdf1f1; border-color: #f3c7c7; color: #8f1f1f; }
.alert.a-warn { background: #fff8e9; border-color: #f6dfab; color: #6d4800; }
.alert.a-info { background: #eef4fc; border-color: #d3e3f7; color: #1c4f8f; }
.alert.a-ok { background: #ecf8ec; border-color: #c4e6c4; color: #0b5a0b; }
.hints { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12.5px; color: #6d4800; margin: 0 0 12px; }
.hints span { display: inline-flex; gap: 6px; align-items: center; }
.hints .ico { width: 14px; height: 14px; }
.docgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.dmain, .dside { display: grid; gap: 18px; min-width: 0; }
.dl2 { display: grid; grid-template-columns: repeat(2, minmax(130px, 170px) minmax(0, 1fr)); gap: 9px 14px; margin: 0; font-size: 13.5px; }
.dl2 dt { color: var(--muted); }
.dl2 dd { margin: 0; color: var(--ink); word-break: break-word; }
.appr { display: grid; gap: 10px; }
.ap { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; }
.ap-pending { border-color: #f6dfab; background: #fffcf4; }
.ap-approved { background: #f6fbf6; }
.ap-rejected { background: #fdf6f6; }
.links { display: grid; gap: 12px; }
.lg-h { font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.li { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; font-size: 12.5px; }
.li:hover { background: var(--hover); }
.li .mono { color: var(--blue); font-weight: 600; }
.li .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr { display: flex; gap: 14px; align-items: center; }
.qr img { border: 1px solid var(--line); border-radius: 6px; background: #fff; flex: none; }
.drop.small { padding: 12px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.files { display: grid; gap: 4px; margin-top: 10px; }
.fi { display: grid; grid-template-columns: 18px 1fr; gap: 0 8px; padding: 6px 8px; border-radius: 6px; font-size: 12.5px; }
.fi:hover { background: var(--hover); }
.fi .ico { width: 15px; height: 15px; grid-row: span 2; color: var(--muted); }
.fi small { color: var(--muted-2); font-size: 11px; }
.hist { max-height: 460px; overflow: auto; }
.hist .tl-i b { font-size: 12.5px; }
.hist .tl-i small { display: block; }
/* tiles & dashboard */
.mtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.mtile { padding: 14px 16px; display: block; transition: border-color .15s, box-shadow .15s; }
a.mtile[href]:hover { border-color: #c7cfd6; box-shadow: 0 4px 18px rgba(7, 26, 45, .08); }
.mtile .lbl { font-size: 12.5px; color: var(--muted); }
.mtile .val { font-size: 23px; font-weight: 600; color: var(--ink); margin: 6px 0 2px; letter-spacing: -.01em; }
.mtile .sub { font-size: 12px; color: var(--muted-2); }
.mtile.tt-crit { border-left: 3px solid var(--crit); }
.mtile.tt-warn { border-left: 3px solid var(--warn); }
.mtile.tt-info { border-left: 3px solid var(--blue); }
.demo-note { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: #5d6b78; background: #fff; border: 1px dashed #c7cfd6; border-radius: 8px; padding: 9px 14px; margin-bottom: 14px; line-height: 1.5; }
.demo-note .ico { width: 16px; height: 16px; margin-top: 1px; color: var(--blue); }
.achips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.achip { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); transition: transform .12s, box-shadow .15s; }
.achip:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(7, 26, 45, .08); }
.achip b { font-size: 20px; color: var(--ink); font-weight: 600; min-width: 22px; }
.achip span { line-height: 1.25; }
.achip small { display: block; font-size: 11px; }
.achip .ico { width: 18px; height: 18px; }
.achip.c-crit { border-color: #f0b9b9; background: #fdf4f4; }
.achip.c-crit .ico, .achip.c-crit small { color: var(--crit); }
.achip.c-warn { border-color: #f3dca6; background: #fffaf0; }
.achip.c-warn .ico { color: #b07800; }
.achip.c-info { border-color: #cfe0f6; background: #f3f8fe; }
.achip.c-info .ico { color: var(--blue); }
.achip.c-zero b { color: var(--muted-2); }
.flow { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; padding: 14px 16px; }
.fstep { position: relative; display: grid; gap: 3px; padding: 10px 10px 9px; border-radius: 8px; border: 1px solid var(--line); background: #FAFBFC; font-size: 12px; transition: border-color .15s, background .15s; min-width: 0; }
.fstep:hover { border-color: var(--ink); background: #fff; }
.fstep b { color: var(--ink); font-size: 12.5px; line-height: 1.25; min-height: 31px; }
.fstep .fs-n { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.fstep .fs-c { font-size: 22px; font-weight: 600; color: var(--muted-2); }
.fstep.has .fs-c { color: var(--accent); }
.fstep small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fstep:not(:last-child)::after { content: '\203A'; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 16px; z-index: 1; }
.kgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.kpi2 { padding: 14px 16px 12px; display: grid; gap: 4px; border-top: 3px solid var(--line); transition: box-shadow .15s; }
.kpi2:hover { box-shadow: 0 6px 22px rgba(7, 26, 45, .1); }
.kpi2.s-ok { border-top-color: var(--ok); }
.kpi2.s-warn { border-top-color: var(--warn); }
.kpi2 .lbl { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi2 .lbl .ico { width: 15px; height: 15px; }
.kpi2 .val { font-size: 27px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.kpi2 .val small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi2 .tg { font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi2 .st { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.kpi2 .st .ico { width: 14px; height: 14px; }
.kpi2 .st.ok { color: var(--ok-t); }
.kpi2 .st.warn { color: #9a6300; }
.kpi2 .st.na { color: var(--muted-2); }
.kpi2 .dl { font-size: 12px; color: var(--muted); }
.kpi2 .dl.up { color: var(--ok-t); }
.kpi2 .dl.down { color: var(--crit); }
.kpi2 .fm { font-size: 11px; color: var(--muted-2); line-height: 1.4; }
.drow { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 5px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line-2); }
.drow:hover span { color: var(--blue); }
.drow small { grid-column: 1 / -1; font-size: 11px; }
/* gantt */
.gantt-wrap { overflow-x: auto; }
.gantt { min-width: 980px; font-size: 11.5px; }
.g-head, .g-row { display: grid; grid-template-columns: 190px 1fr; }
.g-days { display: grid; grid-template-columns: repeat(var(--days), 1fr); border-bottom: 1px solid var(--line); }
.g-days span { text-align: center; padding: 4px 0; color: var(--muted); border-left: 1px solid var(--line-2); }
.g-days span.sun { background: #f6f7f9; }
.g-days span.tod { background: var(--accent); color: #fff; border-radius: 4px 4px 0 0; }
.g-row { border-bottom: 1px solid var(--line-2); min-height: 46px; }
.g-lbl { padding: 6px 8px 6px 0; display: grid; align-content: center; }
.g-lbl small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; }
.g-bar { position: absolute; top: 9px; height: 26px; min-width: 22px; border-radius: 5px; color: #fff; font-size: 11px; padding: 0 6px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); border: 1px solid rgba(255, 255, 255, .7); }
.g-bar:hover { filter: brightness(1.08); z-index: 2; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .6; }
.kanban.mk { grid-auto-columns: minmax(230px, 1fr); }
.kanban.mk .kcard { display: block; cursor: pointer; }
.smalls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.smalls .sm-t { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.t.matrix th.c { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 200px; vertical-align: bottom; font-size: 11.5px; padding: 8px 4px; }
.t.matrix td.c { text-align: center; }
.print-h { display: none; }
.demo-accts .seg button { padding: 5px 10px; font-size: 12px; display: inline-block; width: auto; }
.demo-accts .seg button.on { background: var(--ink); color: #fff; }
@media (max-width: 1400px) { .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); } .fstep:nth-child(5)::after { display: none; } }
@media (max-width: 1200px) { .docgrid { grid-template-columns: 1fr; } .kgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .achips { grid-template-columns: repeat(3, minmax(0, 1fr)); } .smalls { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dl2 { grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fstep::after { display: none; }
  .achips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi2 .val { font-size: 22px; }
  .dochead { padding: 14px; }
  .dh-r { justify-content: flex-start; }
  .dh-r .btn { flex: 1 1 auto; justify-content: center; }
  .smalls { grid-template-columns: 1fr; }
  .mtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; }
  .topbar #topbar-extra { width: 100%; order: 5; }
  .modal .modal-b { padding: 14px; }
}
@media (max-width: 560px) { .kgrid, .mtiles { grid-template-columns: 1fr; } }
@media print {
  .side, .topbar, .demo-note, #toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-h { display: block; font-size: 15px; margin-bottom: 12px; }
  .tbl-wrap { max-height: none !important; overflow: visible !important; }
}
/* narrow screens: grid tracks must be allowed to shrink below their content (warehouse & production use phones) */
@media (max-width: 1200px) { .docgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: minmax(0, 1fr); }
  .card-h { flex-wrap: wrap; }
  .dl2 { grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); }
  .kanban.mk { grid-auto-columns: 82vw; }
  .chart { max-width: 100%; }
}
.dmain, .dside { grid-template-columns: minmax(0, 1fr); }
.dmain > *, .dside > * { min-width: 0; }
.chart { overflow: hidden; }
.links { grid-template-columns: minmax(0, 1fr); }
.lg, .li { min-width: 0; }
.li .mono, .li .pill { flex: none; }

/* ===================== executive workspace (Đề án dashboard quản trị phân cấp) ===================== */
.gsearch { position: relative; }
.gsearch .in { width: 260px; height: 36px; }
.gs-res { position: absolute; right: 0; top: 42px; width: 420px; max-width: 92vw; max-height: 60vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(7, 26, 45, .16); z-index: 60; padding: 6px; }
.gs-i { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.gs-i:hover { background: var(--hover); }
.gs-i small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.gs-i span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.gs-e { padding: 14px; color: var(--muted); font-size: 13px; }
.btn.bell { position: relative; }
.bdot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.bdot[hidden] { display: none; }
.nlist { display: grid; gap: 4px; }
.ni { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 8px; border: 1px solid transparent; }
.ni:hover { background: var(--hover); }
.ni.unread { background: #f3f8fe; border-color: #d9e7f8; }
.ni p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.ni > div { min-width: 0; overflow-wrap: anywhere; } /* m1911: liên kết / email dài không đẩy thẻ rộng quá màn hình (iPhone phóng to chữ, cắt chữ) */
.ni small { color: var(--muted-2); font-size: 11.5px; }
.nk { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.nk.k-approval { background: #fff3dc; color: #a06a00; }
.nk.k-task { background: #e8f1fb; color: var(--blue); }
.nk.k-risk { background: #fdecec; color: var(--crit); }
.nk.k-decision { background: #e7f6ec; color: var(--ok-t); }
.xhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.xbrand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.xbrand > b { background: var(--ink); color: #fff; border-radius: 6px; padding: 5px 10px; letter-spacing: .06em; font-size: 13px; }
.xbrand span b { color: var(--ink); }
.xme { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.xfilter { margin-bottom: 14px; }
.xf-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; }
.xf-row .in.sm, .xf-row .sel.sm { width: auto; min-width: 120px; height: 32px; }
.xf-row .sp { flex: 1; }
.xalert { display: grid; grid-template-columns: auto auto auto 1fr auto; gap: 10px 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.xalert.has { border-left-color: var(--crit); background: #fffafa; }
.xa-c { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--muted); }
.xa-c b { font-size: 22px; color: var(--crit); }
.xa-c.y b { color: #b07800; }
.xa-c.i b { color: var(--blue); }
.xa-l { display: grid; gap: 3px; font-size: 12.5px; min-width: 0; }
.xa-l a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sev { display: inline-block; min-width: 22px; text-align: center; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.sev.s-red { background: #fde5e5; color: #b42323; }
.sev.s-yel { background: #fff1cc; color: #8a5d00; }
.xtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.xtile { text-align: left; padding: 14px 16px; cursor: pointer; border: 1px solid var(--line); background: #fff; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .12s; }
.xtile:hover { border-color: #b9c3cc; box-shadow: 0 6px 20px rgba(7, 26, 45, .08); transform: translateY(-1px); }
.xtile .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.xtile .lbl .ico { width: 15px; height: 15px; }
.xtile .val { font-size: 23px; font-weight: 600; color: var(--ink); margin: 6px 0 3px; letter-spacing: -.01em; }
.xtile .val small { font-size: 13px; color: var(--muted); font-weight: 500; }
.xtile .sub { font-size: 12px; color: var(--muted-2); line-height: 1.4; }
.xtile.bad { border-left: 3px solid var(--crit); }
.xtile.bad .val { color: var(--crit); }
.xtile.warn { border-left: 3px solid var(--warn); }
.xtile.good { border-left: 3px solid var(--ok); }
.xd { font-size: 11.5px; font-weight: 500; }
.xd.up { color: var(--ok-t); }
.xd.down { color: var(--crit); }
.xd.flat { color: var(--muted); }
.xfin { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin-bottom: 14px; }
.xfin > div { padding: 12px 14px; border-right: 1px solid var(--line-2); display: grid; gap: 2px; }
.xfin > div:nth-child(6) { border-right: 0; }
.xfin > div.wide { grid-column: 1 / -1; border-top: 1px solid var(--line-2); border-right: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.xfin span { font-size: 12px; color: var(--muted); }
.xfin b { font-size: 16px; color: var(--ink); }
.xfin small { font-size: 11.5px; color: var(--muted-2); }
.xbus { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.xbu { display: grid; gap: 10px; padding: 14px 16px; border-top: 4px solid var(--bc); transition: box-shadow .15s, transform .12s; }
.xbu:hover { box-shadow: 0 8px 24px rgba(7, 26, 45, .1); transform: translateY(-1px); }
.xb-h { display: flex; gap: 10px; align-items: center; }
.xb-h > div { flex: 1; min-width: 0; }
.xb-h b { color: var(--ink); }
.xb-h small { display: block; font-size: 11.5px; color: var(--muted); }
.xb-code { width: 34px; height: 34px; border-radius: 8px; background: var(--bc); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.xb-g { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xb-g span, .xb-plan > span { font-size: 11.5px; color: var(--muted); display: block; }
.xb-g b { font-size: 17px; color: var(--ink); }
.xb-g small { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.xb-plan small { font-size: 11.5px; color: var(--muted-2); }
.xb-f { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.xb-f .ico, .xb-o .ico { width: 13px; height: 13px; vertical-align: -2px; }
.xb-o { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.xb-o b { color: var(--ink); }
tr.od td { background: #fff8f8; }
.t.xdec td { vertical-align: top; }
.xacts { display: flex; flex-wrap: wrap; gap: 8px; }
.xreq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.xreq li { display: flex; gap: 8px; font-size: 13px; }
.xreq li .ico { color: var(--ok); width: 17px; height: 17px; flex: none; margin-top: 1px; }
.xreq b { display: block; color: var(--ink); }
.xreq span { color: var(--muted); font-size: 12.5px; }
.t.pmx th span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 11px; max-height: 150px; display: inline-block; }
.t.pmx td.c { text-align: center; }
.bu-tag { background: var(--ink); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
@media (max-width: 1300px) {
  .xtiles, .xbus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xfin { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xfin > div:nth-child(3) { border-right: 0; }
}
@media (max-width: 900px) {
  .gsearch .in { width: 150px; }
  .hide-m { display: none !important; }
  .xalert { grid-template-columns: repeat(3, auto); }
  .xa-l, .xalert > .btn { grid-column: 1 / -1; }
  .xreq { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .xtiles, .xbus { grid-template-columns: minmax(0, 1fr); }
  .xfin { grid-template-columns: 1fr 1fr; }
  .xfin > div { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .gsearch { order: 6; width: 100%; }
  .gsearch .in { width: 100%; }
  .xtile .val { font-size: 20px; }
}

.xf-more { display: none; }
@media (max-width: 560px) {
  .xf-more { display: inline-flex; }
  .xfilter:not(.open) .xf-row > :not(.seg):not(.xf-more) { display: none; }
  .xf-row .seg { width: 100%; display: flex; } .xf-row .seg button { flex: 1; padding: 7px 4px; }
  .xf-row .in.sm, .xf-row .sel.sm { width: 100%; }
}

/* SXPT shop floor (px.js) */
.pxl { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pxl-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pxl-h b { font-size: 15px; color: var(--ink); }
.pxl-h span { font-size: 12px; color: var(--muted); }
.pxl-load { margin-left: auto; background: var(--line-2, #eef1f4); border-radius: 12px; padding: 2px 9px; color: var(--ink) !important; font-weight: 600; }
.pxl-load.hi { background: #fdecea; color: var(--crit) !important; }
.pxl-s { display: flex; flex-direction: column; gap: 5px; }
.pxs { display: block; font-size: 12.5px; padding: 6px 9px; border-radius: 7px; background: #eef4fb; color: var(--ink); text-decoration: none; border-left: 3px solid var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxs.st-done { background: #eaf7f1; border-left-color: #1baf7a; }
.pxs:hover { filter: brightness(.97); }
.pxl-j { border-top: 1px dashed var(--line-2); padding-top: 4px; }
.pxl-f { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 6px; }
.pxr { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.pxr .lbl { font-size: 12px; color: var(--muted); }
.pxr b { display: block; font-size: 18px; color: var(--ink); margin: 4px 0 2px; }
.pxr small { font-size: 11.5px; color: var(--muted-2, #8a96a2); }

/* ---------- SXPT cấp 2: form checks, typed attachments, alerts center, work list ---------- */
.lines .in.bad { border-color: var(--crit); background: #fdf1f1; }
.calcwarn { color: var(--crit); font-size: 12.5px; font-weight: 500; padding: 6px 2px 0; }
.calcwarn:empty { display: none; }
.fkind { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.wtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wtile { text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.wtile .lbl { font-size: 12.5px; color: var(--muted); }
.wtile .val { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.wtile .sub { font-size: 11.5px; color: var(--muted); }
.wtile.on { outline: 2px solid var(--accent); }
.wtile.t-crit .val { color: var(--crit); } .wtile.t-warn .val { color: #b97c00; } .wtile.t-ok .val { color: var(--ok-t); }
.sev { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sev.s-crit { background: #fbe3e3; color: #a32020; } .sev.s-warn { background: #fff1d2; color: #8a5a00; } .sev.s-info { background: #e5effb; color: #1f5fa8; }
.alrow td { vertical-align: top; }
.alrow .why { font-size: 12px; color: var(--muted); margin-top: 3px; }
.alrow.od td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.kvx { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13px; }
.kvx dt { color: var(--muted); } .kvx dd { margin: 0; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.cmp div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; } .cmp b { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.cmp .exp { border-color: #b7d7b7; } .cmp .act { border-color: #f0b8b8; }
.sheet-t th, .sheet-t td { white-space: nowrap; font-size: 12px; }
.togg { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.drill { cursor: pointer; } .drill:hover td { background: var(--hover); }
@media (max-width: 760px) { .wtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kvx { grid-template-columns: 1fr; } .cmp { grid-template-columns: 1fr; } }

/* ---------- SXPT · bảng giá vốn theo mẫu, biểu mẫu ký duyệt, danh mục giá vốn, dự kiến tiến độ (28/10/2026) ---------- */
.cb-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.cb-head label, .cb-cost label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cb-head label small { font-weight: 500; color: var(--blue); min-height: 14px; }
.cb-head .w2 { grid-column: span 2; } .cb-head .w4 { grid-column: span 4; }
.cb-cost { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; } .cb-cost .w2 { grid-column: span 2; }
.cb-ops td, .cb-lines td { padding: 4px 5px; vertical-align: middle; } .cb-ops .in.sm, .cb-lines .in.sm { width: 100%; min-width: 0; padding: 5px 6px; }
.cb-sheet .tbl-x { overflow-x: auto; } .cb-lines { min-width: 1180px; } .cb-ops { min-width: 620px; } .cb-lines .right input { text-align: right; } .cb-ops input.right { text-align: right; }
.cb-tag { display: inline-block; margin-top: 3px; font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-weight: 600; cursor: default; }
.cb-tag.ok { background: #e7f6ec; color: #0b6b2f; cursor: pointer; } .cb-tag.new { background: #fff4dc; color: #8a5a00; }
.cb-sg { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.3; } .cb-sg a { cursor: pointer; }
.cb-src { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-weight: 600; background: #eef2f7; color: var(--muted); white-space: nowrap; }
.cb-src.k-actual, .cb-src.k-misa { background: #e7f6ec; color: #0b6b2f; } .cb-src.k-quote, .cb-src.k-buyq { background: #e8f0fb; color: #1f5fae; } .cb-src.k-sheet { background: #f2ecfb; color: #6b3fb0; }
.cb-img { width: 44px; height: 32px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block; }
.cb-fc { font-size: 13px; border-top: 1px solid var(--line-2); background: #fbfcfd; } .cb-fc svg { vertical-align: -2px; }
.cb-sum td { padding: 6px 8px; font-size: 13px; } .cb-sum tr.tot td { background: #fff7e0; }
.cb-sheet.ro .in:disabled { background: #f7f8fa; color: var(--text); border-color: var(--line-2); }
.cb-cat td { vertical-align: middle; } .cb-pbox { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; } .cb-pbox img { width: 120px; border: 1px solid var(--line); border-radius: 6px; }
.cb-pk { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; } .cb-pk small { color: var(--muted); font-size: 11.5px; } .cb-pk b { font-size: 18px; color: var(--ink); }
.pf-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; } .pf-tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 13px; text-decoration: none; }
.pf-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pf-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; } .pf-paper { overflow-x: auto; padding: 0; } .pf-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
.pf-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-res { margin-top: 12px; } .fc-big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .fc-big > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.fc-big small { color: var(--muted); font-size: 11.5px; } .fc-big b { font-size: 17px; color: var(--ink); } .fc-big .pill { align-self: flex-start; white-space: normal; }
.btn.warn { background: #fff4dc; border-color: #f3d48a; color: #7a4b00; } .pos { color: var(--ok-t); }
@media (max-width: 1100px) { .pf-wrap { grid-template-columns: 1fr; } .pf-side { position: static; } }
@media (max-width: 760px) { .cb-head, .cb-cost { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cb-head .w4 { grid-column: span 2; } .fc-big { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .pf-paper .pf { min-width: 900px; } .pf-tabs a { padding: 6px 10px; } }
/* workspace tiles (Dashboard · Văn phòng · 01 · 02 · 03 SXPT · 04 · Website) */
.ws button { padding: 6px 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws button small { overflow: hidden; text-overflow: ellipsis; }
/* SXPT · quy trình khách hàng 6 bước */
.crm-kb .kcard.late { border-left: 3px solid var(--crit); }
.crm-kb details.crit { margin: 0 4px 8px; font-size: 11.5px; color: var(--muted); }
.crm-kb details.crit summary { cursor: pointer; }
.crm-kb details.crit ul { margin: 4px 0 0; padding-left: 16px; }

/* ===== yêu cầu 31/10/2026: thêm nhanh, chữ ký trên phê duyệt, chấm công, bản vẽ bảng giá vốn ===== */
.fadd{margin-top:6px;margin-right:6px;color:var(--blue,#2a78d6)}
.lines .fadd{margin-top:8px}
.ap-sig{margin-top:6px}.ap-sig img{max-height:46px;max-width:180px;background:#fff;border:1px solid var(--line,#e3e8ec);border-radius:6px;padding:3px}
.att-steps{display:grid;gap:12px;margin-top:14px}
.att-step{border:1px solid var(--line,#e3e8ec);border-radius:10px;padding:10px 12px;background:var(--bg2,#fafbfc)}
.att-step>b{display:block;margin-bottom:6px}
.att-cam{margin-top:6px}.att-cam video,.att-cam img{width:100%;max-width:320px;border-radius:10px;background:#000;display:block}.att-cam [hidden]{display:none}
.att-go{width:100%;height:48px;justify-content:center;font-size:16px;margin-top:8px}
.att-kpi{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}
.att-sheet table th,.att-sheet table td{white-space:nowrap}
.att-sheet .stick{position:sticky;left:0;background:var(--card,#fff);z-index:1;min-width:170px}
.att-sheet th.sun{color:#c0392b}
.att-c{cursor:pointer;font-variant-numeric:tabular-nums;min-width:38px}
.att-c:hover{outline:2px solid var(--blue,#2a78d6);outline-offset:-2px}
.att-c.bad{background:#fdecea;color:#b42318}.att-c.wait{background:#fff6e0;color:#8a5a00}.att-c.late{color:#b7791f;font-weight:600}
.att-tabs button{margin-bottom:4px}
/* Phân ca nhanh (10/11/2026) — lưới tuần tô màu theo ca, chọn nhiều người, nút ⚡ theo dòng / cột, hộp thoại phân ca hàng loạt */
.rs-bar,.rs-flt{flex-wrap:wrap;gap:8px;align-items:center}
.rs-flt .in[type=search]{width:220px;max-width:100%}
.rs-selbar{display:inline-flex;gap:6px;align-items:center;background:#eef5ff;border:1px solid #cfe0fb;border-radius:8px;padding:3px 6px 3px 10px}
.rs-selbar[hidden]{display:none}
.rs-hint{font-size:12px;display:inline-flex;gap:4px;align-items:center;flex-wrap:wrap}
.rs-t th,.rs-t td{vertical-align:middle}
.rs-t th.c{white-space:nowrap}.rs-t th.sun{color:#c0392b}
.rs-t .rs-dh{display:inline-block;vertical-align:middle;text-align:center}
.rs-t .rs-colq{margin-left:2px;padding:2px 4px;min-height:0;height:24px;width:24px;vertical-align:middle;opacity:.7}
.rs-t .rs-colq:hover,.rs-nm .btn:hover{opacity:1;color:var(--blue,#2a78d6)}
.rs-t .rs-ck{width:30px;text-align:center}
.rs-t .rs-ck input{width:16px;height:16px;cursor:pointer}
.rs-nm{min-width:170px}.rs-nm>div{display:inline-block;vertical-align:middle;max-width:calc(100% - 34px)}
.rs-nm .btn{float:right;padding:2px 4px;height:26px;width:26px;opacity:.65}
.rs-t tr.rs-on td{background-color:#f3f8ff}
.rs-t td.rs-c{position:relative;min-width:104px;padding:6px 6px}
.rs-t td.rs-c .sel{width:100%;min-width:92px;background-color:rgba(255,255,255,.75)}
.rs-lv{display:block;margin-top:2px;font-size:10.5px;font-weight:600;color:#b42318}
.rs-rec{position:absolute;top:1px;right:2px;color:#16794c}.rs-rec .ico{width:11px;height:11px}
.rsq{display:grid;gap:12px}
.rsq-row{display:grid;grid-template-columns:120px 1fr;gap:10px;align-items:start}
.rsq-l{font-weight:600;font-size:13px;padding-top:7px}
.rsq-dates,.rsq-wd,.rsq-pre,.rsq-ppf{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.rsq-dates .in{width:160px}
.rsq-day{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line,#e3e8ec);border-radius:7px;padding:5px 9px;cursor:pointer;font-weight:600;font-size:13px;user-select:none}
.rsq-day:has(input:checked){background:#eef5ff;border-color:#9cc0f5;color:#174ea6}
.rsq-day.sun{color:#c0392b}
.rsq-ppf .in{width:180px}
.rsq-list{margin-top:8px;max-height:min(300px,38vh);overflow:auto;border:1px solid var(--line,#e3e8ec);border-radius:8px;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:0 4px;padding:4px}
.rsq-p{display:flex;gap:8px;align-items:center;padding:6px 8px;border-radius:6px;cursor:pointer}
.rsq-p:hover{background:#f5f8fb}.rsq-p[hidden]{display:none}
.rsq-p input{width:16px;height:16px;flex:none}
.rsq-p span{display:flex;flex-direction:column;min-width:0}.rsq-p b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rsq-p small{color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rsq-mode{display:flex;flex-direction:column;gap:6px;padding-top:6px}.rsq-mode label{display:flex;gap:6px;align-items:center;cursor:pointer}
.rsq-ppf .sel{width:auto;min-width:200px;max-width:100%}
.modal-f .rsq-sum{margin-right:auto;display:flex;gap:6px;align-items:center;font-size:13px;color:#174ea6;min-width:0}.modal-f .rsq-sum .ico{flex:none}
@media (max-width:720px){.rsq-row{grid-template-columns:1fr;gap:4px}.rsq-l{padding-top:0}.rsq-dates .in,.rsq-ppf .in,.rsq-ppf .sel{width:100%}.modal-f .rsq-sum{flex-basis:100%;margin:0 0 4px}.modal-f:has(.rsq-sum){flex-wrap:wrap}.rsq-list{grid-template-columns:1fr}.rs-hint{display:none}.rs-flt .in[type=search]{width:100%}}
.cb-att{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.cb-att .att-file{border:1px solid var(--line,#e3e8ec);border-radius:10px;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.cb-att .att-file .th{height:110px;display:flex;align-items:center;justify-content:center;background:#f4f6f8;cursor:pointer}
.cb-att .att-file .th img{max-width:100%;max-height:110px;object-fit:contain}
.cb-att .att-file .nm{padding:6px 8px;font-size:12px;word-break:break-all;flex:1}
.cb-att .att-file .ac{display:flex;gap:4px;padding:0 6px 6px}
.cb-drop{display:block;border:2px dashed var(--line,#cfd6dd);border-radius:12px;padding:18px;text-align:center;color:var(--muted,#6b7a88);cursor:pointer;margin-bottom:12px;transition:background .15s}
.cb-drop.over{background:#eef5ff;border-color:var(--blue,#2a78d6)}
@media (max-width:720px){.att-top{grid-template-columns:1fr}}
[hidden]{display:none!important} /* thuộc tính hidden luôn thắng display của .btn / .in (nút Chụp, Chỉ đường, khung video chấm công) */

/* ===== yêu cầu lần 02 + 03 (03/11/2026): xem tệp trực tiếp, tìm kiếm trong ô chọn ===== */
.modal.fview { max-width: 1200px; }
.modal.fview .modal-b { padding: 0; }
.fv-frame { display: block; width: 100%; height: min(74vh, 900px); border: 0; background: #eef1f5; }
select.ss { background-image: linear-gradient(transparent, transparent); }
.ss-pop { position: fixed; z-index: 400; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 50px rgba(7, 26, 45, .22); display: flex; flex-direction: column; overflow: hidden; }
.ss-q { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.ss-q svg { width: 16px; height: 16px; flex: none; }
.ss-q input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 14px; min-width: 0; background: transparent; color: var(--text); }
.ss-l { overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; }
.ss-o { padding: 7px 12px; cursor: pointer; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.ss-o.cur { background: var(--hover); }
.ss-o.on { font-weight: 600; color: var(--ink); }
.ss-o.on::after { content: ' ✓'; color: #16a34a; }
.ss-more { padding: 8px 12px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .fv-frame { height: 70vh; } .ss-o { padding: 10px 12px; font-size: 14.5px; } }
.lprofit { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; padding: 10px 12px; border: 1px solid #cfe7d6; background: #f2fbf5; border-radius: 8px; font-size: 13px; }
.lprofit > div { display: flex; flex-direction: column; min-width: 120px; }
.lprofit span { color: var(--muted); font-size: 12px; }
.lprofit b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lprofit small { color: var(--muted); font-size: 11.5px; }
.lprofit.warn { border-color: #f3d19c; background: #fff8ec; }
.lprofit .was { border-left: 1px solid var(--line); padding-left: 14px; }
/* kho NVL theo mã, đối chiếu chi phí ↔ dòng tiền, lập PO từ MRP (yêu cầu lần 02 + 03) */
.bkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.bkpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.bkpi span { font-size: 12px; color: var(--muted); }
.bkpi b { font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stk { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.stk-list { max-height: 68vh; overflow: auto; }
.stk-list tr.sel td { background: #eef5ff; }
.stk-d { position: sticky; top: 76px; }
.stk-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ftable .tbl-x { max-height: 260px; overflow: auto; }
.ftable tr.hl td { font-weight: 600; }
.mrp-po td { vertical-align: middle; }
.stk > * { min-width: 0; }
@media (max-width: 1100px) { .stk { grid-template-columns: minmax(0, 1fr); } .stk-d { position: static; } }
/* ===== r811: hướng dẫn bật định vị, luồng 3 cấp bảng lương ===== */
.gps-sec{border:1px solid var(--line,#e3e8ec);border-radius:10px;padding:8px 12px;margin-bottom:8px;background:var(--surface,#fff)}
.gps-sec summary{cursor:pointer;padding:4px 0}
.gps-steps{margin:8px 0 4px 18px;padding:0;line-height:1.65;font-size:13.5px}
.gps-steps li{margin-bottom:4px}
.att-geo-err{line-height:1.5}
.pay-flow .stp small{font-weight:400}
.pay-log td{font-size:12.5px}
.pay-flow .stp{white-space:normal;min-width:150px;align-items:flex-start}.pay-flow .stp>span:last-child{line-height:1.35}.pay-flow .stp small{display:block;font-weight:400}

/* điện thoại: nút có nhãn dài (Tạo mới: tên loại hồ sơ…) xuống dòng, không làm trang rộng quá màn hình */
@media (max-width: 760px) { .btn { max-width: 100%; white-space: normal; text-align: left; } [data-create], [data-fromonly] { white-space: normal; } }

/* ===== Trung tâm điều hành Ban Giám đốc (CEO Command Center, màn hình PGĐ — cập nhật 09/11/2026 tối) ===== */
.bgd { --b1: #1f5fd1; --b2: #0b2a5b; --bgl: #eef4ff; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); } .bgd > *, .bgd .tabs + div { min-width: 0; } .bgd .tabs { overflow-x: auto; }
.bgd .bg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg, #fff, #f2f7ff); border: 1px solid #dbe7fb; border-radius: 12px; padding: 10px 14px; }
.bg-ttl { display: flex; align-items: center; gap: 10px; }
.bg-ttl > .ico { width: 34px; height: 34px; color: var(--b1); }
.bg-ttl h2 { font-size: 19px; color: var(--b2); margin: 0; }
.bg-ttl span { font-size: 12.5px; color: var(--muted); }
.bg-filter { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.bg-filter label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.bg-filter .row { display: flex; gap: 6px; }
.bg-filter .sel, .bg-filter .in { height: 34px; min-width: 120px; }
.bg-filter .sp { flex: 1; }
.bg-upd { font-size: 11.5px; }
.bg-who { font-size: 13px; background: var(--b1, #1f5fd1); color: #fff; padding: 5px 12px; border-radius: 16px; white-space: nowrap; } .bg-who b { color: #fff; }
.bg-row { display: grid; gap: 12px; align-items: stretch; }
.bg-row.r-top { grid-template-columns: minmax(0, 3.2fr) minmax(280px, 1fr); }
.bg-row.r-top2 { grid-template-columns: minmax(0, 2.6fr) minmax(270px, 1fr); }
.bg-row.r-3 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr) minmax(0, 1.05fr); }
.bg-row.r-3b { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr); }
.bg-row.r-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bg-row.r-3c.t4 { grid-template-columns: minmax(0, .85fr) minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1.1fr); } .bg-row.r-3c.t3 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.1fr); }
.bg-row.r-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.bg-row.r-1 { grid-template-columns: 1fr; }
.bg-row.r-pg { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
.bg-row.r-kpi { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
.bg-col { display: grid; gap: 12px; align-content: start; min-width: 0; }
.bg-card { background: #fff; border: 1px solid #dfe8f5; border-radius: 12px; box-shadow: 0 2px 10px rgba(15, 50, 110, .06); padding: 12px 14px; min-width: 0; }
.bg-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bg-card > header h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--b2); }
.bg-card > header h3 .ico { color: var(--b1); width: 20px; height: 20px; }
.bg-card > header h3 small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.bg-more { font-size: 12.5px; color: var(--b1); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.bg-note { font-size: 11.5px; }
.bg-foot { margin-top: 8px; font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bgd .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.bg-tiles { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 10px; }
.bg-tiles.n4 { --n: 4; } .bg-tiles.n5 { --n: 5; }
.bg-tile { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; border-radius: 12px; padding: 12px; color: #fff; cursor: pointer; box-shadow: 0 6px 16px rgba(15, 50, 110, .18); transition: transform .12s, box-shadow .12s; min-width: 0; }
.bg-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15, 50, 110, .25); }
.bg-tile .ic .ico { width: 34px; height: 34px; opacity: .9; }
.bg-tile .tx { display: grid; gap: 2px; min-width: 0; }
.bg-tile .lb { font-size: 12.5px; opacity: .95; line-height: 1.25; }
.bg-tile b { font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.bg-tile small { font-size: 11.5px; opacity: .95; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.bg-tile small .ico { width: 13px; height: 13px; }
.bg-tile.c-blue { background: linear-gradient(135deg, #1d4ed8, #2f7bf2); } .bg-tile.c-green { background: linear-gradient(135deg, #15803d, #22b05a); }
.bg-tile.c-violet { background: linear-gradient(135deg, #5b21b6, #7c4ddb); } .bg-tile.c-orange { background: linear-gradient(135deg, #ea580c, #f59e0b); } .bg-tile.c-navy { background: linear-gradient(135deg, #0b3a8a, #2563eb); }
.bg-kpib { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 10px 14px; align-items: center; color: inherit; } .bg-kpib ul { grid-column: 1 / -1; }
.bg-kpib .medal { display: grid; justify-items: center; text-align: center; padding: 8px 10px; border-radius: 50%; background: radial-gradient(circle, #fff7d6, #fde68a); border: 3px solid #f2c94c; width: 108px; height: 108px; align-content: center; }
.bg-kpib .medal span, .bg-kpib .grade span { font-size: 10.5px; color: #475569; } .bg-kpib .medal b { font-size: 19px; color: var(--b2); } .bg-kpib .medal small { font-size: 10px; color: #475569; }
.bg-kpib .grade { display: grid; justify-items: center; padding: 6px 10px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.bg-kpib .grade b { font-size: 30px; line-height: 1; } .bg-kpib .grade small { font-size: 10.5px; color: var(--muted); }
.bg-kpib .g-A b { color: #dc2626; } .bg-kpib .g-B b { color: #2563eb; } .bg-kpib .g-C b { color: #ca8a04; } .bg-kpib .g-D b { color: #64748b; }
.bg-kpib ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.bg-kpib li { display: flex; gap: 5px; align-items: flex-start; color: var(--muted); } .bg-kpib li.ok { color: #14532d; } .bg-kpib li .ico { width: 14px; height: 14px; flex: none; margin-top: 1px; } .bg-kpib li.ok .ico { color: #16a34a; }
.bgd .t td, .bgd .t th { padding: 7px 8px; }
.bg-st th { font-size: 11px; line-height: 1.25; } .bg-st td { font-size: 12.5px; white-space: nowrap; } .bg-st td:nth-child(2) b { white-space: normal; }
.bgd .t tfoot td { background: #eef4ff; }
.bgd .t tr.sub td { font-size: 12.5px; color: #334155; background: #fafcff; }
.bgd .t tr.click { cursor: pointer; } .bgd .t tr.click:hover td { background: #f1f6ff; }
.bgd .t td.hl, .modal .t td.hl { background: #fff7d6; }
.bgd .pos { color: #15803d; } .bgd .neg { color: #dc2626; } .bgd .warn { color: #b45309; }
.bg-bar { position: relative; height: 18px; border-radius: 9px; background: #e2e8f0; overflow: hidden; }
.bg-bar i { position: absolute; inset: 0 auto 0 0; background: #16a34a; border-radius: 9px; } .bg-bar.warn i { background: #f59e0b; } .bg-bar.bad i { background: #ef4444; }
.bg-bar span { position: relative; z-index: 1; font-size: 11px; font-weight: 700; padding-left: 8px; line-height: 18px; color: #0f172a; }
.bg-pp { display: inline-block; padding: 1px 8px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 12px; background: #16a34a; } .bg-pp.warn { background: #f59e0b; color: #fff; } .bg-pp.bad { background: #ef4444; }
.bg-seg2 { display: flex; gap: 4px; margin-bottom: 6px; } .bg-seg2 button { flex: 1; border: 1px solid #c9d8f2; background: #fff; border-radius: 8px; padding: 6px; font-size: 12px; } .bg-seg2 button.on { background: var(--b1); color: #fff; border-color: var(--b1); }
.bg-donut { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, 1fr); gap: 6px; align-items: center; }
.bg-donut .chart { height: 220px; }
.bg-leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 11.5px; }
.bg-leg li { display: flex; gap: 6px; } .bg-leg i { width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; flex: none; } .bg-leg li.tot { border-top: 1px dashed #cbd5e1; padding-top: 4px; }
.bg-trend .chart { height: 240px; }
.bg-dl { display: grid; margin: 0; } .bg-dl a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed #e2e8f0; color: inherit; } .bg-dl a:hover { background: #f5f9ff; }
.bg-dl dt { font-size: 13px; color: #334155; display: flex; align-items: center; gap: 6px; } .bg-dl dd { margin: 0; font-weight: 700; font-size: 14px; color: var(--b2); white-space: nowrap; }
.bg-dl dd.pos { color: #15803d; } .bg-dl dd.neg { color: #dc2626; }
.bg-dl.dots dt i { width: 10px; height: 10px; border-radius: 50%; } .bg-dl.ic dt .ico { width: 16px; height: 16px; color: var(--b1); }
.bg-progb { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; }
.bg-gauge { text-align: center; cursor: pointer; } .bg-gauge .chart { height: 112px; } .bg-gauge span { font-size: 11.5px; font-weight: 600; color: var(--b2); }
.bg-hr2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .bg-hrc { border: 1px solid #dbe7fb; border-radius: 10px; padding: 8px; color: inherit; background: #f8fbff; }
.bg-hrc > b { display: block; text-align: center; font-size: 12.5px; color: var(--b1); margin-bottom: 4px; } .bg-hrc dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; margin: 0; font-size: 12.5px; } .bg-hrc dd { margin: 0; font-weight: 700; text-align: right; }
.bg-risk { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bg-risk li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; }
.bg-risk a { display: flex; gap: 8px; align-items: flex-start; color: inherit; font-size: 13px; } .bg-risk a .ico { color: #dc2626; flex: none; margin-top: 2px; } .bg-risk small { display: block; color: var(--muted); font-size: 11.5px; }
.bg-lv { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; } .bg-lv.vh { background: #fde2e2; color: #b91c1c; } .bg-lv.h { background: #fef3c7; color: #a16207; } .bg-lv.m { background: #fef9c3; color: #854d0e; }
.bg-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; } .bg-tabs button { border: 1px solid #c9d8f2; background: #f5f9ff; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--b2); } .bg-tabs button.on { background: var(--b1); color: #fff; border-color: var(--b1); } .bg-tabs .sp { flex: 1; }
.bg-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bg-tasks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; }
.bg-tasks .ck { width: 24px; height: 24px; border: 2px solid #2563eb; border-radius: 5px; background: #fff; display: grid; place-items: center; color: #2563eb; padding: 0; } .bg-tasks .ck .ico { width: 14px; height: 14px; }
.bg-tasks li.done .ck { background: #16a34a; border-color: #16a34a; color: #fff; } .bg-tasks li.done a { text-decoration: line-through; color: var(--muted); }
.bg-tasks a { color: inherit; font-size: 13px; } .bg-tasks small { display: block; color: var(--muted); font-size: 11px; } .bg-tasks .due { font-size: 12.5px; font-weight: 600; }
.bg-tasks li.od .due { color: #dc2626; }
.bg-acts { display: grid; gap: 8px; }
.bg-prof h3 { font-size: 18px; color: var(--b2); } .bg-prof h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--b2); margin: 12px 0 6px; } .bg-prof h4 .ico { color: var(--b1); }
.bg-pf { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; } .bg-pf span { color: var(--b1); font-size: 13px; font-weight: 600; }
.bg-ava { border-radius: 50%; object-fit: cover; border: 3px solid #dbe7fb; } .bg-ava.ini { display: grid; place-items: center; background: linear-gradient(135deg, #1d4ed8, #60a5fa); color: #fff; font-weight: 700; font-size: 22px; }
.bg-chk { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; } .bg-chk li { display: flex; gap: 6px; } .bg-chk .ico { color: #16a34a; width: 16px; height: 16px; flex: none; margin-top: 2px; } .bg-chk small { display: block; color: var(--muted); }
.bg-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } .bg-mini.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bg-mini.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bg-mini > button, .bg-mini > a, .bg-mini > .bg-card { display: grid; justify-items: center; text-align: center; gap: 3px; border: 1px solid #dbe7fb; border-radius: 10px; background: #f8fbff; padding: 10px 6px; color: inherit; cursor: pointer; }
.bg-mini .ico { width: 26px; height: 26px; color: var(--b1); } .bg-mini span { font-size: 12px; color: #334155; } .bg-mini b { font-size: 17px; color: var(--b2); } .bg-mini small { font-size: 11px; color: var(--muted); }
.bg-mini > button:hover, .bg-mini > a:hover { border-color: var(--b1); }
.bg-fn { display: flex; align-items: center; gap: 2px; } .bg-fn > button { flex: 1; display: grid; justify-items: center; gap: 2px; border: 0; background: none; padding: 4px 2px; min-width: 0; }
.bg-fn > button .ico { width: 24px; height: 24px; color: var(--b1); } .bg-fn span { font-size: 11px; text-align: center; line-height: 1.2; } .bg-fn b { font-size: 19px; color: var(--b2); } .bg-fn em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #16a34a; border-radius: 8px; padding: 0 7px; } .bg-fn em.warn { background: #f59e0b; } .bg-fn em.bad { background: #ef4444; }
.bg-fn .ar .ico { width: 14px; height: 14px; color: #94a3b8; }
.bg-mt td, .bg-mt th { font-size: 12.5px; }
.bg-kt td { font-size: 12.5px; }
.bg-lds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; } .bg-ld { border: 1px solid #dbe7fb; border-radius: 10px; padding: 10px; color: inherit; background: #f8fbff; } .bg-ld b { display: block; color: var(--b2); } .bg-ld small { color: var(--muted); } .bg-ld:hover { border-color: var(--b1); }
.bg-aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; } .bg-ag { display: grid; gap: 2px; text-align: left; border: 1px solid #e2e8f0; border-left: 4px solid #16a34a; border-radius: 8px; background: #fff; padding: 8px 10px; }
.bg-ag.k-risk { border-left-color: #f59e0b; } .bg-ag.k-late { border-left-color: #ef4444; } .bg-ag.k-bad { border-left-color: #7f1d1d; } .bg-ag span { font-size: 12px; color: var(--muted); } .bg-ag b { font-size: 16px; color: #0b2a5b; } .bg-ag small { font-size: 11px; color: var(--muted); }
.bg-plan .in.sm { height: 30px; min-width: 110px; text-align: right; } .bg-plan small { display: block; font-size: 11px; }
.bgd tr.strike td { text-decoration: line-through; }
.bgd tr.sel td { background: #eef4ff; }
.bg-cfg { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; } .bg-cfg dd { margin: 0; }
.bgd .up, .bgd .dn { display: inline-flex; align-items: center; }
.bgd .bg-alertbar { display: none; }
@media (max-width: 1760px) { .bg-row.r-3, .bg-row.r-3b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .bg-row.r-3 > .bg-seg, .bg-row.r-3b > .bg-seg { grid-column: 1 / -1; } }
@media (max-width: 1500px) { .bg-row.r-3c.t4, .bg-row.r-3c.t3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .bg-row.r-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bg-row.r-3, .bg-row.r-3b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .bg-row.r-3 > .bg-seg, .bg-row.r-3b > .bg-seg { grid-column: 1 / -1; } }
@media (max-width: 1200px) { .bg-row.r-top, .bg-row.r-top2, .bg-row.r-pg, .bg-row.r-2, .bg-row.r-kpi { grid-template-columns: minmax(0, 1fr); } .bg-tiles.n5 { --n: 3; } }
@media (max-width: 760px) {
  .bg-row.r-3, .bg-row.r-3b, .bg-row.r-4, .bg-row.r-3c.t4, .bg-row.r-3c.t3 { grid-template-columns: minmax(0, 1fr); }
  .bg-tiles.n5, .bg-tiles.n4 { --n: 2; } .bg-tile b { font-size: 19px; } .bg-tile .ic .ico { width: 26px; height: 26px; }
  .bg-mini, .bg-mini.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bg-mini.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bg-donut { grid-template-columns: minmax(0, 1fr); } .bg-kpib { grid-template-columns: auto auto; } .bg-kpib ul { grid-column: 1 / -1; }
  .bg-fn { flex-wrap: wrap; } .bg-fn > button { flex: 1 0 30%; } .bg-fn .ar { display: none; }
  .bg-aging { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bg-hr2 { grid-template-columns: minmax(0, 1fr); } .bg-progb { grid-template-columns: 100px 1fr; }
  .bg-filter label { flex: 1 1 140px; } .bg-cfg { grid-template-columns: 1fr; }
  .bgd .bg-alertbar { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; color: inherit; font-size: 13px; order: -1; } .bgd .bg-alertbar .ico { color: #dc2626; grid-row: span 2; } .bgd .bg-alertbar small { color: var(--muted); }
}
/* u1611-mn: ô chọn có tìm kiếm (public/admin/selsearch.js) — số kết quả, tô phần khớp, lựa chọn khóa / bỏ chọn */
.ss-n { padding: 4px 12px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: #f8fafc; }
.ss-o mark { background: #fff1b8; color: inherit; padding: 0; border-radius: 2px; font-weight: 600; }
.ss-o.dis { color: var(--muted); cursor: not-allowed; opacity: .6; }
.ss-o.none { color: var(--muted); font-style: italic; }
.ss-o.cur.on { background: #dbeafe; }

/* u1711 — Bảng chấm công hôm nay kiểu ABC Resort: điểm + khoảng cách + trong / ngoài vùng, ảnh thu nhỏ, ra ca hộ */
.att-today td { vertical-align: top; }
.att-today .att-t { font-size: 15px; display: block; }
.att-geo { font-size: 12px; color: var(--muted, #667085); line-height: 1.45; margin-top: 2px; max-width: 240px; }
.att-geo b { color: var(--ink, #1d2939); }
.att-zone { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; }
.att-zone.ok { background: #e7f6ec; color: #18794e; }
.att-zone.bad { background: #fdecec; color: #b42318; }
.att-st .pill { margin: 1px 0; }
.att-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #e4e7ec); margin-right: 4px; cursor: zoom-in; background: #f2f4f7; }
.att-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.att-acts .btn { white-space: nowrap; }
.att-acts .att-out { background: #3f5a36; border-color: #3f5a36; color: #fff; }
.att-acts .att-out:hover { background: #33492c; }
@media (max-width: 720px) { .att-geo { max-width: 160px; } .att-thumb { width: 36px; height: 36px; } }
/* u1711 — Danh mục vai trò: danh sách quyền theo nhóm (ô tích thường, 2 cột trên màn rộng) */
.rf-grp { margin-bottom: 10px; }
.rf-gh { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line, #e4e7ec); position: sticky; top: 0; background: var(--card, #fff); z-index: 1; }
.rf-gh .muted { font-weight: 400; }
.rf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px 16px; padding: 4px 0 0 4px; }
.rf-pi { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; padding: 3px 0; cursor: pointer; }
.rf-pi input, .rf-gh input { margin-top: 2px; width: 16px; height: 16px; flex: 0 0 auto; }
.rf-pi .mono { font-size: 11px; }
.fn-chips .pill { white-space: normal; max-width: 100%; text-align: left; line-height: 1.35; height: auto; }
/* u1711 — bảng chấm công hôm nay trên điện thoại: mỗi người một thẻ (không phải cuộn ngang) */
@media (max-width: 720px) {
  table.att-today thead { display: none; }
  table.att-today, table.att-today tbody { display: block; }
  table.att-today tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 4px; border-bottom: 1px solid var(--line, #e4e7ec); }
  table.att-today td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; }
  table.att-today td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted, #667085); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
  table.att-today td.att-who { grid-column: 1 / -1; font-size: 15px; }
  table.att-today td.att-who::before { display: none; }
  table.att-today td.att-actc { grid-column: 1 / -1; }
  table.att-today .att-acts { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  table.att-today .att-geo { max-width: none; }
}
/* u1711 — Báo cáo số dư Mỹ phẩm */
.xb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.xb-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; color: inherit; min-width: 0; }
.xb-tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.xb-tile small { font-size: 12px; line-height: 1.4; }
.xb-tile.warn { box-shadow: inset 3px 0 0 #d97706; }
.xb-dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; }
.xb-dl dt { margin: 0; } .xb-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.dochead a.dhead { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; text-decoration: none; border: 1px solid; }
.dochead a.dhead .ico, .dochead a.dhead svg { width: 16px; height: 16px; flex: none; }
.dochead a.dhead.t-warn { background: #fff7e6; border-color: #f5c77a; color: #8a4b00; } .dochead a.dhead.t-ok { background: #ecf8ec; border-color: #b9e0b9; color: #0b5a0b; } .dochead a.dhead.t-crit { background: #fdecec; border-color: #f2b3b3; color: #9b1c1c; } .dochead a.dhead.t-info { background: #eef4ff; border-color: #b8cdf5; color: #1d4fa8; }
.cl-fig li span { min-width: 0; }
.chk-bar { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 2px 0 8px; }
.chk-bar .in { max-width: 220px; } .chk-bar .muted { font-size: 12px; }
.dr-note { margin-bottom: 10px; }
@keyframes mnudge { 0%, 100% { transform: none; } 30% { transform: scale(1.012); } 60% { transform: scale(.996); } }
.modal.nudge { animation: mnudge .28s ease; }
/* p1911 (ABC 19/11): dải loại hồ sơ to, màu riêng — Tờ trình · Đề xuất đặt hàng · Đề xuất giao hàng · ĐNTT Nhà máy */
.dkind { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; padding: 7px 14px 7px 11px; border-radius: 10px; margin: 0 0 8px; color: #fff; background: var(--kc, #475569); box-shadow: 0 1px 2px rgba(15,23,42,.18); max-width: 100%; }
.dkind b { font-size: 17px; letter-spacing: .02em; line-height: 1.2; }
.dkind small { font-size: 12px; opacity: .9; font-weight: 500; }
.dkind .ico, .dkind svg { width: 20px; height: 20px; color: #fff; flex: none; }
.dkind.k-tt { --kc: #4338ca; } .dkind.k-po { --kc: #c2410c; } .dkind.k-dx { --kc: #047857; } .dkind.k-pr { --kc: #7c3aed; }
.dkind.k-gen { background: #eef2f7; color: #1e293b; box-shadow: inset 0 0 0 1px #cbd5e1; } .dkind.k-gen b { font-size: 15px; } .dkind.k-gen .ico, .dkind.k-gen svg { color: #475569; }
@media (max-width: 640px) { .dkind { display: flex; width: 100%; } .dkind b { font-size: 16px; } }
/* p1911 (ABC 19/11: “Xem tờ trình đã duyệt — tô màu lên giúp em”): nút xem tờ trình cùng màu dải TỜ TRÌNH */
.btn.ttp { background: #4338ca; border-color: #4338ca; color: #fff; font-weight: 600; }
.btn.ttp:hover { background: #3730a3; border-color: #3730a3; }
.btn.ttp .ico, .btn.ttp svg { color: #fff; }
.btn.ttp2 { background: #eef2ff; border-color: #a5b4fc; color: #3730a3; font-weight: 600; }
a.ttp-l { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 6px; background: #4338ca; color: #fff !important; font-weight: 600; text-decoration: none; }
/* q2011: ô thông tin dài chiếm trọn hàng — nhãn trên, nội dung dưới, giữ xuống dòng */
.dl2 dt.w { grid-column: 1 / -1; margin-top: 4px; border-top: 1px dashed var(--line-2, #e5e9f0); padding-top: 8px; }
.dl2 dd.w { grid-column: 1 / -1; white-space: pre-wrap; line-height: 1.55; margin-top: -4px; }
/* q2011: khung “Thông tin hồ sơ” hẹp (cột giữa cạnh khung bên phải) → một cặp nhãn | giá trị mỗi hàng, giá trị không bị bóp 4–5 dòng */
.dmain .card-b { container-type: inline-size; }
@container (max-width: 720px) { .dl2 { grid-template-columns: minmax(110px, 32%) minmax(0, 1fr); } }
/* q2011b (ABC 20/11 13:55, điện thoại): ô ngày / giờ / ngày-giờ luôn vừa khung biểu mẫu, chữ căn trái (trước đây tràn mép phải, chữ lệch) */
.fgrid input[type="date"], .fgrid input[type="time"], .fgrid input[type="datetime-local"] { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; text-align: left; }
.fgrid input[type="date"]::-webkit-date-and-time-value, .fgrid input[type="time"]::-webkit-date-and-time-value, .fgrid input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
/* q2011e: lịch sử sửa đơn — danh sách trước → sau */
.hchg { margin: 4px 0 2px; padding-left: 16px; font-size: 12.5px; line-height: 1.45; display: grid; gap: 2px; }
.hchg li { overflow-wrap: anywhere; }

/* r2111b — Thông báo nổi bật (ABC 21/11): dải tiêu đề đậm, lọc chưa đọc, thẻ chưa đọc viền màu theo loại + MỚI */
.modal.npanel { width: min(560px, 100%); }
.modal.npanel .modal-h { background: linear-gradient(120deg, #0b2a5b, #1d63dc); color: #fff; border-bottom: 0; }
.modal.npanel .modal-h h3 { color: #fff; font-size: 17px; }
.modal.npanel .modal-h .btn.icon { color: #fff; background: rgba(255, 255, 255, .14); border-color: transparent; }
.np-seg { display: flex; gap: 6px; margin: 0 0 10px; position: sticky; top: -1px; z-index: 1; background: var(--card, #fff); padding: 4px 0; }
.nps-b { border: 1px solid var(--line); background: var(--card, #fff); border-radius: 999px; padding: 6px 12px; font: 600 13px inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.nps-b b { background: #e5484d; color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.nps-b.on { background: #0b2a5b; color: #fff; border-color: #0b2a5b; }
.ni { position: relative; }
.ni b { font-size: 14px; line-height: 1.35; }
.ni p { white-space: pre-line; color: #3b4659; font-size: 13px; }
.ni-h { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; flex-wrap: wrap; }
.ni-h small { margin-left: auto; }
.ni-k { font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.ni-new { font-size: 10.5px; font-weight: 800; color: #fff; background: #e5484d; border-radius: 4px; padding: 1px 6px; }
.ni.unread { background: #fff; border: 1px solid #d6e2f3; box-shadow: 0 2px 8px rgba(11, 42, 91, .08); }
.ni.unread::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #1d63dc; }
.ni.unread.nk2-approval::before { background: #d68a00; } .ni.unread.nk2-risk::before, .ni.unread.nk2-urgent::before { background: #e5484d; }
.ni.unread.nk2-leave::before { background: #0ea5a4; } .ni.unread.nk2-watch::before { background: #7c5cd6; } .ni.unread.nk2-decision::before { background: #1e8f52; }
.ni:not(.unread) { opacity: .82; }
.nk.k-leave { background: #e0f5f4; color: #0b7f7e; } .nk.k-watch { background: #efeafd; color: #6747c7; } .nk.k-urgent { background: #fdecec; color: var(--crit); }
.nk.k-zc { background: #fff0e6; color: #c2570c; } .nk.k-xnk { background: #fde8f3; color: #b0247a; } .nk.k-broadcast { background: #e8f1fb; color: var(--blue); } .nk.k-consult { background: #eef2f7; color: #334155; }
@media (max-width: 560px) { .modal.npanel { width: 100%; } .ni b { font-size: 14.5px; } }

/* r2111d — ô bắt buộc còn thiếu: nháy viền; thông báo trùng: rung nhẹ thay vì chồng */
@keyframes fflash { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 4px rgba(229, 72, 77, .35); } }
.f.err.flash { animation: fflash 1s ease 2; border-radius: 8px; }
@keyframes tbump { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.toast.bump { animation: tbump .35s ease; }
