/* NQC Procurement – navy + cam */
:root {
  --navy: #0F2D57; --navy-2: #0A2244; --orange: #F47920; --green: #12875A; --green-soft: #E2F5EC; --red: #C62F28; --red-soft: #FDE8E6;
  --amber: #B96A00; --amber-soft: #FFF0DB; --blue: #2459A9; --blue-soft: #E7EFFB; --bg: #F4F6FA; --surface: #fff; --surface-2: #F7F9FC;
  --border: #E1E6EF; --text: #172033; --muted: #5C6778; --faint: #8C97A8;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; color: var(--navy); } h2 { font-size: 15px; margin: 0; } h3 { font-size: 14px; margin: 0 0 2px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; } .bold { font-weight: 600; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); }

.side a em[hidden] { display: none; }

/* Khung */
.top { height: 56px; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 18px; position: sticky; top: 0; z-index: 30; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 16px; width: 200px; color: #fff; }
.logo img { width: 30px; height: 30px; } .logo:hover { text-decoration: none; }
.search { flex: 1; max-width: 460px; margin: 0 auto; position: relative; }
.search input { width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.search input::placeholder { color: #AFC0DC; }
.results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(10,34,68,.2); max-height: 60vh; overflow: auto; }
.results a { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.results a:hover { background: var(--surface-2); text-decoration: none; }
.me { display: flex; align-items: center; gap: 9px; cursor: pointer; background: none; border: 0; color: #fff; font: inherit; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
.shell { display: flex; min-height: calc(100vh - 56px); }
.side { width: 220px; flex: none; background: var(--navy); color: #C5D2E8; padding: 6px 0 24px; border-top: 1px solid rgba(255,255,255,.1); }
.side .who { padding: 10px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side .who b { display: block; color: #fff; margin-top: 8px; } .side .who span.small { word-break: break-all; }
.role { display: inline-block; background: rgba(244,121,32,.18); color: #FFA55C; border: 1px solid rgba(244,121,32,.45); border-radius: 20px; padding: 1px 10px; font-size: 11px; font-weight: 600; }
.side .sec { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: #7E93BA; padding: 16px 18px 6px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 18px; color: #D3DDEF; border-left: 3px solid transparent; }
.side a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side a.on { background: rgba(255,255,255,.1); border-left-color: var(--orange); color: #fff; font-weight: 600; }
.side a i { font-style: normal; width: 18px; text-align: center; }
.side a em { margin-left: auto; font-style: normal; background: var(--orange); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { padding: 20px 24px 40px; flex: 1; }
footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.head { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.head > div:first-child { flex: 1; min-width: 240px; } .head p { margin: 3px 0 0; color: var(--muted); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Thành phần */
.btn { font: inherit; font-weight: 600; font-size: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.navy:hover { background: var(--navy-2); }
.btn.cta { background: var(--orange); border-color: var(--orange); color: #fff; } .btn.cta:hover { filter: brightness(.94); }
.btn.line { border-color: var(--navy); color: var(--navy); }
.btn.danger { color: var(--red); border-color: #EFC1BE; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 0; }
textarea { resize: vertical; min-height: 62px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--navy); border-radius: 10px; padding: 13px 16px; }
.stat.o { border-top-color: var(--orange); } .stat.g { border-top-color: var(--green); } .stat.n { border-top-color: #AEB8C8; }
.stat label { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; font-size: 28px; line-height: 1.25; margin-top: 6px; color: var(--navy); }
.stat.o b { color: var(--orange); } .stat.g b { color: var(--green); } .stat b small { font-size: 13px; font-weight: 400; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--muted); padding: 7px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--navy); color: #fff; font-weight: 600; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; min-width: 0; }
.card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card > header h2 { flex: 1; }
.card > .body { padding: 14px 16px; }
.vendor { margin: 0; display: flex; flex-direction: column; }
.vendor .vh { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.vendor .vh > div:nth-child(2) { flex: 1; min-width: 0; }
.vendor h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-sq { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.c0 { background: #124A8C; } .c1 { background: #0E7F99; } .c2 { background: #12875A; } .c3 { background: #C46A10; } .c4 { background: #4B45C0; } .c5 { background: #C0322C; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 12px 16px; flex: 1; }
.kv label, .info label { display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); }
.kv span { font-weight: 600; }
.vf { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border); }
.tags { flex: 1; display: flex; gap: 5px; flex-wrap: wrap; overflow: hidden; max-height: 22px; }
.tag { background: var(--blue-soft); color: var(--blue); border-radius: 20px; font-size: 11px; padding: 2px 9px; white-space: nowrap; }
.info { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; }
.info div { overflow-wrap: anywhere; white-space: pre-line; }
.badge { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 11.5px; font-weight: 600; background: #EDF0F5; color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.orange { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); } .badge.blue { background: var(--blue-soft); color: var(--blue); }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr[data-href] { cursor: pointer; } tr[data-href]:hover td { background: var(--surface-2); }
th.right, td.right { text-align: right; }
td.best { background: var(--green-soft); }
.compare td, .compare th { min-width: 150px; } .compare td:first-child, .compare th:first-child { min-width: 220px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.compare label { cursor: pointer; display: block; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.steps span { padding: 4px 14px; border-radius: 20px; background: #E9EDF4; color: var(--muted); font-size: 12px; font-weight: 600; }
.steps span.done { background: var(--green-soft); color: var(--green); } .steps span.on { background: var(--navy); color: #fff; }
.note { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; background: var(--amber-soft); color: #7A4600; }
.note.red { background: var(--red-soft); color: #8E1F1A; }
.bar { height: 8px; border-radius: 6px; background: #E9EDF4; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--green); }
.hbar { display: grid; grid-template-columns: minmax(90px, 220px) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .bar i { background: var(--blue); }
.files a { margin-right: 4px; } .files span { white-space: nowrap; margin-right: 12px; display: inline-block; }
.x { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 15px; padding: 0 4px; }
svg.chart { width: 100%; height: auto; display: block; }

/* Hộp thoại & biểu mẫu */
.overlay { position: fixed; inset: 0; background: rgba(10,25,50,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 620px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: 1180px; }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal .body { padding: 16px 18px; }
.modal footer { justify-content: flex-end; border-radius: 0 0 14px 14px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.f.full { grid-column: 1 / -1; } .f.two { grid-column: span 2; }
.req::after { content: " *"; color: var(--red); }
.lines td { padding: 4px; } .lines input { width: 100%; padding: 5px 7px; font-size: 13px; }
.lines td.ro { padding: 9px 8px; }
.checks { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.checks label { display: flex; gap: 8px; padding: 4px 0; align-items: center; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; max-width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.login { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 16px; }
.login form { background: var(--surface); border-radius: 16px; padding: 28px; width: 360px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.login img { width: 52px; height: 52px; }
.login .btn { padding: 10px; }
.shade { display: none; }
#print { display: none; }

@media (max-width: 900px) {
  .burger { display: block; } .logo { width: auto; } .logo span, .me span.nm { display: none; }
  .side { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 40; overflow: auto; transform: translateX(-100%); transition: transform .2s; }
  body.menu .side { transform: none; }
  body.menu .shade { display: block; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.4); z-index: 35; }
  .view { padding: 14px 16px 32px; } .cols { grid-template-columns: 1fr; } footer { padding: 12px 16px; }
  .f.two { grid-column: 1 / -1; }
  .compare td:first-child, .compare th:first-child { position: static; }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .stack thead { display: none; }
  .stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .stack td { display: block; border: 0; padding: 3px 14px; text-align: left; }
}
@media print {
  body.printing > * { display: none !important; }
  body.printing > #print { display: block !important; }
  #print { font: 12px/1.5 "Times New Roman", serif; color: #000; }
  #print h1 { text-align: center; color: #000; font-size: 18px; margin: 14px 0 4px; }
  #print table { margin: 10px 0; font-size: 12px; } #print th, #print td { border: 1px solid #000; background: none; color: #000; text-transform: none; padding: 4px 6px; }
  #print .sign { display: flex; justify-content: space-around; text-align: center; margin-top: 30px; font-weight: bold; }
  @page { size: A4; margin: 14mm; }
}
