:root {
  /* Brand GENZ: tím lavender theo bộ nhận diện */
  --bg: #f6f5fb;
  --bg2: #eeeaf8;
  --panel: #ffffff;
  --panel2: #f8f7ff;
  --line: #e6e3f2;
  --text: #2d3447;
  --muted: #8b92a5;
  --accent: #6b5bff;
  --accent-ink: #ffffff;
  --accent-soft: #eeebff;
  --teal: #6b5bff;
  --danger: #e5484d;
  --warn: #f5a524;
  --ok: #12b76a;
  --holding: #6b5bff;
  --clean: #94a3b8;
  --sidebar: #ffffff;
  --sidebar-text: #5b6478;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(60, 40, 120, .08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  width: 100%;
}
a { color: var(--teal); text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ===== AUTH / LOGIN ===== */
.auth-body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: "Outfit", var(--font);
  background: #f3f0ff;
}
.auth-stage {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(1000px 600px at 50% 110%, #ddd6fe 0%, transparent 55%),
    linear-gradient(165deg, #f6f5fb 0%, #e8e4ff 45%, #faf9ff 100%);
}
.auth-aurora {
  position: absolute; border-radius: 50%; filter: blur(70px);
  opacity: .55; will-change: transform, opacity;
}
.auth-aurora.a1 {
  width: 52vw; height: 52vw; max-width: 640px; max-height: 640px;
  left: -12%; top: -18%;
  background: radial-gradient(circle, rgba(107,91,255,.45) 0%, rgba(107,91,255,0) 70%);
  animation: authDrift1 14s ease-in-out infinite alternate;
}
.auth-aurora.a2 {
  width: 48vw; height: 48vw; max-width: 560px; max-height: 560px;
  right: -16%; top: 8%;
  background: radial-gradient(circle, rgba(0,163,191,.35) 0%, rgba(0,163,191,0) 70%);
  animation: authDrift2 18s ease-in-out infinite alternate;
}
.auth-aurora.a3 {
  width: 60vw; height: 42vw; max-width: 720px; max-height: 480px;
  left: 18%; bottom: -22%;
  background: radial-gradient(circle, rgba(59,130,246,.3) 0%, rgba(59,130,246,0) 70%);
  animation: authDrift3 16s ease-in-out infinite alternate;
}
.auth-beam {
  position: absolute; inset: -20% -10%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 42%,
    rgba(107,91,255,.06) 48%,
    rgba(255,255,255,.55) 50%,
    rgba(0,163,191,.06) 52%,
    transparent 58%,
    transparent 100%
  );
  transform: translateX(-30%) rotate(8deg);
  animation: authBeam 9s ease-in-out infinite;
  pointer-events: none;
}
.auth-orb {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(107,91,255,.2);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), rgba(107,91,255,.12) 45%, transparent 70%);
  box-shadow: 0 0 40px rgba(107,91,255,.15);
  animation: authFloat 11s ease-in-out infinite;
}
.auth-orb.o1 { width: 120px; height: 120px; left: 8%; top: 58%; animation-duration: 12s; }
.auth-orb.o2 { width: 72px; height: 72px; right: 12%; top: 22%; animation-duration: 9s; animation-delay: -2s; }
.auth-orb.o3 { width: 46px; height: 46px; right: 28%; bottom: 18%; animation-duration: 14s; animation-delay: -4s; opacity: .7; }
.auth-rings {
  position: absolute; left: 50%; top: 42%;
  width: min(70vw, 520px); height: min(70vw, 520px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.auth-rings span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(107,91,255,.12);
  animation: authRing 10s linear infinite;
}
.auth-rings span:nth-child(2) { inset: 12%; animation-duration: 14s; animation-direction: reverse; opacity: .7; }
.auth-rings span:nth-child(3) { inset: 26%; animation-duration: 18s; opacity: .45; }
.auth-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(11,31,68,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,31,68,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.45), transparent 72%);
  animation: authGrid 28s linear infinite;
  opacity: .7;
}
.auth-sparkles { position: absolute; inset: 0; pointer-events: none; }
.auth-sparkles i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #6b5bff; box-shadow: 0 0 10px rgba(107,91,255,.8);
  animation: authTwinkle 3.6s ease-in-out infinite;
}
.auth-sparkles i:nth-child(1) { left: 12%; top: 18%; animation-delay: 0s; }
.auth-sparkles i:nth-child(2) { left: 78%; top: 14%; animation-delay: .4s; }
.auth-sparkles i:nth-child(3) { left: 22%; top: 72%; animation-delay: .9s; }
.auth-sparkles i:nth-child(4) { left: 88%; top: 62%; animation-delay: 1.3s; }
.auth-sparkles i:nth-child(5) { left: 46%; top: 28%; animation-delay: 1.7s; }
.auth-sparkles i:nth-child(6) { left: 64%; top: 78%; animation-delay: 2.1s; }
.auth-sparkles i:nth-child(7) { left: 8%; top: 44%; animation-delay: 2.5s; }
.auth-sparkles i:nth-child(8) { left: 92%; top: 36%; animation-delay: 2.9s; }
.auth-grain {
  position: absolute; inset: 0; opacity: .18; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  animation: authGrain 0.45s steps(2) infinite;
}
.auth-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(180,200,230,.35) 100%);
}

@keyframes authDrift1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(8%, 12%) scale(1.12); }
}
@keyframes authDrift2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-10%, 8%) scale(1.08); }
}
@keyframes authDrift3 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6%, -10%) scale(1.15); }
}
@keyframes authBeam {
  0%, 100% { transform: translateX(-35%) rotate(8deg); opacity: .35; }
  50% { transform: translateX(35%) rotate(8deg); opacity: .85; }
}
@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}
@keyframes authRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes authGrid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 56px 56px, 56px 56px; }
}
@keyframes authTwinkle {
  0%, 100% { opacity: .15; transform: scale(.7); }
  50% { opacity: 1; transform: scale(1.35); }
}
@keyframes authGrain {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1.5%, 1%); }
}
@keyframes authLogoPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(107,91,255,.22); transform: scale(1); }
  50% { box-shadow: 0 16px 42px rgba(107,91,255,.4); transform: scale(1.04); }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-shell {
  position: relative; z-index: 1;
  max-width: 440px; margin: 0 auto;
  padding: 48px 20px 40px;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.auth-brand { text-align: center; animation: authCardIn .7s ease both; }
.auth-logo {
  width: 72px; height: 72px; margin: 0 auto 14px;
  border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(145deg, #6b5bff, #4f46e5);
  color: #fff; font-family: "Syne", "Outfit", sans-serif;
  font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em;
  box-shadow: 0 12px 30px rgba(107,91,255,.28);
  animation: authLogoPulse 3.2s ease-in-out infinite;
}
.auth-kicker {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: #6b5bff; margin-bottom: 6px; font-weight: 700;
}
.auth-brand h1 {
  margin: 0; font-family: "Syne", "Outfit", sans-serif;
  font-size: clamp(2rem, 6vw, 2.55rem); letter-spacing: -.02em; color: #2d3447;
  text-shadow: none;
}
.auth-brand p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.auth-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(107,91,255,.12);
  border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 24px 60px rgba(60,40,120,.12), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: authCardIn .75s ease .12s both;
}
.auth-card h2 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 700; color: #2d3447; }
.auth-form .field { margin-bottom: 12px; }
.auth-submit {
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 28px rgba(107,91,255,.25);
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(107,91,255,.35); }
.auth-quick { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.quick-user {
  border: 1px solid var(--line); background: #faf9ff; color: var(--text);
  border-radius: 12px; padding: 10px 8px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease;
}
.quick-user:hover {
  border-color: rgba(107,91,255,.45); color: var(--accent);
  background: var(--accent-soft); transform: translateY(-1px);
}
.tiny { font-size: .78rem; }

@media (prefers-reduced-motion: reduce) {
  .auth-aurora, .auth-beam, .auth-orb, .auth-rings span,
  .auth-grid, .auth-sparkles i, .auth-grain, .auth-logo {
    animation: none !important;
  }
}

/* ===== APP SHELL ===== */
/* Scrollbar mỏng toàn app */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100,116,139,.45) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,.4);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,.65); }

.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 18px 12px 12px;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(60, 40, 120, .04);
}
.nav-scroll-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.nav-scroll-wrap .nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-scroll-wrap .nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.nav-scroll-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 34px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .72rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(60,40,120,.12);
  animation: navHintBlink 1.1s ease-in-out infinite;
}
.nav-scroll-hint.up { top: 4px; }
.nav-scroll-hint.down { bottom: 4px; }
.nav-scroll-hint[hidden] { display: none !important; }
.nav-scroll-hint:hover { background: var(--accent); color: #fff; }
@keyframes navHintBlink {
  0%, 100% { opacity: .45; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(2px); }
}
.nav-scroll-hint.up {
  animation-name: navHintBlinkUp;
}
@keyframes navHintBlinkUp {
  0%, 100% { opacity: .45; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-2px); }
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background: var(--accent); color: #fff; letter-spacing: -.02em;
  box-shadow: 0 6px 16px rgba(107,91,255,.28);
}
.brand strong { display: block; color: var(--accent); font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; }
.brand small { color: var(--muted); letter-spacing: .08em; font-size: .62rem; text-transform: uppercase; }
.nav-group { margin-bottom: 10px; }
.nav-label {
  margin: 0 10px 6px;
  font-size: .62rem; font-weight: 650;
  color: var(--muted); text-transform: uppercase; letter-spacing: .12em;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--sidebar-text); margin-bottom: 2px;
  font-size: .92rem; font-weight: 550;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
.nav a:hover { background: rgba(107,91,255,.06); color: var(--accent); }
.nav-ico {
  width: 1.35rem; flex-shrink: 0;
  display: inline-grid; place-items: center;
  font-size: .95rem; line-height: 1;
  color: inherit; opacity: .9;
}
.nav a.active .nav-ico { transform: scale(1.05); opacity: 1; }
.nav-txt { flex: 1; min-width: 0; line-height: 1.2; }
.nav a.nav-sub {
  font-size: .8rem; color: var(--muted); padding-left: 14px; font-weight: 450;
}
.nav a.nav-sub .nav-ico { font-size: .95rem; opacity: .85; }
.nav .soon { opacity: .78; }
.nav .tag {
  margin-left: auto;
  font-size: .58rem; background: var(--accent-soft); color: var(--accent);
  padding: 2px 6px; border-radius: 6px; font-weight: 600; letter-spacing: .04em;
}
.nav-foot { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-logout { color: var(--muted) !important; }
.nav-sep {
  margin: 14px 8px 6px; font-size: .7rem; color: #7f93b8;
  text-transform: uppercase; letter-spacing: .08em;
}

.main {
  padding: 16px 20px 32px;
  width: 100%;
  min-width: 0;
  max-width: none;
}
.page-body { width: 100%; min-width: 0; }
.topbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
  width: 100%;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.2rem; }
.branch-switch { min-width: 0; flex-shrink: 1; }
.branch-switch select { min-width: 140px; max-width: min(280px, 40vw); }
.scope-chip {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(107,91,255,.22);
  background: var(--accent-soft);
  color: #0056c7;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.scope-chip.branch-locked {
  border-color: rgba(0,163,191,.35);
  background: #e6f8fb;
  color: #0a7a8f;
}

