/*  FILE: style.css */
:root{
  --red:#dc2626; --red-50:#fef2f2; --border:#d1d5db; --muted:#6b7280;
  --bg:#f8fafc; --panel:#ffffff; --chip:#f3f4f6; --title:#111827;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:#111;font:15px/1.5 system-ui,Segoe UI,Roboto,Arial}
/* Cố định bề ngang toàn trang 1200px */
.container{width:1200px;max-width:1200px;margin:0 auto;padding:16px}
.page{display:flex;flex-wrap:nowrap;gap:16px;align-items:flex-start}

/* Vùng dưới toàn trang cho “Đầu - Đuôi Lô tô” */
.page-bottom{ width:1200px; max-width:1200px; margin:0 auto; }

/* 3 cột cố định, không co giãn */
.col-left{  flex:0 0 288px; max-width:288px; }
.col-mid{   flex:0 0 576px; max-width:576px; }
.col-right{ flex:0 0 304px; max-width:304px; display:flex; flex-direction:column; }
.col-right > .card{ width:100%; }

/* Topbar */
.topbar{ background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:5; }
.menu .menu-item{ text-decoration:none; color:#374151; margin-right:10px; padding:6px 8px; border-radius:8px; }
.menu .menu-item.active, .menu .menu-item:hover{ background:#eef2ff; }

/* Subtitle (đậm hơn) */
.card .header .subtitle, .card .header .subtle, .card .header .desc{ color:#111827; font-weight:700; }

.card{background:var(--panel);border:1px solid var(--border);border-radius:10px;overflow:hidden}
.header{padding:10px 12px;border-bottom:1px solid var(--border);background:#fff}
.body{padding:12px}

/* Tabs */
.tabs{display:flex;gap:0;border-bottom:1px solid var(--border);margin-bottom:10px}
.tab{flex:1;border:none;background:#fff;color:var(--red);padding:10px 8px;font-weight:600;cursor:pointer}
.tab.active{background:var(--red);color:#fff;border-top-left-radius:6px;border-top-right-radius:6px}

/* Tables */
table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--border)}
th,td{border:1px solid var(--border);padding:6px 8px}
th{background:#f3f4f6}
.center{text-align:center}
.right{text-align:right}

/* Text */
.title-xl{font-size:18px;color:var(--red);font-weight:800}
.subtle{color:var(--muted)}
.special{color:var(--red);font-weight:800;font-size:20px}

/* Chips */
.chips{ display:flex; flex-wrap:wrap; gap:5px; align-content:flex-start; }
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; min-width:40px; padding:2px 0; font-size:12px; line-height:1;
  text-align:center; border:1px solid var(--border); border-radius:6px;
  background:#f3f4f6; margin-bottom:5px;
}
.chip.sp{ background:#fff1f2; color:#dc2626; border-color:#fecaca; font-weight:700; }

/* REPLACE SECTION: headtail layout */
#headTail .grid{
display:flex;
gap:12px;
flex-wrap:wrap; /* nhiều đài -> xuống dòng */
overflow:visible;
padding-bottom:4px;
}
#headTail .grid .card{
flex:0 0 380px; /* mỗi bảng rộng cố định 380px */
width:380px;
}
#headTail .grid .card .header{ text-align:center; }

/* Bảng 3 cột cố định – cột giữa (Số) nhỏ gọn */
#headTail .grid table{
width:100%;
table-layout:fixed;
border-collapse:collapse;
}
#headTail .grid th, #headTail .grid td{
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
padding:4px 6px;
font-size:15px;
line-height:1.3;
}
#headTail .grid thead th:nth-child(2),
#headTail .grid tbody td:nth-child(2){
width:31px; /* cột Số nhỏ gọn */
text-align:center;
}
#headTail .grid thead th:first-child,
#headTail .grid tbody td:first-child{ text-align:right; }
#headTail .grid thead th:last-child,
#headTail .grid tbody td:last-child{ text-align:left; }


/* DatePicker (compact) */
.dp{
  background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px;
}
.dp .nav{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.dp .nav .btn{border:none;background:#fff;padding:2px 6px;cursor:pointer;color:#374151}
.dp .nav .title{font-weight:700;cursor:pointer;font-size:13px}
.dp .dow{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:2px}
.dp .dow div{font-size:11px;text-align:center;color:#374151}
.dp .grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.dp .cell{padding:4px 0;text-align:center;border-radius:5px;cursor:pointer;font-size:12px}
.dp .cell.muted{color:#9ca3af}
.dp .cell:hover{background:#eff6ff}
.dp .cell.today{outline:1px solid #60a5fa}
.dp .cell.selected{background:#2563eb;color:#fff}
.dp .grid-3{grid-template-columns:repeat(3,1fr)}
.dp .foot{text-align:center;margin-top:4px}
.dp .link{color:#2563eb;font-size:11px;cursor:pointer}

/* Login (not used but kept for consistency) */
.fullpage{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f1f5f9}

/* Inputs */
.form-item{ margin-bottom:12px; }
.form-item label{ display:block; font-weight:600; margin-bottom:6px; }
.select, .input{ width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:8px; outline:none; }
.select:focus, .input:focus{ border-color:#8dc63f; }
.btn{ height:40px; padding:0 12px; border:1px solid #d1d5db; background:#fff; border-radius:10px; cursor:pointer; }
.btn-green{ border:none; background:linear-gradient(180deg,#16a34a 0%,#0f8a3b 100%); color:#fff; font-weight:800; border-radius:10px; }
.btn-block{ display:block; width:100%; }

/* REPLACE SECTION: KQXS table tuning */
:root{
  --row-h: 34px;            /* giữ nguyên chiều cao ô hiện tại */
  --kq-font: 20px;          /* số thường = 20px (match dự án cũ) */
  --kq-db-font: 1.8rem;     /* ĐB/G7/G8 ~28.8px (match dự án cũ) */
  --kq-label-w-mb: 120px;
  --kq-label-w-tn: 96px;    /* trung/nam */
}

.kqxs-wrap{ overflow: hidden; } /* giữ cứng, không trôi ngang */

.kqxs{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;            /* chia đều cột tỉnh */
  background:#fff;
  border:1px solid var(--border);
}

.kqxs th, .kqxs td{
  border:1px solid var(--border);
  padding:4px 6px;
  height:var(--row-h);
  vertical-align:middle;         /* canh giữa theo chiều dọc */
  text-align:center;             /* canh giữa ngang */
}

.kqxs .label{
  font-weight:700;
  background:#f8fafc;
  text-align:left;               /* nhãn giải canh trái */
  white-space:nowrap;
}

.kqxs.mb .label{ width:var(--kq-label-w-mb); }
.kqxs.mt .label, .kqxs.mn .label{ width:var(--kq-label-w-tn); }

.kqxs td:not(.label){
  font-weight:700;               /* từ 800 -> 700 (match dự án cũ) */
  font-size:var(--kq-font);      /* 22px -> 20px */
  color:#0f172a;
  letter-spacing:.3px;
}

.kqxs tr.odd-row td, .kqxs tr.odd-row .label{ background:#f4f6f8; }

.kqxs .db{ color:#dc2626; font-weight:800; }

.kqxs .db-row td:not(.label){
  color:#dc2626;
  font-weight:800;               /* từ 900 -> 800 (match dự án cũ) */
  font-size:var(--kq-db-font);   /* 30px -> 1.8rem */
  line-height:1.05;
}

.kqxs .g7-row td:not(.label),
.kqxs .g8-row td:not(.label){
  color:#dc2626;
  font-weight:800;               /* từ 900 -> 800 */
  font-size:var(--kq-db-font);   /* 30px -> 1.8rem */
  line-height:1.05;
}

/* căn giữa phụ trợ */
.tac{text-align:center}
.vtm{vertical-align:middle}

/* SKQ skin (compact) */
.skq { --skq-border:#e5e7eb; --skq-focus:rgba(22,163,74,.18); --skq-radius:12px; }
.skq .header{ background:#fff; }
.skq .title-xl{ color:#111827; font-size:20px; font-weight:800; letter-spacing:.2px; }

/* Header: tiêu đề trái, nút bên phải */
.skq-header{ display:flex; align-items:center; justify-content:space-between; gap:8px; }

/* Inputs – chiều cao nhỏ lại */
.skq select, .skq input, .skq button { font:inherit; color:inherit; }
.skq .input, .skq .select{
  width:100%; height:34px; padding:6px 10px; border:1px solid var(--skq-border);
  border-radius: var(--skq-radius); background:#fff;
  transition:border-color .15s, box-shadow .15s, background-color .15s;
}
.skq .input::placeholder{ color:#9ca3af; }
.skq .select{
  -webkit-appearance:none; appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 8 10 12 14 8'/></svg>");
  background-repeat:no-repeat; background-position:right 10px center; padding-right:34px;
}
.skq .input:hover, .skq .select:hover{ border-color:#cbd5e1; }
.skq .input:focus, .skq .select:focus{ outline:none; border-color:#16a34a; box-shadow:0 0 0 3px var(--skq-focus); }
.skq .form-item{ margin-bottom:8px; }

/* Buttons – chiều cao nhỏ lại */
.skq .btn{ height:36px; border-radius: var(--skq-radius); font-weight:800; border:1px solid #d1d5db; background:#fff; }
.skq .btn.btn-green{ border:none; cursor:pointer; background:linear-gradient(180deg,#16a34a 0%,#0f8a3b 100%); color:#fff; letter-spacing:.3px; box-shadow:0 6px 18px rgba(16,185,129,.22); }
.skq .btn.btn-green:hover{ filter:brightness(1.03); }

/* Nút tải kết quả (nhỏ, xanh dương) */
.skq .btn.btn-primary{ border:none; background:linear-gradient(180deg,#3b82f6 0%, #2563eb 100%); color:#fff; box-shadow:0 6px 18px rgba(37,99,235,.22); }
.skq .btn.btn-primary:hover{ filter:brightness(1.03); }
.skq .btn.btn-xs{ height:28px; padding:0 8px; border-radius:10px; display:inline-flex; align-items:center; gap:6px; }
.skq .btn .ico{ display:inline-block; width:16px; height:16px; }


/* Combo (đài) */
.combo{ position:relative; }
.combo .input{ padding-right:42px; }
.combo .combo-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:30px; height:30px; border-radius:8px; border:1px solid #e5e7eb; background:#fff;
  cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 8 10 12 14 8'/></svg>");
  background-repeat:no-repeat; background-position:center;
}
.combo .combo-toggle:hover{ background-color:#f8fafc; }
.combo .combo-list{ position:absolute; left:0; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 12px 24px rgba(0,0,0,.08); max-height:280px; overflow:auto; padding:6px 0; z-index:30; }
.combo .combo-list li{ padding:8px 12px; cursor:pointer; font-size:14px; }
.combo .combo-list li:hover, .combo .combo-list li.active{ background:#eef2ff; }
.combo .combo-list li.empty{ color:#9ca3af; cursor:default; }
/* Floater fix */
.combo-floater{ position:fixed; z-index:9999; background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 12px 24px rgba(0,0,0,.10); padding:6px 0; max-height:min(60vh,480px); overflow:auto; }

/* REPLACE SECTION: live badge */
.live-badge{ display:none !important; }

/* REPLACE SECTION: center all titles */
.card>.header{ text-align:center; }
.card>.header .title-xl{ text-align:center; }
/* Phòng trường hợp header lồng nhau */
.card .header .title-xl{ text-align:center; }
/* Nếu có tiêu đề riêng trong bảng KQXS */
.kqxs .title{ text-align:center; }


/* REPLACE SECTION: KQXS header controls (CSS) */
.topbar{background:var(--panel);position:sticky;top:0;z-index:100;box-shadow:0 1px 0 var(--border)}
.topbar .menu{display:flex;gap:1px;flex-wrap:wrap;align-items:center}
.topbar .menu .menu-item{position:relative;display:inline-flex;align-items:center;justify-content:center;height:36px;padding:0 12px;border-radius:12px;text-decoration:none;font-weight:600;color:#111827;background:linear-gradient(#fff,#f9fafb);border:1px solid #e5e7eb;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:transform .15s ease,box-shadow .2s ease,background .2s ease,color .2s ease,border-color .2s ease}
.topbar .menu .menu-item:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(2,132,199,.15);border-color:#d1d5db}
.topbar .menu .menu-item:focus-visible{outline:2px solid #0ea5e9;outline-offset:2px}
.topbar .menu .menu-item.active{background:#0ea5e9;color:#fff;border-color:#0ea5e9;box-shadow:0 8px 20px rgba(14,165,233,.35)}
.topbar .menu .menu-item.active::after{content:"";position:absolute;left:10px;right:10px;bottom:-8px;height:3px;border-radius:3px;background:#0ea5e9}
@media (max-width:600px){
  .topbar .menu{gap:5px}
  .topbar .menu .menu-item{height:34px;padding:0 10px;border-radius:10px}
}


/* REPLACE SECTION: footer-styles */
.site-footer{
  display:flex; align-items:center; gap:12px;
}
.site-footer .footer-left{ white-space:nowrap; }
.site-footer .footer-right{
  margin-left:auto; text-align:right; color:#6b7280; font-size:13px;
  display:flex; flex-direction:column; align-items:flex-end; line-height:1.45;
}
.site-footer .vs-title{ font-weight:600; }
.site-footer .vs-line{ white-space:nowrap; }
.site-footer .vs-sep{ display:inline-block; padding:0 6px; opacity:.7; }
.site-footer .vs-time{ opacity:.9; }
