/* Wings Control Tower — phong cách thẻ bo tròn (bento), nền tối mặc định + chế độ sáng.
   Chủ đạo: đen / trắng / đỏ cam. Màu nội dung đa dạng dùng cho KPI, biểu đồ, huy hiệu.
   Màu sống ở tokens trên :root; theme đổi bằng data-theme="light|dark" (xem base.html). */
:root {
  --bg: #0b0b0c;
  --surface: #151517;
  --surface-2: #1d1d20;
  --surface-3: #26262a;
  --line: #2c2c31;
  --grid: #45454d;          /* đường ranh giữa các cột/hàng của bảng */
  color-scheme: dark;
  --text: #f5f5f6;
  --text-dim: #cfcfd6;
  --accent: #f23a17;        /* đỏ cam chủ đạo */
  --accent-ink: #ffffff;    /* chữ trên nền accent */
  --c-yellow: #ffcc29;
  --c-green: #2fd48a;
  --c-blue: #3d7bff;
  --c-lime: #e9f78a;
  --c-violet: #b79cff;
  --ok: #2fd48a;
  --warn: #ffcc29;
  --bad: #ff5a3c;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}

:root[data-theme="light"] {
  --bg: #eceeec;
  --surface: #f7f7f6;
  --surface-2: #ffffff;
  --surface-3: #e4e6e3;
  --line: #dcdedb;
  --grid: #c3c6c2;
  color-scheme: light;
  --text: #121212;
  --text-dim: #4a4c4a;
  --accent: #f23a17;
  --accent-ink: #ffffff;
  --c-yellow: #e9b800;
  --c-green: #12a465;
  --c-blue: #1f6bff;
  --c-lime: #dff25c;
  --c-violet: #7d5cf0;
  --ok: #12a465;
  --warn: #c99700;
  --bad: #e0300f;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eceeec; --surface: #f7f7f6; --surface-2: #ffffff; --surface-3: #e4e6e3;
    --line: #dcdedb; --grid: #c3c6c2; color-scheme: light; --text: #121212; --text-dim: #4a4c4a;
    --c-yellow: #e9b800; --c-green: #12a465; --c-blue: #1f6bff; --c-lime: #dff25c; --c-violet: #7d5cf0;
    --ok: #12a465; --warn: #c99700; --bad: #e0300f; --shadow: 0 1px 2px rgba(0,0,0,.05);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-blue); }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

/* ---------- Bố cục: sidebar trái + nội dung ---------- */
body {
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(242, 58, 23, .16), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body.app { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: 100vh; }

aside.sidebar {
  position: sticky; top: 12px; margin: 12px 0 12px 12px; height: calc(100vh - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 14px; display: flex; flex-direction: column; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 4px 12px 18px;
  font-size: 22px; font-weight: 700; letter-spacing: .01em; color: var(--text); text-decoration: none;
}
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
}
.nav-group {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim);
  padding: 18px 14px 8px; font-weight: 600;
}
aside.sidebar nav a {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin: 2px 0; border-radius: 14px;
  color: var(--text); text-decoration: none; font-size: 15px;
}
aside.sidebar nav a svg { width: 20px; height: 20px; flex: none; opacity: 1; }
aside.sidebar nav a:hover { background: var(--surface-3); }
aside.sidebar nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
aside.sidebar nav a.active svg { opacity: 1; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.user-box { display: flex; align-items: center; gap: 10px; padding: 8px 6px 12px; }
.user-box .dot {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--c-yellow));
  display: inline-flex; align-items: center; justify-content: center; color: #111; font-weight: 700; text-transform: uppercase;
}
.user-box .who { font-size: 14px; font-weight: 600; line-height: 1.2; }
.user-box .role { font-size: 12px; color: var(--text-dim); }
.linklike {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 14px;
  background: none; border: 0; color: var(--text-dim); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.linklike:hover { background: var(--surface-3); color: var(--text); }
.linklike svg { width: 18px; height: 18px; }

.content { min-width: 0; }
.page-head {
  display: flex; align-items: center; gap: 12px; padding: 26px 28px 0; max-width: 1360px;
}
.page-head h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; }
.icon-btn.menu-btn { display: none; }
.search-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.search-btn svg { width: 18px; height: 18px; }
.search-btn kbd { color: var(--text-dim); font: inherit; font-size: 12px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-family: inherit;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-3); }