/* ===== LIVE CLOCK ===== */
.live-clock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(107,91,255,.18);
  background:
    radial-gradient(circle at 20% 30%, rgba(107,91,255,.08), transparent 55%),
    linear-gradient(180deg, #ffffff, #f3f7ff);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.live-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(107,91,255,.35);
  border-radius: 999px;
  padding: 2px 7px;
  box-shadow: 0 0 12px rgba(107,91,255,.25);
}
.live-badge i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 0 0 rgba(255,77,77,.55);
  animation: livePulse 1.4s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(255,77,77,.55); }
  70% { box-shadow: 0 0 0 8px rgba(255,77,77,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); }
}
.clock-face {
  width: 40px; height: 40px; flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(107,91,255,.15));
}
.clock-ring {
  fill: #eef4ff;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-dasharray: 4 3;
  animation: ringSpin 12s linear infinite;
  transform-origin: 24px 24px;
}
@keyframes ringSpin {
  to { stroke-dashoffset: -70; }
}
.clock-core { fill: var(--accent); }
.hand {
  stroke-linecap: round;
  transform-origin: 24px 24px;
}
.hand.hour { stroke: #2d3447; stroke-width: 2.4; }
.hand.minute { stroke: var(--accent); stroke-width: 1.8; }
.hand.second { stroke: #e5484d; stroke-width: 1.2; }
.clock-meta { line-height: 1.15; min-width: 92px; }
.clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .03em;
  color: var(--text);
}
.clock-date {
  font-size: .68rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}
.period-form {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.period-form select { width: auto; min-width: 96px; flex: 0 0 auto; }
.period-form input[type="date"],
.period-form input[type="week"],
.period-form input[type="search"] {
  width: auto; min-width: 0; flex: 0 1 auto;
}
.period-form input[type="search"] { width: 180px; max-width: 42vw; }
.period-form .btn { flex: 0 0 auto; white-space: nowrap; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 1.1rem;
}
.mobile-only { display: none; }

.panel, .hero-panel, .bill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.hero-panel {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background:
    linear-gradient(135deg, rgba(107,91,255,.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #faf9ff);
}
.hero-panel.compact {
  align-items: center;
  flex-wrap: nowrap;
}
@media (max-width: 640px) {
  .hero-panel.compact { flex-wrap: wrap; }
}
.hero-title { margin: 4px 0 6px; font-size: 1.35rem; }
.eyebrow {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.panel-head {
  display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: clamp(10px, 1vw, 14px);
  margin-bottom: 14px;
}
/* Desktop: 8 ô 1 hàng — bớt khoảng trống trong từng ô */
.kpi-grid.kpi-hero {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}
.kpi-grid.kpi-hero .kpi {
  padding: 12px 12px 10px;
}
.kpi-grid.kpi-hero .kpi-top {
  margin-bottom: 6px;
  gap: 6px;
}
.kpi-grid.kpi-hero .kpi-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}
.kpi-grid.kpi-hero .kpi-ico .ui-ico {
  width: 13px;
  height: 13px;
}
.kpi-grid.kpi-hero .kpi .label {
  font-size: .68rem;
  letter-spacing: .04em;
}
.kpi-grid.kpi-hero .kpi .value {
  font-size: clamp(.98rem, 0.86rem + 0.22vw, 1.18rem);
}
.kpi-grid.kpi-hero .ov-room-den { font-size: .78rem; }
.kpi-grid.kpi-hero .ov-room-meta {
  margin-top: 4px;
  font-size: .72rem;
}
@media (max-width: 1400px) {
  .kpi-grid.kpi-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kpi-grid.kpi-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px 12px;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.kpi.glow { box-shadow: inset 0 0 0 1px rgba(107,91,255,.25); }
.kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}
.kpi-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}
.kpi-ico .ui-ico { width: 15px; height: 15px; }
.kpi.ok .kpi-ico { background: rgba(18,183,106,.12); color: var(--ok); }
.kpi.warn .kpi-ico { background: rgba(245,165,36,.14); color: var(--warn); }
.kpi.danger .kpi-ico { background: rgba(229,72,77,.12); color: var(--danger); }
.kpi .label {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.25;
}
.kpi .value {
  /* Vừa phải, luôn hiện đủ số — không dùng … */
  font-size: clamp(1.12rem, 0.98rem + 0.28vw, 1.38rem);
  font-weight: 750;
  margin-top: 2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
  overflow-wrap: normal;
  max-width: 100%;
}
.ov-room-live .value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
}
.ov-room-den {
  font-size: .86rem;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.ov-room-meta {
  margin-top: 6px;
  line-height: 1.35;
  font-size: .8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-room-live {
  border-color: rgba(107, 91, 255, .28);
  background: linear-gradient(160deg, #f7f5ff, #eeebff);
}
.kpi.ok .value, .held-ok { color: var(--ok); }
.kpi.warn .value, .held-warn { color: var(--warn); }
.kpi.danger .value, .held-danger { color: var(--danger); }

.ui-ico { display: block; }
.nav-ico .ui-ico { width: 18px; height: 18px; }
.bn-ico .ui-ico { width: 20px; height: 20px; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.overview-grid-charts,
.overview-grid-eff {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.menu-chart-wrap {
  height: 220px;
  max-height: 220px;
}
.modern-chart-wrap {
  max-height: 240px;
  overflow: hidden;
}
.overview-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
}
.overview-filters .ov-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 0;
}
.overview-filters .ov-field-branch,
.overview-filters .ov-field-range,
.overview-filters .ov-month-fields,
.overview-filters .ov-custom-fields {
  flex: 1 1 0;
  min-width: 160px;
}
.overview-filters .ov-field-go {
  flex: 0 0 132px;
  width: 132px;
  min-width: 132px;
}
.overview-filters .ov-field > label {
  margin: 0;
  font-size: .8rem;
  font-weight: 650;
  color: #8b92a5;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 1.2em;
}
.overview-filters .ov-inline {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 8px;
  min-width: 0;
  align-items: center;
}
.overview-filters .ov-custom-fields .ov-inline {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
.overview-filters .ov-sep {
  color: #8b92a5;
  font-size: .84rem;
  text-align: center;
}
.overview-filters select,
.overview-filters input[type="date"],
.overview-filters .btn {
  width: 100%;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
  font-size: .92rem;
  line-height: 1.25;
  padding: 11px 12px;
  height: 44px;
  border-radius: 12px;
  white-space: nowrap;
}
.overview-filters .ov-field-go .btn {
  width: 100%;
  min-width: 132px;
  height: 44px;
  padding-inline: 18px;
  font-weight: 650;
}
@media (max-width: 900px) {
  .overview-filters .ov-field-branch,
  .overview-filters .ov-field-range,
  .overview-filters .ov-month-fields,
  .overview-filters .ov-custom-fields {
    flex: 1 1 calc(50% - 14px);
    min-width: 140px;
  }
  .overview-filters .ov-field-go {
    flex: 1 1 100%;
    width: auto;
    min-width: 0;
  }
}
@media (max-width: 560px) {
  .overview-filters .ov-field-branch,
  .overview-filters .ov-field-range,
  .overview-filters .ov-month-fields,
  .overview-filters .ov-custom-fields {
    flex: 1 1 100%;
  }
}
.chart-panel { min-height: 280px; }
.modern-chart-panel { overflow: hidden; }
.chart-focus {
  text-align: right;
  min-width: 140px;
}
.chart-focus strong {
  display: block;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1.2;
}
.modern-chart-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(107,91,255,.06), rgba(107,91,255,.02));
  border: 1px solid rgba(107,91,255,.08);
}
.modern-chart-meta span { display: block; margin-bottom: 2px; }
.modern-chart-meta strong { font-size: .95rem; }
.modern-chart-wrap {
  position: relative;
  height: 240px;
  border-radius: 16px;
  padding: 8px 4px 4px;
  background:
    radial-gradient(500px 160px at 20% 0%, rgba(107,91,255,.08), transparent 55%),
    #fbfaff;
  border: 1px solid rgba(107,91,255,.08);
}
.sig-pill {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 650;
}
.sig-ok { background: rgba(18,183,106,.12); color: #15803d; }
.sig-warn { background: rgba(245,165,36,.16); color: #b45309; }
.sig-bad { background: rgba(229,72,77,.12); color: #b91c1c; }
@media (max-width: 960px) {
  .overview-grid { grid-template-columns: 1fr; }
  .modern-chart-wrap { height: 220px; }
  .modern-chart-meta { grid-template-columns: 1fr; }
}

.rb-page {
  width: 100%;
  max-width: none;
  margin: 0;
}
.rb-hero {
  margin: 4px 0 18px;
  padding: 4px 2px 2px;
}
.rb-kicker {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6b5bff;
}
.rb-hero-title {
  margin: 8px 0 6px;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  color: #1f1638;
}
.rb-hero-desc {
  margin: 0;
  color: #7b8499;
  font-size: .95rem;
  max-width: 42rem;
}
.rb-shell {
  background: #fff;
  border: 1px solid #ebe8f4;
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 30px rgba(55, 40, 120, .06);
}
.rb-shell-secondary { margin-top: 14px; }
.rb-panel-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 750;
  color: #1f1638;
  letter-spacing: -.01em;
}
.rb-panel-sub {
  margin: 3px 0 0;
  color: #8b92a5;
  font-size: .8rem;
}
.rb-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.rb-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rb-filter-form { margin: 0; }
.rb-filter {
  width: auto !important;
  min-width: 168px;
  height: 42px;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid #e6e3f2 !important;
  background: #faf9ff !important;
  color: #3b4258;
  box-shadow: none !important;
}
.rb-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #7a6bff, #6b5bff);
  color: #fff !important;
  font-weight: 750;
  font-size: .92rem;
  box-shadow: 0 8px 18px rgba(107, 91, 255, .28);
  border: 0;
  white-space: nowrap;
}
.rb-btn-primary:hover { filter: brightness(1.04); }
.rb-summary {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f3f7ff, #eef4ff);
  border: 1px solid #d7e4ff;
  color: #3558a0;
  font-size: .86rem;
  line-height: 1.45;
}
.rb-summary strong { color: #24458a; }
.rb-empty-filter {
  grid-column: 1 / -1;
  padding: 28px 12px;
  text-align: center;
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-items: stretch;
  width: 100%;
}
.room-card {
  position: relative;
  border-radius: 16px;
  padding: 14px 14px 12px;
  border: 1px solid #eceaf3;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 132px;
  box-shadow: 0 1px 2px rgba(30, 20, 60, .03);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.room-card:hover {
  border-color: #cfc8ff;
  box-shadow: 0 10px 24px rgba(107, 91, 255, .10);
  transform: translateY(-1px);
}
.room-card.active {
  border-color: #6b5bff;
  box-shadow: 0 0 0 1px rgba(107,91,255,.18), 0 10px 24px rgba(107,91,255,.12);
}
.room-card.overdue { border-color: #f3a4a7; }
.room-card.maintenance { background: #fbfbfd; }
.rb-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rb-card-id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rb-id-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #6b5bff;
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-id-text b {
  color: #2a2150;
  font-size: .95rem;
  font-weight: 800;
}
.rb-id-text i {
  font-style: normal;
  color: #b7b0e8;
  font-weight: 700;
}
.rb-bed {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #f0edff;
  color: #6b5bff;
  flex: 0 0 auto;
}
.rb-card-sub {
  margin: 0;
  color: #8b92a5;
  font-size: .8rem;
  line-height: 1.35;
}
.rb-card-guest {
  margin: 0;
  min-height: 1.2em;
  font-size: .86rem;
  font-weight: 700;
  color: #2d3447;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-card-guest-empty { opacity: 0; }
.rb-card-guest-soon {
  color: #6b7288;
  font-weight: 650;
  font-size: .8rem;
}
.rb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}
.rb-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}
.rb-status-empty { background: #e8faf0; color: #12805a; }
.rb-status-holding { background: #ebe7ff; color: #5b4fe0; }
.rb-status-active { background: #6b5bff; color: #fff; }
.rb-status-overdue { background: #e5484d; color: #fff; }
.rb-status-awaiting_payment { background: #fff1e0; color: #c2410c; }
.rb-status-awaiting_clean { background: #fff6d8; color: #a16207; }
.rb-status-cleaning { background: #ffe8d2; color: #c2410c; }
.rb-status-maintenance { background: #eef1f5; color: #5b6478; }
.rb-link {
  font-size: .8rem;
  font-weight: 700;
  color: #6b5bff;
  text-decoration: none;
  white-space: nowrap;
}
.rb-link:hover { color: #5246d8; }
.rb-link.is-muted { color: #9aa3b5; font-weight: 600; }
.rb-card-actions {
  display: none;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0eef7;
}
.room-card:hover .rb-card-actions,
.room-card:focus-within .rb-card-actions {
  display: flex;
  flex-wrap: wrap;
}
.rb-cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: #6b5bff;
  color: #fff !important;
  font-size: .8rem;
  font-weight: 750;
  text-decoration: none;
  flex: 1 1 auto;
}
.rb-cta.ghost {
  background: #f2f0ff;
  color: #5b4fe0 !important;
}
.rb-cccd-btn {
  cursor: pointer;
  text-align: center;
}
.rb-cccd-btn.is-warn {
  background: #fff7ed !important;
  color: #c2410c !important;
  box-shadow: inset 0 0 0 1px #fdba74;
}
.rb-cccd-btn.is-ok {
  background: #ecfdf5 !important;
  color: #047857 !important;
}
.rb-cccd-btn.is-busy {
  opacity: .65;
  pointer-events: none;
}
.rb-card-actions form {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
}
.rb-card-actions form .rb-cta { width: 100%; }
.room-gear-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9aa3b5;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  opacity: .55;
  transition: .15s ease;
}
.room-card:hover .room-gear-btn,
.room-gear-btn:focus-visible {
  opacity: 1;
  background: #f4f2ff;
  color: #6b5bff;
}
.room-gear-btn .ui-ico { width: 15px; height: 15px; }
.room-ops-dialog {
  margin: auto !important;
  padding: 0;
  border: none;
  border-radius: 16px;
  width: min(360px, calc(100vw - 28px));
  max-width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  box-sizing: border-box;
}
.room-ops-dialog::backdrop { background: rgba(15, 23, 42, .48); }
.room-ops-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px;
  overflow: hidden;
  background: #fff;
}
.room-ops-hint { margin: 0 0 10px; }
.room-ops-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
label.room-ops-choice {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  box-sizing: border-box;
  width: 100%;
  margin: 0 !important;
  color: var(--text);
  font-size: inherit;
}
label.room-ops-choice.is-on,
label.room-ops-choice:has(input:checked) {
  border-color: #a5b4fc;
  background: #eef2ff;
}
label.room-ops-choice input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  max-width: 18px;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 0 0 18px;
  accent-color: #6366f1;
}
.room-ops-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #475569;
  flex: 0 0 32px;
}
.room-ops-ico .ui-ico { width: 17px; height: 17px; display: block; }
.room-ops-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.room-ops-txt strong {
  display: block;
  font-size: .9rem;
  line-height: 1.25;
  color: var(--text);
  font-weight: 700;
}
.room-ops-txt small {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
}
.room-ops-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  flex: 0 0 auto;
}
.room-ops-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(255,107,107,.25); }
  50% { box-shadow: 0 0 0 4px rgba(255,107,107,.12); }
}

.badge, .pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1.15;
  white-space: nowrap; vertical-align: middle;
  box-sizing: border-box;
}
.badge.empty, .pill.ok { background: #dcfce7; color: #15803d; }
.badge.active { background: #fee2e2; color: #b91c1c; }
.badge.overdue, .pill.danger { background: #e5484d; color: #fff; }
.badge.holding { background: #dbeafe; color: #1d4ed8; }
.badge.awaiting_payment { background: #ffedd5; color: #c2410c; }
.badge.awaiting_clean { background: #e0e7ff; color: #3730a3; }
.badge.cleaning { background: #e2e8f0; color: #334155; }
.badge.maintenance { background: #e2e8f0; color: #475569; }
.badge.cancelled { background: #fee2e2; color: #991b1b; }
.badge.paid { background: #dcfce7; color: #15803d; }
.pill.warn { background: #fff7ed; color: #c2410c; }
.pill.xl { font-size: .85rem; padding: 8px 12px; }

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pinch-zoom;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  /* lớp cuộn độc lập — tránh cha overflow:hidden chặn vuốt */
  transform: translateZ(0);
  will-change: scroll-position;
}
.table-wrap.app-swipe {
  position: relative;
  padding-bottom: 0;
}
.table-wrap.app-swipe::after {
  content: "← vuốt ngang để xem đủ cột →";
  display: none;
  position: sticky;
  left: 0;
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  padding: 6px;
  background: linear-gradient(180deg, transparent, #fff 30%);
}
table, .data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table { min-width: 860px; }
.data-table.compact { min-width: 0; width: 100%; }
.data-table.wide,
.table-wrap.app-swipe .data-table {
  min-width: 720px;
  width: max-content;
  max-width: none;
}
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { white-space: nowrap; vertical-align: middle; }

/* Hiệu quả CS — thẻ mobile, không cần vuốt */
.eff-cards { display: none; gap: 8px; }
.eff-card {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.eff-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.eff-kpi {
  flex: 0 0 auto;
  min-width: 44px;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--kv-blue, #0070f4);
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 8px;
  line-height: 1.2;
}
.eff-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.eff-card-metrics span {
  display: block;
  font-size: .68rem;
  color: var(--muted);
}
.eff-card-metrics strong {
  display: block;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
td.cell-stack { white-space: normal; min-width: 140px; max-width: 220px; }
td.table-actions {
  white-space: nowrap;
  text-align: right;
}
.table-actions .row,
td.table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: none;
}
.table-actions form { display: inline-flex; margin: 0; }
tr:hover td { background: #faf9ff; }
tr.row-danger { background: rgba(255,107,107,.06); }
tr.row-warn { background: rgba(255,176,32,.05); }
tr[onclick] { cursor: pointer; }

/* Mobile card list for branch treasury */
.branch-cards { display: none; gap: 10px; }
.branch-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  color: inherit;
}
.branch-card.danger { border-color: rgba(255,107,107,.45); }
.branch-card.warn { border-color: rgba(255,176,32,.4); }
.bc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.bc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bc-grid div span { display: block; font-size: .68rem; color: var(--muted); }
.bc-grid div strong { font-size: .92rem; }

.btn {
  border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.secondary { background: #e8eef7; color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 11px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 16px; font-size: 1rem; }

input, select, textarea {
  width: 100%; background: #fff; border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 11px 12px;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  flex: 0 0 auto;
  accent-color: #2563eb;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(107,91,255,.55);
  box-shadow: 0 0 0 3px rgba(107,91,255,.12);
}
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-actions { margin-bottom: 12px; }
.muted { color: var(--muted); }

.alert { padding: 11px 13px; border-radius: 12px; margin-bottom: 12px; }
.alert.ok { background: #ecfdf3; color: #027a48; border: 1px solid #abeFC6; }
.alert.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.alert.warn, .alert.danger-soft { background: #fffaeb; color: #b54708; border: 1px solid #fedf89; }
.alert.danger-soft { background: #fef3f2; color: #b42318; }

.legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.empty { background: var(--ok); }
.dot.active { background: var(--danger); }
.dot.overdue { background: #ff3b3b; }
.dot.holding { background: var(--holding); }
.dot.awaiting_payment { background: #ea580c; }
.dot.awaiting_clean { background: #6366f1; }
.dot.cleaning { background: var(--clean); }
.dot.maintenance { background: #94a3b8; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.inv-page .hub-nav { margin-bottom: 14px; }
.inv-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inv-top-actions form { margin: 0; }
.inv-form-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.inv-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.inv-filter .field {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 240px;
}
.inv-filter .field.inv-filter-grow {
  flex: 2 1 280px;
  max-width: none;
}
.inv-filter .field.inv-filter-go {
  flex: 0 0 120px;
  min-width: 110px;
  max-width: 140px;
}
.inv-filter .field label {
  display: block;
  margin-bottom: 5px;
  font-size: .78rem;
  font-weight: 650;
  color: #6b7288;
}
.inv-filter .field input,
.inv-filter .field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e6e3f2;
  background: #fbfaff;
  padding: 11px 12px;
}
.inv-filter-go .btn { width: 100%; min-height: 44px; }
.inv-list-card { margin-bottom: 14px; }
.inv-lines-wrap {
  border: 1px solid #efeef6;
  border-radius: 14px;
  overflow: auto;
  background: #fcfbff;
}
.inv-lines-table { margin: 0; }
.inv-lines-table th {
  background: #f7f5ff;
  font-size: .78rem;
  color: #6b7288;
}
.inv-lines-table td,
.inv-lines-table th { padding: 10px 12px; }
#inv-lines select,
#inv-lines input {
  min-width: 0;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e6e3f2;
  background: #fff;
  padding: 9px 10px;
}
#inv-lines .inv-qty,
#inv-lines .inv-cost,
#inv-lines .inv-counted { min-width: 88px; }
#inv-lines td { vertical-align: middle; }
.inv-void-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e8e5f2;
}
.inv-void-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.inv-void-form input {
  flex: 1 1 220px;
  border-radius: 12px;
  border: 1px solid #e6e3f2;
  background: #fbfaff;
  padding: 11px 12px;
}
.inv-stock-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.inv-kpi {
  background: #fff;
  border: 1px solid #ebe8f4;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(55, 40, 120, .05);
}
.inv-kpi-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8b92a5;
  margin-bottom: 6px;
}
.inv-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1f1638;
  letter-spacing: -.02em;
}
.inv-kpi.is-ok .inv-kpi-val { color: #12805a; }
.inv-kpi.is-glow .inv-kpi-val { color: #4f46d8; }
.inv-kpi.is-warn .inv-kpi-val { color: #a16207; }
.inv-kpi.is-danger .inv-kpi-val { color: #b91c1c; }
.inv-stock-list { display: grid; gap: 10px; }
.inv-stock-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(0, 1.4fr) minmax(160px, .9fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ebe8f4;
  background: #fcfbff;
}
.inv-stock-row.is-low {
  background: #fffbeb;
  border-color: #fde68a;
}
.inv-stock-row.is-zero {
  background: #fff5f5;
  border-color: #fecaca;
}
.inv-stock-main { display: grid; gap: 2px; }
.inv-stock-code {
  font-size: .75rem;
  font-weight: 750;
  color: #6b5bff;
  letter-spacing: .04em;
}
.inv-stock-name { display: grid; gap: 2px; }
.inv-stock-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.inv-stock-metrics > div { display: grid; gap: 2px; }
.inv-stock-qty { font-size: 1.05rem; }
.inv-stock-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.inv-min-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.inv-min-input {
  width: 72px;
  padding: 6px 8px;
  font-size: .85rem;
  border-radius: 10px;
  border: 1px solid #e6e3f2;
  background: #fff;
}
.inv-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.inv-hub-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #ebe8f4;
  background: #fff;
  box-shadow: 0 8px 20px rgba(55, 40, 120, .05);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.inv-hub-card:hover {
  border-color: rgba(107, 91, 255, .35);
  transform: translateY(-1px);
}
.inv-hub-card strong {
  font-size: 1.02rem;
  color: #1f1638;
}
.inv-hub-card span {
  color: #8b92a5;
  font-size: .84rem;
  line-height: 1.35;
}
.inv-home-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.inv-mini-list { display: grid; gap: 8px; }
.inv-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fbfaff;
  border: 1px solid #efeef6;
  text-decoration: none;
  color: inherit;
}
.inv-mini-row:not(.static):hover { border-color: rgba(107, 91, 255, .3); }
.inv-mini-delta { text-align: right; }
@media (max-width: 1100px) {
  .inv-stock-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inv-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-stock-row { grid-template-columns: 1fr; }
  .inv-stock-side { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .inv-stock-kpis,
  .inv-hub-grid,
  .inv-home-cols { grid-template-columns: 1fr; }
  .inv-filter .field,
  .inv-filter-grow,
  .inv-filter-go {
    flex: 1 1 calc(50% - 12px);
    min-width: 140px;
    max-width: none;
  }
  .inv-stock-metrics { grid-template-columns: 1fr 1fr; }
  .inv-form-btns { width: 100%; }
  .inv-form-btns .btn { flex: 1; }
}
@media (max-width: 520px) {
  .inv-filter .field,
  .inv-filter-grow,
  .inv-filter-go {
    flex: 1 1 100%;
  }
}
.btn.tiny {
  padding: 3px 8px;
  font-size: .78rem;
  border-radius: 8px;
  line-height: 1.2;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  box-sizing: border-box;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.filter-bar select {
  width: auto !important;
  flex: 1 1 140px;
  min-width: 110px;
  max-width: 220px;
  box-sizing: border-box;
}
.filter-bar input[type="date"],
.filter-bar input[type="search"],
.filter-bar input[type="text"] {
  width: auto !important;
  flex: 0 1 140px;
  min-width: 110px;
  max-width: 170px;
  box-sizing: border-box;
}
.filter-bar .btn {
  width: auto !important;
  flex: 0 0 auto;
  white-space: nowrap;
}
.hero-panel.compact .period-form {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}
.hero-panel.compact .period-form select,
.hero-panel.compact .period-form input[type="date"],
.hero-panel.compact .period-form input[type="search"] {
  width: auto !important;
  max-width: 100%;
  flex: 0 1 auto;
}
.hero-panel.compact .period-form input[type="search"] {
  width: min(200px, 36vw) !important;
  flex: 1 1 140px;
}

/* ===== Compact app filters (shared density) ===== */
.app-shell .period-form,
.app-shell .filter-bar,
.app-shell .exp-filters,
.app-shell .emp-filters,
.app-shell .inv-filter,
.app-shell .rb-filter,
.app-shell .cl-hist-filter,
.app-shell .cc-period-month,
.app-shell .cc-period-week,
.app-shell .cc-period-custom {
  align-items: center;
}
.app-shell .period-form select,
.app-shell .period-form input[type="date"],
.app-shell .period-form input[type="week"],
.app-shell .period-form input[type="month"],
.app-shell .period-form input[type="search"],
.app-shell .period-form input[type="text"],
.app-shell .filter-bar select,
.app-shell .filter-bar input[type="date"],
.app-shell .filter-bar input[type="search"],
.app-shell .filter-bar input[type="text"],
.app-shell .exp-filters select,
.app-shell .emp-filters select,
.app-shell .emp-filters input,
.app-shell .inv-filter select,
.app-shell .inv-filter input,
.app-shell .rb-filter select,
.app-shell .rb-filter input,
.app-shell .cl-hist-filter select,
.app-shell .cl-hist-filter input,
.app-shell .cc-page .period-form select,
.app-shell .cc-page .period-form input[type="date"],
.app-shell .cc-page .period-form input[type="week"] {
  height: 32px !important;
  min-height: 32px !important;
  padding: 4px 10px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  line-height: 20px !important;
  box-sizing: border-box !important;
}
.app-shell .period-form .btn,
.app-shell .period-form .btn.small,
.app-shell .filter-bar .btn,
.app-shell .filter-bar .btn.small,
.app-shell .exp-filters .btn,
.app-shell .emp-filters .btn,
.app-shell .inv-filter .btn,
.app-shell .rb-filter .btn,
.app-shell .cl-hist-filter .btn,
.app-shell .cc-page .period-form .btn,
.app-shell .cc-page .period-form .btn.small {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}
.app-shell .hero-panel.compact {
  padding: 12px 14px;
  gap: 10px;
  align-items: flex-start;
}
.app-shell .hero-panel.compact .hero-title {
  font-size: 1.1rem;
  line-height: 1.25;
}
.app-shell .cc-period-month:not(.is-hidden),
.app-shell .cc-period-week:not(.is-hidden),
.app-shell .cc-period-custom:not(.is-hidden) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
  align-items: center;
}
.app-shell .cc-page .cc-app-filters .cc-period-month:not(.is-hidden),
.app-shell .cc-page .cc-app-filters .cc-period-week:not(.is-hidden),
.app-shell .cc-page .cc-app-filters .cc-period-custom:not(.is-hidden) {
  width: auto;
}
.app-shell .cc-period-month.is-hidden,
.app-shell .cc-period-week.is-hidden,
.app-shell .cc-period-custom.is-hidden,
.app-shell .kv-dash-month.is-hidden,
.app-shell .kv-dash-custom.is-hidden {
  display: none !important;
}
.app-shell .exp-filters {
  gap: 6px;
}
.app-shell .exp-filters select {
  height: 32px !important;
  max-width: 140px;
  padding: 4px 8px !important;
}
tr.row-muted { opacity: .62; }
.held-danger { color: #e11d48; }
.kpi.danger .value { color: #e11d48; }
.print-sheet {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 8px 40px;
}
.print-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.print-head h1 {
  margin: 4px 0 6px;
  font-size: 1.55rem;
}
.print-meta {
  display: grid;
  gap: 6px;
  min-width: 220px;
}
.print-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.print-signs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
  text-align: center;
}
.print-signs span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 42px;
}
@media print {
  .sidebar, .topbar, .hub-nav, .hero-panel, .flash, .form-actions, .no-print { display: none !important; }
  .main, .content, body { background: #fff !important; }
  .print-sheet { padding: 0; max-width: none; }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.settings-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  min-height: 96px;
  box-shadow: 0 4px 14px rgba(60,40,120,.05);
  transition: border-color .15s ease, transform .15s ease;
}
.settings-card:hover {
  border-color: rgba(107,91,255,.45);
  transform: translateY(-1px);
}
.settings-card-ico {
  font-size: 1.85rem; line-height: 1;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: #f1f5f9;
  flex-shrink: 0;
}
.settings-card-body {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1;
}
.settings-card-body strong { font-size: 1.05rem; }
.settings-card-body .muted { font-size: .82rem; line-height: 1.35; }
.settings-card-go {
  color: var(--muted); font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}

.mini-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.mini-card {
  display: block; padding: 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); color: inherit;
}
.mini-code { color: var(--accent); font-weight: 700; }
.mini-name { font-size: .82rem; color: var(--muted); min-height: 2.4em; }
.mini-val { font-weight: 750; margin-top: 6px; }

.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.bill-head, .bill-meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.bill-meta { margin: 8px 0; gap: 8px; }
.bill-meta > div { min-width: 100px; }
.bill-meta span { display: block; font-size: .72rem; }
.bill-meta strong { font-size: .9rem; }
.bill-page,
.co-page,
.bk-page,
.dep-page {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.app-shell:not(.page-focus) .bill-page,
.app-shell:not(.page-focus) .co-page,
.app-shell:not(.page-focus) .bk-page,
.app-shell:not(.page-focus) .dep-page {
  max-width: 980px;
  margin: 0 auto;
}
.bill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr);
  gap: 10px;
  align-items: start;
  width: 100%;
}
@media (max-width: 900px) {
  .bill-layout { grid-template-columns: 1fr; }
}
.bill-side { display: flex; flex-direction: column; gap: 8px; }
.qr-panel { text-align: center; }
.vietqr-img {
  display: block; margin: 6px auto 0;
  width: 128px; height: 128px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.audit-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0;
  max-height: 360px;
  overflow: auto;
}
.audit-item {
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: .86rem;
}
.audit-item:last-child { border-bottom: 0; }
.audit-item.is-money {
  border-left: 3px solid #0f766e;
  padding-left: 10px;
  margin-left: -2px;
}
.audit-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.audit-item-top strong {
  font-size: .86rem;
  font-weight: 800;
  color: #0f172a;
}
.audit-item-top time {
  font-size: .72rem;
  color: #64748b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.audit-item-reason {
  margin-top: 3px;
  font-size: .84rem;
  color: #334155;
  line-height: 1.35;
}
.audit-item-meta { margin-top: 3px; }
.bill-audit.is-compact .audit-list { max-height: 280px; }
.bill-audit.is-compact .audit-item { padding: 8px 2px; }

/* Thanh toán kiểu KiotViet — overlay 2 cột */
.kv-temp-dialog {
  border: 1px solid var(--line);
  color: var(--text);
  max-width: 480px;
  width: 92%;
}
.kv-pay-dialog {
  border: none;
  padding: 0;
  max-width: min(1080px, 96vw);
  width: min(1080px, 96vw);
  height: min(720px, 92vh);
  max-height: 92vh;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
}
.kv-pay-dialog::backdrop { background: rgba(15, 23, 42, .52); }
.kv-pay {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.kv-pay-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.kv-pay-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kv-pay-ot-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: #fff7ed;
  color: #c2410c;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.kv-pay-ot-btn.is-late {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.kv-pay-ot-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}
.kv-pay-ot-txt { white-space: nowrap; }
.kv-pay-head .eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #64748b;
}
.kv-pay-head h3 { margin: 2px 0 2px; font-size: 1.15rem; font-weight: 850; }
.kv-pay-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .95fr);
  overflow: hidden;
}
.kv-pay-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
}
.kv-pay-left-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.kv-pay-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 8px;
}
.kv-pay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.kv-pay-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 8px 8px;
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.kv-pay-table th.num,
.kv-pay-table td.num { text-align: right; white-space: nowrap; }
.kv-pay-table th:nth-child(2),
.kv-pay-table td:nth-child(2) {
  min-width: 108px;
  width: 108px;
}
.kv-pay-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.kv-pay-table .name {
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 18rem;
}
.kv-pay-table .name .tiny { display: block; font-weight: 600; color: #64748b; margin-top: 2px; }
.kv-pay-table tr.kv-pay-combo td.name { color: #0f172a; }
.kv-pay-qty {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 92px;
}
.kv-pay-qty button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  flex: 0 0 28px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.kv-pay-qty button:hover { background: #f8fafc; }
.kv-pay-qty button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.kv-pay-qty strong {
  min-width: 1.6em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.kv-pay-left-top p { margin: 2px 0 0; }
.kv-pay-ot-dialog {
  border: none;
  padding: 0;
  width: min(440px, 94vw);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
}
.kv-pay-ot-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.kv-pay-ot-card { padding: 16px 18px 18px; }
.kv-pay-ot-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.kv-pay-ot-head h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.kv-pay-ot-times,
.kv-pay-ot-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.kv-pay-ot-times label,
.kv-pay-ot-fields label {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.kv-pay-ot-times input,
.kv-pay-ot-fields input {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
}
.kv-pay-ot-waive {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 700;
}
.kv-pay-ot-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}
.kv-pay-fee-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f9;
}
.kv-pay-fee-tab {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}
.kv-pay-fee-tab.is-on {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.kv-pay-fee-pane[hidden] { display: none !important; }
.kv-pay-lines-empty td {
  text-align: center;
  color: #94a3b8;
  padding: 28px 8px;
}
.kv-pay-left-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  font-weight: 750;
}
.kv-pay-left-foot em {
  font-style: normal;
  color: #64748b;
  margin-left: 4px;
}
.kv-pay-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.kv-pay-right-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 8px;
  overscroll-behavior: contain;
}
.kv-pay-due-hero {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
}
.kv-pay-due-hero span {
  font-size: .86rem;
  font-weight: 750;
  color: #1e40af;
}
.kv-pay-due-hero strong {
  font-size: 1.45rem;
  font-weight: 900;
  color: #1d4ed8;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.kv-pay-sum-rows {
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e2e8f0;
}
.kv-pay-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-size: .82rem;
  color: #64748b;
}
.kv-pay-sum-row strong { color: #0f172a; font-weight: 750; }
.kv-pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.kv-method {
  border: 1px solid #dbe4f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 6px;
  font-weight: 750;
  font-size: .84rem;
  cursor: pointer;
  color: var(--text);
}
.kv-method.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .22);
}
.kv-pay-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 210px;
}
.kv-pay-body.has-side {
  grid-template-columns: minmax(0, 1fr) 168px;
}
.kv-pay-fields {
  min-width: 0;
  min-height: 210px;
}
.kv-pay-pane[hidden] { display: none !important; }
.kv-pay-fields label,
.kv-pay-bank label {
  display: block;
  margin-bottom: 3px;
  font-size: .78rem;
  color: var(--muted);
}
.kv-pay-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 210px;
}
.kv-pay-side[hidden] { display: none !important; }
.kv-pay-bank select {
  width: 100%;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 8px;
  font: inherit;
  font-size: .8rem;
  background: #fff;
}
.kv-pay-bank-one {
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  line-height: 1.35;
}
.kv-pay-qr {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  min-height: 0;
}
.kv-pay-qr img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  flex-shrink: 0;
}
.kv-pay-qr #pay-qr-caption {
  margin-top: 6px;
  max-width: 150px;
  font-size: .68rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.kv-tender, #pay-transfer-input, #pay-combine-cash, #pay-combine-transfer {
  font-size: 1.05rem !important;
  font-weight: 800;
  padding: 8px 12px !important;
  height: 42px !important;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
.kv-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
  max-height: 68px;
  overflow: hidden;
}
.kv-chip {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}
.kv-change-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: .88rem;
}
.kv-change-row strong { font-size: 1.1rem; color: #15803d; }
.kv-pay-foot {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.kv-pay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kv-pay-actions .btn.secondary { text-align: center; }
.kv-pay-actions .kv-pay-submit { grid-column: 1 / -1; }
.kv-pay-submit {
  width: 100%;
  background: #2563eb !important;
  border-color: #2563eb !important;
  font-size: 1rem;
  font-weight: 850;
  padding: 12px 16px;
  min-height: 48px;
  border-radius: 10px;
}
.kv-pay-submit:disabled { opacity: .45; cursor: not-allowed; }
.kv-pay-confirm {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}
.kv-pay-confirm[hidden] { display: none !important; }
.kv-pay-confirm-kicker {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  color: #1d4ed8;
  text-transform: uppercase;
}
.kv-pay-confirm-due {
  margin: 6px 0 2px;
  font-size: .95rem;
  font-weight: 750;
}
.kv-pay-confirm-due strong {
  color: #1d4ed8;
  font-size: 1.1rem;
}
.kv-pay-confirm-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.kv-pay-err {
  margin: 8px 0 0;
  color: #b91c1c;
  font-size: .85rem;
  font-weight: 700;
}
@media (max-width: 900px) {
  .kv-pay-dialog { height: auto; max-height: 94vh; }
  .kv-pay-main { grid-template-columns: 1fr; overflow: auto; }
  .kv-pay-left { border-right: 0; border-bottom: 1px solid #e2e8f0; max-height: 34vh; }
  .kv-pay-body,
  .kv-pay-body.has-side { grid-template-columns: 1fr; min-height: 0; }
  .kv-pay-fields { min-height: 0; }
  .kv-pay-side { min-height: 0; }
  .kv-pay-methods { grid-template-columns: 1fr; }
}
.kv-pay-foot { margin: 10px 0 0; }
.row-focus td {
  background: #fff7ed !important;
  box-shadow: inset 3px 0 0 #ea580c;
}

/* Bill / checkout panels denser */
.co-layout .panel,
.co-layout .bill-card,
.bill-layout .panel,
.bill-layout .bill-card,
.bk-page .panel,
.dep-page .panel {
  padding: 12px 14px;
  margin-bottom: 0;
  border-radius: 10px;
  box-shadow: none;
}
.bill-card .hero-title,
.bill-layout .hero-title { font-size: 1.05rem; margin: 2px 0; }

/* ===== Checkout workspace — cân, khoa học ===== */
.co-page {
  --co-gap: 12px;
  --co-radius: 10px;
  --co-line: #e5eaf1;
  --co-muted: #64748b;
  --co-ink: #0f172a;
  display: flex;
  flex-direction: column;
  gap: var(--co-gap);
}
.co-page .alert { margin: 0; }
.co-kicker {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--co-muted);
  margin: 0 0 2px;
}
.co-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--co-ink);
  line-height: 1.2;
}
.co-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: .82rem;
  color: var(--co-muted);
}
.co-dot { opacity: .5; }
.co-saving {
  min-height: 1em;
  font-size: .78rem;
  color: #0f766e;
  font-weight: 650;
}
.co-btn-done {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
  font-weight: 750 !important;
}

/* Bill action buttons — màu rõ theo việc */
.bm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.bm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.bm-btn:active { transform: translateY(0); }
.bm-btn-sm {
  min-height: 30px;
  padding: 4px 11px;
  font-size: .78rem;
  border-radius: 8px;
}
.bm-btn-back {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
  color: #1d4ed8;
}
.bm-btn-back:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #60a5fa;
  color: #1e40af;
}
.bm-btn-soft {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}
.bm-btn-soft:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.bm-btn-print {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: #94a3b8;
  color: #1e293b;
}
.bm-btn-print:hover {
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #0f172a;
}
.bm-btn-charge {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
  color: #c2410c;
}
.bm-btn-charge:hover {
  background: linear-gradient(180deg, #ffedd5 0%, #fed7aa 100%);
  border-color: #fb923c;
  color: #9a3412;
}
.bm-btn-primary {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #fff;
}
.bm-btn-primary:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
}
.bm-btn-done {
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
  border-color: #0f766e;
  color: #fff;
}
.bm-btn-done:hover {
  background: linear-gradient(180deg, #0d9488 0%, #115e59 100%);
  color: #fff;
}
.co-actions-main .bm-btn,
.co-actions-nav .bm-btn {
  min-height: 36px;
}
.co-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--co-line);
  border-radius: var(--co-radius);
  position: sticky;
  top: 0;
  z-index: 20;
}
.co-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.co-actions-nav,
.co-actions-main {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.co-actions-main {
  padding-left: 10px;
  border-left: 1px solid var(--co-line);
}
.co-topbar-actions .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-weight: 650;
  font-size: .84rem;
}
.co-await-banner {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
  color: #9a3412 !important;
  border-radius: var(--co-radius);
  padding: 10px 14px;
  font-weight: 650;
}
.co-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr) !important;
  gap: var(--co-gap);
  align-items: start;
  width: 100%;
}
.co-bill,
.co-side {
  min-width: 0;
  width: 100%;
}
.co-side {
  display: flex;
  flex-direction: column;
  gap: var(--co-gap);
}
.co-bill {
  padding: 16px !important;
  position: sticky;
  top: 72px;
}
.co-bill h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}
.co-bill .bill-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--co-line);
}
.co-bill .bill-code {
  text-align: right;
}
.co-bill .bill-code strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.co-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--co-line);
  border-radius: 8px;
}
.co-meta-item.co-meta-combo {
  grid-column: 1 / -1;
  min-width: 0;
}
.co-meta-item span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--co-muted);
  margin-bottom: 2px;
}
.co-meta-item strong {
  display: block;
  font-size: .9rem;
  font-weight: 750;
  color: var(--co-ink);
  line-height: 1.3;
}
.co-meta-item strong.co-combo-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.co-meta-note {
  display: block;
  margin-top: 3px;
  font-size: .72rem;
  font-style: normal;
  color: var(--co-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.co-bill .bill-lines {
  table-layout: fixed;
  width: 100%;
}
.co-bill .bill-lines td {
  padding: 7px 0;
  font-size: .88rem;
  vertical-align: top;
}
.co-bill .bill-lines td:first-child {
  width: auto;
  max-width: 0; /* ép cột trái co trong table-layout:fixed */
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding-right: 14px;
}
.co-bill .bill-lines td.right {
  width: 7.75rem;
  white-space: nowrap;
  text-align: right;
  vertical-align: top;
}
.co-line-kicker {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--co-muted);
  margin-bottom: 2px;
  line-height: 1.2;
}
.co-line-title {
  display: block;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.co-line-sub {
  display: block;
  margin-top: 2px;
  font-size: .75rem;
  color: var(--co-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.co-bill .bill-lines .payable td {
  padding-top: 10px;
  font-size: 1.08rem;
}
.co-card {
  padding: 12px 14px !important;
}
.co-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--co-line);
}
.co-card-head strong {
  font-size: .9rem;
  font-weight: 800;
  color: var(--co-ink);
}
.co-card-tag {
  font-size: .72rem;
  font-weight: 700;
  color: var(--co-muted);
}
.co-side-panel {
  max-height: min(42vh, 420px);
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.co-catalog {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
  flex: 1;
  margin: 0 -4px;
  padding: 0 4px;
}
.co-empty { margin: 8px 0; font-size: .86rem; }
.co-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-bottom: 1px solid #eef2f7;
  border-radius: 8px;
}
.co-item-row:last-child { border-bottom: 0; }
.co-item-row.has-qty {
  background: #f0fdfa;
  border-bottom-color: transparent;
}
.co-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.co-item-info { min-width: 0; flex: 1; }
.co-item-name {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: var(--co-ink);
  line-height: 1.3;
}
.co-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--co-line);
  border-radius: 999px;
  padding: 2px;
}
.co-stepper .btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border-radius: 999px;
  border: 0;
  background: transparent;
}
.co-qty-val {
  min-width: 22px;
  text-align: center;
  font-size: .9rem;
  font-weight: 800;
}
.co-ot.is-ontime {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.co-ot.is-ontime .co-ot-suggest { color: #166534; }
.co-ot.is-late {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fffaf5, #fff);
}
.co-ot-times,
.co-ot-fields,
.co-fee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.co-ot-times label,
.co-ot-fields label,
.co-fee-grid label {
  display: block;
  margin-bottom: 3px;
  font-size: .7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--co-muted);
}
.co-ot-times input,
.co-ot-fields input,
.co-fee-grid input {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #d5dde8;
  padding: 0 10px;
  font-size: .88rem;
  background: #fff;
}
.co-ot-times input[readonly] {
  background: #f8fafc;
  color: var(--co-ink);
  font-weight: 750;
}
.co-ot-waive {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--co-line);
  font-size: .86rem;
  font-weight: 700;
  color: var(--co-ink);
  cursor: pointer;
}
.co-ot-waive input { width: 16px; height: 16px; accent-color: #0f766e; }
.co-ot-suggest {
  margin: 8px 0 0;
  font-size: .75rem;
  color: var(--co-muted);
  line-height: 1.4;
}
.co-fee-note { grid-column: 1 / -1; }
.co-locked-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.co-qr {
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--co-line);
}
.co-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--co-line);
  border-radius: 8px;
}
.co-print-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--co-line);
  font-size: .75rem;
}
#co-save-hint { margin-top: 6px; min-height: 1em; }

@media (max-width: 960px) {
  .co-layout {
    grid-template-columns: 1fr !important;
  }
  .co-bill { position: static; }
  .co-side-panel { max-height: 320px; }
  .co-actions-main {
    padding-left: 0;
    border-left: 0;
    width: 100%;
  }
  .co-topbar { position: static; }
  .bill-page,
  .co-page,
  .bk-page,
  .dep-page { max-width: 100%; }
}
@media (max-width: 560px) {
  .co-meta { grid-template-columns: 1fr 1fr; gap: 8px; }
  .co-ot-times,
  .co-ot-fields,
  .co-fee-grid { grid-template-columns: 1fr 1fr; }
}

/* Màn chờ nhận tiền sau in tính tiền */
.co-await-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
}
.co-await-overlay[hidden] { display: none !important; }
.co-await-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
  text-align: center;
}
.co-await-kicker {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #c2410c;
  margin-bottom: 6px;
}
.co-await-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  color: #0f172a;
}
.co-await-meta { margin: 0 0 14px; font-size: .9rem; }
.co-await-amount {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.co-await-amount span {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: #9a3412;
  margin-bottom: 4px;
}
.co-await-amount strong {
  font-size: 1.55rem;
  color: #9a3412;
  letter-spacing: .01em;
}
.co-await-hint { margin: 0 0 16px; line-height: 1.4; }
.co-pay-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  text-align: left;
}
.co-pay-methods-label {
  font-size: .78rem;
  font-weight: 750;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.co-pay-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 650;
  color: #0f172a;
  cursor: pointer;
}
.co-pay-opt input { accent-color: #0f766e; width: 16px; height: 16px; }
.co-split-pay {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  text-align: left;
}
.co-split-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.co-split-pay-grid label {
  display: block;
  margin: 0 0 4px;
  font-size: .78rem;
  font-weight: 700;
  color: #9a3412;
}
.co-split-pay-grid input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
  background: #fff;
}
.co-split-pay-sum {
  margin-top: 8px;
  font-size: .82rem;
  font-weight: 650;
  color: #9a3412;
}
.co-split-pay-sum.is-ok { color: #0f766e; }
.co-split-pay-sum.is-bad { color: #b91c1c; }
.co-await-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.co-await-actions .btn,
.co-await-actions .bm-btn {
  min-height: 42px;
  font-weight: 600;
  width: 100%;
}
.co-await-reopen { margin: 0; }
.bm-btn-ghost {
  background: transparent;
  border: 1px dashed #f59e0b;
  color: #b45309;
}
.bm-btn-ghost:hover {
  background: #fffbeb;
  border-color: #d97706;
}
.co-await-reopen-hint {
  margin: 10px 0 0;
  text-align: center;
  line-height: 1.4;
}

.co-temp-banner {
  display: none;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: .82rem;
  line-height: 1.35;
}
.co-temp-banner strong {
  display: block;
  margin-bottom: 2px;
  font-size: .9rem;
  letter-spacing: .02em;
}
.co-temp-only { display: none; }

.co-rcpt-print { display: none; }

@media print {
  @page {
    margin: 5mm;
    size: auto;
  }
  /* Chỉ in phiếu — ẩn toàn bộ UI (kể cả menu mobile) */
  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body * { visibility: hidden !important; }
  .co-rcpt-print,
  .co-rcpt-print * {
    visibility: visible !important;
  }
  /* Căn giữa trên mọi khổ giấy (80mm / A4 / …) */
  .co-rcpt-print {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 80mm !important;
    margin: 0 auto !important;
    padding: 0 1.5mm !important;
    box-sizing: border-box !important;
  }
  .co-rcpt-print[hidden] { display: block !important; }
  .co-rcpt-print .rcpt {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .sidebar, .topbar, .bottom-nav, .sidebar-backdrop, .no-print, .flash, .hub-nav,
  .kv-header, .kv-page-head, .kv-nav, .kv-account, .co-topbar, .alert,
  .co-bill, .co-side, .co-await-overlay, #co-paymethod-overlay, .co-temp-banner {
    display: none !important;
  }

  body.print-mode-temp .rcpt-pay-method,
  body.print-mode-temp .rcpt-charge-only,
  body.print-mode-temp .rcpt-qr { display: none !important; }
  body.print-mode-charge .co-temp-banner { display: none !important; }
}
.bill-lines { width: 100%; }
.bill-lines td { border-bottom: 1px dashed var(--line); }
.bill-lines .right { text-align: right; }
.bill-lines .total td, .bill-lines .payable td { font-weight: 750; border-bottom-style: solid; }
.bill-lines .payable td { color: var(--accent); font-size: 1.05rem; }
.bill-foot { margin-top: 12px; font-size: .85rem; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + var(--safe-bottom));
  backdrop-filter: blur(12px);
  box-shadow: 0 -6px 20px rgba(60,40,120,.06);
}
.bottom-nav a,
.bottom-nav .bn-more-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: .65rem;
  line-height: 1.1;
  padding: 8px 4px;
  border-radius: 12px;
  text-align: center;
  background: transparent;
  border: 0;
  appearance: none;
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.bottom-nav .bn-ico { font-size: 1.15rem; line-height: 1; }
.bottom-nav .bn-txt {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav a.active,
.bottom-nav .bn-more-btn.active { color: var(--accent); background: var(--accent-soft); }

/* App drawer (☰) */
.app-menu-btn { display: none; }
.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .45);
}
.app-drawer-backdrop[hidden] { display: none !important; }
.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  width: min(320px, 88vw);
  background: #fff;
  box-shadow: 12px 0 40px rgba(15, 23, 42, .2);
  transform: translateX(-105%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top, 0px);
  padding-bottom: var(--safe-bottom, 0px);
}
.app-drawer.is-open { transform: translateX(0); }
.app-drawer[aria-hidden="true"]:not(.is-open) { pointer-events: none; }
.app-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.app-drawer-user strong { display: block; font-size: .95rem; }
.app-drawer-close {
  appearance: none;
  border: 0;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}
