/* Bảng điều hành nội bộ — admin.autoera.ai.vn
   Chỉ dùng lại biến màu, phông và nút của style.css. Mọi thứ còn lại đặt riêng
   ở đây để trang bán hàng và trang này không kéo nhau khi sửa. */

body.qt { background: #f2f5fa; }

/* Thuộc tính hidden của HTML chỉ là `display: none` trong bảng kiểu mặc định của
   trình duyệt, nên bất kỳ luật display nào viết ở đây cũng đè lên nó và phần tử
   vẫn hiện. Nói thẳng một lần cho cả trang. */
[hidden] { display: none !important; }

.qt-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ── Màn đăng nhập ───────────────────────────────────────────────────────── */
.qt-khoa {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 620px at 50% -10%, #14294a 0%, #0b1526 55%, #080f1c 100%);
}
.qt-the-khoa {
  width: 100%; max-width: 372px; background: var(--surface);
  border-radius: 18px; padding: 30px 28px 26px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 8px;
}
.qt-hieu {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; letter-spacing: -.02em;
}
.qt-hieu b { color: var(--ink-3); font-weight: 600; }
.qt-the-khoa h1 { font-size: 21px; letter-spacing: -.02em; margin-top: 14px; }
.qt-the-khoa p { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.qt-the-khoa label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .05em;
}
.qt-the-khoa input {
  border: 1.5px solid var(--line); border-radius: 11px;
  padding: 12px 14px; margin-bottom: 6px; background: #fff;
}
.qt-the-khoa input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.qt-loi {
  color: var(--red); font-size: 13.5px; margin-top: 10px;
  background: #fdeaea; border-radius: 9px; padding: 8px 11px;
}

/* ── Thanh trên ──────────────────────────────────────────────────────────── */
.qt-dau {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.qt-dau .qt-wrap { display: flex; align-items: center; gap: 16px; height: 58px; }
.qt-hieu.nho { font-size: 16px; }
.qt-hieu.nho em {
  font-style: normal; font-weight: 500; font-size: 14px; color: var(--ink-3);
  border-left: 1px solid var(--line); margin-left: 10px; padding-left: 12px;
}
.qt-dau-phai { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.qt-than { padding: 22px 20px 60px; display: flex; flex-direction: column; gap: 18px; }

/* ── Chọn khoảng ngày ────────────────────────────────────────────────────── */
.qt-loc { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qt-nhanh { display: flex; gap: 4px; background: #e7ecf4; padding: 4px; border-radius: 11px; }
.qt-nhanh button {
  padding: 7px 13px; border-radius: 8px; font-size: 13.5px;
  font-weight: 600; color: var(--ink-2);
}
.qt-nhanh button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.qt-tuychon { display: flex; align-items: center; gap: 7px; margin-left: auto; font-size: 13.5px; color: var(--ink-3); }
.qt-tuychon input {
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 6px 10px; background: var(--surface); font-size: 13.5px; color: var(--ink);
}

.qt-bao {
  background: var(--amber-soft); color: var(--amber);
  border-radius: 11px; padding: 11px 14px; font-size: 14px;
}
.qt-bao.do { background: #fdeaea; color: var(--red); }

/* ── Thẻ chỉ số ──────────────────────────────────────────────────────────── */
.qt-chi-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.qt-the {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.qt-the .nhan {
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em;
}
.qt-the .so {
  font-size: 25px; font-weight: 800; letter-spacing: -.03em;
  margin-top: 5px; font-variant-numeric: tabular-nums;
}
.qt-the .phu { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.qt-the.lai .so { color: var(--green); }
.qt-the.lo .so { color: var(--red); }

/* ── Hộp nội dung ────────────────────────────────────────────────────────── */
.qt-hop {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.qt-hop-dau {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.qt-hop-dau h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.qt-phu { font-size: 13px; color: var(--ink-3); margin-left: auto; }
.qt-hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.qt-hop table.data { width: 100%; }
.qt-hop table.data th:last-child,
.qt-hop table.data td:last-child { text-align: right; }
.qt-hop table.data td.tien { font-variant-numeric: tabular-nums; font-weight: 600; }
.qt-hop tbody tr:hover td { background: #f7f9fc; }
.qt-trong { padding: 26px 18px; color: var(--ink-3); font-size: 14px; text-align: center; }
.qt-ma { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.qt-mo { color: var(--ink-3); }

/* Đơn đã đánh dấu là đơn thử: vẫn nằm nguyên trong bảng, chỉ mờ đi và không
   được cộng vào doanh thu. Không xoá đơn nào cả. */
tr.la-thu td { opacity: .45; }
.qt-nut-thu { font-size: 12.5px; color: var(--ink-3); text-decoration: underline; white-space: nowrap; }
.qt-nut-thu:hover { color: var(--ink); }

/* ── Biểu đồ ─────────────────────────────────────────────────────────────── */
.qt-bieu-do { padding: 16px 18px 10px; overflow-x: auto; }
.qt-bieu-do svg { display: block; min-width: 100%; }
.qt-chu-thich { display: flex; gap: 14px; margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.ct::before {
  content: ""; display: inline-block; width: 9px; height: 9px;
  border-radius: 3px; margin-right: 6px; vertical-align: 0;
}
.ct-thu::before { background: var(--brand); }
.ct-qc::before { background: #f0a53a; }

/* ── Thêm chi phí ────────────────────────────────────────────────────────── */
.qt-them-chi {
  display: flex; gap: 8px; padding: 13px 18px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.qt-them-chi input {
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 7px 11px; font-size: 14px; background: #fff;
}
.qt-them-chi input[type="text"] { flex: 1; min-width: 160px; }
.qt-them-chi input[type="number"] { width: 140px; }

.qt-chan { color: var(--ink-3); font-size: 13px; text-align: center; margin-top: 6px; }

/* Bảng nào cũng có thể rộng hơn màn hình. Cho từng bảng tự cuộn ngang trong hộp
   của nó, để cả trang không bao giờ phải cuộn ngang. */
.qt-cuon { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Màn hẹp ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .qt-chi-so { grid-template-columns: repeat(2, 1fr); }
  .qt-hai-cot { grid-template-columns: 1fr; }
  .qt-tuychon { margin-left: 0; }
}

@media (max-width: 700px) {
  .qt-wrap { padding: 0 14px; }
  /* Thanh trên xếp hai hàng thay vì ép mọi thứ vào một hàng rồi tràn ra ngoài. */
  .qt-dau .qt-wrap { height: auto; padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .qt-hieu.nho em { display: none; }
  .qt-than { padding: 14px 14px 44px; gap: 14px; }

  .qt-loc { gap: 10px; }
  .qt-nhanh { width: 100%; overflow-x: auto; }
  .qt-nhanh button { white-space: nowrap; }
  .qt-tuychon { width: 100%; }
  .qt-tuychon input { flex: 1; min-width: 0; }

  .qt-hop-dau { padding: 13px 14px; }
  .qt-phu { margin-left: 0; flex-basis: 100%; }
  .qt-cuon table.data { min-width: 560px; }
  .qt-them-chi { padding: 12px 14px; }
  .qt-them-chi input[type="number"] { width: 110px; }
}

@media (max-width: 560px) {
  .qt-chi-so { grid-template-columns: 1fr; }
  .qt-the .so { font-size: 23px; }
}
