/* Khung giao diện Mẫu C — PVOIL (07-UI-SPEC). Nạp sau Tabler và legacy.css. Chỉ 2 độ đậm: 400 và 600. */
:root {
  --tblr-font-sans-serif: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --tblr-body-font-size: 16px;
  --tblr-body-line-height: 1.5;
  --tblr-body-bg: #f6f7f9;
  --tblr-primary: #1f5aa6;
  --tblr-primary-rgb: 31, 90, 166;
  --tblr-link-color: #1f5aa6;
  --tblr-link-color-rgb: 31, 90, 166;
  --tblr-link-hover-color: #174a8c;
  --tblr-font-weight-bold: 600;
  --pv-red: #ed1c24;
  --pv-blue: #1f5aa6;
  --pv-blue-hover: #174a8c;
  --pv-navy: #173f73;
}
body { font-size: 16px; line-height: 1.5; font-weight: 400; background: #f6f7f9; color: #1d2330; }
b, strong, .fw-bold, .fw-bolder { font-weight: 600 !important; }
label, .form-label { font-size: 14px; font-weight: 600; }
.text-secondary, .text-muted, small, .small { font-size: 14px; color: #5d6675 !important; }
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .card-title, .page-title { font-size: 20px; font-weight: 600; line-height: 1.2; }
.display { font-size: 28px; font-weight: 600; line-height: 1.2; }
.page-body { margin-top: 24px; }

/* Accent PVOIL */
a { color: var(--pv-blue); }
a:hover { color: var(--pv-blue-hover); }
.btn-primary { background: var(--pv-blue); border-color: var(--pv-blue); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--pv-blue-hover); border-color: var(--pv-blue-hover); color: #fff; }
.btn-outline-primary { color: var(--pv-blue); border-color: var(--pv-blue); }
.btn-outline-primary:hover { background: var(--pv-blue); color: #fff; }
.page-link.active, .active > .page-link { background: var(--pv-blue); border-color: var(--pv-blue); color: #fff; }
.page-link { color: var(--pv-blue); }
:focus-visible, .form-control:focus, .form-select:focus, .btn:focus-visible {
  outline: 2px solid var(--pv-blue); outline-offset: 2px; box-shadow: none; border-color: var(--pv-blue);
}

/* Vùng chạm 44px */
.btn, .form-control, .form-select, .page-link { min-height: 44px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
table.table tbody tr, table.t tbody tr { min-height: 48px; }
table.table td, table.table th { padding-top: 12px; padding-bottom: 12px; }
table.table th { font-size: 14px; font-weight: 600; }

/* Menu bên */
.navbar-vertical.pv-sidebar { background: var(--pv-navy); color: #fff; border-top: 4px solid var(--pv-red); }
.pv-sidebar .navbar-brand-box { display: flex; align-items: center; gap: 12px; padding: 16px; color: #fff; text-decoration: none; }
.pv-sidebar .pv-logo { background: #fff; border-radius: 8px; padding: 4px 8px; display: inline-flex; }
.pv-sidebar .pv-logo img { height: 40px; width: auto; }
.pv-sidebar .pv-brand-title { font-size: 16px; font-weight: 600; line-height: 1.2; color: #fff; }
.pv-sidebar .pv-brand-sub { font-size: 14px; color: rgba(255, 255, 255, .85); }
.pv-sidebar .nav-link, .pv-sidebar .navbar-toggler { color: #fff; min-height: 44px; display: flex; align-items: center; padding-left: 16px; border-left: 4px solid transparent; }
.pv-sidebar .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pv-sidebar .nav-link.active { background: rgba(255, 255, 255, .12); border-left-color: var(--pv-red); color: #fff; font-weight: 600; }
.pv-sidebar .pv-group { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .8); padding: 16px 16px 4px 20px; }
.pv-sidebar .navbar-toggler { border: 1px solid rgba(255, 255, 255, .6); width: 44px; height: 44px; justify-content: center; padding: 0; }
.pv-sidebar .navbar-toggler-icon { filter: invert(1); }
.pv-user { padding: 16px; border-top: 1px solid rgba(255, 255, 255, .2); color: #fff; }
.pv-avatar { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--pv-navy); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pv-role { display: inline-block; background: #fff; color: var(--pv-navy); border-radius: 999px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.pv-sidebar .btn-logout { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .7); width: 100%; margin-top: 12px; }
.pv-sidebar .btn-logout:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* Huy hiệu trạng thái: luôn có chữ + ký hiệu */
.st { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 24px; white-space: nowrap; }
.st-good { background: #e3f3e8; color: #1e7d3a; }
.st-warn { background: #fff4d6; color: #8a6100; }
.st-bad { background: #fbe4e2; color: #b3261e; }
.st-neutral { background: #eceff3; color: #5d6675; }
.st-nostore { background: #ffe9d6; color: #9a4a00; }

/* Số và mã */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; user-select: all; }

/* Đang tải (htmx) */
.htmx-request.pv-results, .htmx-request .pv-results { opacity: .6; }

/* Đăng nhập */
.pv-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pv-auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid #dde1e7; border-radius: 8px; padding: 32px 24px; }
.pv-auth-card .pv-auth-logo { height: 64px; width: auto; display: block; margin: 0 auto 16px; }
.pv-auth-card h1 { font-size: 28px; font-weight: 600; line-height: 1.2; text-align: center; margin: 0 0 4px; }
.pv-auth-card .pv-auth-sub { text-align: center; color: #5d6675; font-size: 14px; margin-bottom: 32px; }
.pv-alert { background: #fbe4e2; color: #b3261e; border: 1px solid #b3261e; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }

/* Tra cứu: chữ "Đang tìm…" chỉ hiện khi htmx đang chạy; bảng dính tiêu đề; thẻ dòng điện thoại */
.pv-loading { display: none; align-items: center; gap: 8px; color: #5d6675; font-size: 14px; margin-bottom: 8px; }
.htmx-request .pv-loading, .htmx-request.pv-loading { display: inline-flex; }
.pv-table-wrap { max-height: 70vh; overflow: auto; }
.pv-table-wrap thead th { position: sticky; top: 0; background: #f4f6f9; z-index: 2; }
.pv-table-wrap td:first-child, .pv-table-wrap th:first-child { position: sticky; left: 0; background: #fff; }
.pv-table-wrap thead th:first-child { background: #f4f6f9; z-index: 3; }
.pv-card-row { border-bottom: 1px solid #dde1e7; padding: 12px 16px; }
.pv-total-row { font-size: 16px; font-weight: 600; }
.pv-display { font-size: 28px; font-weight: 600; line-height: 1.2; }

/* Đối soát POS (Phase 8): lưới cửa hàng x ngày — dùng lại màu st-* của Phase 7 */
.rc-grid td.rc-cell { padding: 2px; min-width: 88px; }
.rc-grid th.rc-store { position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; }
.rc-grid thead th:first-child { background: #f4f6f9; z-index: 3; }
.rc-link { display: block; min-height: 44px; padding: 4px 6px; border-radius: 6px; font-size: 13px; line-height: 1.25; text-decoration: none; }
.rc-link .rc-count { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.rc-warn { margin-left: 4px; font-weight: 700; }
.rc-mrow { margin-bottom: 6px; }
a.rc-link:hover { text-decoration: underline; }
.pv-store-list { max-height: 320px; overflow-y: auto; }
.pv-store-picker .dropdown-menu { min-width: 260px; }