.app-drawer-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 24px;
  flex: 1 1 auto;
}
.app-drawer-group { padding: 8px 0; }
.app-drawer-group + .app-drawer-group { border-top: 1px solid #f1f5f9; }
.app-drawer-group-title {
  padding: 6px 16px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.app-drawer-link {
  display: block;
  padding: 11px 16px;
  color: #0f172a;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
}
.app-drawer-link:hover,
.app-drawer-link.is-active {
  background: #f8fafc;
  color: var(--accent);
}
body.app-drawer-open { overflow: hidden; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35;
}

.coming { text-align: center; padding: 48px 16px; }
.coming h2 { color: var(--warn); }

.view-toggle { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ok-text { color: #027a48; font-weight: 600; font-size: .9rem; }
.bill-lines .deposit-row td {
  background: #ecfdf3; color: #027a48; font-weight: 700;
}
input.money-input { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.booking-create .panel { margin-bottom: 12px; }
.booking-optional summary {
  cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
}
.booking-optional summary::-webkit-details-marker { display: none; }
.sticky-actions {
  position: sticky; bottom: 64px; z-index: 5;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  padding: 10px 0; margin-top: 8px; border-top: 1px solid var(--line);
}
.manage-grid { align-items: start; }
@media (max-width: 900px) {
  .sticky-actions { bottom: 72px; }
}

.genz-dialog {
  border: none; padding: 0; border-radius: 16px; max-width: min(440px, calc(100vw - 24px));
  width: 100%; box-shadow: 0 24px 60px rgba(16, 24, 40, .2);
}
.genz-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.genz-dialog .dialog-card { padding: 16px 18px 18px; background: #fff; }
.genz-dialog .dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.pill-soon {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 999px; background: #fffaeb; color: #b54708; border: 1px solid #fedf89;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}

.roadmap-list { list-style: none; margin: 0; padding: 0; }
.roadmap-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.roadmap-item:last-child { border-bottom: 0; }
.roadmap-check {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #f2f4f7; color: var(--muted); font-weight: 700;
}
.roadmap-item.status-done .roadmap-check { background: #ecfdf3; color: #027a48; }
.roadmap-badge {
  font-size: .72rem; padding: 3px 8px; border-radius: 999px;
  background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; white-space: nowrap;
}
.roadmap-item.status-done .roadmap-badge { background: #ecfdf3; color: #027a48; border-color: #abeFC6; }


/* ===== CATALOG / PRICES ===== */
.catalog-toolbar { flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.catalog-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.catalog-tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
}
.catalog-tab.active {
  border-color: rgba(107,91,255,.35);
  background: var(--accent-soft);
  color: #0056c7;
}
.catalog-table input[type=number] { width: 120px; max-width: 100%; }
.catalog-table .row-off { opacity: .55; }
.catalog-table .center { text-align: center; }
.catalog-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.catalog-inline-form input[name=name] { min-width: 180px; flex: 1; }
.catalog-flags { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 0; }
.catalog-check {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  font-size: .92rem;
  margin: 10px 0;
  color: var(--text);
  cursor: pointer;
  width: 100%;
}
.catalog-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  margin-top: .15rem;
  flex: 0 0 1.15rem;
}
.catalog-check span,
.catalog-check {
  line-height: 1.35;
}
.catalog-stock-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,.02);
}
.catalog-stock-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.catalog-bom-row {
  display: grid;
  grid-template-columns: 1fr 88px auto;
  gap: 8px;
  margin: 8px 0;
}
.cat-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cat-modal[hidden] { display: none !important; }
.cat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}
.cat-modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  padding: 0 0 12px;
}
@media (min-width: 720px) {
  .cat-modal { align-items: center; }
  .cat-modal-panel { border-radius: 16px; }
}
.cat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.cat-modal-body { padding: 14px 16px; }
.cat-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.catalog-ot-fold { margin-bottom: 12px; }
.mgr-inbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.mgr-inbox-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.mgr-inbox-card.is-danger { border-color: #fecdca; background: #fff8f7; }
.mgr-inbox-card.is-warn { border-color: #fedf89; background: #fffcf5; }
.mgr-inbox-count {
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: #fff7ed;
  color: #c2410c;
}
.mgr-inbox-card.is-danger .mgr-inbox-count { background: #fee2e2; color: #b91c1c; }
.mgr-inbox-go { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.mgr-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.co-bank-pick { margin: 10px 0 8px; }
.co-bank-pick select { margin-top: 4px; }
.emp-modal {
  position: fixed; inset: 0; z-index: 85;
  display: flex; align-items: flex-end; justify-content: center;
}
.emp-modal[hidden] { display: none !important; }
.emp-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.emp-modal-panel {
  position: relative; z-index: 1; width: min(720px, 100%);
  max-height: min(92vh, 920px); overflow: auto;
  background: #fff; border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18); padding-bottom: 12px;
}
@media (min-width: 720px) {
  .emp-modal { align-items: center; }
  .emp-modal-panel { border-radius: 16px; }
}
.emp-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.emp-modal-body { padding: 14px 16px; }
.catalog-create-stock { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.catalog-create-stock-form { margin-top: 10px; }
.catalog-create-stock-grid {
  display: grid;
  grid-template-columns: 1fr 90px auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 560px) {
  .catalog-create-stock-grid { grid-template-columns: 1fr; }
}
.line-row.is-stock-low .line-name small.stock-warn,
.bk-combo-menu-card.is-stock-low .stock-warn,
.co-item.is-stock-low .stock-warn {
  color: #b42318;
  font-weight: 600;
}
.line-picker { border-top: 1px solid var(--line); padding-top: 10px; }
.line-grid { display: grid; gap: 8px; margin-top: 8px; }
.line-in-combo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--muted, #6b7280);
}
.line-in-combo input { width: auto; margin: 0; }
.bk-combo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
}
.bk-combo-summary-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.bk-combo-summary-text strong {
  font-size: .88rem;
  color: #9a3412;
}
.bk-combo-summary-text span {
  font-size: .78rem;
  color: #78716c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk-combo-dlg {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  padding: 16px;
}
.bk-combo-dlg[hidden] { display: none !important; }
.bk-combo-dlg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.bk-combo-dlg-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 24px));
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}
.bk-combo-dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}
.bk-combo-dlg-eye {
  margin: 0;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.bk-combo-dlg-head h3 {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}
.bk-combo-dlg-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.bk-combo-dlg-hint {
  margin: 0 16px 8px;
  font-size: .82rem;
  color: #64748b;
}
.bk-combo-dlg .bk-combo-none {
  margin: 0 16px 10px;
}
.bk-combo-menu-grid {
  flex: 1;
  overflow: auto;
  padding: 0 12px 8px;
  display: grid;
  gap: 8px;
}
.bk-combo-menu-grid.is-disabled {
  opacity: .45;
  pointer-events: none;
}
.bk-combo-menu-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e8eef5;
  border-radius: 14px;
  background: #f8fafc;
}
.bk-combo-menu-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #e2e8f0;
}
.bk-combo-menu-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.bk-combo-menu-meta strong {
  font-size: .9rem;
  color: #0f172a;
  line-height: 1.25;
}
.bk-combo-menu-meta span {
  font-size: .72rem;
  color: #94a3b8;
}
.bk-combo-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px;
}
.bk-combo-step {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.bk-combo-step:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.bk-combo-item-qty {
  width: 36px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  text-align: center;
  font-weight: 800;
  font-size: .95rem;
  color: #0f172a;
  -moz-appearance: textfield;
}
.bk-combo-item-qty::-webkit-outer-spin-button,
.bk-combo-item-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.bk-combo-dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}
#bk-combo-dlg-done.is-ready {
  background: #006fff;
  color: #fff;
  font-weight: 800;
  min-width: 140px;
}
.co-item-row.has-combo {
  background: #fffbeb;
  border-color: #fde68a;
}
.co-item-row.has-combo .co-item-price {
  color: #b45309;
  font-weight: 600;
}
html.is-bk-combo-open { overflow: hidden; }
.kv-busy {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}
.kv-busy[hidden] { display: none !important; }
.kv-busy-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(320px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
}
.kv-busy-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  animation: kvBusySpin 0.75s linear infinite;
  flex-shrink: 0;
}
.kv-busy-text { display: grid; gap: 2px; }
.kv-busy-title { font-size: 0.95rem; color: #0f172a; }
.kv-busy-msg { font-size: 0.82rem; color: #64748b; }
html.is-kv-busy { cursor: progress; }
html.is-kv-busy body { pointer-events: none; }
html.is-kv-busy .kv-busy { pointer-events: auto; }
@keyframes kvBusySpin {
  to { transform: rotate(360deg); }
}
.bk-combo-none {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  font-size: .9rem;
  cursor: pointer;
}
.bk-combo-none input { width: auto; margin: 0; }
.line-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
}
.line-row input[type=number] { width: 72px; }
.line-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.line-name { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; flex: 1; min-width: 0; }
.line-name small { color: var(--muted); font-size: .75rem; }
.catalog-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: block;
}

