/* ShootingPOS – giao diện chung. Nền sáng, màu chủ đạo theo gian hàng (--accent). */
:root {
  --accent: #F26B1D;
  --accent-ink: #fff;
  --ink: #1f2328;
  --ink-2: #57606a;
  --line: #d8dee4;
  --bg: #f4f5f7;
  --card: #fff;
  --dark: #2b2f36;
  --ok: #1a7f37;
  --warn-bg: #fff4c2;
  --warn-ink: #7a5a00;
  --danger: #cf222e;
  --radius: 10px;
  --tap: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: 10px; }

/* nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); min-width: var(--tap); padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; user-select: none;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(.92); }
.btn-dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark); filter: brightness(1.2); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok); filter: brightness(.92); }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 1.1rem; }

/* ô nhập */
label.field { display: block; font-weight: 600; font-size: .9rem; }
label.field > span { display: block; margin-bottom: 4px; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; min-height: var(--tap); padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 1px; }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #e5e7eb; color: #374151; }
.badge.paid { background: #dcfce7; color: #166534; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.void { background: #fee2e2; color: #991b1b; }
.badge.req { background: #e0e7ff; color: #3730a3; }
.alert { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.alert.danger { background: #ffe0e0; color: #8a1018; }
.alert.info { background: #e7f1ff; color: #174a8b; }
.error-text { color: var(--danger); font-weight: 600; min-height: 1.2em; }

/* trang giữa màn hình (đăng nhập…) */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.center-card { width: 100%; max-width: 420px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand img { height: 36px; max-width: 120px; object-fit: contain; }
.brand .sub { font-weight: 500; font-size: .85rem; color: var(--ink-2); display: block; }

/* thanh trên */
.topbar { background: var(--dark); color: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.topbar .brand { color: #fff; font-size: 1.05rem; }
.topbar .btn { background: transparent; color: #fff; border-color: #555b66; }
.topbar .btn:hover { background: #3b4049; }
.topbar .btn.active { background: var(--accent); border-color: var(--accent); }
.topbar .who { color: #cfd4da; font-size: .9rem; }

/* bảng */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f6f8fa; font-size: .82rem; text-transform: none; color: var(--ink-2); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafbfc; }
tr.dim td { color: #8b949e; }

/* cửa sổ nổi */
.overlay { position: fixed; inset: 0; background: rgba(15, 18, 22, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 94vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 760px; }
.modal-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.toast-box { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--radius); background: var(--dark); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tab { flex: none; min-height: var(--tap); padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-2); font-size: .85rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 0; }
.bar-col { flex: 1 1 0; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar { background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.h0 { height: 2%; } .bar.h10 { height: 10%; } .bar.h20 { height: 20%; } .bar.h30 { height: 30%; } .bar.h40 { height: 40%; }
.bar.h50 { height: 50%; } .bar.h60 { height: 60%; } .bar.h70 { height: 70%; } .bar.h80 { height: 80%; } .bar.h90 { height: 90%; } .bar.h100 { height: 100%; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-box canvas { width: 260px; height: 260px; max-width: 100%; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }

@media (max-width: 600px) {
  .modal { max-height: 100vh; border-radius: 14px 14px 0 0; align-self: flex-end; }
  .overlay { padding: 0; }
  th, td { padding: 8px 6px; }
}
.print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
