:root {
  --color-text: #1f2933;
  --color-muted: #647382;
  --color-border: #d3dce6;
  --color-bg: #f5f7fa;
  --color-panel: #ffffff;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-success: #15803d;
  --color-success-bg: #dcfce7;
  --color-error: #b91c1c;
  --color-error-bg: #fee2e2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 24px 16px 48px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

main, header { max-width: 900px; margin: 0 auto; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
p.subtitle { margin: 0 0 20px; color: var(--color-muted); }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
nav a { color: var(--color-primary); text-decoration: none; font-weight: 600; }
nav a:hover, nav a:focus { text-decoration: underline; }

ul.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
ul.link-list a {
  display: block;
  padding: 14px 16px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
ul.link-list a:hover, ul.link-list a:focus { border-color: var(--color-primary); }

section {
  margin-bottom: 24px;
  padding: 18px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
form { display: flex; flex-direction: column; gap: 12px; }
form.inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  font: inherit;
  color: inherit;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
/* iPhone Safari: o ngay/gio co be rong toi thieu rieng nen tran ra ngoai the; bo kieu goc, giu chieu cao khi trong. */
input[type="date"], input[type="time"], input[type="month"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; min-height: 2.6em; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}
button {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
}
button:hover, button:focus { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
button:disabled { cursor: wait; opacity: 0.65; }
button.secondary { background: #fff; color: var(--color-primary); }
button.secondary:hover, button.secondary:focus { background: #eff6ff; }
button.danger { background: var(--color-error); border-color: var(--color-error); }
button.danger:hover, button.danger:focus { background: #991b1b; border-color: #991b1b; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.94rem; }
th, td { border: 1px solid var(--color-border); padding: 8px 10px; text-align: left; vertical-align: top; }
thead th { background: #eef2f7; }
tbody tr:nth-child(even) { background: #fafbfc; }
/* Man hinh dien thoai: bang nhieu cot cuon ngang trong khung, khong day ca trang. */
@media (max-width: 720px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

.result {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
}
.result:empty { display: none; }
.result.success { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success); }
.result.error { color: var(--color-error); background: var(--color-error-bg); border-color: var(--color-error); }
.hidden { display: none; }
video {
  width: 100%;
  max-width: 360px;
  margin-top: 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #000;
}
pre.json {
  margin: 12px 0 0;
  padding: 12px;
  overflow-x: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
}
.hint { color: var(--color-muted); font-size: 0.88rem; margin: 0; }

.employee-page, .activation-page { max-width: 620px; }
.phone-card { padding: 22px 18px; border-radius: 14px; }
.phone-card h2 { font-size: 1.3rem; line-height: 1.3; }
.phone-card p { margin-top: 0; }
.phone-card .hint { margin-top: 16px; }
.phone-status { font-size: 1.08rem; line-height: 1.5; margin-bottom: 20px; }
.phone-action { display: block; width: 100%; min-height: 58px; padding: 14px 18px; font-size: 1.1rem; border-radius: 10px; }
.phone-form { gap: 18px; margin-top: 18px; }
.phone-form label { gap: 7px; font-size: 1rem; }
.phone-form input, .phone-form select, .phone-form textarea { min-height: 50px; padding: 11px 12px; }
.phone-form textarea { min-height: 100px; }
.phone-card .result { margin-top: 16px; }
.phone-form .result { margin-top: 0; }
#activationCode { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.3rem; letter-spacing: 0.15em; text-transform: uppercase; }
.activation-code { margin: 6px 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.15em; user-select: all; }

/* Huong dan cai len man hinh chinh (cai-dat.js) */
.install-guide { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 16px; background: rgba(15, 23, 42, 0.55); }
.install-guide[hidden] { display: none; }
.install-guide-panel { width: 100%; max-width: 480px; max-height: calc(100% - 72px); overflow-y: auto; padding: 22px 18px; border-radius: 14px; background: var(--color-panel); color: var(--color-text); }
.install-guide-panel h2 { margin-top: 0; font-size: 1.2rem; line-height: 1.3; }
.install-steps { margin: 0 0 18px; padding-left: 22px; font-size: 1.05rem; line-height: 1.5; }
.install-steps li + li { margin-top: 10px; }
.install-glyph { display: inline-block; width: 1.4em; height: 1.4em; vertical-align: -0.35em; color: #1d5daa; }
.install-guide-arrow { display: none; margin-top: 8px; color: #fff; font-size: 2.4rem; line-height: 1; animation: install-bounce 1s ease-in-out infinite; }
.install-guide[data-kind="ios"] .install-guide-arrow { display: block; }
@keyframes install-bounce { 50% { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .install-guide-arrow { animation: none; } }

@media (max-width: 480px) {
  body { padding: 18px 12px 36px; }
  .phone-card { padding: 22px 16px; }
  .employee-page h1, .activation-page h1 { font-size: 1.75rem; }
}

/* Bao cao: o tom tat + bang cong. */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.summary-item { border: 1px solid var(--color-border); border-radius: 6px; padding: 10px 12px; background: #f8fafc; }
.summary-item strong { display: block; font-size: 1.3rem; }
.summary-item span { font-size: 0.88rem; color: #475569; }
.summary-item.warn { border-color: var(--color-error); background: var(--color-error-bg); }
.summary-item.warn strong { color: var(--color-error); }
tfoot th { background: #eef2f7; }
button.link { background: none; border: none; padding: 0; color: var(--color-primary); text-decoration: underline; font: inherit; cursor: pointer; }
details > summary { cursor: pointer; font-weight: 600; }
button.link:hover, button.link:focus { background: none; color: var(--color-primary); }

/* ===== Khung quan tri (body.admin-layout): menu trai + noi dung tran ngang man hinh. =====
   Trang nhan vien (/cham-cong, /kich-hoat) khong dung class nay nen giu nguyen giao dien dien thoai. */
body.admin-layout {
  --sidebar-w: 236px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #64748b;
  --gutter: 32px;
  padding: 0;
  min-height: 100vh;
  font-size: 15px;
}
body.admin-layout main { max-width: none; margin: 0; }
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 40;
  overflow-y: auto;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; font-weight: 700; color: #fff; }
.admin-brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--color-primary); color: #fff; font-size: 0.95rem;
}
.admin-nav { flex: 1; padding: 4px 12px 16px; margin: 0; border: 0; display: block; }
.admin-nav-group { margin-top: 14px; }
.admin-nav-title {
  padding: 0 10px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--sidebar-muted);
}
.admin-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0;
  border-radius: 8px; color: var(--sidebar-text); text-decoration: none; font-weight: 600;
}
/* QĐ-27: an muc menu khong du quyen (display:flex o tren de .hidden). */
.admin-nav-link.hidden { display: none; }
nav.admin-nav a:hover, nav.admin-nav a:focus-visible { background: rgba(148, 163, 184, 0.14); color: #fff; text-decoration: none; }
nav.admin-nav a.active, nav.admin-nav a.active:hover { background: var(--color-primary); color: #fff; }
.admin-nav-icon {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.admin-nav-label { flex: 1; }
.admin-badge {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 0.75rem; font-weight: 700; text-align: center;
}
.admin-account { padding: 14px 20px 18px; border-top: 1px solid rgba(148, 163, 184, 0.18); }
.admin-account-name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-account-role { color: var(--sidebar-muted); font-size: 0.82rem; margin-bottom: 10px; }
button.admin-logout {
  width: 100%; padding: 8px 12px; background: transparent; color: var(--sidebar-text);
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
button.admin-logout .admin-nav-label { flex: none; }
button.admin-logout:hover, button.admin-logout:focus { background: rgba(148, 163, 184, 0.14); color: #fff; border-color: rgba(148, 163, 184, 0.6); }
.admin-content { margin-left: var(--sidebar-w); min-width: 0; padding: 0 var(--gutter) 48px; }
body.admin-layout header.admin-topbar {
  max-width: none;
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  min-height: 64px; margin: 0 calc(-1 * var(--gutter)) 20px; padding: 10px var(--gutter);
  background: rgba(245, 247, 250, 0.94); border-bottom: 1px solid var(--color-border);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.admin-topbar h1 { margin: 0; font-size: 1.35rem; flex: 1; min-width: 0; }
.admin-topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.admin-menu-toggle {
  display: none; padding: 6px 11px; font-size: 1.15rem; line-height: 1;
  background: #fff; color: var(--color-text); border-color: var(--color-border);
}
button.admin-menu-toggle:hover, button.admin-menu-toggle:focus { background: #eef2f7; border-color: var(--color-border); }
.admin-backdrop { display: none; }

/* Thu gon menu (anh Dung 14/10): chi may tinh >= 1024px; man hinh hep van dung nut ☰ truot menu. */
button.admin-collapse {
  display: flex; align-items: center; gap: 10px; width: auto; margin: 0 12px 8px; padding: 9px 10px;
  background: transparent; border: 0; border-radius: 8px; color: var(--sidebar-muted); font-weight: 600; text-align: left;
}
button.admin-collapse:hover, button.admin-collapse:focus-visible { background: rgba(148, 163, 184, 0.14); color: #fff; }
@media (min-width: 1024px) {
  .admin-sidebar { transition: width 0.18s ease; overflow-x: hidden; }
  .admin-content { transition: margin-left 0.18s ease; }
  body.admin-layout.admin-nav-collapsed { --sidebar-w: 64px; }
  .admin-nav-collapsed .admin-brand { justify-content: center; padding: 20px 0 16px; }
  .admin-nav-collapsed .admin-brand-name,
  .admin-nav-collapsed .admin-nav-label,
  .admin-nav-collapsed .admin-account-name,
  .admin-nav-collapsed .admin-account-role { display: none; }
  .admin-nav-collapsed .admin-nav { padding: 4px 8px 16px; }
  /* Tieu de nhom thanh vach ngan mong. */
  .admin-nav-collapsed .admin-nav-title { height: 1px; padding: 0; margin: 4px 8px 8px; overflow: hidden; font-size: 0; background: rgba(148, 163, 184, 0.25); }
  .admin-nav-collapsed .admin-nav-link { position: relative; justify-content: center; padding: 10px 0; }
  .admin-nav-collapsed .admin-nav-icon { width: 20px; height: 20px; }
  /* So viec cho duyet thanh cham do o goc bieu tuong (so van doc duoc qua aria-label). */
  .admin-nav-collapsed .admin-badge { position: absolute; top: 5px; right: 9px; min-width: 0; width: 9px; height: 9px; padding: 0; font-size: 0; box-shadow: 0 0 0 2px var(--sidebar-bg); }
  .admin-nav-collapsed button.admin-collapse { justify-content: center; margin: 0 8px 8px; padding: 10px 0; }
  .admin-nav-collapsed button.admin-collapse .admin-nav-icon { transform: rotate(180deg); }
  .admin-nav-collapsed .admin-account { padding: 12px 8px 16px; }
  .admin-nav-collapsed button.admin-logout { padding: 8px 0; }
}
@media (max-width: 1023px) {
  button.admin-collapse { display: none; }
}
/* Trang chua lam lai (dot 2): form doc va doan huong dan khong keo dai het man hinh rong. */
body.admin-layout main section > form:not(.inline) { max-width: 760px; }
body.admin-layout main p.hint { max-width: 110ch; }
body.admin-layout section { border-radius: 10px; }

@media (max-width: 1023px) {
  body.admin-layout { --gutter: 16px; }
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  body.admin-nav-open .admin-sidebar { transform: none; box-shadow: 0 0 40px rgba(15, 23, 42, 0.35); }
  body.admin-nav-open .admin-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, 0.45); }
  .admin-content { margin-left: 0; }
  button.admin-menu-toggle { display: inline-block; }
  body.admin-layout header.admin-topbar { min-height: 56px; }
  .admin-topbar h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ===== Thanh phan dung chung: the so lieu, thanh cong cu, bang, phan trang, nhan trang thai. ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  display: block; width: 100%; text-align: left; padding: 14px 16px; border-radius: 10px;
  background: var(--color-panel); border: 1px solid var(--color-border); color: var(--color-text); font-weight: 400;
}
button.stat-card { cursor: pointer; }
button.stat-card:hover, button.stat-card:focus { background: #f8fafc; border-color: var(--color-primary); color: var(--color-text); }
button.stat-card.selected { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.stat-label { display: block; color: var(--color-muted); font-size: 0.85rem; font-weight: 600; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.stat-card.warn .stat-value { color: #b45309; }
.stat-card.alert .stat-value { color: var(--color-error); }
.stat-note { display: block; color: var(--color-muted); font-size: 0.8rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
form.toolbar { flex-direction: row; max-width: none; }
.toolbar label { font-size: 0.8rem; color: var(--color-muted); }
.toolbar input, .toolbar select { padding: 7px 10px; min-width: 150px; }
.toolbar .toolbar-search { flex: 1 1 260px; }
.toolbar .toolbar-search input { min-width: 0; }
.toolbar button { padding: 8px 14px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
table.data-table { margin: 0; border: 0; font-size: 0.92rem; display: table; }
table.data-table th, table.data-table td { border: 0; border-bottom: 1px solid #e5eaf0; padding: 10px 12px; vertical-align: middle; }
table.data-table thead th {
  background: #f1f5f9; color: #334155; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
}
table.data-table tbody tr:nth-child(even) { background: #fff; }
table.data-table tbody tr:hover { background: #f8fafc; }
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table .nowrap { white-space: nowrap; }
table.data-table .sub { display: block; color: var(--color-muted); font-size: 0.82rem; }
button.sort {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700;
  text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center;
}
button.sort:hover, button.sort:focus { background: none; color: var(--color-primary); }
button.sort .sort-arrow { opacity: 0.35; }
button.sort.active .sort-arrow { opacity: 1; color: var(--color-primary); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button, button.small { padding: 5px 10px; font-size: 0.85rem; white-space: nowrap; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--color-success-bg); color: var(--color-success); }
.pill.off { background: #e2e8f0; color: #475569; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.info { background: #dbeafe; color: #1e40af; }

.pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
.pager-info { color: var(--color-muted); font-size: 0.88rem; }
.pager-pages { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pager-pages button { min-width: 36px; padding: 6px 10px; background: #fff; color: var(--color-text); border-color: var(--color-border); font-weight: 600; }
.pager-pages button:hover, .pager-pages button:focus { background: #eef2f7; border-color: var(--color-border); }
.pager-pages button.current, .pager-pages button.current:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pager-pages button:disabled { cursor: default; opacity: 0.45; }
.pager-gap { padding: 0 4px; color: var(--color-muted); }
.empty-state { padding: 28px 16px; text-align: center; color: var(--color-muted); }

/* ===== Ngan keo ben phai (form them/sua): 2 cot tren may tinh, 1 cot tren dien thoai. ===== */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 100%);
  display: flex; flex-direction: column; background: var(--color-panel);
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.25);
}
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--color-border); }
.drawer-head h2 { margin: 0; flex: 1; font-size: 1.15rem; }
button.drawer-close { padding: 4px 10px; font-size: 1.3rem; line-height: 1; background: none; color: var(--color-muted); border-color: transparent; }
button.drawer-close:hover, button.drawer-close:focus { background: #eef2f7; color: var(--color-text); border-color: transparent; }
.drawer form { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; max-width: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; -webkit-overflow-scrolling: touch; }
.drawer-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--color-border); background: #f8fafc; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1; margin: 8px 0 -4px; padding-top: 12px; border-top: 1px solid #e5eaf0;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-muted);
}
.form-grid .form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }
.device-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.link-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.link-box input { flex: 1 1 260px; width: auto; }
.mail-status { margin-top: 6px; font-size: 0.9rem; }
.mail-status:empty { display: none; }
.mail-status.ok { color: var(--color-success); font-weight: 600; }
.mail-status.error { color: var(--color-error); }
body.drawer-open { overflow: hidden; }

@media (max-width: 720px) {
  table.data-table { display: table; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 1.4rem; }
  .toolbar label { flex: 1 1 45%; }
  .toolbar input, .toolbar select { min-width: 0; }
  .pager { justify-content: center; }
}

/* ===== Dot 2: khoi trang (tieu de + luoi 2 cot), lich phan ca tuan. ===== */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.section-head h2 { margin: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 0 20px; align-items: start; }
.panel-grid > section { min-width: 0; }
.panel-grid > .span-all { grid-column: 1 / -1; }
/* QĐ-32: Cau hinh ca - Lich chung 2 cot (trai: ngay lam viec + ca; phai: ngay le); doi ca 60 ngay chia cot theo bo phan. */
.panel-grid > .config-col { min-width: 0; }
.override-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 0 20px; align-items: start; }
.override-col { min-width: 0; }
.override-col h3 { margin-top: 8px; }
.override-col td:first-child, .override-col td:last-child { white-space: nowrap; }
body.admin-layout .panel-grid section > form:not(.inline) { max-width: none; }
section h3 { font-size: 1rem; margin: 18px 0 8px; }
body.admin-layout main section form:not(.inline) > button { align-self: flex-start; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
body.admin-layout div.inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
body.admin-layout div.inline > label { flex: 1 1 160px; }
section .table-wrap { margin-top: 12px; }

.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav strong { min-width: 118px; text-align: center; font-variant-numeric: tabular-nums; }
.week-nav button[aria-label] { padding: 7px 12px; font-size: 1.1rem; line-height: 1; }
.roster-toolbar { margin-top: 12px; }

.shift-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.shift-chip { padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid transparent; }

/* Mau ca: tone-0..5 theo thu tu ca, tone-off = Nghi. */
.tone-0 { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.tone-1 { background: #dcfce7; color: #14532d; border-color: #86efac; }
.tone-2 { background: #fef3c7; color: #78350f; border-color: #fcd34d; }
.tone-3 { background: #f3e8ff; color: #581c87; border-color: #d8b4fe; }
.tone-4 { background: #ffe4e6; color: #881337; border-color: #fda4af; }
.tone-5 { background: #cffafe; color: #164e63; border-color: #67e8f9; }
.tone-off { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

.roster-wrap { max-height: 72vh; overflow: auto; }
table.roster-table { border-collapse: separate; border-spacing: 0; width: 100%; }
table.roster-table thead th { position: sticky; top: 0; z-index: 2; text-transform: none; letter-spacing: 0; font-size: 0.82rem; }
table.roster-table th, table.roster-table td { padding: 6px 5px; }
table.roster-table th:first-child, table.roster-table td:first-child { padding-left: 12px; }
table.roster-table .sticky-col {
  position: sticky; left: 0; z-index: 1; background: #fff; min-width: 180px; max-width: 220px;
  text-align: left; font-weight: 400; border-right: 1px solid #e5eaf0;
}
table.roster-table thead .sticky-col { z-index: 3; background: #f1f5f9; }
table.roster-table tbody tr:hover .sticky-col { background: #f8fafc; }
table.roster-table tfoot th, table.roster-table tfoot td {
  position: sticky; bottom: 0; z-index: 1; background: #f1f5f9; font-weight: 700; text-align: center;
  border-top: 1px solid var(--color-border);
}
table.roster-table tfoot .sticky-col { z-index: 3; text-align: left; font-size: 0.85rem; }
.roster-name { display: block; font-weight: 600; }
th.day-col { text-align: center; min-width: 104px; }
th.day-col span { display: block; }
.day-name { font-weight: 700; }
.day-date { color: var(--color-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.day-holiday { color: var(--color-error); font-size: 0.75rem; font-weight: 600; white-space: normal; }
td.day-col { text-align: center; }
table.roster-table .is-weekend { background: #fafaf9; }
table.roster-table thead .is-weekend { background: #ebeef3; }
table.roster-table .is-holiday { background: #fff1f2; }
table.roster-table thead .is-holiday { background: #ffe4e6; }
table.roster-table .is-today { box-shadow: inset 2px 0 0 var(--color-primary), inset -2px 0 0 var(--color-primary); }
table.roster-table thead .is-today { background: #dbeafe; color: #1e3a8a; }
table.roster-table thead .is-today .day-date { color: #1e40af; }
select.shift-select {
  width: 100%; min-width: 96px; padding: 6px 6px; font-size: 0.85rem; font-weight: 600; border-width: 1px; border-style: solid;
  -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center; cursor: pointer;
}
.roster-quota { font-size: 0.8rem; min-width: 130px; color: #475569; }

/* QĐ-31: tab bo phan + chuyen Tuan/Thang + luoi thang (o hep, ky hieu ca). */
.dept-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.dept-tabs:empty { display: none; }
.dept-tabs button { border-radius: 999px; padding: 6px 14px; font-weight: 600; }
.dept-tabs button[aria-selected="true"] { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.dept-tabs .count { font-weight: 400; opacity: 0.8; margin-left: 4px; }
.view-switch { display: inline-flex; }
.view-switch button { border-radius: 0; }
.view-switch button:first-child { border-radius: 8px 0 0 8px; }
.view-switch button:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.view-switch button[aria-pressed="true"] { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
table.month-table th.day-col { min-width: 38px; padding: 4px 2px; }
table.month-table td.day-col { padding: 2px; min-width: 38px; }
table.month-table .sticky-col { min-width: 150px; }
.cell-pick { position: relative; display: block; border: 1px solid transparent; border-radius: 6px; min-height: 30px; line-height: 28px; text-align: center; font-size: 0.8rem; font-weight: 700; }
/* O chon trong suot phu kin o: bam la mo danh sach ca day du (iOS/Android); chu 16px tranh iOS phong to. */
.cell-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.cell-pick select:disabled { cursor: default; }
.cell-pick:focus-within { outline: 2px solid var(--color-primary); outline-offset: 1px; }
table.month-table td.sum-col, table.month-table th.sum-col { text-align: center; min-width: 46px; font-variant-numeric: tabular-nums; border-left: 1px solid #e5eaf0; }
table.month-table td.sum-col.over-quota { color: var(--color-error); font-weight: 700; }
table.month-table tfoot td.zero { color: var(--color-error); }
/* Ngay chua ap dung phan cong (truoc moc doi che do / ngoai thoi gian lam viec): khong sua, khong dem. */
table.roster-table td.off-roster { background: repeating-linear-gradient(135deg, #f8fafc 0 6px, #eef2f6 6px 12px); color: #94a3b8; text-align: center; }
.roster-quota .over-quota { color: var(--color-error); font-weight: 700; }

/* Bao cao: chon ky cong + bang cong ty tieu de dinh, o can chu y to mau. */
.report-period { flex-direction: row; max-width: none; padding: 14px 16px; background: var(--color-panel); border: 1px solid var(--color-border); border-radius: 10px; margin-bottom: 18px; }
.report-period .week-nav { align-items: flex-end; }
.report-period .week-nav input { width: 92px; min-width: 0; }
.report-wrap { max-height: 70vh; overflow: auto; }
.report-section .stat-grid { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.report-section .stat-value { font-size: 1.45rem; }
table.report-table { border-collapse: separate; border-spacing: 0; width: 100%; }
table.report-table thead th { position: sticky; top: 0; z-index: 2; text-transform: none; letter-spacing: 0; font-size: 0.8rem; white-space: normal; vertical-align: bottom; }
table.report-table thead button.sort { text-align: left; }
table.report-table tfoot th { position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--color-border); white-space: nowrap; }
table.report-table td.num, table.report-table tfoot th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.report-table td.warn-cell { background: #fef3c7; color: #92400e; font-weight: 700; }
table.report-table td.alert-cell { background: var(--color-error-bg); color: var(--color-error); font-weight: 700; }
table.report-table tbody tr.row-warn td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
table.report-table tbody tr.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--color-error); }

@media (min-width: 1200px) {
  /* QĐ-35: danh sach tai khoan rong het hang (span-all); khung Sua + Tao chia doi ben duoi. */
  .panel-grid.accounts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* QĐ-32: may tinh pho thong (1280px) van 2 cot: cau hinh ca, doi ca theo bo phan. */
@media (min-width: 1100px) {
  .panel-grid.config-grid, .override-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Nhat ky: chi tiet dai xuong dong, chu nho hon. */
table.audit-table td.audit-detail { font-size: 0.84rem; color: #475569; min-width: 260px; word-break: break-word; }
table.audit-table td.audit-target { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; white-space: nowrap; }
table.audit-table td { vertical-align: top; }

@media (max-width: 720px) {
  .week-nav { flex: 1 1 100%; justify-content: space-between; }
  .report-period .week-nav label { flex: 1 1 0; }
  .report-period .week-nav input { width: 100%; }
  .roster-wrap { max-height: 68vh; }
  table.roster-table .sticky-col { min-width: 132px; max-width: 150px; }
  table.roster-table .sticky-col .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  th.day-col { min-width: 100px; }
}

/* QĐ-26: trang bang cong ca nhan (/bang-cong) */
.timesheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timesheet-head h2 { margin: 0; flex: 1; text-align: center; }
.timesheet-head button[hidden] { display: inline-block; visibility: hidden; }
#timesheetSummary { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
#timesheetSummary .summary-item strong { font-size: 1.15rem; }
table.timesheet-table { width: 100%; font-size: 0.88rem; }
table.timesheet-table th, table.timesheet-table td { padding: 6px 6px; }
table.timesheet-table td.warn-cell { background: #fef3c7; color: #92400e; font-weight: 700; }
table.timesheet-table tr.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--color-error); }
table.timesheet-table .cell-note { display: block; font-weight: 400; color: var(--color-muted); }
a.button-link { display: flex; align-items: center; justify-content: center; text-decoration: none; background: var(--color-primary); color: #fff; font-weight: 600; box-sizing: border-box; }
a.button-link:hover, a.button-link:focus { background: var(--color-primary-dark); }

/* QĐ-26 dot 3: xin review ngay cong (nhan vien) + trang Review cong (HCNS) */
.review-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.review-item { border: 1px solid var(--color-border, #e2e8f0); border-radius: 10px; padding: 10px 12px; background: #fff; }
.review-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.review-reason { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-decision { margin: 6px 0 0; color: var(--color-muted); }
.review-tabs { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.review-tabs button[aria-pressed="true"] { background: var(--color-primary, #1f6feb); color: #fff; border-color: transparent; }
.review-files { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 8px; font-size: 0.9rem; }
.review-files a { overflow-wrap: anywhere; }
.review-current { margin: 10px 0 6px; font-size: 0.9rem; }
.review-decide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; max-width: none; }
.review-decide label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--color-muted); }
.review-decide label:has(textarea), .review-decide .review-actions { grid-column: 1 / -1; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#reviewFileInfo:empty { display: none; }

/* QĐ-33: trang Phép năm */
.text-error { color: var(--color-error); }
table.data-table tbody tr.row-selected { background: #eff6ff; }
.leave-rules { margin-bottom: 12px; }
.leave-rules summary { cursor: pointer; font-weight: 600; }
.leave-rules ul { margin: 8px 0 0; padding-left: 20px; }
.adjust-list { margin: 0 0 12px; padding-left: 20px; }
.adjust-list li { margin-bottom: 6px; }
.leave-balance { margin: 4px 0 0; }
.leave-sub { display: block; margin-top: 2px; color: var(--color-muted); font-size: 0.82rem; }
.leave-sub.text-error { color: var(--color-error); }

/* QĐ-36 "Xem của tôi": danh sach don/lich dang the, khong bang rong tren dien thoai. */
.my-list { list-style: none; margin: 12px 0 0; padding: 0; }
.my-item { padding: 10px 0; border-top: 1px solid var(--color-border); }
.my-item:first-child { border-top: 0; }
.my-item.off .my-day-shift { color: var(--color-muted); }
.my-item-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.my-item-title { font-weight: 600; }
.my-tag { font-size: 0.82rem; padding: 1px 8px; border-radius: 999px; background: var(--color-bg); color: var(--color-muted); white-space: nowrap; }
.my-tag.ok { background: var(--color-success-bg); color: var(--color-success); }
.my-tag.bad { background: var(--color-error-bg); color: var(--color-error); }
.my-tag.wait { background: #fef3c7; color: #92400e; }
.my-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 12px 0 0; }
.my-detail dt { color: var(--color-muted); }
.my-detail dd { margin: 0; text-align: right; }
.my-detail dd.strong { font-weight: 700; font-size: 1.1rem; }

/* QĐ-35: tai khoan tam dung mo di; cach nut thao tac tren dong. */
tr.row-muted td { color: var(--color-muted, #64748b); }
.row-actions button + button { margin-left: 6px; }
/* QĐ-35 bo sung: bang tai khoan 8 cot — tieu de cot duoc xuong dong de vua man hinh may tinh 1280px. */
.accounts-grid table.data-table th { white-space: normal; }
/* Trang Tai khoan (anh Dung 14/10): 3 cot thao tac co dinh — Sửa | Tạm dừng/Mở lại | Xóa — thang hang moi dong; nut khong
   dung duoc la o xam. O la table-cell binh thuong (khong flex) nen duong ke bang lien mach. */
td.account-actions { width: 1%; white-space: nowrap; vertical-align: middle; }
.account-action-grid { display: grid; grid-template-columns: 4.2em 6.6em 4.2em; gap: 6px; justify-content: end; }
.account-action-grid > button, .account-action-grid > .action-off { width: 100%; padding: 5px 6px; font-size: 0.85rem; white-space: nowrap; }
.action-off {
  display: inline-block; box-sizing: border-box; text-align: center; font-weight: 600; line-height: normal;
  border: 1px solid var(--color-border); border-radius: 6px; background: #f1f5f9; color: #94a3b8; cursor: not-allowed;
}

/* QĐ-37: the "Thông báo đơn mới" tren trang Đơn chờ duyệt. */
.push-card { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-panel); }
.push-card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.push-card .hint { margin: 0 0 10px; }
.push-card button + button { margin-left: 8px; }
/* QĐ-37 đợt 2: trang Thông báo (tự kiểm) */
.notify-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notify-actions button { flex: 1 1 260px; }

/* Kich hoat: sao chep link de dan vao Safari/Chrome */
#copyBox { margin: 14px 0; }
#copyBox .hint { margin-bottom: 12px; }
.phone-action + .phone-action, #copyBox + .phone-action { margin-top: 12px; }
.copy-field { width: 100%; margin-top: 10px; font-size: 0.9rem; }
.copy-steps { margin: 12px 0 0; padding-left: 22px; line-height: 1.6; }

label.inline-check { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.profile-detail { grid-template-columns: minmax(110px, auto) minmax(0, 1fr); }
.profile-detail dd { text-align: left; overflow-wrap: anywhere; }
.tab-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }

/* ===== Trang Tong quan: bieu do SVG (co gian theo be ngang, dung tren dien thoai). ===== */
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.chart-box { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: 10px; padding: 12px; }
.chart { display: block; width: 100%; height: auto; }
.donut { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.donut-chart { width: 160px; max-width: 45%; flex: 0 0 auto; }
.chart-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.88rem; }
.donut .chart-legend { flex-direction: column; flex: 1 1 140px; }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.chart-placeholder { border: 2px dashed var(--color-border); border-radius: 8px; padding: 24px 16px; text-align: center; color: var(--color-muted); }
#dashGenderText { width: 100%; font-family: ui-monospace, Consolas, monospace; }

/* ===== Tong quan (anh Dung 10/10): 3 tab cung khung — the chi so + 2 khoi + cot ben phai; khoi cung hang cao bang nhau,
   danh sach dai thi chia trang (< 1/2 >) chu khong keo dai khoi. ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ov-topbar { flex-wrap: wrap; gap: 10px 16px; }
.ov-tabs { display: flex; gap: 2px; padding: 3px; background: #eef2f6; border-radius: 9px; }
.ov-tab { margin: 0; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: #475569; font-size: 0.86rem; font-weight: 500; cursor: pointer; width: auto; min-height: 0; box-shadow: none; }
.ov-tab.active { background: var(--color-panel); color: var(--color-text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.ov-period { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ov-period input { width: auto; margin: 0; padding: 6px 8px; }
.ov-period .hint { margin: 0; font-size: 0.82rem; }
.ov-main { padding-top: 14px; }
.ov-main .result:empty { display: none; }
/* hidden phai thang display grid / flex cua cac khoi ben duoi (tab an, muc ngoai trang hien tai). */
.ov-main [hidden] { display: none !important; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: stretch; }
.ov-left { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-width: 0; }
.ov-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ov-card { background: var(--color-panel); border: 1px solid #e5eaf0; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-card-label { color: var(--color-muted); font-size: 0.78rem; font-weight: 500; }
.ov-card-value { font-size: 1.45rem; font-weight: 600; line-height: 1.25; color: var(--color-text); }
.ov-delta { font-size: 0.76rem; font-weight: 500; }
.ov-delta.bad { color: #c2410c; }
.ov-delta.good { color: #15803d; }
.ov-delta.flat { color: #64748b; }
/* Ghi chu xuong toi da 2 dong (khong cat chu o dong 1), qua 2 dong moi cat. */
.ov-card-note { font-size: 0.74rem; line-height: 1.35; color: #8492a3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ov-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-height: 0; }
body.admin-layout section.ov-panel, .ov-panel { background: var(--color-panel); border: 1px solid #e5eaf0; border-radius: 10px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; min-width: 0; }
.ov-panel h2 { font-size: 0.9rem; font-weight: 600; margin: 0 0 6px; color: var(--color-text); }
.ov-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ov-panel-head h2 { margin: 0; }
.ov-seg { display: flex; gap: 2px; padding: 2px; background: #f1f5f9; border-radius: 7px; }
.ov-seg-btn { margin: 0; padding: 3px 8px; border: 0; border-radius: 5px; background: transparent; color: #64748b; font-size: 0.74rem; cursor: pointer; width: auto; min-height: 0; box-shadow: none; }
.ov-seg-btn.active { background: var(--color-panel); color: #1e3a8a; font-weight: 600; }
.ov-trend { width: 100%; height: auto; display: block; }
.ov-foot { margin: 4px 0 0; font-size: 0.76rem; color: #8492a3; }
.ov-bars { display: grid; gap: 8px; font-size: 0.82rem; padding-top: 4px; }
.ov-bar-row { display: grid; grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 34px; gap: 10px; align-items: center; }
.ov-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #475569; }
.ov-bar { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.ov-bar-fill { display: block; height: 100%; background: #93c5fd; border-radius: 3px; }
.ov-bar-value { text-align: right; color: #475569; }
.ov-alert-list, .ov-rows { list-style: none; margin: 0; padding: 0; }
.ov-alert { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 0 8px 10px; border-bottom: 1px solid #eef2f6; border-left: 3px solid #cbd5e1; font-size: 0.82rem; line-height: 1.4; }
.ov-alert.danger { border-left-color: #ef4444; }
.ov-alert.warning { border-left-color: #f59e0b; }
.ov-alert.info { border-left-color: #94a3b8; }
.ov-alert.ok { border-left-color: #22c55e; color: #15803d; }
.ov-alert-level { grid-column: 1; font-size: 0.7rem; font-weight: 600; color: #64748b; }
.ov-alert.danger .ov-alert-level { color: #b91c1c; }
.ov-alert.warning .ov-alert-level { color: #b45309; }
.ov-alert-text { grid-column: 1; color: var(--color-text); }
.ov-alert-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.78rem; }
.ov-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 7px 0; border-bottom: 1px solid #eef2f6; font-size: 0.82rem; line-height: 1.35; }
.ov-row-main { grid-column: 1; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-row-sub { grid-column: 1; font-size: 0.74rem; color: #8492a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-row-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #475569; font-size: 0.78rem; text-align: right; white-space: nowrap; }
.ov-empty { padding: 8px 0; font-size: 0.82rem; color: var(--color-muted); }
/* Thanh chia trang + link cuoi khoi luon nam o day khoi (khoi da duoc keo cao bang hang). */
.ov-pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-size: 0.78rem; color: #64748b; }
.ov-pager:empty { display: none; }
.ov-page-btn { margin: 0; width: 26px; height: 26px; min-height: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 6px; background: var(--color-panel); color: #475569; font-size: 0.95rem; line-height: 1; cursor: pointer; box-shadow: none; }
.ov-page-btn:disabled { opacity: 0.4; cursor: default; }
.ov-more { margin: auto 0 0; padding-top: 10px; font-size: 0.84rem; }
.ov-pager:not(:empty) + .ov-more { margin-top: 0; }
@media (max-width: 1180px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  /* Man hep: the chi so -> cot ben phai (canh bao / sinh nhat / can chu y) -> 2 khoi. */
  .ov-left { display: contents; }
  .ov-cards { order: 1; }
  .ov-alerts { order: 2; }
  .ov-charts { order: 3; }
}
@media (max-width: 720px) {
  .ov-tabs { width: 100%; }
  .ov-tab { flex: 1 1 0; padding: 7px 4px; font-size: 0.8rem; }
  .ov-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ov-charts { grid-template-columns: minmax(0, 1fr); }
  .ov-period { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .ov-card-value { font-size: 1.25rem; }
  .ov-page-btn { width: 34px; height: 34px; }
}
