﻿/* P2-CUSTOMER-PORTAL-20261125: trang Trả kết quả từ xa */
:root {
    --brand: #0d5aa7; --brand-dark: #0a3d73; --brand-soft: #e8f1fb;
    --ink: #1f2d3a; --muted: #5f7184; --line: #dde5ee; --bg: #f3f6fa; --card: #fff;
    --ok: #2e7d32; --ok-bg: #e7f5e9; --warn: #b45309; --warn-bg: #fff4e0; --bad: #c62828; --bad-bg: #fdecec;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--brand); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* thanh trên */
.topbar { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { height: 40px; width: 40px; background: #fff; border-radius: 50%; padding: 2px; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand small { opacity: .85; font-size: 12.5px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 500; opacity: .92; }
.nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.nav a.active { background: rgba(255,255,255,.2); opacity: 1; }
.nav-user { display: flex; align-items: center; gap: 8px; margin-left: 12px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.3); }
.nav-user .who { font-size: 13.5px; opacity: .9; }
.nav a.logout { border: 1px solid rgba(255,255,255,.5); padding: 5px 10px; font-size: 13.5px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; font-size: 20px; border-radius: 6px; padding: 2px 10px; cursor: pointer; }
.customer-bar { background: #fff; border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 14.5px; }
.cust-label { color: var(--muted); }
.main { padding: 22px 16px 40px; min-height: calc(100vh - 220px); }
.footer { color: var(--muted); font-size: 13px; padding: 18px 0 26px; border-top: 1px solid var(--line); background: #fff; }

/* tiêu đề, thẻ */
h1 { font-size: 23px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .right { margin-left: auto; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: var(--brand); }
.stat .n { font-size: 28px; font-weight: 700; color: var(--brand-dark); }
.stat .t { color: var(--muted); font-size: 13.5px; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); }

/* bảng */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 2px solid var(--line); background: #f8fafc; white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: #fafcff; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .c { text-align: center; }
.code { font-family: Consolas, "Courier New", monospace; font-weight: 600; color: var(--brand-dark); text-decoration: none; }
.sub { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

/* trạng thái */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-new { background: #eef2f7; color: #43566b; }
.st-lab { background: var(--brand-soft); color: var(--brand-dark); }
.st-wait { background: var(--warn-bg); color: var(--warn); }
.st-part { background: #fff7d6; color: #8a6100; }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-old { background: #f1f1f1; color: #666; }
.st-cancel { background: var(--bad-bg); color: var(--bad); }
.dat { color: var(--ok); font-weight: 600; } .khong-dat { color: var(--bad); font-weight: 600; }

/* tiến độ */
.steps { display: flex; margin: 8px 0 4px; }
.steps .s { flex: 1; text-align: center; position: relative; font-size: 13px; color: var(--muted); padding-top: 34px; }
.steps .s::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%;
    background: #e3e9f0; color: #6b7d90; font-weight: 700; line-height: 28px; z-index: 1; }
.steps .s::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: #e3e9f0; }
.steps .s:first-child::after { display: none; }
.steps .s.done::before { background: var(--ok); color: #fff; content: "✓"; }
.steps .s.done::after, .steps .s.cur::after { background: var(--ok); }
.steps .s.cur::before { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.steps .s.cur { color: var(--brand-dark); font-weight: 600; }
.steps .s .d { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }

.info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 22px; }
.info div span { display: block; font-size: 12.5px; color: var(--muted); }
.info div b { font-weight: 600; }

.slip { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.slip.returned { border-color: #b9e0bd; background: #fbfefb; }
.slip .t { font-weight: 600; }
.slip .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* biểu mẫu, nút */
.btn { display: inline-block; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 8px 16px; border-radius: 7px; font-weight: 600;
    font-size: 14.5px; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--brand-dark); }
.btn.light { background: #fff; color: var(--brand); }
.btn.light:hover { background: var(--brand-soft); }
.btn.sm { padding: 5px 11px; font-size: 13.5px; }
.btn.pdf { background: #c62828; border-color: #c62828; }
.btn.pdf:hover { background: #9f1f1f; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters label, .form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=password], input[type=email], input[type=date], select, textarea {
    font-family: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #c7d3e0; border-radius: 7px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3ec; border-color: var(--brand); }
.filters .f { min-width: 150px; }
.filters .f.grow { flex: 1; min-width: 220px; }
.form { max-width: 720px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.readonly { background: #f5f7fa; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-height: 38px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--brand-soft); color: var(--brand-dark); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: #fff; font-size: 14px; }
.pager span.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f1f5f9; border-radius: 12px; padding: 3px 10px; font-size: 13px; }

/* trang đăng nhập */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
    background: linear-gradient(135deg, #0a3d73 0%, #0d5aa7 55%, #2f86d6 100%); }
.login-box { background: #fff; border-radius: 14px; width: 100%; max-width: 410px; padding: 30px 30px 24px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.login-box .logo { text-align: center; margin-bottom: 8px; }
.login-box .logo img { width: 70px; height: 70px; }
.login-box h1 { text-align: center; font-size: 21px; }
.login-box .lead { text-align: center; font-size: 14px; }
.login-box .btn { width: 100%; padding: 10px; font-size: 16px; margin-top: 6px; }
.login-box .help { font-size: 13px; color: var(--muted); margin-top: 16px; text-align: center; }

/* bản xem kết quả */
.result-head { text-align: center; margin-bottom: 14px; }
.result-head h1 { font-size: 20px; text-transform: uppercase; }
.watermark-note { font-size: 13px; color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 7px; margin-bottom: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .info { grid-template-columns: 1fr 1fr; }
    .menu-btn { display: block; }
    .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--brand-dark); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; z-index: 10; }
    .nav-open .nav { display: flex; }
    .nav-user { margin: 8px 0 0; padding: 8px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.3); }
    .topbar { position: relative; }
}
@media (max-width: 640px) {
    .info, .form .row2 { grid-template-columns: 1fr; }
    .tbl.responsive thead { display: none; }
    .tbl.responsive tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fff; }
    .tbl.responsive td { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef2f6; text-align: right; }
    .tbl.responsive td::before { content: attr(data-l); color: var(--muted); font-size: 13px; text-align: left; }
    .steps .s { font-size: 11.5px; }
    .brand small { display: none; }
}
@media print {
    .topbar, .customer-bar, .footer, .toolbar, .no-print { display: none !important; }
    body { background: #fff; }
    .card { border: 0; padding: 0; }
    .main { padding: 0; }
}