/* Bảng tìm nhanh trang (Cmd/Ctrl+K) */
.palette { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: flex-start; justify-content: center; padding-top: 14vh; z-index: 50; }
.palette.open { display: flex; }
.palette-box { width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.palette-box input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; }
.palette-list { margin-top: 8px; max-height: 50vh; overflow-y: auto; }
.palette-list a { display: block; padding: 11px 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 14px; }
.palette-list a.sel, .palette-list a:hover { background: var(--accent); color: var(--accent-ink); }

main { padding: 22px 28px 70px; max-width: 1360px; }

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 30px 4px 12px;
}

/* ---------- Thẻ (card) chung ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card.accent { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.card.light { background: #f4f4f2; color: #121212; border-color: transparent; }
.card.lime { background: var(--c-lime); color: #121212; border-color: transparent; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 500; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }

/* ---------- Tile job ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.tile {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--text-dim);
}
.tile.state-idle::before { background: var(--c-green); }
.tile.state-running { background: var(--c-lime); color: #121212; border-color: transparent; }
.tile.state-running::before { background: #121212; }
.tile.state-stale::before { background: var(--c-yellow); }
.tile.state-error { border-color: var(--bad); }
.tile.state-error::before { background: var(--bad); }
.tile .tile-label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }
.tile .tile-meta { font-size: 12px; color: var(--text-dim); }
.tile.state-running .tile-meta { color: #3b4a00; }
.tile .tile-warn { color: var(--c-yellow); font-weight: 600; }
.tile .tile-err { color: var(--bad); font-weight: 600; }

/* ---------- KPI ---------- */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; position: relative;
}
.kpi .kpi-label { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.kpi .kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.kpi:nth-child(5n+1) { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.kpi:nth-child(5n+1) .kpi-label { color: rgba(255,255,255,.8); }
.kpi:nth-child(5n+2) { background: var(--c-yellow); border-color: transparent; color: #121212; }
.kpi:nth-child(5n+2) .kpi-label { color: rgba(0,0,0,.6); }
.kpi:nth-child(5n+3) { background: var(--c-green); border-color: transparent; color: #08150f; }
.kpi:nth-child(5n+3) .kpi-label { color: rgba(0,0,0,.6); }
.kpi:nth-child(5n+4) { background: var(--c-blue); border-color: transparent; color: #fff; }
.kpi:nth-child(5n+4) .kpi-label { color: rgba(255,255,255,.8); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; background: rgba(255,255,255,.9); color: #121212; font-weight: 500;
}

/* ---------- Banner cảnh báo ---------- */
.banner {
  background: rgba(242, 58, 23, .12); border: 1px solid var(--accent); color: var(--text);
  border-radius: var(--radius-sm); padding: 14px 18px; font-size: 13px; margin: 14px 0; line-height: 1.5;
}
.banner strong { color: var(--accent); }

/* ---------- Bảng ---------- */
.table-wrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; overflow-x: auto;
}
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--text-dim); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
table tr:hover td { background: var(--surface-2); }
tr.status-lech td, td.status-lech { color: var(--bad); font-weight: 600; }
tr.status-trong td, td.status-trong { color: var(--text-dim); }

/* Bảng đặt trực tiếp trong main (các template cũ) vẫn có nền thẻ */
main > table {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 8px;
}

/* ---------- Huy hiệu ---------- */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.badge-ok { background: rgba(47,212,138,.16); color: var(--ok); }
.badge-idle { background: var(--surface-3); color: var(--text-dim); }
.badge-error { background: rgba(255,90,60,.16); color: var(--bad); }
.badge-warn { background: rgba(255,204,41,.16); color: var(--warn); }

/* ---------- Form lọc ---------- */
form.filter-bar {
  margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  color: var(--text-dim); font-size: 13px;
}
form.filter-bar input, form.filter-bar select, form.filter-bar button {
  font-family: inherit; font-size: 13px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
form.filter-bar button { cursor: pointer; background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 500; }

/* ---------- Log ---------- */
pre.log-view {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; font-size: 12px; overflow: auto; max-height: 70vh; white-space: pre-wrap; word-break: break-word;
}

/* ---------- Thanh pill (biểu đồ cột dạng viên thuốc) ---------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; }
.bars .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 8px; }
.bars .bar-fill { border-radius: 14px; padding: 8px 10px; font-size: 13px; color: #121212; min-height: 28px; }
.bars .bar-label { text-align: center; font-size: 12px; color: var(--text-dim); }
.hbar { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; margin: 9px 0; font-size: 13px; }
.hbar .track { background: var(--surface-3); border-radius: 999px; height: 14px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 999px; }
.hbar .val { text-align: right; color: var(--text-dim); }

.muted { color: var(--text-dim); }
.total-row td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid.cols-3, .grid.cols-4, .grid.hero, .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hbar { grid-template-columns: 100px 1fr 70px; }
}

.card.blue { background: var(--c-blue); border-color: transparent; color: #fff; }
.card.blue .muted, .card.accent .muted { color: rgba(255,255,255,.8); }
.big-number { font-size: 56px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }

/* ---------- Form / nút / modal ---------- */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font-family: inherit; font-size: 14px; padding: 11px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); max-width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  font-family: inherit; font-size: 14px; font-weight: 500; padding: 11px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-3); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 6px 14px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); }
.field input, .field select { width: 100%; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: rgba(47,212,138,.16); color: var(--ok); }
.flash.err { background: rgba(255,90,60,.16); color: var(--bad); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal.open { display: flex; }
.modal-box { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-height: 92vh; overflow-y: auto; }
.modal-box h3 { margin: 0 0 4px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.chart-box { position: relative; height: 280px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
tr.row-warn td { background: rgba(255, 204, 41, .10); }
tr.row-bad td { background: rgba(255, 90, 60, .10); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  body.app { grid-template-columns: 1fr; }
  aside.sidebar {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; margin: 0; height: auto; width: 290px;
    border-radius: 0 var(--radius) var(--radius) 0; transform: translateX(-105%); transition: transform .2s;
  }
  body.nav-open aside.sidebar { transform: none; }
  body.nav-open .content { cursor: pointer; }  /* iOS Safari chỉ phát click cho phần tử 'bấm được' -> chạm vào nội dung để đóng menu */
  .icon-btn.menu-btn { display: inline-flex; }
  .page-head { padding: 18px 16px 0; }
  .page-head h1 { font-size: 24px; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { padding: 0 14px; }
  main { padding: 18px 16px 60px; }
}

/* ---------- DataTable dùng chung ---------- */
.dt-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.dt-bar .dt-q { min-width: 220px; flex: 1; max-width: 360px; border-radius: 999px; }
.dt-count { margin-left: auto; font-size: 12px; }
.dt-menu { position: relative; }
.dt-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 260px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.dt-pop.open { display: block; }
.dt-pop-head { display: flex; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.dt-pop-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin: 10px 0 4px; }
.dt-colorrow { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.dt-colorrow input { width: 34px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.dt-scroll { overflow: auto; max-height: 72vh; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.dt { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; }
table.dt th, table.dt td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.dt th { position: sticky; top: 0; z-index: 3; background: var(--surface-3); color: var(--text); font-weight: 600; font-size: 12px; text-transform: none; letter-spacing: 0; }
table.dt thead tr.dt-filter th { top: 38px; background: var(--surface-2); padding: 5px 6px; z-index: 3; }
table.dt thead tr.dt-filter input, table.dt thead tr.dt-filter select { width: 100%; padding: 5px 8px; font-size: 12px; border-radius: 10px; }
table.dt .dt-th { cursor: pointer; user-select: none; }
table.dt .dt-rs { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: col-resize; }
table.dt .dt-rs:hover { background: var(--accent); }
table.dt td.num, table.dt th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt tbody tr:hover td { background: var(--surface-2); }
table.dt .dt-sticky { position: sticky; z-index: 2; background: var(--surface); }
table.dt th.dt-sticky { z-index: 4; background: var(--surface-3); }
table.dt tfoot td { position: sticky; bottom: 0; background: var(--surface-3); font-weight: 700; border-top: 2px solid var(--line); z-index: 2; }
table.dt .dt-act { text-align: center; position: sticky; right: 0; background: var(--surface); }
.dt-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Màu tô dòng phủ lên NỀN ĐẶC (var(--surface)) — nếu để màu bán trong suốt, cột ghim trái (dt-sticky) và cột thao tác
   phải sẽ "nhìn xuyên" thấy chữ của cột bên dưới khi cuộn ngang (chữ chồng lên nhau). */
table.dt tr.row-bad td { background: linear-gradient(rgba(255, 90, 60, .14), rgba(255, 90, 60, .14)), var(--surface); }
table.dt tr.row-warn td { background: linear-gradient(rgba(255, 204, 41, .12), rgba(255, 204, 41, .12)), var(--surface); }
table.dt tr.row-ok td { background: linear-gradient(rgba(47, 212, 138, .09), rgba(47, 212, 138, .09)), var(--surface); }
table.dt tbody tr.row-bad:hover td, table.dt tbody tr.row-warn:hover td, table.dt tbody tr.row-ok:hover td { background: var(--surface-2); }
table.dt td.dt-sticky, table.dt td.dt-act { background-clip: padding-box; }

a.kpi { display: block; text-decoration: none; color: inherit; transition: transform .12s; }
a.kpi:hover { transform: translateY(-2px); filter: brightness(1.06); }
.kpi-label { color: inherit; opacity: .85; }
.kpi:nth-child(5n+1) .kpi-label, .kpi:nth-child(5n+2) .kpi-label, .kpi:nth-child(5n+3) .kpi-label, .kpi:nth-child(5n+4) .kpi-label { color: inherit; opacity: .85; }

/* ---------- Icon lịch / mũi tên chọn / nút lên-xuống: luôn rõ trên cả 2 theme ---------- */
/* Ô ngày: ẩn icon gốc (đen, khó thấy) và vẽ icon lịch TRẮNG của riêng mình; vùng bấm mở lịch vẫn là icon gốc (trong suốt, phủ bên phải). */
html body input[type=date] { position: relative; padding-right: 44px; background-color: var(--surface-2); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='16.5' rx='2.5'/><path d='M8 2.5v4M16 2.5v4M3 10h18'/></svg>"); }
html body form.filter-bar input[type=date] { background-color: var(--surface); }
:root[data-theme="light"] body input[type=date] { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='16.5' rx='2.5'/><path d='M8 2.5v4M16 2.5v4M3 10h18'/></svg>"); }
input[type=date]::-webkit-calendar-picker-indicator { position: absolute; top: 0; right: 0; bottom: 0; width: 46px; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
/* Ô số: giữ nút lên/xuống như cũ (nền sáng, mũi tên đậm) */
input[type=number] { color-scheme: light; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px; background-repeat: no-repeat; background-position: right 13px center; background-size: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); }
:root[data-theme="light"] select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* ---------- Đường ranh giữa các cột ---------- */
th, td { border-right: 1px solid var(--grid); }
th:last-child, td:last-child { border-right: 0; }
table.dt th, table.dt td { border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
table.dt th:last-child, table.dt td:last-child { border-right: 0; }
table.dt th { border-bottom: 2px solid var(--grid); }

/* ---------- Tiêu đề bảng: xuống dòng để đọc hết, cỡ chữ tuỳ chỉnh ---------- */
table.dt th { white-space: normal; word-break: break-word; line-height: 1.3; vertical-align: bottom; padding-top: 10px; padding-bottom: 10px; text-overflow: clip; }
table.dt.hdr-nowrap th { white-space: nowrap; text-overflow: ellipsis; }
table.dt.hs-s th { font-size: 11px; } table.dt.hs-m th { font-size: 13px; } table.dt.hs-l th { font-size: 15px; }
table.dt th .dt-th { display: block; }
table.dt thead tr.dt-filter th { padding: 5px 6px; white-space: nowrap; }
.dt-pop .field { margin: 6px 0; }

/* ---------- Tab điều hướng trong trang ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs .tab { padding: 10px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.tabs .tab:hover { background: var(--surface-3); }
.tabs .tab.active { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }

/* ---------- Số tiền gõ nhanh (chip) + chọn người ---------- */
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--surface-3); color: var(--text); }
.chip:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip-edit { background: transparent; color: var(--text-dim); border-style: dashed; }

.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; }
.nav-badge.warn { background: var(--c-yellow); color: #111; }
aside.sidebar nav a.active .nav-badge { background: #fff; color: var(--accent); }
.alert-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.alert-card .lv { flex: none; width: 10px; align-self: stretch; border-radius: 6px; background: var(--c-blue); }
.alert-card.bad .lv { background: var(--bad); } .alert-card.warn .lv { background: var(--c-yellow); }
.alert-card .t { font-weight: 600; margin-bottom: 4px; } .alert-card .d { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.alert-card .go { margin-left: auto; flex: none; }