/* ===== EMPLOYEES ===== */
.emp-add-panel {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(107,91,255,.2);
  border-radius: 14px;
  background: var(--accent-soft);
}
.emp-add-btn[aria-expanded="true"] { opacity: .85; }
.emp-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.emp-filters input,
.emp-filters select {
  width: 100%;
  min-width: 0;
}
.emp-filters .btn { width: auto; white-space: nowrap; }
.emp-list { display: grid; gap: 12px; margin-top: 12px; }
.emp-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.emp-card.status-resigned { opacity: .7; }
.emp-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #6b5bff, #4f46e5);
  font-weight: 700; color: #fff;
}
.emp-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.emp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: .82rem; }
.emp-meta span {
  background: #faf9ff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.emp-contact { margin-top: 6px; }
.emp-edit { margin-top: 10px; }
.emp-edit summary { cursor: pointer; color: var(--accent); font-size: .85rem; }
.badge.emp-active { background: #dcfce7; color: #15803d; }
.badge.emp-probation { background: #ffedd5; color: #c2410c; }
.badge.emp-inactive { background: #e2e8f0; color: #475569; }
.badge.emp-resigned { background: #fee2e2; color: #b91c1c; }

/* ===== DUYỆT BILL CHI (lễ tân) ===== */
.exp-page { margin-top: 2px; }
.exp-hero {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  align-items: center;
  background: #fff; border: 1px solid #e6e8eb; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px;
}
.exp-hero-text { min-width: 0; flex: 1 1 200px; }
.exp-eyebrow {
  font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #6b7280;
}
.exp-title {
  margin: 2px 0 0; font-size: 1.18rem; font-weight: 700; color: #15171a;
}
.exp-sub { margin: 4px 0 0; font-size: .82rem; color: #6b7280; }
.exp-hero-actions {
  display: flex; gap: 8px; align-items: center;
  flex: 0 0 auto; flex-wrap: nowrap;
}
.exp-filters {
  display: inline-flex; gap: 6px; align-items: center;
  flex-wrap: nowrap; margin: 0;
}
.exp-filters select {
  border: 1px solid #e6e8eb; border-radius: 6px; background: #fff;
  padding: 6px 8px; font-size: .86rem; height: 34px;
  max-width: 120px;
}
.exp-panel-head .exp-filters select { max-width: 140px; }
@media (max-width: 720px) {
  .exp-hero-actions { width: 100%; flex-wrap: wrap; }
  .exp-filters { flex-wrap: wrap; }
  .exp-filters select { max-width: none; }
}
.exp-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.exp-kpi-item {
  background: #fff; border: 1px solid #e6e8eb; border-radius: 8px;
  padding: 10px 12px;
}
.exp-kpi-item strong {
  display: block; font-size: 1.05rem; font-weight: 700; color: #15171a;
  margin-top: 2px;
}
.exp-kpi-label { font-size: .76rem; font-weight: 600; color: #6b7280; }
.exp-kpi-item em { display: block; font-style: normal; font-size: .72rem; color: #b42318; margin-top: 2px; }
.exp-kpi-item.is-warn strong { color: #c2410c; }
.exp-kpi-item.is-danger strong { color: #e11d48; }
.exp-panel {
  background: #fff; border: 1px solid #e6e8eb; border-radius: 8px;
  margin-bottom: 12px; overflow: hidden;
}
.exp-panel-head {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  align-items: center; padding: 10px 12px; border-bottom: 1px solid #eef0f2;
}
.exp-panel-head strong { font-size: .92rem; }
.exp-table-wrap { overflow: auto; }
.exp-table {
  width: 100%; border-collapse: collapse; font-size: .86rem;
}
.exp-table th {
  text-align: left; font-size: .74rem; font-weight: 650; color: #6b7280;
  background: #f7f8f9; padding: 8px 10px; border-bottom: 1px solid #e6e8eb;
  white-space: nowrap;
}
.exp-table td {
  padding: 8px 10px; border-bottom: 1px solid #eef0f2; vertical-align: top;
}
.exp-table tr.is-pending td { background: #fffbeb; }
.exp-table tr.is-rejected td { background: #fef2f2; }
.exp-empty { color: #6b7280; padding: 16px !important; }
.exp-cat { font-size: .72rem; color: #6b7280; margin-bottom: 2px; }
.exp-neg { color: #b42318; font-size: .75rem; margin-top: 2px; }
.exp-tag {
  display: inline-block; font-size: .7rem; font-weight: 650;
  padding: 2px 6px; border-radius: 4px; background: #f3f4f6; color: #374151;
}
.exp-tag.tag-lo { background: #fff7ed; color: #c2410c; }
.exp-tag.tag-hi { background: #fef2f2; color: #b42318; }
.exp-tag.tag-warn { background: #fffbeb; color: #92400e; }
.exp-tag.tag-ok { background: #ecfdf3; color: #027a48; }
.exp-bill-link {
  display: inline-block; margin: 0 4px 2px 0; font-size: .78rem; font-weight: 600;
  color: var(--kv-blue, #0070f4);
}
.exp-dlg {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(400px, 94vw);
  width: calc(100% - 24px);
  margin: auto;
}
.exp-dlg[open] {
  display: block;
}
.exp-dlg::backdrop { background: rgba(21, 23, 26, .48); }
.exp-dlg-card {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(21, 23, 26, .16);
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 640px);
  overflow: hidden;
}
.exp-dlg-head {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  padding: 14px 16px; border-bottom: 1px solid #eef0f2; flex-shrink: 0;
}
.exp-dlg-body {
  padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  overflow: auto;
}
.exp-dlg-body.exp-act-body {
  grid-template-columns: 1fr;
  gap: 12px;
}
.exp-dlg-body label {
  display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: #4b5563;
}
.exp-dlg-body input,
.exp-dlg-body select {
  width: 100%; border: 1px solid #e6e8eb; border-radius: 6px;
  padding: 7px 9px; font: inherit; font-weight: 400; color: #15171a; background: #fff;
  box-sizing: border-box;
}
.exp-dlg-body .exp-full { grid-column: 1 / -1; }
.exp-dlg-foot {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid #eef0f2; flex-shrink: 0;
}
.exp-warn-box {
  grid-column: 1 / -1; padding: 8px 10px; border-radius: 6px;
  background: #fffbeb; border: 1px solid #f5d78e; color: #92400e; font-size: .82rem; font-weight: 500;
}
.exp-act-bills { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-act-buttons { display: grid; gap: 10px; }
.exp-btn-block { width: 100%; justify-content: center; }
.exp-reject-form {
  display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid #eef0f2;
}
.exp-file-list {
  list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px;
}
.exp-file-list li {
  font-size: .78rem; font-weight: 400; padding: 5px 8px; border-radius: 6px;
  background: #f7f8f9; border: 1px solid #e6e8eb;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.exp-file-list li.bad { border-color: #f0b4b0; background: #fef2f2; color: #b42318; }
.exp-file-meta {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.exp-file-remove {
  flex-shrink: 0; border: 0; background: transparent; color: #b42318;
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer; padding: 2px 4px;
}
.exp-file-remove:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .exp-dlg-body { grid-template-columns: 1fr; }
  .exp-actions { min-width: 0; }
}

/* ===== CRM / Khách hàng ===== */
.crm-wrap {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px 20px 36px;
  margin: -8px -4px 0;
  box-sizing: border-box;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(0, 112, 244, .10), transparent 60%),
    radial-gradient(720px 380px at 96% 8%, rgba(14, 165, 233, .08), transparent 55%),
    linear-gradient(180deg, #e8eef5 0%, #f0f3f7 42%, #e9eef4 100%);
  border-radius: 0;
}
.crm-page {
  width: 100%;
  max-width: 1080px;
  display: grid;
  gap: 14px;
  margin: 0 auto;
}
.crm-page-show { max-width: 1080px; gap: 12px; }
.crm-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.crm-kicker {
  margin: 0 0 2px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0070f4;
}
.crm-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 780;
  color: #15171a;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.crm-sub {
  margin: 4px 0 0;
  font-size: .86rem;
  color: #6b7280;
  line-height: 1.4;
}
.crm-sub strong { color: #c2410c; font-weight: 700; }
.crm-addr {
  margin: 4px 0 0;
  font-size: .82rem;
  color: #9ca3af;
}
.crm-back {
  justify-self: start;
  font-size: .82rem;
  font-weight: 650;
  color: #0070f4;
  text-decoration: none;
}
.crm-back:hover { text-decoration: underline; }
.crm-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 260px;
  max-width: 420px;
  justify-content: flex-end;
}
.crm-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  font: inherit;
  font-size: .9rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 23, 26, .04);
}
.crm-search input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(0, 112, 244, .12);
}
.crm-search .btn { height: 38px; padding: 0 14px; border-radius: 10px; }

.crm-profile {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 8px 24px rgba(21, 23, 26, .05);
  display: grid;
  gap: 14px;
}
.crm-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.crm-profile-text { flex: 1; min-width: 0; }
.crm-edit-btn {
  flex-shrink: 0;
  margin-left: auto;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
}
.crm-dlg {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(440px, 94vw);
  width: calc(100% - 24px);
  margin: auto;
}
.crm-dlg[open] { display: block; }
.crm-dlg::backdrop { background: rgba(21, 23, 26, .48); }
.crm-dlg-card {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(21, 23, 26, .16);
  overflow: hidden;
}
.crm-dlg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f2;
}
.crm-dlg-head strong { font-size: .98rem; font-weight: 750; }
.crm-dlg-body {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.crm-dlg-body label {
  display: grid;
  gap: 4px;
  font-size: .78rem;
  font-weight: 650;
  color: #4b5563;
  margin: 0;
}
.crm-dlg-body .crm-dlg-full { grid-column: 1 / -1; }
.crm-dlg-body input,
.crm-dlg-body textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 400;
  color: #15171a;
  background: #fff;
}
.crm-dlg-body textarea { resize: vertical; min-height: 72px; }
.crm-dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eef0f2;
  background: #fafbfc;
}
@media (max-width: 520px) {
  .crm-dlg-body { grid-template-columns: 1fr; }
  .crm-profile-top { flex-wrap: wrap; }
  .crm-edit-btn { width: 100%; margin-left: 0; }
}
.crm-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: .95rem;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #0070f4);
}
.crm-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 1.25rem;
}
.crm-profile-text { min-width: 0; }
.crm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.crm-stats > div {
  background: #f7f8f9;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  text-align: center;
}
.crm-stats span {
  font-size: .68rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.crm-stats strong {
  font-size: 1.05rem;
  font-weight: 780;
  color: #15171a;
}
.crm-stats .is-hold {
  background: #fff7ed;
  border-color: #fed7aa;
}
.crm-stats .is-hold strong { color: #c2410c; }
.crm-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: .8rem;
  color: #6b7280;
}
.crm-mini-stats b { color: #15171a; font-weight: 700; }
.crm-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  font-size: .86rem;
  color: #475569;
  line-height: 1.45;
}

.crm-panel {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(21, 23, 26, .04);
}
.crm-panel-head {
  padding: 11px 14px;
  font-size: .84rem;
  font-weight: 750;
  color: #15171a;
  border-bottom: 1px solid #eef0f2;
  background: #fafbfc;
  display: flex;
  align-items: center;
  gap: 8px;
}
.crm-panel-head em {
  font-style: normal;
  font-size: .72rem;
  font-weight: 700;
  color: #6b7280;
  background: #eef0f2;
  border-radius: 999px;
  padding: 1px 8px;
}

.crm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crm-list li + li { border-top: 1px solid #f1f3f5; }
.crm-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: background .12s ease;
}
.crm-item:hover { background: #f8fafc; }
.crm-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.crm-item-main strong {
  font-size: .95rem;
  font-weight: 720;
  color: #15171a;
}
.crm-item-line {
  font-size: .8rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-item-side {
  display: grid;
  gap: 2px;
  text-align: right;
}
.crm-item-spend {
  font-size: .9rem;
  font-weight: 750;
  color: #15171a;
}
.crm-item-meta {
  font-size: .74rem;
  color: #9ca3af;
}
.crm-item-chev {
  color: #cbd5e1;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}
.crm-item:hover .crm-item-chev { color: #0070f4; }

.crm-branch-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crm-branch-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid #f1f3f5;
  font-size: .88rem;
}
.crm-branch-list li:first-child { border-top: 0; }
.crm-muted { color: #9ca3af; font-size: .8rem; }
.crm-branch-nums {
  margin-left: auto;
  font-weight: 700;
  color: #15171a;
  font-size: .84rem;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.crm-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: .72rem;
  font-weight: 700;
  color: #6b7280;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f2;
  white-space: nowrap;
}
.crm-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f3f5;
  color: #15171a;
  vertical-align: middle;
}
.crm-table tr:last-child td { border-bottom: 0; }
.crm-table .right { text-align: right; font-weight: 650; }
.crm-table a { color: #0070f4; font-weight: 650; text-decoration: none; }
.crm-table a:hover { text-decoration: underline; }
.crm-time { font-size: .78rem; color: #6b7280; white-space: nowrap; }
.crm-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: .72rem;
  font-weight: 700;
}
.crm-empty-box {
  text-align: center;
  color: #9ca3af;
  padding: 36px 16px;
  font-size: .9rem;
}
.crm-pager-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid #eef0f2;
  background: #fafbfc;
}
.crm-pager-info {
  font-size: .8rem;
  font-weight: 600;
  color: #6b7280;
}
.crm-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.crm-pager a,
.crm-pager .crm-pager-nav,
.crm-pager .is-disabled {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: #4b5563;
  text-decoration: none;
  border: 1px solid #e6e8eb;
  background: #fff;
  box-sizing: border-box;
}
.crm-pager a.crm-pager-nav { min-width: auto; padding: 0 10px; }
.crm-pager a.is-on {
  background: #0070f4;
  border-color: #0070f4;
  color: #fff;
}
.crm-pager a:hover:not(.is-on) {
  border-color: #bfdbfe;
  color: #0070f4;
  background: #eff6ff;
}
.crm-pager .is-disabled {
  opacity: .4;
  cursor: default;
}
.crm-pager-dots {
  padding: 0 2px;
  color: #9ca3af;
  font-weight: 700;
}
@media (max-width: 640px) {
  .crm-wrap { padding: 12px 10px 28px; margin: 0; }
  .crm-head { align-items: stretch; }
  .crm-search { max-width: none; justify-content: stretch; }
  .crm-stats { grid-template-columns: 1fr; }
  .crm-pager-bar { flex-direction: column; align-items: stretch; }
  .crm-pager { justify-content: center; }
  .crm-item {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "av main chev"
      "av side chev";
  }
  .crm-avatar { grid-area: av; }
  .crm-item-main { grid-area: main; }
  .crm-item-side { grid-area: side; text-align: left; }
  .crm-item-chev { grid-area: chev; }
  .crm-table th:nth-child(3),
  .crm-table td:nth-child(3) { display: none; }
}
/* ===== HUB TABS ===== */
.hub-nav {
  display: flex; gap: 6px; flex-wrap: nowrap; align-items: center;
  margin: 0 0 14px; padding: 6px; background: #f1f5f9;
  border-radius: 14px; border: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.hub-tab {
  padding: 8px 14px; border-radius: 10px; font-size: .88rem; font-weight: 600;
  color: var(--muted); background: transparent;
  flex: 0 0 auto; white-space: nowrap;
}
.hub-tab:hover { color: var(--text); background: rgba(255,255,255,.7); }
.hub-tab.active {
  background: #fff; color: var(--text);
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.hub-cta { margin-left: auto; }

/* ===== TIMELINE ===== */
.timeline-panel { padding: 8px; }
.timeline-kpis { margin-bottom: 10px; }
.timeline-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
.timeline-table {
  border-collapse: separate;
  border-spacing: 2px;
  width: max-content;
  min-width: 100%;
  font-size: .72rem;
}
.timeline-table th {
  text-align: center;
  padding: 4px 1px;
  color: #64748b;
  font-weight: 600;
  font-size: .7rem;
}
.timeline-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 4px 5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.tl-room-code {
  display: block;
  font-size: .72rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-until {
  margin-top: 1px; font-size: .58rem; color: #6366f1; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-cell {
  width: 44px;
  min-width: 44px;
  height: 30px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: center;
  vertical-align: middle;
  padding: 0;
  position: relative;
  color: #475569;
}
.tl-click:hover { outline: 1px solid rgba(99,102,241,.35); background: #eef2ff; }
.tl-empty { background: #f8fafc; color: #94a3b8; }
.tl-past {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #cbd5e1;
  cursor: not-allowed;
}
.tl-hour-past { color: #94a3b8; }
.tl-past-mark { color: #cbd5e1; font-size: .75rem; line-height: 1; }
.tl-holding { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.tl-busy { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.tl-awaiting { background: #ffedd5; border-color: #fdba74; color: #c2410c; }
.tl-awaiting_clean { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
.tl-overdue { background: #fecaca; border-color: #f87171; color: #991b1b; }
.tl-cleaning { background: #e2e8f0; border-color: #cbd5e1; color: #475569; }
.tl-done { background: #dcfce7; border-color: #86efac; color: #15803d; }
.tl-cancelled { background: #f8fafc; border-color: #fecaca; color: #f87171; opacity: .85; }
.tl-maintenance { background: #f1f5f9; border-color: #cbd5e1; color: #64748b; cursor: not-allowed; }
.tl-mark {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  opacity: .9;
}
.tl-cleaning .tl-mark,
.tl-awaiting_clean .tl-mark {
  width: 7px; height: 7px;
  opacity: .75;
}
.tl-actions {
  display: flex; height: 100%; width: 100%;
}
.tl-hit {
  flex: 1; display: grid; place-items: center;
  color: #94a3b8; font-weight: 700; font-size: .7rem;
  text-decoration: none;
}
.tl-hit:hover { background: #e0e7ff; color: #4f46e5; }
.tl-hit.dep:hover { background: #dbeafe; color: #1d4ed8; }
.tl-block-link {
  display: grid; place-items: center; height: 100%; width: 100%;
  text-decoration: none; color: inherit;
}
.tl-chip {
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid currentColor;
  background: transparent;
  font-size: .58rem; font-weight: 700;
  color: inherit;
}
.tl-hold-time {
  display: block;
  font-size: .58rem;
  font-weight: 700;
  color: inherit;
  line-height: 1.05;
  padding: 0 1px;
  letter-spacing: -.02em;
}

/* ===== CLEANING ===== */
.clean-queue { display: grid; gap: 12px; margin-top: 12px; }
.clean-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.clean-card.late, .clean-card.overdue { border-color: rgba(229,72,77,.45); }
.cc-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.cc-timer { text-align: right; font-weight: 800; font-size: 1.15rem; }
.cc-timer.ok { color: var(--ok); }
.cc-timer.danger { color: var(--danger); }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e8eef7;
  margin: 12px 0;
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00a3bf);
  border-radius: 999px;
}
.cc-form { display: grid; gap: 10px; }
.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}
.check-item {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .88rem;
  color: var(--text);
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--line);
}
.check-item input { width: auto; }

@media (max-width: 1100px) {
  .kpi-grid:not(.kpi-hero) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.kpi-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; width: 100%; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(292px, 86vw);
    transform: translateX(-105%); transition: transform .22s ease;
    height: 100%;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .mobile-only { display: inline-flex !important; }
  .bottom-nav { display: grid !important; }
  .main {
    padding: 12px 12px calc(108px + var(--safe-bottom));
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .page-body { max-width: 100%; overflow-x: hidden; }
  .panel { max-width: 100%; }
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .topbar-title { order: 2; flex: 1 1 calc(100% - 56px); }
  .icon-btn.mobile-only { order: 1; }
  .live-clock {
    order: 3;
    flex: 1 1 auto;
    justify-content: flex-start;
    max-width: 100%;
  }
  .branch-switch,
  .scope-chip {
    order: 4;
    flex: 1 1 100%;
  }
  .scope-chip { text-align: center; }
  .clock-meta { min-width: 0; }
  .clock-time { font-size: .98rem; }
  .branch-switch select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .hero-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-panel .period-form,
  .hero-panel > .row,
  .panel-head,
  .page-actions {
    width: 100%;
  }
  .period-form {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 6px;
  }
  .period-form select {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    width: auto;
    max-width: 100%;
  }
  .period-form input[type="date"],
  .period-form input[type="week"],
  .period-form input[type="search"] {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 0;
    max-width: 100%;
  }
  .period-form .btn,
  .period-form a.btn {
    flex: 0 0 auto;
  }
  .hero-panel.compact {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
  }
  .hero-panel.compact .period-form {
    width: 100%;
    justify-content: flex-start;
  }
  .filter-bar {
    gap: 6px;
    padding: 8px;
  }
  .filter-bar select,
  .filter-bar input[type="date"],
  .filter-bar input[type="search"],
  .filter-bar input[type="text"] {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    max-width: none;
  }
  .filter-bar .btn {
    width: auto !important;
    margin-left: 0;
    flex: 0 0 auto;
  }
  .hero-title { font-size: 1.12rem; }
  .emp-filters {
    grid-template-columns: 1fr 1fr;
  }
  .emp-filters input[type=search] { grid-column: 1 / -1; }
  .emp-filters .btn { grid-column: 1 / -1; width: 100%; }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .kpi-grid.kpi-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .room-card { padding: 12px; min-height: 124px; }
  .room-card .rb-card-actions { display: flex; }
  .rb-toolbar-actions { width: 100%; }
  .rb-filter { flex: 1 1 auto; min-width: 0; width: 100% !important; }
  .rb-btn-primary { width: 100%; }
  .rb-shell { padding: 14px; border-radius: 16px; }
  .rb-hero-title { font-size: 1.4rem; }
  .form-grid { grid-template-columns: 1fr; }
  .mini-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-table { display: none; }
  .branch-cards { display: grid; }
  .eff-cards { display: grid; }
  .table-wrap.app-swipe::after { display: block; }
  /* Bảng rộng: ép chiều ngang để vuốt được */
  .table-wrap.app-swipe .data-table,
  .table-wrap.app-swipe .data-table.compact {
    min-width: 720px;
    width: max-content;
  }
  .pill.xl { display: inline-flex; align-self: flex-start; }
  .bill-meta > div { min-width: calc(50% - 8px); }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .room-grid { grid-template-columns: 1fr; }
  .mini-cards { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .auth-shell { padding: 28px 16px 32px; }
}

.payroll-wrap { max-width: 100%; }
.pay-inp {
  width: 72px;
  padding: 6px 8px;
  font-size: .8rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.pay-inp.money-input { width: 104px; }
.pay-src-chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}
.pay-src-chip.shift { background: #fff7ed; color: #c2410c; }
.pay-src-chip.mixed { background: #fef3c7; color: #92400e; }
.pay-src-chip.base { background: #f1f5f9; color: #475569; }

/* ===== Bảng lương (pr-page) ===== */
.pr-page .pr-kpi { margin-bottom: 14px; }
.pr-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.pr-toolbar-left,
.pr-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pr-toolbar .btn {
  border-radius: 999px;
  font-weight: 700;
}
.pr-panel {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cc-line, #e2e8f0);
  border-radius: var(--cc-radius, 14px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.pr-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cc-line, #e2e8f0);
  background: #f8fafc;
}
.pr-table { font-size: .82rem; }
.pr-table .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  min-width: 148px;
  box-shadow: 4px 0 8px rgba(15, 23, 42, .04);
}
.pr-table thead .sticky-col {
  z-index: 3;
  background: #f8fafc;
}
.pr-table tbody tr.pr-row-paid td { background: #f0fdf4; }
.pr-table tbody tr.pr-row-paid .sticky-col { background: #f0fdf4; }
.pr-table tbody tr:hover .sticky-col { background: #f8fbff; }
.pr-table tbody tr.pr-row-paid:hover .sticky-col { background: #ecfdf5; }
.pr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 132px;
}
.pr-actions .btn.small {
  border-radius: 999px;
  white-space: nowrap;
}
.cc-dialog.pr-dlg-wide {
  max-width: min(920px, 96vw);
  width: min(920px, 96vw);
}
.pr-adj-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0 2px;
}
.pr-adj-tab {
  border: 1px solid var(--cc-line, #e2e8f0);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
}
.pr-adj-tab.active {
  background: var(--cc-blue-soft, #e8f2ff);
  border-color: #bfdbfe;
  color: var(--cc-blue, #0070f4);
}
.pr-adj-pane.is-hidden { display: none; }
.pr-detail-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.pr-dk {
  border: 1px solid var(--cc-line, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
}
.pr-dk span {
  display: block;
  font-size: .72rem;
  color: #64748b;
  font-weight: 650;
  margin-bottom: 4px;
}
.pr-dk strong {
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.pr-detail-block { margin-bottom: 14px; }
.pr-detail-label {
  font-size: .78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}
.pr-detail-lines {
  margin: 8px 0 0;
  padding: 8px 10px 8px 22px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: .78rem;
  line-height: 1.45;
}
.pr-day-table th.day-h {
  min-width: 30px;
  padding: 4px 2px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
}
.pr-day-table .day-cell {
  text-align: center;
  padding: 4px 2px;
  min-width: 30px;
  font-variant-numeric: tabular-nums;
}
.pr-day-table .day-cell.ot { background: rgba(234, 88, 12, .12); color: #c2410c; font-weight: 650; }
.pr-day-table .day-cell.ok { background: rgba(34, 197, 94, .08); }
.pr-day-table .day-cell.empty { color: transparent; }
@media (max-width: 720px) {
  .pr-toolbar { flex-direction: column; align-items: stretch; }
  .pr-toolbar-left,
  .pr-toolbar-right { width: 100%; }
  .pr-toolbar .btn { flex: 1 1 auto; justify-content: center; }
}

/* ===== SHIFT HANDOVER / CHỐT CA ===== */
.sh-page { width: 100%; }
.sh-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .85fr);
  gap: 14px;
  align-items: start;
}
.sh-side {
  background: #fff;
  border: 1px solid #ebe8f4;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(55, 40, 120, .06);
  position: sticky;
  top: 14px;
}
.sh-alert {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.4;
}
.sh-alert.is-short {
  background: #fff6d8;
  color: #92400e;
  border: 1px solid #fde68a;
}
.sh-alert.is-over {
  background: #e8faf0;
  color: #12805a;
  border: 1px solid #bbf7d0;
}
.shift-pending-list { display: grid; gap: 10px; }
.shift-pending-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f5ff;
  border: 1px solid #ebe8f4;
}
.sh-recv-opts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.sh-recv-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid #ebe8f4;
  border-radius: 12px;
  background: #faf9ff;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 650;
}
.sh-recv-opt:has(input:checked) {
  border-color: #6b5bff;
  background: #f0edff;
  color: #4c3fd4;
}
.sh-recv-opt input { accent-color: #6b5bff; }
@media (max-width: 960px) {
  .sh-layout { grid-template-columns: 1fr; }
  .sh-side { position: static; }
  .sh-recv-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== CLEANING JOB (ảnh xác minh) ===== */
.clean-card-link { display: block; text-decoration: none; color: inherit; }
.clean-card-link:active { transform: scale(.995); }
.cl-job { width: 100%; max-width: 720px; margin: 0 auto; }
.cl-job-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cl-job-title {
  margin: 4px 0;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 800;
  color: #1f1638;
}
.cl-job-sub { margin: 0; color: #8b92a5; font-size: .86rem; }
.cl-rules {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  font-size: .82rem;
  color: #4b5568;
}
.cl-panel {
  background: #fff;
  border: 1px solid #ebe8f4;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 22px rgba(55, 40, 120, .05);
}
.cl-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.cl-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cl-slot { margin: 0; }
.cl-slot-box {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px dashed #d9d4ea;
  background: #f6f4fc;
  cursor: pointer;
}
.cl-slot.is-done .cl-slot-box {
  border-style: solid;
  border-color: #86efac;
  background: #fff;
}
.cl-slot-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cl-slot-box input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.cl-slot-cam, .cl-slot-miss {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #8b92a5;
  text-align: center;
}
.cl-slot-cam { top: 32%; }
.cl-slot-miss {
  bottom: 16%;
  width: 90%;
  font-size: .72rem;
  line-height: 1.3;
}
.cl-slot-ok {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #12b76a;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .85rem;
}
.cl-slot-label {
  margin-top: 6px;
  font-size: .82rem;
  font-weight: 650;
  color: #3b4254;
  text-align: center;
}
.cl-checks { display: grid; gap: 8px; }
.cl-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f7ff;
  border: 1px solid #efeef6;
  cursor: pointer;
}
.cl-check input { width: 18px; height: 18px; }
.cl-check-ico {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 800;
  background: #e8faf0;
  color: #12805a;
}
.cl-check.is-warn .cl-check-ico {
  background: #fff6d8;
  color: #a16207;
}
.cl-submit {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 750;
}
.cl-submit.is-disabled,
.cl-submit:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.cl-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #efeaf8;
  overflow: hidden;
  margin-bottom: 12px;
}
.cl-progress-track > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5b8def, #12b76a);
  border-radius: 999px;
  transition: width .25s ease;
}
.cl-done-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.cl-done-thumb {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #86efac;
}
.cl-done-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cl-done-thumb span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
}
.cl-slot-hero .cl-slot-box {
  aspect-ratio: 4 / 3;
  min-height: 220px;
}
.cl-photo-grid-12 {
  grid-template-columns: repeat(3, 1fr);
}
.cl-submit-row {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.cl-submit-issue {
  border-color: #f5c518;
  color: #92400e;
}
.cl-review-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.cl-review-box {
  border-color: #f5c518;
  background: #fffdf5;
}
.cl-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.cl-timeline li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0eef6;
}
.cl-timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
.cl-tl-time {
  font-size: .78rem;
  font-weight: 700;
  color: #6b7280;
  padding-top: 2px;
}
@media (max-width: 640px) {
  .cl-photo-grid-12 { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr !important; }
}
@media (max-width: 520px) {
  .cl-photo-grid { gap: 8px; }
}
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr !important; }
}

/* ===== VẬN HÀNH PHÒNG (compact) ===== */
.ops-page { margin-top: 2px; }
.ops-tabs {
  display: inline-flex;
  gap: 0;
  margin: 0 0 10px;
  padding: 3px;
  background: #eef2f7;
  border-radius: 10px;
  max-width: 100%;
}
.ops-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 7px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: .84rem;
  color: #64748b;
  border-radius: 8px;
  border: 0;
  background: transparent;
  white-space: nowrap;
  line-height: 1.2;
}
.ops-tab.is-active {
  color: #fff;
  background: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .18);
}
.ops-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}
.ops-toolbar-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ops-eyebrow {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.ops-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.ops-hint {
  margin: 0 0 10px;
  font-size: .78rem;
  color: #64748b;
}
.ops-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.ops-kpi-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.ops-kpi-lab {
  font-size: .74rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.ops-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
  flex: 0 0 auto;
}
.ops-kpi-item.is-warn .ops-kpi-val { color: #b45309; }
.ops-kpi-item.is-danger .ops-kpi-val { color: #b91c1c; }
.ops-kpi-item.is-ok .ops-kpi-val { color: #047857; }

.ops-filter {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  flex-wrap: nowrap;
}
.ops-filter select,
.ops-filter input[type="search"] {
  width: auto !important;
  max-width: none;
  min-height: 34px;
  margin: 0 !important;
  font-size: .84rem;
  box-sizing: border-box;
}
.ops-filter select {
  flex: 0 1 150px;
  min-width: 120px;
  max-width: 170px !important;
}
.ops-filter input[type="search"] {
  flex: 1 1 auto;
  min-width: 140px;
  width: 0 !important; /* flex-grow thay vì width 100% */
}
.ops-filter-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap;
}

.ops-section {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ops-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: .9rem;
}
.ops-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.ops-split-dense { align-items: start; }
.ops-queue { margin: 0; gap: 8px; }
.ops-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
}
.ops-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 8px 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  line-height: 1.2;
}
.ops-chip:hover { border-color: #94a3b8; background: #fff; }
.ops-chip strong {
  font-size: .92rem;
  font-weight: 800;
  color: #0f172a;
}
.ops-chip-br {
  font-size: .65rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ops-chip-meta {
  font-size: .7rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-chip-sub {
  font-size: .68rem;
  color: #94a3b8;
}
.ops-chip.is-warn { border-color: #fcd34d; background: #fffbeb; }
.ops-chip.is-warn .ops-chip-meta { color: #b45309; }
.ops-chip.is-busy { border-color: #93c5fd; background: #eff6ff; }
.ops-chip.is-busy .ops-chip-meta { color: #1d4ed8; }
.ops-chip.is-late { border-color: #fecaca; background: #fff1f2; }
.ops-chip.is-late .ops-chip-meta { color: #b91c1c; }
.ops-card {
  padding: 10px 12px !important;
  border-radius: 10px !important;
  margin: 0 !important;
}
.ops-card .cc-top { gap: 8px; }
.ops-card-note { margin-top: 4px; }
.ops-card-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.ops-empty,
.ops-empty-inline {
  margin: 0;
  padding: 10px 0 2px;
  color: #94a3b8;
  font-size: .84rem;
}
.ops-empty {
  background: #fff;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

/* Bảo trì — layout gọn */
.mt-page .ops-section {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
}
.mt-page .ops-split {
  gap: 8px;
  margin-bottom: 8px;
}
.mt-work-panel { margin-top: 10px; }
.mt-work-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.mt-work-mode {
  appearance: none;
  border: 1px solid #d7dee8;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}
.mt-work-mode.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.mt-work-pane[hidden] { display: none !important; }
.mt-work-pane.is-active { display: block; }
.mt-page .field { margin-bottom: 8px; }
.mt-page .field label {
  font-size: .74rem;
  margin-bottom: 3px;
}
.mt-page .field input,
.mt-page .field select,
.mt-page .field textarea {
  min-height: 34px;
  padding: 6px 9px;
  font-size: .86rem;
  border-radius: 8px;
}
.mt-page .field textarea { min-height: 64px; }
.mt-page .btn,
.mt-page .btn.small {
  width: auto;
  min-height: 32px;
  padding: 6px 12px;
  font-size: .8rem;
  border-radius: 8px;
}
.mt-list { display: grid; gap: 6px; }
.mt-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.mt-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 210px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  padding: 12px;
  border-top: 3px solid #94a3b8;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mt-tile:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}
.mt-tile.is-focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #93c5fd;
  background: #f8fbff;
}
.mt-tile.mt-prio-urgent { border-top-color: #ef4444; }
.mt-tile.mt-prio-high { border-top-color: #f59e0b; }
.mt-tile.mt-prio-normal { border-top-color: #3b82f6; }
.mt-tile.mt-prio-low { border-top-color: #94a3b8; }
.mt-tile-late { border-color: #fecaca; background: #fff7f7; }
.mt-tile-pending { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .35); }
.mt-tile-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.mt-tile-top .bk-badge {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: .68rem;
  padding: 2px 7px;
}
.mt-tile-title {
  font-weight: 700;
  font-size: .92rem;
  color: #0f172a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mt-tile-desc {
  font-size: .75rem;
  color: #64748b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.mt-tile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mt-fact {
  font-size: .68rem;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 8px;
}
.mt-tile-people {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  flex-wrap: wrap;
}
.mt-people-label {
  font-size: .72rem;
  color: #334155;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.mt-people-empty {
  font-size: .72rem;
  color: #94a3b8;
  font-style: italic;
}
.mt-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  font-size: .68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.mt-avatar-more {
  background: #cbd5e1;
  font-size: .62rem;
}
.mt-tile-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .72rem;
  color: #64748b;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}
.mt-cmt-count { white-space: nowrap; }
.mt-cmt-open {
  appearance: none;
  border: 0;
  background: #f1f5f9;
  color: #334155;
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
  font-size: .72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  line-height: 1.2;
}
.mt-cmt-open:hover { background: #e2e8f0; color: #0f172a; }
.mt-cmt-ico {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 4px;
  background: #94a3b8;
  display: inline-block;
  flex: 0 0 auto;
}
.mt-fb-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(520px, calc(100vw - 24px));
  width: 100%;
}
.mt-fb-dialog::backdrop {
  background: rgba(15, 23, 42, .45);
}
.mt-fb-sheet {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 640px);
}
.mt-fb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8eef5;
}
.mt-fb-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 700;
  color: #64748b;
}
.mt-fb-title {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin-top: 2px;
}
.mt-fb-close {
  appearance: none;
  border: 0;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
  flex: 0 0 auto;
}
.mt-fb-close:hover { background: #e2e8f0; }
.mt-fb-list {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}
.mt-fb-list-inline {
  max-height: none;
  padding: 8px 0 0;
}
.mt-fb-empty {
  font-size: .8rem;
  color: #94a3b8;
  padding: 8px 0;
}
.mt-fb-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: start;
}
.mt-fb-item > .mt-avatar {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  font-size: .85rem;
  background: #dbeafe;
  color: #1d4ed8;
}
.mt-fb-bubble {
  background: #f0f2f5;
  border-radius: 16px;
  padding: 8px 12px;
  min-width: 0;
}
.mt-fb-name {
  font-size: .8rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.mt-fb-text {
  font-size: .88rem;
  color: #0f172a;
  white-space: pre-wrap;
  line-height: 1.4;
  word-break: break-word;
}
.mt-fb-meta {
  grid-column: 2;
  font-size: .72rem;
  color: #64748b;
  padding-left: 10px;
}
.mt-fb-composer,
.mt-fb-composer-inline {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid #e8eef5;
  background: #fff;
}
.mt-fb-composer-inline {
  padding: 10px 0 0;
  border-top: 1px dashed #e2e8f0;
  margin-top: 8px;
}
.mt-fb-me {
  background: #bfdbfe !important;
  color: #1e40af !important;
  width: 36px;
  height: 36px;
  font-size: .85rem;
}
.mt-fb-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: #f0f2f5;
  border-radius: 20px;
  padding: 6px 8px 6px 12px;
}
.mt-fb-input-wrap textarea {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  resize: none;
  min-height: 22px;
  max-height: 96px;
  padding: 4px 0 !important;
  font-size: .88rem;
  line-height: 1.35;
  outline: none;
}
.mt-fb-send {
  appearance: none;
  border: 0;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}
.mt-fb-send:disabled {
  opacity: .5;
  cursor: default;
}
.mt-fb-locked {
  padding: 0 14px 12px;
}
.mt-fb-panel .ops-section-head {
  align-items: center;
}
.mt-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 8px;
  padding: 7px 10px;
  border-left: 3px solid #94a3b8;
}
.mt-card.is-focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #93c5fd;
  background: #f8fbff;
}
.mt-card.mt-prio-urgent { border-left-color: #ef4444; }
.mt-card.mt-prio-high { border-left-color: #f59e0b; }
.mt-card.mt-prio-normal { border-left-color: #3b82f6; }
.mt-card.mt-prio-low { border-left-color: #94a3b8; }
.mt-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.mt-card-top .bk-badge {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: .68rem;
  padding: 2px 7px;
}
.mt-card-title {
  margin-top: 2px;
  font-weight: 700;
  font-size: .86rem;
  color: #0f172a;
  line-height: 1.25;
}
.mt-card-meta {
  margin-top: 2px;
  font-size: .72rem;
  color: #64748b;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.mt-card-meta > span:not(:first-child)::before {
  content: "·";
  margin-right: 6px;
  color: #cbd5e1;
}
.mt-assignee-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.mt-assignee-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .82rem;
  color: #334155;
  margin: 0;
  cursor: pointer;
}
.mt-assignee-opt input { margin-top: 2px; }

/* Popup chọn người làm bảo trì */
.mt-assign-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.mt-assign-summary {
  line-height: 1.35;
  max-width: 100%;
}
.mt-assign-dialog {
  border: 0;
  padding: 0;
  border-radius: 14px;
  max-width: min(420px, 94vw);
  width: 100%;
  background: transparent;
  box-shadow: none;
}
.mt-assign-dialog::backdrop {
  background: rgba(15, 23, 42, .45);
}
.mt-assign-sheet {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
}
.mt-assign-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}
.mt-assign-head strong { font-size: .92rem; }
.mt-assign-close {
  appearance: none;
  border: 0;
  background: #f1f5f9;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}
.mt-assign-list {
  overflow: auto;
  padding: 6px 8px;
  flex: 1 1 auto;
}
.mt-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .84rem;
  color: #0f172a;
}
.mt-assign-row:hover { background: #f8fafc; }
.mt-assign-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #0f172a;
}
.mt-assign-name {
  font-weight: 650;
  flex: 1 1 auto;
  min-width: 0;
}
.mt-assign-role {
  font-size: .72rem;
  color: #64748b;
  flex: 0 0 auto;
}
.mt-assign-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.mt-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: .78rem;
  color: #475569;
}
.mt-form-wrap {
  max-width: 520px;
  margin: 0 auto;
}
.mt-form-hero { margin-bottom: 6px; }
.mt-form-panel {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  margin: 0 auto;
}
.mt-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.mt-code-hero {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #0f172a;
  margin-top: 2px;
}
.mt-show-title { font-size: .95rem !important; margin-top: 2px !important; }
.mt-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .01em;
  font-size: .8rem;
}
.mt-card-late { border-color: #fecaca; background: #fff7f7; }
.mt-card-pending { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .35); }
@media (max-width: 640px) {
  .mt-board { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mt-tile { min-height: 190px; padding: 10px; }
  .mt-fb-sheet { max-height: 86vh; border-radius: 12px 12px 0 0; }
  .mt-fb-dialog { max-width: 100vw; margin: 0; }
}
@media (max-width: 420px) {
  .mt-board { grid-template-columns: 1fr; }
}
.mt-due-late { color: #b91c1c; font-weight: 700; }
.mt-ready-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mt-ready-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
  position: relative;
  min-width: 0;
  max-width: 100%;
}
.mt-ready-opt input {
  position: static;
  margin: 0;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.mt-ready-opt:has(input:checked) {
  border-color: #0f172a;
  background: #eef2ff;
  box-shadow: none;
}
.mt-ready-title {
  font-size: .76rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
}
.mt-ready-sub {
  display: none;
}
.mt-admin-watch { border-color: #cbd5e1; background: #f8fafc; }
.mt-watch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  font-size: .86rem;
}
.mt-nudge-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.mt-nudge-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 0 !important;
  min-height: 34px;
  margin: 0 !important;
  font-size: .84rem;
}
.mt-nudge-form .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  width: auto !important;
}
.mt-ev-nudge {
  background: #fff7ed;
  border-radius: 8px;
  padding: 6px 8px !important;
  margin: 0 -4px;
}
@media (max-width: 720px) {
  .mt-ready-opts { flex-direction: column; align-items: stretch; }
  .mt-ready-opt { border-radius: 8px; }
  .mt-watch-grid { grid-template-columns: 1fr 1fr; }
  .mt-nudge-form { flex-wrap: wrap; }
  .mt-nudge-form input[type="text"] { width: 100% !important; flex: 1 1 100%; }
}
.mt-pending-box { border: 1px solid #fcd34d; background: #fffbeb; }
.mt-photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mt-photo-row a {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.mt-photo-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cl-hist-panel { overflow: hidden; }
.cl-hist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 2px;
}
.cl-hist-filter {
  display: flex !important;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
.cl-hist-filter input[type="date"] {
  min-height: 32px;
  width: 138px !important;
  max-width: 138px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: .82rem;
  margin: 0 !important;
}
.cl-hist-filter .btn {
  flex: 0 0 auto;
  width: auto !important;
  white-space: nowrap;
}
.cl-hist-scroll {
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cl-hist-table {
  margin: 0;
  min-width: 680px;
  width: 100%;
  table-layout: fixed;
  font-size: .82rem;
}
.cl-hist-table th,
.cl-hist-table td {
  vertical-align: middle;
  padding: 7px 8px;
}
.cl-hist-table .nowrap {
  white-space: nowrap;
  word-break: normal;
}
.cl-hist-bill {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-hist-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-hist-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}
.cl-hist-pager-nav { display: flex; gap: 6px; flex: 0 0 auto; }

@media (max-width: 860px) {
  .two-col,
  .ops-split { grid-template-columns: 1fr !important; }
  .ops-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-filter {
    flex-wrap: wrap;
  }
  .ops-filter select {
    flex: 1 1 calc(50% - 4px);
    max-width: none;
  }
  .ops-filter input[type="search"] {
    flex: 1 1 100%;
    order: 3;
  }
  .ops-filter-btn {
    order: 4;
    margin-left: auto;
  }
  .cl-hist-head {
    flex-wrap: wrap;
  }
  .cl-hist-table { min-width: 620px; }
}
@media (max-width: 520px) {
  .ops-toolbar { flex-wrap: wrap; }
  .ops-tabs { width: 100%; }
  .ops-tab { flex: 1; min-width: 0; }
}

/* ===== CLEANER MOBILE APP ===== */
body.is-cleaner-app {
  background: #f3f5f8;
}
body.is-cleaner-app .kv-shell.page-cleaner .kv-header-cleaner {
  height: 52px;
  background: #0f172a;
  border-bottom: 0;
}
body.is-cleaner-app .kv-shell.page-cleaner .kv-header-inner {
  height: 52px;
  padding: 0 12px;
}
body.is-cleaner-app .kv-shell.page-cleaner .kv-brand-text,
body.is-cleaner-app .kv-shell.page-cleaner .kv-nav,
body.is-cleaner-app .kv-shell.page-cleaner .kv-actions,
body.is-cleaner-app .kv-shell.page-cleaner .kv-page-head {
  display: none !important;
}
body.is-cleaner-app .kv-shell.page-cleaner .main {
  padding-top: 0;
}
body.is-cleaner-app .kv-shell.page-cleaner {
  --header-h: 52px;
}
body.is-cleaner-app .kv-shell.page-cleaner .kv-brand-mark {
  width: 34px;
  height: 34px;
  font-size: .85rem;
  background: #22c55e;
}
body.is-cleaner-app .kv-shell.page-cleaner .page-body {
  padding: 0 0 88px;
  max-width: 480px;
  margin: 0 auto;
}
body.is-cleaner-app .bottom-nav {
  display: flex !important;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
}
body.is-cleaner-app .bottom-nav a.active { color: #16a34a; }

.cl-home { padding: 14px 14px 8px; }
.cl-home-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.cl-home-eye {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cl-home-head h1 {
  margin: 4px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}
.cl-home-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cl-home-pills span {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .72rem;
  color: #64748b;
  font-weight: 600;
}
.cl-home-pills b { color: #0f172a; font-size: .9rem; }
.cl-home-pills .is-late { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.cl-home-pills .is-late b { color: #b91c1c; }
.cl-home-sec { margin-bottom: 18px; }
.cl-home-sec-t {
  font-size: .78rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.cl-home-empty {
  margin: 0;
  padding: 18px;
  text-align: center;
  color: #94a3b8;
  background: #fff;
  border-radius: 16px;
  border: 1px dashed #dbe3ef;
  font-size: .9rem;
}
.cl-home-list { display: grid; gap: 10px; }
.cl-home-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
  border: 1px solid #eef2f7;
  min-height: 76px;
  -webkit-tap-highlight-color: transparent;
}
.cl-home-card:active { transform: scale(.985); }
.cl-home-card.is-late { border-color: #fecaca; }
.cl-home-room {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(160deg, #16a34a, #0f766e);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.cl-home-card.is-late .cl-home-room {
  background: linear-gradient(160deg, #ef4444, #b91c1c);
}
.cl-home-meta { min-width: 0; }
.cl-home-meta strong {
  display: block;
  font-size: .98rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-home-meta span {
  display: block;
  margin-top: 2px;
  font-size: .78rem;
  color: #64748b;
}
.cl-home-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.cl-home-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
}
.cl-home-go {
  font-size: .78rem;
  font-weight: 800;
  color: #16a34a;
  background: #ecfdf5;
  border-radius: 999px;
  padding: 8px 12px;
}
.cl-home-foot {
  text-align: center;
  color: #94a3b8;
  font-size: .75rem;
  margin: 8px 0 0;
}

.cl-app {
  min-height: calc(100vh - 120px);
  background: #f3f5f8;
  padding-bottom: 24px;
}
.cl-app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(243, 245, 248, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
}
.cl-app-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.cl-app-bar-main strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
}
.cl-app-bar-main span {
  display: block;
  font-size: .72rem;
  color: #64748b;
}
.cl-bed-pick {
  margin: 16px 14px 24px;
  padding: 18px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.cl-bed-pick h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.cl-bed-pick > p { margin: 0 0 14px; line-height: 1.45; }
.cl-bed-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cl-bed-actions .cl-btn-queen {
  background: #0f766e;
}
.cl-bed-hint {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #64748b;
  font-size: .86rem;
  line-height: 1.45;
}
.cl-bed-badge {
  margin: 8px 14px 0;
  display: block;
}
.cl-app-bar-stat {
  min-width: 52px;
  text-align: center;
  font-weight: 800;
  font-size: .95rem;
  color: #16a34a;
  background: #ecfdf5;
  border-radius: 12px;
  padding: 8px 10px;
}
.cl-app-progress {
  height: 4px;
  background: #e2e8f0;
  margin: 0 12px 12px;
  border-radius: 999px;
  overflow: hidden;
}
.cl-app-progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width .25s ease;
}
.cl-thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 12px 14px;
}
.cl-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1.5px solid #dbe3ef;
  background: #fff;
  overflow: hidden;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.cl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cl-thumb-n {
  position: absolute;
  left: 5px;
  top: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.cl-thumb.done { border-color: #86efac; }
.cl-thumb.current {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}
.cl-thumb.todo { background: #f8fafc; }
.cl-thumb.uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .28);
}
.cl-thumb-spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: cl-spin .7s linear infinite;
  z-index: 2;
}
@keyframes cl-spin { to { transform: rotate(360deg); } }

.cl-cam {
  margin: 0 12px;
  padding: 18px 16px 16px;
  background: #fff;
  border-radius: 22px;
  border: 1px solid #e8eef5;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  text-align: center;
}
.cl-cam-kicker {
  font-size: .75rem;
  font-weight: 800;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cl-cam-title {
  margin: 6px 0 4px;
  font-size: 1.28rem;
  font-weight: 800;
  color: #0f172a;
}
.cl-cam-hint {
  margin: 0 0 14px;
  color: #64748b;
  font-size: .88rem;
}
.cl-cam-shot {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 148px;
  border-radius: 18px;
  background: linear-gradient(160deg, #ecfdf5, #f0f9ff);
  border: 1.5px dashed #86efac;
  cursor: pointer;
  padding: 18px;
  -webkit-tap-highlight-color: transparent;
}
.cl-cam-shot input { display: none; }
.cl-cam-ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #16a34a;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(22, 163, 74, .28);
}
.cl-cam-shot strong {
  font-size: 1.05rem;
  color: #0f172a;
}
.cl-cam-shot small {
  color: #64748b;
  font-size: .75rem;
}
.cl-cam-shot.is-busy {
  opacity: .7;
  pointer-events: none;
}
.cl-cam-status {
  margin-top: 10px;
  font-size: .82rem;
  font-weight: 700;
  color: #0ea5e9;
}
.cl-finish {
  margin: 14px 12px 0;
  padding: 16px;
  background: #fff;
  border-radius: 22px;
  border: 1px solid #e8eef5;
}
.cl-finish h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #0f172a;
}
.cl-finish .field { margin-top: 12px; }
.cl-finish-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.cl-btn-primary,
.cl-btn-warn {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
.cl-btn-primary {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 163, 74, .25);
}
.cl-btn-warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.cl-duration-box {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4, #fff);
}
.cl-duration-badge {
  font-size: .9rem;
  font-weight: 800;
  color: #15803d;
  background: #dcfce7;
  border-radius: 999px;
  padding: 4px 10px;
}
.cl-duration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cl-duration-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
  color: #0f172a;
}
.cl-duration-total { color: #15803d !important; font-size: 1.2rem !important; }
@media (max-width: 640px) {
  .cl-duration-grid { grid-template-columns: 1fr; }
}
.cl-mgr-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cl-mgr-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.cl-mgr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cl-mgr-thumb span,
.cl-mgr-thumb.is-empty span {
  position: absolute;
  left: 5px;
  top: 5px;
  background: rgba(15,23,42,.7);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.cl-mgr-thumb.is-empty {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: .75rem;
}

.cl-account {
  padding: 16px 14px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.cl-account-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.cl-account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(160deg, #16a34a, #0f766e);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.cl-account-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  color: #0f172a;
}
.cl-account-hero p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: .86rem;
}
.cl-account-card {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}
.cl-account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .9rem;
}
.cl-account-row:last-child { border-bottom: 0; }
.cl-account-row span { color: #64748b; }
.cl-account-row strong {
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}
.cl-account-pass h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: #0f172a;
}
.cl-account-pass .field { margin-top: 12px; }
.cl-account-pass .cl-btn-primary {
  width: 100%;
  margin-top: 14px;
}
.cl-account-logout {
  display: block;
  text-align: center;
  margin-top: 8px;
  padding: 14px;
  border-radius: 14px;
  color: #b91c1c;
  font-weight: 800;
  text-decoration: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

/* ===== POS COUNTER KANBAN ===== */
.pos-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.pos-col {
  background: #fff;
  border: 1px solid #ebe8f4;
  border-radius: 18px;
  padding: 14px;
  min-height: 280px;
  box-shadow: 0 8px 22px rgba(55, 40, 120, .05);
}
.pos-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.pos-col-head strong { color: #1f1638; }
.pos-count {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eeebff;
  color: #4f46d8;
  font-size: .78rem;
  font-weight: 750;
}
.pos-empty {
  padding: 18px 10px;
  text-align: center;
  font-size: .88rem;
}
.pos-card {
  border: 1px solid #efeef6;
  border-radius: 14px;
  padding: 12px;
  background: #fbfaff;
  margin-bottom: 10px;
}
.pos-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.pos-card-sum {
  margin: 0 0 6px;
  font-size: .92rem;
  color: #3b4254;
}
.pos-card-btn {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  min-height: 42px;
  font-weight: 750;
}
.pos-foot-tips {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  color: #4b5568;
  font-size: .84rem;
}
@media (max-width: 960px) {
  .pos-board { grid-template-columns: 1fr; }
}

/* ===== DEPOSIT SLIP (gọn Kiot) ===== */
.dep-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .85fr);
  gap: 10px;
  align-items: start;
}
.dep-slip {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: none;
  padding: 12px;
  position: sticky;
  top: 10px;
}
.dep-amount-box {
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #92400e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: .88rem;
}
.dep-amount-box strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #b45309;
}
@media (max-width: 960px) {
  .dep-layout { grid-template-columns: 1fr; }
  .dep-slip { position: static; }
}

/* ===== BOOKING CREATE (vào phòng — gọn Kiot) ===== */
.bk-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.bk-kicker {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #64748b;
}
.bk-title {
  margin: 2px 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #0f172a;
}
.bk-sub { margin: 0; color: #94a3b8; font-size: .8rem; }
.bk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .85fr);
  gap: 10px;
  align-items: start;
}
.bk-card,
.bk-quote {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: none;
}
.bk-card { padding: 12px; }
.bk-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}
.bk-card-head strong { font-size: .95rem; color: #0f172a; flex: 0 0 auto; }
.bk-card-head .sh-loc { flex: 1 1 auto; text-align: right; }
.bk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.bk-span-2 { grid-column: 1 / -1; }
.bk-grid .field label {
  display: block;
  margin-bottom: 3px;
  font-size: .72rem;
  font-weight: 600;
  color: #64748b;
}
.bk-grid .field input,
.bk-grid .field select {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 0 10px;
  font-size: .86rem;
}
.bk-grid .field input[readonly] {
  background: #f1f5f9;
  color: #334155;
  cursor: default;
}
.bk-grid .field input:focus,
.bk-grid .field select:focus {
  border-color: #0066cc;
  background: #fff;
  outline: none;
}
.bk-grid .field input[readonly] {
  background: #f8fafc;
  color: #64748b;
}
.bk-optional {
  margin-top: 10px;
  border-top: 1px dashed #e5e7eb;
  padding-top: 8px;
}
.bk-optional summary {
  cursor: pointer;
  color: #0066cc;
  font-weight: 600;
  font-size: .82rem;
}
.bk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef0f3;
}
/* .btn ghi đè UA [hidden] → lộ nút submit ảo (ô xanh dư dưới form) */
.bk-submit-real[hidden],
button.btn[hidden] {
  display: none !important;
}
.bk-submit {
  min-width: 132px;
  min-height: 34px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: none;
}
.bk-quote { padding: 12px; position: sticky; top: 10px; }
.bk-quote-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.bk-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.bk-badge.warn { background: #fff6d8; color: #a16207; }
.bk-badge.ok { background: #e8faf0; color: #12805a; }
.bk-quote-rows { display: grid; gap: 6px; }
.bk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: .84rem;
  min-width: 0;
}
.bk-row > span:first-child { flex: 0 0 auto; }
.bk-row strong {
  color: #0f172a;
  font-weight: 700;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.sh-loc {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.sh-shift-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: .92rem;
}
.sh-shift-locked strong { font-size: 1rem; }
.sh-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.sh-hero-actions .period-form { flex: 0 0 auto; }
.sh-close-now {
  flex: 0 0 auto;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
}
.hero-panel.compact .sh-hero-actions { margin-left: 12px; }
.bk-row.total {
  padding-top: 6px;
  border-top: 1px solid #eef0f3;
  font-size: .9rem;
  color: #0f172a;
}
.bk-row.total strong { font-size: 1rem; }
.bk-row.soft,
.bk-row.soft strong {
  color: #94a3b8;
  font-weight: 600;
}
.bk-after {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f0fdfa;
  color: #0f766e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: .84rem;
}
.bk-after strong { font-size: .98rem; font-weight: 800; }
.bk-tips {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: .76rem;
}
.bk-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: .76rem;
  line-height: 1.35;
}

/* Giờ 24h — compact HH:mm + panel chọn */
.time24 {
  --t24-h: 30px;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  height: var(--t24-h);
  min-height: var(--t24-h);
  border: 1px solid #d1d5da;
  border-radius: 8px;
  background: #fff;
  vertical-align: middle;
  z-index: 1;
}
.time24.is-open { z-index: 80; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, .18); }
.time24.is-locked { background: #f1f5f9; color: #64748b; }
.time24-face {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 8px 0 7px;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  line-height: 1;
}
.time24-face:disabled { cursor: not-allowed; color: #94a3b8; }
.time24-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex: 0 0 auto;
}
.time24.is-open .time24-icon { color: #2563eb; }
.time24-seg {
  min-width: 1.35em;
  font-size: .84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1;
  text-align: center;
}
.time24-sep {
  width: 5px;
  text-align: center;
  font-size: .84rem;
  font-weight: 800;
  color: #0f172a;
  user-select: none;
}
.time24-seg.is-active { color: #1d4ed8; }

.time24-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 148px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  overflow: hidden;
  z-index: 90;
}
.time24-pop[hidden] { display: none !important; }
.time24-pop-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-height: 200px;
}
.time24-col {
  min-width: 0;
  border-right: 1px solid #eef2f7;
  display: flex;
  flex-direction: column;
  max-height: 200px;
}
.time24-col:last-child { border-right: 0; }
.time24-col.is-focus { background: #f8fbff; }
.time24-col-label {
  padding: 6px 8px 2px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #94a3b8;
}
.time24-col-list {
  overflow: auto;
  padding: 3px;
  max-height: 168px;
  scroll-behavior: smooth;
}
.time24-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .84rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.time24-opt:hover { background: #e8f0fe; }
.time24-opt.is-on {
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}
.kv-book-field .time24,
.field .time24 { width: max-content; max-width: 100%; }

/* Khách hàng: tên + nút thêm trong ô; SĐT riêng */
.bk-name-wrap,
.kv-book-name-wrap {
  display: flex;
  align-items: stretch;
  min-height: 42px;
  border: 1px solid #d1d5da;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.bk-name-wrap > input,
.kv-book-name-wrap > input {
  min-width: 0;
  flex: 1;
  width: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
}
.bk-name-wrap > input:focus,
.kv-book-name-wrap > input:focus {
  outline: none;
}
.bk-name-wrap:focus-within,
.kv-book-name-wrap:focus-within {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.bk-phone-wrap,
.kv-book-phone-wrap {
  position: relative;
  display: block;
}
.bk-phone-wrap > input,
.kv-book-phone-wrap > input { min-width: 0; width: 100%; }
.bk-cust-edit,
.bk-cust-add,
.kv-book-cust-edit,
.kv-book-cust-add {
  width: 42px;
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid #e2e8f0;
  border-radius: 0;
  background: #0f766e;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.bk-cust-edit,
.kv-book-cust-edit {
  background: #334155;
  font-size: 1rem;
}
.bk-cust-edit:hover,
.kv-book-cust-edit:hover { background: #1e293b; }
.bk-cust-add:hover,
.kv-book-cust-add:hover { background: #0d9488; }
.bk-cust-edit[hidden],
.kv-book-cust-edit[hidden] { display: none !important; }
.bk-phone-wrap .kv-book-suggest,
.kv-book-phone-wrap .kv-book-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid #d1d5da;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15,23,42,.14);
  max-height: 220px;
  overflow: auto;
}
.kv-book-suggest[hidden] { display: none !important; }
.kv-book-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}
.kv-book-suggest button:hover { background: #f1f5f9; }
.kv-cust-dialog {
  border: 0;
  padding: 0;
  border-radius: 14px;
  width: min(440px, calc(100vw - 24px));
  max-width: 100%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  background: #fff;
  z-index: 12000;
}
.kv-cust-dialog::backdrop {
  background: rgba(15, 23, 42, .55);
}
.kv-cust-modal .kv-book-modal-head,
.kv-cust-dialog .kv-book-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.kv-cust-modal .kv-book-modal-head h3,
.kv-cust-dialog .kv-book-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.kv-cust-body {
  display: grid;
  gap: 10px;
  padding: 14px 16px 8px;
}
.kv-cust-body .kv-book-field,
.kv-cust-body label {
  display: grid;
  gap: 4px;
  font-size: .82rem;
  color: #475569;
}
.kv-cust-body input {
  height: 40px;
  border: 1px solid #d1d5da;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  color: #0f172a;
}
.kv-cust-body em { color: #ef4444; font-style: normal; }
.kv-cust-err {
  margin: 0;
  color: #b91c1c;
  font-size: .82rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 10px;
}
.kv-cust-dialog .kv-book-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px 16px;
}
.kv-cust-dialog .kv-btn-primary,
.kv-cust-dialog .kv-btn-ghost {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.kv-cust-dialog .kv-btn-primary {
  border: 0;
  background: #0f766e;
  color: #fff;
}
.kv-cust-dialog .kv-btn-ghost {
  border: 1px solid #d1d5da;
  background: #f8fafc;
  color: #334155;
}

/* Ảnh CCCD check-in */
.cccd-upload {
  --cccd-ink: #1e293b;
  --cccd-muted: #64748b;
  --cccd-line: #dbe3ef;
  --cccd-soft: #f4f7fb;
  --cccd-accent: #0f766e;
  --cccd-accent-soft: #ecfdf5;
  display: grid;
  gap: 10px;
}
.cccd-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cccd-upload-drop {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1.5px dashed var(--cccd-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--cccd-soft) 100%);
  color: var(--cccd-ink);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cccd-upload-drop:hover,
.cccd-upload-drop:focus-visible,
.cccd-upload-drop.is-drag {
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
  background: linear-gradient(180deg, #fff 0%, var(--cccd-accent-soft) 100%);
  outline: none;
}
.cccd-upload-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--cccd-accent);
  background: var(--cccd-accent-soft);
  border: 1px solid #99f6e4;
}
.cccd-upload-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.cccd-upload-copy strong {
  font-size: .92rem;
  font-weight: 750;
  color: var(--cccd-ink);
}
.cccd-upload-copy span {
  font-size: .78rem;
  color: var(--cccd-muted);
  line-height: 1.35;
}
.cccd-upload-btns {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cccd-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cccd-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.cccd-btn-cam {
  border-color: #99f6e4;
  background: var(--cccd-accent-soft);
  color: #115e59;
}
.cccd-btn-cam:hover {
  border-color: #5eead4;
  background: #d1fae5;
}
.cccd-upload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cccd-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cccd-line);
  background: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.cccd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cccd-thumb-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.cccd-thumb-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: .68rem;
  color: #f8fafc;
  background: linear-gradient(transparent, rgba(15, 23, 42, .78));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cccd-thumb-status {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(15, 23, 42, .72);
  color: #fff;
}
.cccd-thumb.is-uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .28);
}
.cccd-thumb.is-uploading .cccd-thumb-status { background: #0f766e; }
.cccd-thumb.is-done .cccd-thumb-status { background: #15803d; }
.cccd-thumb.is-error .cccd-thumb-status { background: #b91c1c; }
.co-cccd {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
}
.co-cccd-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.co-cccd-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.co-cccd-thumb {
  position: relative;
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  background: #fff;
  text-decoration: none;
}
.co-cccd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.co-cccd-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  font-size: 11px;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
}
.co-cccd-missing {
  color: #c2410c;
  font-size: .82rem;
  font-weight: 700;
}
.co-cccd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.co-cccd-btn {
  cursor: pointer;
  margin: 0;
}
.cccd-upload-hint {
  margin: 0;
}

/* Phiếu in chốt ca */
.sh-print-page { max-width: 720px; margin: 0 auto; }
.sh-print-toolbar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.sh-slip {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 22px 24px;
}
.sh-slip-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}
.sh-slip-brand {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 700;
}
.sh-slip-head h1 {
  margin: 4px 0 0;
  font-size: 1.45rem;
}
.sh-slip-meta {
  display: grid;
  gap: 4px;
  min-width: 220px;
  font-size: .9rem;
}
.sh-slip-meta span {
  color: #6b7280;
  margin-right: 8px;
}
.sh-slip-table {
  width: 100%;
  border-collapse: collapse;
}
.sh-slip-table td {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .95rem;
}
.sh-slip-table td.right { text-align: right; font-weight: 650; }
.sh-slip-table tr.is-total td {
  font-weight: 800;
  border-top: 1px solid #dbe3ef;
  padding-top: 12px;
}
.sh-slip-table tr.is-diff td { color: #b45309; }
.sh-slip-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
}
.sh-slip-sign span {
  display: block;
  color: #6b7280;
  font-size: .82rem;
  margin-bottom: 28px;
}
.sh-slip-sign em {
  display: block;
  min-height: 1.2em;
  font-style: normal;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  text-align: center;
}
.sh-slip-foot {
  margin: 18px 0 0;
  color: #94a3b8;
  font-size: .78rem;
}
@media print {
  .sh-print-toolbar { display: none !important; }
  .sh-slip {
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
}
@media (max-width: 640px) {
  .cccd-upload-drop {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .cccd-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .bk-layout { grid-template-columns: 1fr; }
  .bk-quote { position: static; }
}
@media (max-width: 640px) {
  .bk-grid { grid-template-columns: 1fr; }
  .bk-span-2 { grid-column: auto; }
  .bk-actions .btn,
  .bk-submit { width: 100%; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions { display: none !important; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
}

/* ===== INVENTORY LAYOUT (cache-safe tail) ===== */
.inv-stock-kpis {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.inv-kpi {
  display: block;
  background: #fff;
  border: 1px solid #ebe8f4;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(55, 40, 120, .05);
}
.inv-kpi-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8b92a5;
  margin-bottom: 6px;
}
.inv-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1f1638;
}
.inv-kpi.is-ok .inv-kpi-val { color: #12805a; }
.inv-kpi.is-glow .inv-kpi-val { color: #4f46d8; }
.inv-kpi.is-warn .inv-kpi-val { color: #a16207; }
.inv-kpi.is-danger .inv-kpi-val { color: #b91c1c; }
.inv-hub-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.inv-hub-card {
  display: grid !important;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #ebe8f4;
  background: #fff;
  box-shadow: 0 8px 20px rgba(55, 40, 120, .05);
  text-decoration: none !important;
  color: #1f1638 !important;
}
.inv-hub-card span { color: #8b92a5; font-size: .84rem; line-height: 1.35; }
.inv-home-cols {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.inv-home-cols.is-single { grid-template-columns: 1fr !important; }
.inv-zero-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.inv-filter {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
}
@media (max-width: 1100px) {
  .inv-stock-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .inv-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
  .inv-stock-kpis,
  .inv-hub-grid,
  .inv-home-cols { grid-template-columns: 1fr !important; }
}

/* ===== BILL MANAGEMENT (compact / page-focus) ===== */
.bill-mgmt .bk-top { margin-bottom: 12px; }
.bill-mgmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.bill-mgmt-actions .btn,
.bill-mgmt-actions .bm-btn {
  min-height: 34px;
}
.bill-mgmt-table .table-actions .bm-btn {
  min-height: 28px;
}
.bill-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.bill-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  text-decoration: none !important;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.bill-kpi-card strong {
  font-size: 1.25rem;
  letter-spacing: -.02em;
  color: #0f172a;
}
.bill-kpi-card.is-await strong { color: #c2410c; }
.bill-kpi-card.is-cancel strong { color: #b91c1c; }
.bill-kpi-card.is-active {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(0, 112, 244, .12);
  background: #f8fbff;
}
.bill-kpi-card:hover { border-color: #93c5fd; }
.bill-mgmt-filter {
  margin-bottom: 10px;
  padding: 10px 12px !important;
}
.bill-mgmt-filter input[type="date"],
.bill-mgmt-filter input[type="search"] {
  height: 34px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 0 10px;
  font-size: .86rem;
  width: 100%;
  box-sizing: border-box;
}
.bill-mgmt-tabs { margin-bottom: 10px; }
.bill-mgmt-table-wrap {
  padding: 0 !important;
  overflow: hidden;
  margin-bottom: 0 !important;
}
.bill-mgmt-table td,
.bill-mgmt-table th {
  padding: 8px 10px;
  font-size: .88rem;
  vertical-align: top;
}
.bill-mgmt-table tr.is-clickable { cursor: pointer; }
.bill-mgmt-table tr.is-clickable:hover td { background: #f0f7ff; }
.bill-mgmt-table .bill-code-link { color: #0f172a; }
.bill-mgmt-table .bill-payable { white-space: nowrap; }
.bill-mgmt-table .table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}
.bill-mgmt-table .table-actions .btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: .8rem;
}
.bill-mgmt-table .nowrap { white-space: nowrap; }
.bill-page .bill-card h2 {
  margin: 2px 0;
  font-size: 1.05rem;
}
.page-focus .hub-nav {
  margin-bottom: 10px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .bill-kpi { grid-template-columns: 1fr; }
  .bill-mgmt-table .table-actions { justify-content: flex-start; }
}


/* Nhân sự — tab phụ + lịch ca */
.hr-subnav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
}
.hr-subnav::-webkit-scrollbar { display: none; }
.hr-subnav-item { flex: 0 0 auto; white-space: nowrap; }
.hr-subnav-item {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 650;
  color: #475569;
  text-decoration: none;
}
.hr-subnav-item:hover { background: #fff; color: #0f172a; }
.hr-subnav-item.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
/* ===== Sắp xếp ca — gọn, mật độ cao ===== */
.sch-page {
  --sch-line: #e6e8eb;
  --sch-muted: #6b7280;
  --sch-blue: var(--kv-blue, #0070f4);
  display: grid;
  gap: 10px;
}
.sch-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--sch-line);
  border-radius: 8px;
}
.sch-kicker {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sch-muted);
}
.sch-title {
  margin: 2px 0 4px;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -.02em;
  color: #15171a;
}
.sch-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .82rem;
}
.sch-links a { color: var(--sch-blue); text-decoration: none; font-weight: 600; }
.sch-links .sch-dot { color: #cbd5e1; font-weight: 700; }
.sch-links a b {
  display: inline-block;
  min-width: 1.1em;
  padding: 0 5px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: .72rem;
}
.sch-weekbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sch-weekbar-inline {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.sch-weekbar select,
.sch-weekbar input[type="date"] {
  height: 34px;
  border: 1px solid var(--sch-line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  font-size: .84rem;
  flex: 0 0 auto;
}
.sch-weekbar select.sch-weekbar-branch {
  max-width: 210px;
  min-width: 140px;
}
.sch-weekbar select.sch-weekbar-year {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
}
.sch-top-main {
  min-width: 0;
  flex: 1 1 auto;
}
@media (max-width: 720px) {
  .sch-top { flex-wrap: wrap; }
  .sch-weekbar { flex-wrap: wrap; white-space: normal; }
  .sch-weekbar select.sch-weekbar-branch { max-width: min(210px, 70vw); }
}
.sch-navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--sch-line);
  border-radius: 6px;
  background: #fff;
  color: #15171a;
  font-size: 1.1rem;
  line-height: 1;
  text-decoration: none;
  font-weight: 600;
}
.sch-navbtn:hover { background: #f3f4f6; }
.sch-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: #eef2f7;
  font-size: .8rem;
  font-weight: 700;
  color: #334155;
}

.sch-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.sch-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--sch-line);
  border-radius: 8px;
}
.sch-stat span {
  font-size: .72rem;
  font-weight: 600;
  color: var(--sch-muted);
}
.sch-stat b {
  font-size: 1.05rem;
  font-weight: 750;
  color: #15171a;
  letter-spacing: -.02em;
}
.sch-stat.is-ok b { color: #00a63e; }
.sch-stat.is-warn b { color: #d97706; }

.sch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--sch-line);
  border-radius: 8px;
}
.sch-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.sch-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.sch-save-status {
  font-size: .75rem;
  font-weight: 650;
  color: var(--sch-muted);
  white-space: nowrap;
}
.sch-save-status.is-busy { color: #1d4ed8; }
.sch-save-status.is-ok { color: #00a63e; }
.sch-save-status.is-err { color: #b91c1c; }
.sch-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.sch-field > span {
  font-size: .68rem;
  font-weight: 600;
  color: var(--sch-muted);
}
.sch-field select,
.sch-field input[type="date"] {
  height: 32px;
  border: 1px solid var(--sch-line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  font-size: .82rem;
  min-width: 120px;
}
.sch-page label.sch-check,
.sch-dialog label.sch-check {
  display: inline-flex !important;
  align-items: center !important;
  flex-direction: row !important;
  gap: 6px !important;
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  font-size: .8rem !important;
  font-weight: 650;
  color: #334155 !important;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  width: auto !important;
}
.sch-page label.sch-check-plain,
.sch-dialog label.sch-check-plain {
  padding-top: 2px !important;
}
.sch-page label.sch-field,
.sch-dialog label.sch-field {
  display: grid !important;
  margin: 0 !important;
  margin-bottom: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
}
.sch-dialog label.sch-check input[type="checkbox"] {
  position: static !important;
  opacity: 1 !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  pointer-events: auto !important;
  flex: 0 0 auto;
}
.sch-cell.is-saving {
  outline: 1px solid #93c5fd;
  outline-offset: -1px;
  background: #f8fbff;
}

/* Popup sao chép tuần */
.sch-dialog {
  border: none;
  padding: 0;
  border-radius: 12px;
  max-width: min(420px, calc(100vw - 24px));
  width: 100%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}
.sch-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.sch-dialog-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fff;
}
.sch-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sch-dialog-head strong {
  font-size: 1rem;
  font-weight: 750;
}
.sch-dialog-x {
  border: 0;
  background: #f3f4f6;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.sch-dialog-x:hover { background: #e5e7eb; color: #0f172a; }
.sch-dialog-desc {
  margin: 0;
  font-size: .86rem;
  color: #475569;
  line-height: 1.4;
}
.sch-dialog-grid {
  display: grid;
  gap: 10px;
}
.sch-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.sch-board {
  background: #fff;
  border: 1px solid var(--sch-line);
  border-radius: 8px;
  overflow: hidden;
}
.sch-board-head,
.sch-board-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
}
.sch-board-head {
  border-bottom: 1px solid var(--sch-line);
  background: #fafbfc;
}
.sch-board-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.sch-board-head strong {
  font-size: .9rem;
  font-weight: 750;
}
.sch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: .68rem;
  color: #64748b;
}
.sch-legend b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e6f1fe;
  color: #1d4ed8;
  font-size: .65rem;
}
.sch-board-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sch-board-foot {
  border-top: 1px solid var(--sch-line);
  background: #fafbfc;
}
.sch-hint {
  font-size: .72rem;
  color: var(--sch-muted);
}
.sch-empty {
  padding: 18px 12px !important;
  text-align: center;
  color: var(--sch-muted);
  font-size: .86rem;
}

.schedule-wrap {
  overflow: auto;
  max-height: min(70vh, 720px);
}
.schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .8rem;
}
.schedule-table th,
.schedule-table td {
  border-bottom: 1px solid var(--sch-line);
  border-right: 1px solid #f1f3f5;
  padding: 5px 6px;
  vertical-align: middle;
}
.schedule-table td.sch-cell { vertical-align: top; }
.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
}
.schedule-table th.day-h {
  text-align: center;
  min-width: 92px;
  line-height: 1.15;
  padding: 8px 4px;
}
.schedule-table th.day-h small {
  display: block;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 2px;
  font-size: .7rem;
}
.schedule-table .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  min-width: 148px;
  max-width: 180px;
  border-right: 1px solid var(--sch-line);
}
.schedule-table thead .sticky-col {
  z-index: 5;
  background: #f8fafc;
}
.sch-emp {
  display: grid;
  gap: 2px;
}
.sch-emp strong {
  font-size: .82rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.sch-emp span {
  font-size: .7rem;
  color: var(--sch-muted);
  line-height: 1.2;
}

.sch-cell.is-set { background: #f0f7ff; }
.sch-cell.is-off,
.sch-cell.mark-off { background: #fff5f5; }
/* Off giữ ca để đối chiếu — chỉ làm mờ chip ca, vẫn chỉnh được */
.sch-cell.mark-off .sch-chip-shift { opacity: .55; }
.sch-cell.mark-off .sch-off-toggle { opacity: 1; }
.sch-cell.is-locked {
  background: #f3f4f6;
  position: relative;
}
.sch-page label.sch-chip-shift.is-locked,
.sch-page label.sch-off-toggle.is-locked {
  opacity: .55;
  cursor: not-allowed;
}
.sch-page label.sch-chip-shift.is-locked span,
.sch-page label.sch-off-toggle.is-locked span {
  border-style: solid;
  border-color: #cbd5e1;
  background: #e5e7eb;
  color: #64748b;
}
.sch-lock-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sch-legend-lock {
  color: #64748b !important;
  font-weight: 650;
}

.sch-cell-inner {
  display: grid;
  gap: 4px;
}
.sch-shifts {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
}
.sch-page label.sch-chip-shift {
  display: inline-flex !important;
  align-items: center;
  cursor: pointer;
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  width: auto !important;
  color: inherit !important;
  font-size: inherit !important;
  user-select: none;
  flex-direction: row !important;
}
.sch-page .sch-chip-shift input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
}
.sch-page .sch-chip-shift span {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid #dbe1e8;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.sch-page .sch-chip-shift:hover span { border-color: #93c5fd; color: #1d4ed8; }
.sch-page .sch-chip-shift input:checked + span {
  background: #e6f1fe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.sch-page .sch-chip-shift input:checked + span i { color: #60a5fa; }
.sch-page .sch-chip-shift input:focus-visible + span {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}
.sch-page label.sch-off-toggle {
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  color: inherit !important;
  font-size: inherit !important;
}
.sch-page label.sch-off-toggle input {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  pointer-events: none !important;
}
.sch-page label.sch-off-toggle span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  border: 1px dashed #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #94a3b8;
  font-size: .65rem;
  font-weight: 700;
}
.sch-page label.sch-off-toggle:hover span { border-color: #fca5a5; color: #b91c1c; }
.sch-page label.sch-off-toggle input:checked + span,
.sch-page .sch-cell.mark-off label.sch-off-toggle span {
  background: #fee2e2;
  border-style: solid;
  border-color: #fecaca;
  color: #b91c1c;
}
.sch-page .sch-off-reason {
  display: none;
  width: 100%;
  height: 22px;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff;
  font-size: .65rem;
  color: #b91c1c;
  padding: 0 4px;
}
.sch-page .sch-cell.mark-off .sch-off-reason {
  display: block;
}
.sch-off-badge {
  display: inline-block;
  font-weight: 800;
  font-size: .68rem;
  letter-spacing: .04em;
  color: #b91c1c;
  background: #fee2e2;
  padding: 2px 7px;
  border-radius: 999px;
}
.sch-off-why {
  margin-top: 4px;
  font-size: .68rem;
  color: #9f1239;
  line-height: 1.2;
}

.sch-fab {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 40;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--sch-blue, #0070f4);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
  cursor: pointer;
}
.sch-fab:hover { filter: brightness(1.05); }
@media (min-width: 900px) {
  .sch-fab { bottom: 24px; }
}
@media (max-width: 720px) {
  .sch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sch-toolbar { align-items: stretch; }
  .sch-filter,
  .sch-toolbar-actions { width: 100%; }
  .sch-toolbar-actions { justify-content: flex-start; margin-left: 0; }
  .schedule-table .sticky-col { min-width: 120px; }
  .schedule-table th.day-h { min-width: 96px; }
  .schedule-wrap { max-height: min(62vh, 560px); }
}

/* Danh sách tuần — lưới ô cả năm */
.sch-list-board .sch-board-head {
  align-items: flex-start;
}
.sch-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sch-create-current,
.sch-inline-form { display: inline; margin: 0; }
.sch-empty-msg {
  margin: 8px 0;
  padding: 16px;
  background: #fff;
  border: 1px dashed var(--sch-line);
  border-radius: 8px;
  color: var(--sch-muted);
  font-size: .9rem;
}
.sch-list-legend {
  gap: 8px 14px !important;
}
.sch-dot-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
  border: 1px solid transparent;
}
.sch-dot-swatch.is-current { background: #0070f4; }
.sch-dot-swatch.is-published { background: #22c55e; }
.sch-dot-swatch.is-draft { background: #f59e0b; }
.sch-dot-swatch.is-empty {
  background: #fff;
  border-color: #cbd5e1;
}

.sch-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  padding: 14px;
  background: #eef2f6;
}
.sch-week-tile {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 11px 11px 10px;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  min-height: 112px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.sch-week-tile:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
  transform: translateY(-2px);
}
.sch-week-tile.is-published {
  border-color: #86efac;
  background: #f3fdf6;
}
.sch-week-tile.is-draft {
  border-color: #cbd5e1;
  background: #fff;
}
.sch-week-tile.is-draft .sch-week-tile-top b { color: #334155; }
.sch-week-tile.is-published .sch-week-tile-top b { color: #166534; }
.sch-week-tile.is-empty {
  background: #f8fafc;
  border-style: dashed;
  border-color: #d1d5db;
  box-shadow: none;
}
.sch-week-tile.is-empty:hover {
  border-style: solid;
  border-color: #93c5fd;
  background: #fff;
}
.sch-week-tile.is-current {
  border-color: #0070f4;
  background: #f0f7ff;
  box-shadow: 0 0 0 2px rgba(0, 112, 244, .2);
}
.sch-week-tile.is-current.is-published {
  background: #ecfdf3;
  border-color: #0070f4;
}
.sch-week-tile.is-current::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: #0070f4;
}
.sch-week-tile-btn {
  display: grid;
  gap: 5px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.sch-week-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sch-week-tile-top b {
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #0f172a;
}
.sch-week-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.sch-week-badge.is-draft {
  background: #fef3c7;
  color: #b45309;
}
.sch-week-badge.is-published {
  background: #dcfce7;
  color: #15803d;
}
.sch-week-badge.is-empty {
  background: #eef2f7;
  color: #64748b;
}
.sch-week-tile-range {
  font-size: .78rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: -.01em;
}
.sch-week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.sch-week-days span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  border-radius: 5px;
  background: #eef2f7;
  color: #475569;
  font-size: .64rem;
  font-weight: 700;
}
.sch-week-tile.is-published .sch-week-days span {
  background: #bbf7d0;
  color: #14532d;
}
.sch-week-tile.is-draft .sch-week-days span {
  background: #e8eef6;
  color: #334155;
}
.sch-week-tile.is-current .sch-week-days span {
  background: #dbeafe;
  color: #1d4ed8;
}
.sch-week-tile.is-current.is-published .sch-week-days span {
  background: #bbf7d0;
  color: #14532d;
}
.sch-week-tile.is-empty .sch-week-days span {
  background: #fff;
  border: 1px dashed #e2e8f0;
  color: #94a3b8;
}
.sch-week-fill {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.sch-week-fill i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0070f4;
  min-width: 0;
}
.sch-week-tile.is-published .sch-week-fill i { background: #16a34a; }
.sch-week-tile.is-draft .sch-week-fill i { background: #64748b; }
.sch-week-tile.is-current .sch-week-fill i { background: #0070f4; }
.sch-week-fill.is-ghost { background: #edf0f3; }
.sch-week-fill.is-ghost i { width: 0; }
.sch-week-tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: .68rem;
  font-weight: 650;
  color: #64748b;
}
.sch-week-tile.is-empty .sch-week-tile-meta { color: #94a3b8; }

.sch-kicker a {
  color: var(--sch-blue);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: none;
  font-size: .78rem;
}
.sch-weekbar-static { gap: 8px; }
.sch-field input[type="number"] {
  height: 32px;
  border: 1px solid var(--sch-line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  font-size: .82rem;
  min-width: 100px;
}
@media (max-width: 720px) {
  .sch-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    gap: 7px;
  }
  .sch-week-tile { min-height: 100px; padding: 9px; }
}

.shift-rate-form input { width: 100%; min-width: 0; }

.text-ok { color: #15803d; }
.text-danger { color: #b91c1c; }

/* ===== Dòng tiền CTY — layout giữa, hiện đại, đồng bộ KV blue ===== */
.app-shell .page-body:has(.cc-page) {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.cc-page {
  --cc-blue: #0070f4;
  --cc-blue-2: #2b8af6;
  --cc-blue-soft: #e8f2ff;
  --cc-ink: #0f172a;
  --cc-muted: #64748b;
  --cc-line: #e2e8f0;
  --cc-bg: #f1f5f9;
  --cc-card: #ffffff;
  --cc-radius: 14px;
  --cc-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
  width: 100%;
  max-width: none;
  margin: 0 !important;
  padding: 0;
  box-sizing: border-box;
  color: var(--cc-ink);
}

/* Header: title trái · filter phải (desktop) */
.cc-page .cc-app-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 18px;
  margin: 0 0 14px;
  padding: 4px 2px 0;
}
.cc-page .cc-app-title {
  min-width: 0;
  flex: 1 1 auto;
}
.cc-page .cc-app-title .eyebrow {
  margin: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cc-blue);
}
.cc-page .cc-app-title .hero-title {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 1.15rem + .6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: var(--cc-ink);
}
.cc-page .cc-app-sub {
  margin: 4px 0 0;
  color: var(--cc-muted);
  font-size: .82rem;
}

.cc-page .cc-app-filters,
.cc-page .cc-hero .period-form {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 8px;
  background: var(--cc-card);
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  box-shadow: var(--cc-shadow);
  box-sizing: border-box;
}
.cc-page .cc-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cc-page .cc-app-filters select,
.cc-page .cc-app-filters input[type="date"],
.cc-page .cc-app-filters input[type="week"],
.cc-page .cc-hero .period-form select,
.cc-page .cc-hero .period-form input[type="date"],
.cc-page .cc-hero .period-form input[type="week"] {
  border-radius: 999px;
  border: 1px solid var(--cc-line);
  background: #f8fafc;
  height: 34px;
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cc-ink);
  width: auto !important;
  min-width: 0 !important;
  max-width: 180px !important;
  box-sizing: border-box;
}
.cc-page .cc-app-filters select:focus,
.cc-page .cc-app-filters input:focus {
  border-color: var(--cc-blue);
  background: #fff;
  box-shadow: 0 0 0 3px var(--cc-blue-soft);
  outline: none;
}
.cc-page .cc-period-month:not(.is-hidden),
.cc-page .cc-period-week:not(.is-hidden),
.cc-page .cc-period-custom:not(.is-hidden),
.cc-period-month:not(.is-hidden),
.cc-period-week:not(.is-hidden),
.cc-period-custom:not(.is-hidden) {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  width: auto !important;
  max-width: 100% !important;
  align-items: center;
  box-sizing: border-box;
}
.cc-page .cc-period-month.is-hidden,
.cc-page .cc-period-week.is-hidden,
.cc-page .cc-period-custom.is-hidden,
.cc-period-month.is-hidden,
.cc-period-week.is-hidden,
.cc-period-custom.is-hidden {
  display: none !important;
}
.cc-page .cc-period-month > select,
.cc-page .cc-period-month > .kv-select-wrap,
.cc-page .cc-period-week > input,
.cc-page .cc-period-custom > input[type="date"],
.cc-page .cc-period-custom > .kv-select-wrap {
  width: auto !important;
  min-width: 0 !important;
  max-width: 140px !important;
  box-sizing: border-box !important;
}
.cc-page .cc-period-month .kv-select-trigger,
.cc-page .cc-period-custom .kv-select-trigger {
  width: auto !important;
  min-width: 0 !important;
  border-radius: 999px !important;
}

/* Legacy hero (nếu còn) */
.cc-page .cc-hero.hero-panel {
  background: var(--cc-card) !important;
  box-shadow: var(--cc-shadow) !important;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.cc-page .cc-hero .eyebrow {
  color: var(--cc-blue);
  letter-spacing: .08em;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .68rem;
}
.cc-page .cc-hero .hero-title {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cc-ink);
  letter-spacing: -.02em;
}
.cc-page .cc-hero { align-items: flex-start; }

/* Tabs */
.cc-tabs.hr-subnav {
  margin: 0 0 16px;
  padding: 4px;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  gap: 4px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
}
.cc-tabs .hr-subnav-item {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .84rem;
  font-weight: 650;
  color: var(--cc-muted);
  border: 0;
  background: transparent;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.cc-tabs .hr-subnav-item:hover {
  background: rgba(255,255,255,.7);
  color: var(--cc-ink);
}
.cc-tabs .hr-subnav-item.active {
  color: #fff !important;
  background: var(--cc-blue) !important;
  box-shadow: 0 6px 16px rgba(0, 112, 244, .28);
}

/* Banners */
.cc-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--cc-line);
  margin-bottom: 14px;
  background: var(--cc-card);
  font-size: .88rem;
  box-shadow: var(--cc-shadow);
}
.cc-banner-warn {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb, #fff);
  color: #92400e;
}
.cc-banner-danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2, #fff);
  color: #b91c1c;
}

/* KPI — luôn trải đều khung */
.cc-page .kpi-grid.cc-kpi {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .cc-page .kpi-grid.cc-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.cc-page .kpi-grid.cc-kpi .kpi {
  border-radius: var(--cc-radius);
  padding: 14px 14px 12px;
  box-shadow: var(--cc-shadow);
  background: var(--cc-card);
  border: 1px solid var(--cc-line);
  overflow: visible;
  position: relative;
  min-height: 0;
  min-width: 0;
}
.cc-page .kpi-grid.cc-kpi .kpi::before {
  content: "";
  display: block !important;
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cc-blue);
  opacity: .55;
  border-radius: 0;
}
.cc-page .kpi-grid.cc-kpi .kpi::after { display: none !important; }
.cc-page .kpi-grid.cc-kpi .kpi.ok::before { background: #12b76a; opacity: .9; }
.cc-page .kpi-grid.cc-kpi .kpi.warn::before { background: #f59e0b; opacity: .9; }
.cc-page .kpi-grid.cc-kpi .kpi.danger::before { background: #ef4444; opacity: .9; }
.cc-page .kpi-grid.cc-kpi .kpi.glow::before { background: var(--cc-blue); opacity: 1; }
.cc-page .kpi-grid.cc-kpi .kpi .label {
  text-transform: none;
  letter-spacing: 0;
  font-size: .74rem;
  font-weight: 650;
  color: var(--cc-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: normal;
  margin-bottom: 6px;
}
.cc-page .kpi-grid.cc-kpi .kpi .value {
  font-size: clamp(1.05rem, .95rem + .35vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--cc-ink);
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}
.cc-page .kpi-grid.cc-kpi .kpi .muted.tiny {
  margin-top: 4px;
  font-size: .72rem;
}
.cc-page .kpi.ok .value { color: #059669; }
.cc-page .kpi.warn .value { color: #c2410c; }
.cc-page .kpi.danger .value { color: #e11d48; }

/* Panels / tables */
.cc-page .panel {
  box-shadow: var(--cc-shadow) !important;
  border-radius: var(--cc-radius) !important;
  border: 1px solid var(--cc-line) !important;
  background: var(--cc-card);
  padding: 14px 16px;
  margin-bottom: 14px;
  overflow: hidden;
}
.cc-page .panel[style*="padding:0"],
.cc-page .panel[style*="padding: 0"] {
  padding: 0 !important;
}
.cc-page .panel-head {
  margin-bottom: 10px;
  padding-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cc-page .panel-head strong {
  font-size: .95rem;
  font-weight: 750;
  letter-spacing: -.01em;
}
.cc-panel-dispute {
  border-color: #fecaca !important;
}
.cc-page .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.cc-page .data-table.compact th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cc-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--cc-line);
  padding: 10px 12px;
  white-space: nowrap;
}
.cc-page .data-table td {
  border-bottom: 1px solid #f1f5f9;
  font-size: .86rem;
  padding: 11px 12px;
  vertical-align: middle;
}
.cc-page .data-table tbody tr:hover td {
  background: #f8fbff;
}
.cc-page .data-table tr.row-warn td { background: #fffbeb; }
.cc-page .data-table tr.row-danger td { background: #fef2f2; }
.cc-page .table-wrap {
  border-radius: 0 0 calc(var(--cc-radius) - 1px) calc(var(--cc-radius) - 1px);
}
.cc-page .pill {
  border-radius: 999px;
  font-weight: 700;
  font-size: .68rem;
  padding: 3px 8px;
}
.cc-page label {
  font-size: .8rem;
  font-weight: 650;
  color: #475569;
}
.cc-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.cc-page select,
.cc-page textarea {
  border-radius: 10px;
  border-color: var(--cc-line);
}
.cc-page input:focus,
.cc-page select:focus,
.cc-page textarea:focus {
  border-color: var(--cc-blue);
  box-shadow: 0 0 0 3px var(--cc-blue-soft);
  outline: none;
}
.cc-page .alert {
  border-radius: 12px;
  border: 1px solid var(--cc-line);
  background: #f8fafc;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.cc-page .cc-spend-create-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 14px;
}
.cc-page .cc-spend-create-wrap .btn {
  border-radius: 999px;
  font-weight: 700;
}

.cc-i {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: help;
  padding: 0;
  flex-shrink: 0;
}
.cc-i:hover {
  border-color: var(--cc-blue);
  color: var(--cc-blue);
  background: var(--cc-blue-soft);
}

.cc-proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}
.cc-proof-item {
  display: block;
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.cc-proof-item:hover { border-color: var(--cc-blue); }
.cc-proof-item img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  background: var(--cc-bg);
}
.cc-proof-pdf {
  height: 112px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .82rem;
  background: var(--cc-bg);
  color: var(--cc-muted);
}
.cc-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--cc-line);
  background: #f8fafc;
}
.cc-pager-links { display: flex; gap: 6px; }

/* Dialogs */
.cc-dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  max-width: min(420px, 94vw);
  width: calc(100% - 24px);
  margin: auto;
  background: transparent;
  box-shadow: none;
}
.cc-dialog.cc-dialog-create {
  max-width: min(480px, 94vw);
}
.cc-dialog[open] { display: block; }
.cc-dialog::backdrop {
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
}
.cc-dialog-card {
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  padding: 16px 18px 14px;
  display: grid;
  gap: 8px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .22);
}
.cc-create-type {
  margin: 2px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cc-blue-soft);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 750;
  font-size: .9rem;
  text-align: center;
}
.cc-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 2px;
}
.cc-create-grid label {
  display: grid;
  gap: 4px;
  font-size: .78rem;
  font-weight: 650;
  color: #475569;
  margin: 0;
}
.cc-create-grid input[type="checkbox"],
.cc-create-grid input[type="radio"] {
  width: auto;
  min-width: 16px;
  margin: 0;
}
.cc-month-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: stretch;
}
.cc-month-checks .cc-month-check {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 600;
  font-size: .78rem;
  line-height: 1.2;
  background: #f8fafc;
  box-sizing: border-box;
  min-width: 0;
}
.cc-month-checks .cc-month-check input {
  width: 16px !important;
  height: 16px;
  flex: 0 0 16px;
  accent-color: #0066cc;
}
.cc-month-checks .cc-month-check span {
  min-width: 0;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .cc-month-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cc-create-grid .cc-full { grid-column: 1 / -1; }
.cc-create-grid input,
.cc-create-grid select {
  width: 100%;
  box-sizing: border-box;
  font-weight: 400;
  color: var(--cc-ink);
  border-radius: 10px;
}
.cc-btn-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px 10px 12px;
  background: var(--cc-blue);
  color: #fff;
  font-weight: 750;
  font-size: .88rem;
  box-shadow: 0 10px 22px rgba(0, 112, 244, .28);
  cursor: pointer;
  white-space: nowrap;
}
.cc-btn-create:hover { filter: brightness(1.05); }
.cc-btn-create-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}
.cc-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cc-dialog-head strong { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.cc-dialog-amount {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--cc-ink);
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--cc-line);
}
.cc-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--cc-line);
}
.cc-page .btn.danger,
.btn.danger {
  background: #e11d48;
  color: #fff;
}
.kpi.danger .value { color: #e11d48; }

@media (max-width: 920px) {
  .cc-page {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0 !important;
  }
  .cc-page .cc-app-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
  }
  .cc-page .cc-app-title {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }
  .cc-page .cc-app-title .hero-title {
    font-size: 1.28rem;
  }
  .cc-page .cc-app-filters {
    border-radius: 12px !important;
    width: 100%;
    max-width: 100%;
    padding: 8px;
    gap: 8px;
    box-shadow: none;
  }
  .cc-page .cc-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .cc-page .cc-app-filters select,
  .cc-page .cc-app-filters input[type="date"],
  .cc-page .cc-app-filters input[type="week"],
  .cc-page .cc-app-filters .kv-select-wrap {
    max-width: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .cc-page .cc-app-filters .kv-select-trigger {
    width: 100% !important;
    max-width: none !important;
  }
  .cc-page .cc-app-filters > .cc-period-month,
  .cc-page .cc-app-filters > .cc-period-week,
  .cc-page .cc-app-filters > .cc-period-custom {
    width: 100% !important;
  }
  .cc-page .cc-period-month:not(.is-hidden),
  .cc-page .cc-period-week:not(.is-hidden) {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .cc-page .cc-period-month > select,
  .cc-page .cc-period-month > .kv-select-wrap,
  .cc-page .cc-period-week > input {
    max-width: none !important;
    width: 100% !important;
  }
  .cc-tabs.hr-subnav {
    border-radius: 12px;
    margin: 0 0 10px !important;
  }
  .cc-page .kpi-grid.cc-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-bottom: 12px;
  }
  .cc-page .kpi-grid.cc-kpi .kpi {
    padding: 10px 10px 10px 12px;
    min-height: 0;
    overflow: visible !important;
  }
  .cc-page .kpi-grid.cc-kpi .kpi .label {
    font-size: .68rem;
    margin-bottom: 4px;
  }
  .cc-page .kpi-grid.cc-kpi .kpi .value {
    font-size: .9rem !important;
    letter-spacing: -.04em;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }
  .cc-page .kpi-grid.cc-kpi .kpi .muted.tiny {
    font-size: .65rem;
    line-height: 1.3;
  }
  .cc-page .panel {
    padding: 10px 12px;
    margin-bottom: 10px;
    overflow: hidden;
  }
  .cc-page .panel-head {
    gap: 8px;
    margin-bottom: 8px;
  }
  .cc-page .data-table.compact th,
  .cc-page .data-table td {
    padding: 8px 8px;
    font-size: .78rem;
    vertical-align: top;
  }
  .cc-page .data-table td strong,
  .cc-page .data-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .cc-page .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    margin: 0 -2px;
    padding: 0 2px 4px;
    border-radius: 8px;
  }
  .cc-page .data-table {
    min-width: 640px;
  }
  .cc-page .data-table th:first-child,
  .cc-page .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 4px 0 8px rgba(15, 23, 42, .04);
  }
  .cc-page .data-table thead th:first-child {
    background: #f8fafc;
    z-index: 3;
  }
}
@media (max-width: 560px) {
  .cc-create-grid { grid-template-columns: 1fr; }
  .cc-btn-create { width: 100%; justify-content: center; }
  .cc-page .kpi-grid.cc-kpi {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .cc-page .kpi-grid.cc-kpi .kpi .value {
    font-size: .82rem !important;
  }
  .cc-page .cc-app-title .hero-title {
    font-size: 1.2rem;
  }
  .cc-page .data-table {
    min-width: 560px;
  }
  .cc-page .cc-app-filters {
    margin-bottom: 0;
  }
}

/* ===== Chấm công — giám sát kiosk, không nhập tay ===== */
.att-page {
  --att-line: #e6e8eb;
  --att-muted: #6b7280;
  display: grid;
  gap: 12px;
}
.att-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--att-line);
  border-radius: 10px;
}
.att-kicker {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--att-muted);
}
.att-title {
  margin: 2px 0 4px;
  font-size: 1.2rem;
  font-weight: 750;
  color: #15171a;
}
.att-desc {
  margin: 0;
  font-size: .84rem;
  color: #64748b;
  max-width: 42rem;
  line-height: 1.4;
}
.att-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.att-datebar input[type="date"] {
  height: 36px;
  border: 1px solid var(--att-line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}
.att-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.att-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--att-line);
  border-radius: 10px;
}
.att-stat span { font-size: .72rem; font-weight: 650; color: var(--att-muted); }
.att-stat b { font-size: 1.1rem; font-weight: 750; color: #0f172a; }
.att-stat.is-ok b { color: #15803d; }
.att-stat.is-warn b { color: #c2410c; }
.att-board {
  background: #fff;
  border: 1px solid var(--att-line);
  border-radius: 10px;
  overflow: hidden;
}
.att-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--att-line);
}
.att-board-head strong { font-size: .92rem; }
.att-board-head span { font-size: .75rem; color: var(--att-muted); }
.att-missing { border-color: #fecaca; }
.att-missing .att-board-head { background: #fff7f7; }
.att-table tr.is-ok td { background: #f8fffb; }
.att-table tr.is-empty td { background: #fcfcfd; }
.att-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  background: #eef2f7;
  color: #475569;
  margin-left: 6px;
}
.att-pill.is-photo { background: #dbeafe; color: #1d4ed8; }
.att-pill.is-manual { background: #fee2e2; color: #b91c1c; }
.att-pill.is-late { background: #fee2e2; color: #b91c1c; margin-left: 0; }
.att-pill.is-wait { background: #ffedd5; color: #c2410c; margin-left: 0; }
.att-actions { display: grid; gap: 6px; }
.att-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 0;
}
.att-inline select,
.att-inline input {
  height: 30px;
  border: 1px solid var(--att-line);
  border-radius: 6px;
  padding: 0 6px;
  font-size: .78rem;
  background: #fff;
}
@media (max-width: 720px) {
  .att-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ===== PWA / mobile app shell ===== */
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
html.is-pwa body,
body.is-pwa {
  overscroll-behavior: none;
  user-select: none;
}
html.is-pwa input,
html.is-pwa textarea,
html.is-pwa [contenteditable],
body.is-pwa input,
body.is-pwa textarea {
  user-select: text;
}
@supports (padding: max(0px)) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
  }
}
.kv-header {
  padding-top: max(0px, var(--safe-top, 0px));
}
.pwa-net-chip {
  position: fixed;
  top: calc(10px + var(--safe-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: #b91c1c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(185, 28, 28, .35);
  pointer-events: none;
}
.pwa-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + var(--safe-bottom, 0px));
  z-index: 90;
}
@media (min-width: 921px) {
  .pwa-install-banner { bottom: 20px; max-width: 480px; left: auto; right: 20px; }
}
.pwa-install-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(45, 52, 71, .18);
  backdrop-filter: blur(12px);
}
.pwa-install-logo { border-radius: 10px; flex: 0 0 auto; }
.pwa-install-copy { flex: 1 1 auto; min-width: 0; }
.pwa-install-copy strong { display: block; font-size: 14px; line-height: 1.2; }
.pwa-install-copy span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pwa-install-cta {
  flex: 0 0 auto;
  border: 0;
  background: #0070f4;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.pwa-install-x {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.pwa-install-icon.is-ready { color: #0070f4; }
.pwa-manual-tip {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(140px + var(--safe-bottom, 0px));
  z-index: 95;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .35);
}
.pwa-ios-sheet {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: end center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom, 0px));
}
.pwa-ios-sheet[hidden] { display: none !important; }
.pwa-ios-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 20px 20px 16px 16px;
  padding: 22px 20px 18px;
  position: relative;
  box-shadow: 0 -8px 40px rgba(0,0,0,.2);
}
.pwa-ios-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer;
}
.pwa-ios-icon { text-align: center; margin-bottom: 8px; }
.pwa-ios-icon img { border-radius: 14px; }
.pwa-ios-card h2 { margin: 0 0 12px; font-size: 1.15rem; text-align: center; }
.pwa-ios-steps { margin: 0 0 12px; padding-left: 20px; color: var(--text); line-height: 1.55; }
.pwa-ios-steps li { margin-bottom: 8px; }
.pwa-ios-note { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.pwa-ios-share { display: inline-block; transform: rotate(90deg); font-weight: 700; }

@media (max-width: 920px) {
  .bottom-nav a {
    min-height: 48px;
    padding: 6px 2px;
    font-size: .62rem;
  }
  .bottom-nav .bn-ico {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
  }
  .bottom-nav .bn-ico svg { width: 20px; height: 20px; }
  .app-shell .main {
    min-height: calc(100dvh - 56px);
  }
  .kv-header-inner {
    min-height: 52px;
  }
  /* App-like: sticky header feel */
  .kv-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.92);
  }
}
html.is-offline .pwa-install-banner { display: none !important; }

/* Cách tính tiền: gói combo / theo phút */
.bk-bill-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bk-bill-mode-opt {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.bk-bill-mode-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bk-bill-mode-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  color: #334155;
}
.bk-bill-mode-opt input:checked + span {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.bk-minute-rate {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bk-minute-rate input {
  width: 110px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.bk-minute-step {
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.bk-minute-step:hover { background: #f8fafc; }

/* Queen / King — chọn 1 loại, chỉ hiện bảng giá loại đó */
.bk-bed-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bk-bed-opt {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.bk-bed-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bk-bed-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  color: #334155;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.bk-bed-opt input:checked + span {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.bk-bed-opt:hover span {
  border-color: #93c5fd;
}
.bk-bed-priceboard {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}
.bk-bed-priceboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.bk-bed-priceboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.bk-bed-priceboard-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid transparent;
  font-size: 13px;
}
.bk-bed-priceboard-list li.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
}
.bk-bed-priceboard-list li strong {
  white-space: nowrap;
  color: #0f172a;
}
.bk-bed-priceboard-list em {
  font-style: normal;
  font-size: 11px;
}

/* Lệnh chuyển DT — Admin xác nhận: 2 nút gọn; ô lý do chỉ hiện khi Báo lệch */
.cc-remit-td { min-width: 168px; vertical-align: top; }
.cc-remit-decide { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.cc-remit-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cc-remit-btns .btn { white-space: nowrap; }
.cc-remit-dispute {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
}
.cc-remit-dispute[hidden] { display: none !important; }
.cc-remit-dispute-label {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
}
.cc-remit-dispute textarea {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  resize: vertical;
  border: 1px solid #f5d0a0;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  background: #fff;
}
.cc-remit-dispute-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cc-remit-dispute-actions .btn.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.cc-remit-dispute-actions .btn.danger:hover {
  background: #b91c1c;
}
