/* =========================================================
   Phòng vé Bảo Lâm — Theme v3.1 · Dim / dễ nhìn
   Nền tối dịu, panel xám than, bớt chói trắng
   ========================================================= */

:root {
  /* Palette dim — slate tối, chữ sáng vừa */
  --ink: #0f2744;
  --ink-2: #1e3a5f;
  --muted: #4a6d8c;
  --muted-2: #6b8aaa;
  --line: #b8d4ea;
  --line-strong: #8fbdd9;
  --bg: #e8f4fc;
  --bg-soft: #f0f8fd;
  --surface: #f5fafd;
  --surface-2: #e3f1fa;

  --primary: #0284c7;
  --primary-2: #0369a1;
  --primary-soft: rgba(2, 132, 199, 0.12);
  --primary-glow: rgba(2, 132, 199, 0.16);

  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.12);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.12);
  --coral: #fb923c;
  --coral-soft: rgba(251, 146, 60, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 60, 100, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 60, 100, 0.08), 0 1px 2px rgba(15, 60, 100, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 60, 100, 0.12);
  --shadow-lg: 0 14px 36px rgba(15, 60, 100, 0.16);

  --sidebar-w: 240px;
  --sidebar-collapsed: 80px;

  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-size: 14px;
  --leading: 1.5;
  --tracking: 0;

  --navy: #0c1220;
  --blue: var(--primary);
  --green: var(--success);
  --text: var(--ink);
}

/* ---------- Base typography (Vietnamese-first) ---------- */
html {
  color-scheme: light;
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  /* Nền xanh da trời dịu */
  background-color: #7eb8e8;
  background-image:
    radial-gradient(900px 480px at 0% -8%, rgba(186, 230, 253, 0.75) 0%, transparent 55%),
    radial-gradient(780px 420px at 100% 0%, rgba(56, 189, 248, 0.45) 0%, transparent 52%),
    radial-gradient(640px 380px at 80% 100%, rgba(14, 165, 233, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #a8d4f5 0%, #7eb8e8 42%, #5ba3d9 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--font-size);
  font-weight: 400;
  line-height: var(--leading);
  letter-spacing: 0;
  font-feature-settings: "kern" 1, "liga" 1;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
button, input, select, textarea {
  font-family: inherit;
  letter-spacing: inherit;
}
/* Số tiền / KPI: tabular để cột thẳng hàng */
.money-num,
.dash-kpi b,
.cards b,
.ledger-summary b,
.detail-balance b,
.dash-debt-strip b,
.report-kpis b {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
::selection { background: rgba(91, 141, 239, 0.45); color: #fff; }

/* Headings: rõ, không ép letter-spacing âm (dễ cắt dấu tiếng Việt) */
h1, h2, h3, .page-header-text h1, .content > header h1 {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}
h1, .page-header-text h1, .content > header h1 {
  font-size: 1.65rem;
  font-weight: 800;
}
h2 { font-size: 1.15rem; }
h3 { font-size: 0.98rem; }
p, small, label, th, td, button, input, select {
  line-height: 1.5;
}

/* Material Symbols */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24;
  user-select: none;
  flex-shrink: 0;
}
.material-symbols-outlined.fill {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

/* Boot / loading */
.app-loading {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.boot-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--muted);
}
.boot-loader .boot-icon {
  font-size: 34px;
  color: var(--primary);
  background: var(--primary-soft);
  width: 64px;
  height: 64px;
  border-radius: 18px;
}
.boot-loader p { margin: 0; font-weight: 600; font-size: 13px; }
.boot-loader.error .boot-icon { color: var(--danger); background: var(--danger-soft); }
.boot-loader.error p { color: var(--danger); }
.boot-loader .primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

/* ---------- Shell / Sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }
/* Chỉ sidebar chính — KHÔNG style mọi thẻ <aside> (tránh che menu khi dùng aside khác) */
.app-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: var(--sidebar-w);
  height: 100vh;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  color: #e2e8f0;
  box-shadow: none;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 16px;
  min-width: 0;
}
.brand > span,
.brand-mark {
  display: grid !important;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 12px !important;
  box-shadow: none;
  font-size: 0;
}
.brand-mark .material-symbols-outlined {
  font-size: 22px;
  color: #fff;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.brand-text b,
.user-text b {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc !important;
  letter-spacing: -0.01em;
}
.brand-text small,
.user-text small {
  color: #93a4c3 !important;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
}
.nav-section-label {
  margin: 4px 12px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f92b5;
}
.app-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.app-sidebar nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 12px;
  text-align: left;
  padding: 11px 12px;
  color: #b7c4dc;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  min-width: 0;
}
.app-sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.app-sidebar nav button .nav-icon,
.app-sidebar nav button i {
  display: grid !important;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #9db0d0 !important;
  font-size: 20px !important;
  font-style: normal;
}
.app-sidebar nav button:hover .nav-icon,
.app-sidebar nav button:hover i {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #dbeafe !important;
}
.app-sidebar nav button .nav-label { color: inherit; }
.app-sidebar nav button.active {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-weight: 700;
}
.app-sidebar nav button.active .nav-icon,
.app-sidebar nav button.active i {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: none;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.user {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 10px 6px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.user > span,
.user-avatar {
  background: linear-gradient(145deg, #334155, #1e293b) !important;
  color: #e2e8f0 !important;
  font-weight: 800;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Content ---------- */
.content {
  margin-left: var(--sidebar-w);
  padding: 24px 28px 48px;
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  position: relative;
  color: var(--ink);
}
/* Khung nội dung glass xanh nhạt */
.content > header,
.page-header {
  background: rgba(245, 250, 253, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 18px !important;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.page-header,
.content > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
/* (h1 typography defined above for Vietnamese) */
.page-header-text h1,
.content > header h1 {
  margin: 0 0 6px;
}
.page-header-text p,
.content > header p,
header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---------- Buttons ---------- */
.primary,
button.primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--primary) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: var(--radius) !important;
  padding: 10px 16px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer;
  box-shadow: none;
  transition: background .12s ease, opacity .12s ease;
}
.primary:hover,
button.primary:hover {
  background: var(--primary-2) !important;
  filter: none;
  box-shadow: none;
}
.primary:active { transform: none; opacity: 0.92; }
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none !important;
  filter: none !important;
}
.primary .material-symbols-outlined { font-size: 18px; }

.excel-btn,
.paste,
.entity-btn,
.excel-upload-btn,
.drive-upload-btn,
.f1-upload-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.excel-btn {
  border: 1px solid #a7f3d0 !important;
  background: linear-gradient(180deg, #f0fdf8, #e7faf2) !important;
  color: #047857 !important;
  box-shadow: var(--shadow-xs);
}
.excel-btn:hover { background: #d1fae5 !important; border-color: #6ee7b7 !important; }
.paste {
  border: 1px solid #bfdbfe !important;
  background: #f8fbff !important;
  color: var(--primary) !important;
}
.paste:hover { background: var(--primary-soft) !important; }
.excel-upload-btn,
.drive-upload-btn,
.f1-upload-btn {
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}
.excel-upload-btn:hover,
.drive-upload-btn:hover { background: #dbeafe !important; }
.excel-btn .material-symbols-outlined,
.paste .material-symbols-outlined,
.excel-upload-btn .material-symbols-outlined { font-size: 18px; }

.row-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--primary) !important;
  padding: 7px 11px !important;
  border-radius: 9px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.row-edit-btn:hover {
  background: var(--primary-soft) !important;
  border-color: #93c5fd !important;
}

/* ---------- Cards / panels ---------- */
.panel,
.dash-panel,
.report-filters,
.report-type-tabs,
.ledger-toolbar,
.ledger-panel {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* =========================================================
   METRIC CARD — layout thống nhất toàn app
   [ LABEL ........................ ICON ]
   [ VALUE ]
   [ meta ]
   [ hint ]
   ========================================================= */
.metric-card-grid,
.cards,
.dash-kpis,
.dash-debt-strip,
.ledger-summary,
.report-kpis.four,
.report-kpis.six {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cards { margin-bottom: 14px; }
.dash-kpis.three {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  margin-bottom: 10px;
}
.dash-kpis.three.dash-kpis-balance {
  margin-bottom: 14px;
}
.ledger-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.report-kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }

/* Tự lấp đầy hàng KPI theo đúng số card, tránh chừa ô trống của lưới 4 cột. */
.metric-card-grid:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr) !important;
}
.metric-card-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.metric-card-grid:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
@media (max-width: 1100px) {
  .metric-card-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  .metric-card-grid:has(> :only-child),
  .metric-card-grid:has(> :nth-child(2):last-child),
  .metric-card-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Ô KPI gọn — Tổng quan / Báo cáo / sổ */
.metric-card,
.dash-kpi,
.cards > .metric-card,
.ledger-summary > .metric-card,
.dash-debt-strip > .metric-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  text-align: left !important;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 10px 12px 9px !important;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 12px !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 14px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  cursor: default;
  font: inherit;
  color: inherit;
}
button.metric-card,
.metric-card.is-button,
button.dash-kpi {
  cursor: pointer;
}
.metric-card:hover,
button.metric-card:hover,
.dash-kpi:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 8px rgba(37, 99, 235, 0.07),
    0 8px 20px rgba(15, 23, 42, 0.06) !important;
  border-color: rgba(191, 219, 254, 0.9) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}
/* Accent bar trái — mỏng, đơn sắc */
.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2.5px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  z-index: 2;
  pointer-events: none;
}
.metric-card::after,
.cards article::after { display: none !important; content: none !important; }

.metric-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  position: relative;
  z-index: 1;
}
.metric-card-label {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted) !important;
  line-height: 1.25 !important;
}
.metric-card-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid !important;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}
.metric-card-icon .material-symbols-outlined {
  font-size: 16px !important;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}
.metric-card-value {
  position: relative;
  z-index: 1;
  display: block;
  margin: 6px 0 3px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
  line-height: 1.2 !important;
  color: var(--ink) !important;
}
.metric-card-meta {
  position: relative;
  z-index: 1;
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  margin: 0 !important;
  font-style: normal !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  line-height: 1.3 !important;
}
.metric-card-meta .mini-icon,
.metric-card-meta .trend-icon {
  font-size: 13px !important;
}
.metric-card-hint {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 500;
  line-height: 1.3;
}
.meta-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-trend.up { color: var(--success) !important; }
.meta-trend.down { color: var(--danger) !important; }
.meta-trend.flat { color: var(--muted) !important; }

/* Tone: nền trắng + vạch màu + icon soft (minimal) */
.metric-card.tone-revenue,
.dash-kpi.tone-revenue {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}
.metric-card.tone-revenue::before { background: var(--primary); }
.metric-card.tone-revenue .metric-card-icon,
.dash-kpi.tone-revenue .metric-card-icon {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}
.metric-card.tone-revenue .metric-card-value,
.dash-kpi.tone-revenue .metric-card-value { color: var(--primary) !important; }

.metric-card.tone-collected,
.dash-kpi.tone-collected {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}
.metric-card.tone-collected::before { background: var(--success); }
.metric-card.tone-collected .metric-card-icon,
.dash-kpi.tone-collected .metric-card-icon {
  background: var(--success-soft);
  color: var(--success);
  box-shadow: none;
}
.metric-card.tone-collected .metric-card-value,
.dash-kpi.tone-collected .metric-card-value { color: var(--success) !important; }

.metric-card.tone-debt,
.metric-card.debt,
.metric-card.receivable,
.dash-kpi.tone-debt {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}
.metric-card.tone-debt::before,
.metric-card.debt::before,
.metric-card.receivable::before { background: var(--danger); }
.metric-card.tone-debt .metric-card-icon,
.metric-card.debt .metric-card-icon,
.metric-card.receivable .metric-card-icon,
.dash-kpi.tone-debt .metric-card-icon {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}
.metric-card.tone-debt .metric-card-value,
.metric-card.debt .metric-card-value,
.metric-card.receivable .metric-card-value,
.dash-kpi.tone-debt .metric-card-value { color: var(--danger) !important; }

.metric-card.tone-profit,
.dash-kpi.tone-profit {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}
.metric-card.tone-profit::before { background: var(--violet); }
.metric-card.tone-profit .metric-card-icon,
.dash-kpi.tone-profit .metric-card-icon {
  background: var(--violet-soft);
  color: var(--violet);
  box-shadow: none;
}
.metric-card.tone-profit .metric-card-value,
.dash-kpi.tone-profit .metric-card-value { color: var(--violet) !important; }

.metric-card.tone-warning,
.metric-card.payable {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}
.metric-card.tone-warning::before,
.metric-card.payable::before { background: var(--warning); }
.metric-card.tone-warning .metric-card-icon,
.metric-card.payable .metric-card-icon {
  background: var(--warning-soft);
  color: var(--warning);
  box-shadow: none;
}
.metric-card.tone-warning .metric-card-value,
.metric-card.payable .metric-card-value { color: var(--warning) !important; }

.panel { overflow: hidden; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px !important;
  border-bottom: 1px solid var(--line) !important;
  background: var(--surface) !important;
}
.filter {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
}
.filter.on {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}
.toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line) !important;
  border-radius: 11px !important;
  background: var(--surface) !important;
  color: var(--muted-2);
  box-shadow: var(--shadow-xs);
}
.toolbar input {
  border: 0 !important;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
  min-width: 180px;
}

/* ---------- Tables ---------- */
.table-wrap,
.dash-table-wrap,
.report-table-wrap {
  border-color: var(--line) !important;
}
table,
.dash-table,
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
th {
  background: var(--bg-soft) !important;
  color: var(--muted) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap;
}
td {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--ink-2);
  vertical-align: middle;
}
tr:hover td { background: rgba(91, 141, 239, 0.08); }
.owed { color: var(--danger) !important; font-weight: 700; }
.gain { color: var(--success) !important; font-weight: 700; }
.route {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
}

/* ---------- Dashboard ---------- */
.dashboard { gap: 16px !important; }
.content-dashboard .page-header {
  background: linear-gradient(135deg, rgba(245, 250, 253, 0.95), rgba(186, 230, 253, 0.55));
  border: 1px solid rgba(191, 219, 254, 0.55);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 4px;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.06);
}
.content-dashboard .page-header h1 {
  background: linear-gradient(105deg, #0f172a 0%, #1e3a8a 55%, #0f766e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.content-dashboard .page-header p { color: #64748b; }

/* Cảnh báo Tổng quan → danh sách chi tiết khi bấm Xử lý */
.dash-alert-drill {
  margin-top: 16px;
  border: 1px solid #bfdbfe !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08) !important;
}
.dash-alert-drill .dash-panel-head {
  background: linear-gradient(180deg, #eff6ff, #fff);
}
.dash-alerts li.alert-active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.dash-alerts li.alert-active button {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.dash-toolbar {
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid #dbe5f5;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.dash-chip,
.report-type-tab {
  border: 1px solid #dce5f4 !important;
  background: #fff !important;
  color: #5b6b84 !important;
  border-radius: var(--radius-pill) !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dash-chip:hover,
.report-type-tab:hover {
  border-color: #93c5fd !important;
  background: #f0f7ff !important;
  color: #1d4ed8 !important;
}
.dash-chip.on,
.report-type-tab.on {
  border-color: transparent !important;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 45%, #1d4ed8 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32) !important;
}
.report-type-tab {
  border-radius: 12px !important;
  background: var(--bg-soft) !important;
}
.report-type-tab.on b,
.report-type-tab.on span { color: #fff !important; }
.report-type-tab b { font-size: 12px; }
.report-type-tab span { font-size: 11px; color: var(--muted); }

/* KPI cards — nền tint nhẹ + accent bar + blob */
.dash-kpi {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  border: 1px solid #e2eaf6 !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.045) !important;
  background: linear-gradient(165deg, #ffffff 0%, #f8faff 100%) !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dash-kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  opacity: 0.9;
}
.dash-kpi::before {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 68%);
  pointer-events: none;
}
.dash-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12) !important;
  border-color: #bfdbfe !important;
}
.dash-kpi .kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.dash-kpi .kpi-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  box-shadow:
    0 6px 14px rgba(37, 99, 235, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.dash-kpi .kpi-icon .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.dash-kpi.tone-revenue {
  background: linear-gradient(165deg, #ffffff 0%, #eff6ff 100%) !important;
  border-color: #dbeafe !important;
}
.dash-kpi.tone-revenue::after { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.dash-kpi.tone-revenue::before { background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 68%); }
.dash-kpi.tone-revenue .kpi-icon {
  background: linear-gradient(145deg, #dbeafe, #93c5fd);
  color: #1d4ed8;
}

.dash-kpi.tone-collected {
  background: linear-gradient(165deg, #ffffff 0%, #ecfdf5 100%) !important;
  border-color: #bbf7d0 !important;
}
.dash-kpi.tone-collected::after { background: linear-gradient(180deg, #34d399, #059669); }
.dash-kpi.tone-collected::before { background: radial-gradient(circle, rgba(16, 185, 129, 0.2), transparent 68%); }
.dash-kpi.tone-collected .kpi-icon {
  background: linear-gradient(145deg, #d1fae5, #6ee7b7);
  color: #047857;
  box-shadow: 0 6px 14px rgba(5, 150, 105, 0.2), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.dash-kpi.tone-debt {
  background: linear-gradient(165deg, #ffffff 0%, #fff1f2 100%) !important;
  border-color: #fecdd3 !important;
}
.dash-kpi.tone-debt::after { background: linear-gradient(180deg, #fb7185, #e11d48); }
.dash-kpi.tone-debt::before { background: radial-gradient(circle, rgba(244, 63, 94, 0.18), transparent 68%); }
.dash-kpi.tone-debt .kpi-icon {
  background: linear-gradient(145deg, #ffe4e6, #fda4af);
  color: #be123c;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.18), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.dash-kpi.tone-profit {
  background: linear-gradient(165deg, #ffffff 0%, #f5f3ff 100%) !important;
  border-color: #ddd6fe !important;
}
.dash-kpi.tone-profit::after { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.dash-kpi.tone-profit::before { background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 68%); }
.dash-kpi.tone-profit .kpi-icon {
  background: linear-gradient(145deg, #ede9fe, #c4b5fd);
  color: #6d28d9;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.18), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.dash-kpi.tone-warning {
  background: linear-gradient(165deg, #ffffff 0%, #fffbeb 100%) !important;
  border-color: #fde68a !important;
}
.dash-kpi.tone-warning::after { background: linear-gradient(180deg, #fbbf24, #d97706); }
.dash-kpi.tone-warning::before { background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent 68%); }
.dash-kpi.tone-warning .kpi-icon {
  background: linear-gradient(145deg, #fef3c7, #fcd34d);
  color: #b45309;
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.18), inset 0 0 0 1px rgba(255,255,255,0.5);
}
.dash-kpi small {
  font-size: 10.5px !important;
  letter-spacing: 0.04em;
  color: var(--muted) !important;
  font-weight: 700 !important;
}
.dash-kpi b {
  position: relative;
  z-index: 1;
  font-size: 1.35rem !important;
  letter-spacing: -0.01em;
  margin: 12px 0 6px !important;
  line-height: 1.25;
}
.dash-kpi em,
.dash-kpi-hint {
  position: relative;
  z-index: 1;
}
.dash-kpi em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px !important;
  font-weight: 600;
}
.dash-kpi em .trend-icon { font-size: 16px; }

/* Debt strip — icon badge, không gạch màu trên */
.dash-debt-strip article {
  position: relative !important;
  overflow: hidden !important;
  padding: 16px 18px !important;
  border: 1px solid var(--line) !important;
  border-top: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm) !important;
}
.dash-debt-strip article::before {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.9;
  pointer-events: none;
}
.dash-debt-strip .debt-ar::before { background: radial-gradient(circle, rgba(190, 18, 60, 0.1), transparent 70%); }
.dash-debt-strip .debt-ap::before { background: radial-gradient(circle, rgba(180, 83, 9, 0.1), transparent 70%); }
.dash-debt-strip .debt-credit-c::before { background: radial-gradient(circle, rgba(4, 120, 87, 0.1), transparent 70%); }
.dash-debt-strip .debt-credit-s::before { background: radial-gradient(circle, rgba(29, 78, 216, 0.1), transparent 70%); }
.dash-debt-strip .strip-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.dash-debt-strip .strip-icon .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.dash-debt-strip .debt-ar .strip-icon { background: linear-gradient(145deg, #fff1f2, #ffe4e6); color: var(--danger); }
.dash-debt-strip .debt-ap .strip-icon { background: linear-gradient(145deg, #fff7ed, #ffedd5); color: var(--warning); }
.dash-debt-strip .debt-credit-c .strip-icon { background: linear-gradient(145deg, #ecfdf5, #d1fae5); color: var(--success); }
.dash-debt-strip .debt-credit-s .strip-icon { background: linear-gradient(145deg, #eff4ff, #dbe7ff); color: var(--primary); }
.dash-debt-strip small,
.dash-debt-strip b,
.dash-debt-strip em { position: relative; z-index: 1; }

.dashboard .dash-panel,
.content-dashboard .dash-panel {
  border: 1px solid #dce6f5 !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important;
  overflow: hidden;
}
.dash-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-panel-head .title-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #dbeafe, #93c5fd);
  color: #1d4ed8;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18), inset 0 0 0 1px rgba(255,255,255,0.5);
}
.dash-panel-head .title-icon .material-symbols-outlined { font-size: 18px; }

/* Vé sắp bay — badge màu */
.content-dashboard .dash-table tbody tr:hover td {
  background: #f0f7ff !important;
}
.content-dashboard .dash-table td .route,
.content-dashboard .route {
  background: linear-gradient(135deg, #e0f2fe, #dbeafe) !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd;
}
.meta-trend.up { color: #059669 !important; }
.meta-trend.down { color: #e11d48 !important; }
.excel-btn,
.paste {
  border: 1px solid #c7d7f5 !important;
  background: linear-gradient(180deg, #ffffff, #f3f7ff) !important;
  color: #1d4ed8 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08) !important;
}
.excel-btn:hover,
.paste:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}
.dash-link {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}
.dash-link .material-symbols-outlined { font-size: 16px; }

.cards .card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, #eff4ff, #dbe7ff);
  color: var(--primary);
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
  position: relative;
  z-index: 1;
}
.cards .card-icon.tone-ok {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.12);
}
.cards .card-icon.tone-danger {
  background: linear-gradient(145deg, #fff1f2, #ffe4e6);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(190, 18, 60, 0.12);
}
.cards .card-icon.tone-profit {
  background: linear-gradient(145deg, #f5f3ff, #ede9fe);
  color: var(--violet);
  box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.12);
}
.cards .card-icon .material-symbols-outlined {
  font-size: 21px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.cards em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cards em .mini-icon { font-size: 14px; }
.cards small,
.cards b,
.cards em { position: relative; z-index: 1; }

.empty-state {
  padding: 48px 28px !important;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #eff4ff, #dbe7ff);
  color: var(--primary);
  margin-bottom: 6px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}
.empty-state-icon .material-symbols-outlined { font-size: 28px; }
.empty-state h2 { margin: 0; }
.empty-state p { margin: 0; color: var(--muted); max-width: 420px; }
/* Tone = màu số + halo, KHÔNG gạch viền trên/trái */
.dash-kpi.tone-revenue {
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(110px 90px at 100% 0%, rgba(37, 99, 235, 0.1), transparent 72%),
    var(--surface) !important;
}
.dash-kpi.tone-collected {
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(110px 90px at 100% 0%, rgba(4, 120, 87, 0.1), transparent 72%),
    var(--surface) !important;
}
.dash-kpi.tone-debt {
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(110px 90px at 100% 0%, rgba(190, 18, 60, 0.09), transparent 72%),
    var(--surface) !important;
}
.dash-kpi.tone-profit {
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(110px 90px at 100% 0%, rgba(109, 40, 217, 0.1), transparent 72%),
    var(--surface) !important;
}
.dash-kpi.tone-revenue b { color: var(--primary) !important; }
.dash-kpi.tone-collected b { color: var(--success) !important; }
.dash-kpi.tone-debt b { color: var(--danger) !important; }
.dash-kpi.tone-profit b { color: var(--violet) !important; }
.dash-panel-head {
  padding: 15px 18px !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #fcfdff, #f8fafc);
}
.dash-panel-head h3 {
  font-size: 14.5px !important;
  font-weight: 750 !important;
  letter-spacing: -0.01em;
  color: var(--ink) !important;
}
.dash-panel-head p { color: var(--muted) !important; font-size: 12px !important; }
.dash-link {
  color: var(--primary) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dash-alerts li {
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  background: var(--bg-soft) !important;
}
.dash-recent-item {
  border-radius: 12px !important;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.dash-recent-item:hover {
  background: var(--primary-soft) !important;
  border-color: #dbe7ff;
}

/* ---------- Ledger / partners ---------- */
.partner-ledger-page { gap: 16px !important; }
.ledger-summary article {
  min-height: 108px;
  padding: 18px !important;
}
.ledger-summary article {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line) !important;
  padding: 18px !important;
}
.ledger-summary article::before {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  pointer-events: none;
}
.ledger-summary article.receivable {
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(100px 80px at 100% 0%, rgba(190, 18, 60, 0.08), transparent 70%),
    var(--surface) !important;
}
.ledger-summary article.receivable::before {
  background: radial-gradient(circle, rgba(190, 18, 60, 0.1), transparent 70%);
}
.ledger-summary article.payable {
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(100px 80px at 100% 0%, rgba(180, 83, 9, 0.08), transparent 70%),
    var(--surface) !important;
}
.ledger-summary article.payable::before {
  background: radial-gradient(circle, rgba(180, 83, 9, 0.1), transparent 70%);
}
.ledger-summary .sum-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.ledger-summary .sum-icon .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.ledger-summary article.receivable .sum-icon {
  background: linear-gradient(145deg, #fff1f2, #ffe4e6);
  color: var(--danger);
}
.ledger-summary article.payable .sum-icon {
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  color: var(--warning);
}
.ledger-summary article:not(.receivable):not(.payable) .sum-icon {
  background: linear-gradient(145deg, #eff4ff, #dbe7ff);
  color: var(--primary);
}
.ledger-summary small,
.ledger-summary b,
.ledger-summary em { position: relative; z-index: 1; }
.ledger-summary b { letter-spacing: -0.01em; }
.ledger-toolbar {
  padding: 16px 18px !important;
}
.ledger-toolbar h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem !important;
  font-weight: 750 !important;
  letter-spacing: -0.01em;
}
.ledger-toolbar h2 .title-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, #eff4ff, #dbe7ff);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}
.ledger-toolbar h2 .title-icon .material-symbols-outlined { font-size: 20px; }
.ledger-toolbar label {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-xs);
}
.ledger-list > button {
  transition: background .12s ease;
}
.ledger-list > button:hover { background: #f5f8ff !important; }
.ledger-person > span {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  font-weight: 800;
}
.ledger-person.supplier > span {
  background: var(--warning-soft) !important;
  color: var(--warning) !important;
}
.entity-btn {
  border: 1px solid #bfdbfe !important;
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

/* ---------- Reports ---------- */
.report-toolbar { gap: 12px !important; }
.report-type-tabs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  padding: 12px !important;
}
.report-filters {
  padding: 14px 16px !important;
}
.report-intro h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem !important;
  font-weight: 750 !important;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.report-intro h2 .title-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.report-intro h2 .title-icon .material-symbols-outlined { font-size: 20px; }
.report-intro p { color: var(--muted) !important; line-height: 1.55; }
.report-select select,
.report-search,
.dash-date input,
input[type="date"],
input[type="month"],
input[type="week"],
input[type="search"],
input[type="text"],
input[type="number"],
select,
textarea {
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #93c5fd !important;
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.report-op-tag {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border-radius: 8px !important;
  font-weight: 750 !important;
}

/* ---------- Modal ---------- */
.modal {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(6px);
}
.modal form,
.modal > section,
.ledger-detail-modal > section,
.f1-import-modal > section {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg) !important;
  background: var(--surface) !important;
}
.modal-head {
  border-bottom: 1px solid var(--line) !important;
  padding: 18px 22px !important;
}
.modal-head h2 {
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
}
.modal-head button {
  width: 34px;
  height: 34px;
  border-radius: 10px !important;
  border: 1px solid var(--line) !important;
  background: var(--bg-soft) !important;
  color: var(--muted) !important;
  font-size: 18px;
  cursor: pointer;
}
.modal-head button:hover {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border-color: #fecdd3 !important;
}
.modal-actions {
  border-top: 1px solid var(--line) !important;
  padding: 14px 22px !important;
  background: #fafbfd;
  gap: 10px !important;
}
.modal-actions-edit-ticket {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  flex-wrap: wrap;
}
.modal-actions-edit-ticket .modal-actions-spacer {
  flex: 1 1 auto;
  min-width: 12px;
}
.modal-actions-edit-ticket .edit-ticket-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #fecaca !important;
  background: #fff1f2 !important;
  color: #be123c !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  cursor: pointer;
}
.modal-actions-edit-ticket .edit-ticket-delete:hover {
  background: #ffe4e6 !important;
  border-color: #e11d48 !important;
}
.modal-actions-edit-ticket .primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.form-grid label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  margin-top: 6px;
  padding: 10px 12px !important;
}
.form-grid textarea {
  resize: vertical;
  min-height: 56px;
  width: 100%;
  line-height: 1.45;
  font: inherit;
}
.transaction-edit-modal .form-grid textarea[name="note"] {
  min-height: 64px;
}

/* ---------- Ticket page extras ---------- */
.ticket-filterbar,
.date-range-filter {
  gap: 8px;
}
.ticket-filterbar .dash-chip,
[data-ticket-period] {
  border-radius: var(--radius-pill) !important;
}
.delete-selected {
  border: 1px solid #fecdd3 !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  padding: 8px 12px !important;
  cursor: pointer;
}
.panel footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--line) !important;
}
.detail-balance > span,
.detail-balance > strong {
  background: var(--bg-soft) !important;
}
.detail-balance > strong {
  background: var(--success-soft) !important;
}
.detail-balance b {
  letter-spacing: -0.02em;
}

/* ---------- Placeholder ---------- */
.panel[style*="text-align:center"] {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  border: 1px solid var(--line) !important;
}

/* Search fields with Material icon */
.dash-flight-search,
.report-search,
.toolbar label,
.ledger-toolbar label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
.dash-flight-search .material-symbols-outlined,
.report-search .material-symbols-outlined,
.toolbar label .material-symbols-outlined,
.ledger-toolbar label .material-symbols-outlined {
  font-size: 18px;
  color: var(--muted-2);
}
.dash-flight-search {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.dash-flight-search input {
  border: 0 !important;
  outline: 0;
  min-width: 200px;
  background: transparent;
  box-shadow: none !important;
}

/* ---------- Scrollbars ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --sidebar-w: 80px; }
  .app-sidebar {
    width: var(--sidebar-w);
    padding: 14px 10px;
  }
  .brand { justify-content: center; padding: 6px 0 14px; }
  .brand-text,
  .user-text,
  .nav-section-label,
  .app-sidebar nav button .nav-label {
    display: none !important;
  }
  .brand-mark { margin: 0 auto; }
  .app-sidebar nav button {
    justify-content: center;
    padding: 10px;
  }
  .user { justify-content: center; }
  .content {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    padding: 20px;
  }
  .cards,
  .dash-kpis,
  .dash-debt-strip,
  .report-kpis.four,
  .report-kpis.six,
  .ledger-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  .cards,
  .dash-kpis,
  .dash-debt-strip,
  .report-kpis.four,
  .report-kpis.six,
  .ledger-summary,
  .ledger-columns {
    grid-template-columns: 1fr !important;
  }
  .page-header,
  .content > header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions { width: 100%; }
  .header-actions > * { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Thu / chi live ---------- */
.payment-live .demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(120deg, #0b1730, #1d4ed8 70%, #0f766e);
  color: #fff;
  padding: 18px 20px;
  border-radius: 16px;
}
.payment-live .demo-banner b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.payment-live .demo-banner p { margin: 6px 0 0; color: #dbe7ff; font-size: 12.5px; max-width: 640px; }
.live-badge {
  background: rgba(255,255,255,0.16) !important;
  border: 1px solid rgba(255,255,255,0.28) !important;
  border-radius: 999px !important;
  padding: 7px 12px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}
.payment-live .paste-zone.drag-over {
  border-color: #2459e8 !important;
  background: #eef3ff !important;
  box-shadow: 0 0 0 3px rgba(36, 89, 232, 0.18);
}
.payment-live .pay-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0;
}
.payment-live .pay-file-btn input { display: none; }
.payment-live .paste-zone {
  min-height: 96px;
  cursor: pointer;
}
.payment-live .paste-zone.is-ocr { border-color: #2459e8; background: #f5f8ff; }
.payment-live .pay-preview-img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d5deeb;
  background: #fff;
}
.pay-text-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  color: #5b6b84;
}
.pay-text-label textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  resize: vertical;
}
.pay-text-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.pay-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 12px;
  font-weight: 600;
}
.payment-live .extract-list p {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}
.payment-live .extract-list input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  background: #fafbfd;
}
.pay-offset-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  font-size: 11px;
  font-weight: 700;
  color: #5b6b84;
}
.room-bank-block {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8faff, #fff);
}
.room-bank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.room-bank-head small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #64748b;
}
.room-bank-head span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.room-bank-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.room-bank-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 10px 9px;
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, box-shadow .12s, background .12s, transform .12s;
}
.room-bank-chip b {
  font-size: 12px;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: 0.02em;
}
.room-bank-chip span {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}
.room-bank-chip em {
  font-style: normal;
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 2px;
  word-break: break-all;
}
.room-bank-chip:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  transform: translateY(-1px);
}
.room-bank-chip.on {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  box-shadow: 0 0 0 1px #2563eb33, 0 6px 14px #1d4ed818;
}
.room-bank-chip.on b { color: #1d4ed8; }
.room-bank-chip.on span { color: #1e3a8a; }
.room-bank-chip { position: relative; }
.room-bank-chip.add {
  border-style: dashed;
  border-color: #93c5fd;
  background: #f8fbff;
  color: #1d4ed8;
}
.room-bank-chip.add b { color: #2563eb; font-size: 16px; line-height: 1; }
.room-bank-chip.add span { color: #1d4ed8; }
.room-bank-chip.add:hover { background: #eff6ff; border-color: #2563eb; }
.room-bank-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  color: #b91c1c;
  font-style: normal;
}
.room-bank-del .material-symbols-outlined { font-size: 14px; }
.room-bank-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.room-bank-form {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #f8fbff;
}
.room-bank-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.room-bank-form-head b { font-size: 13px; color: #1e3a8a; }
.room-bank-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 8px;
}
.room-bank-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}
.room-bank-form-grid input,
.room-bank-form-grid select {
  padding: 8px 10px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  font-weight: 600;
}
.room-bank-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 900px) {
  .room-bank-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .room-bank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pay-offset-label select {
  padding: 10px 12px;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  background: #fff;
}
.pay-offset-label .source-search,
.pay-offset-label .partner-search,
.posting-fields .source-search,
.posting-fields .partner-search {
  margin-top: 0;
  width: 100%;
}
.pay-offset-label .source-search > input,
.form-grid .source-search > input,
.posting-fields .source-search > input,
.posting-fields .partner-search > input {
  width: 100%;
  margin-top: 0;
  padding: 10px 34px 10px 12px;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  box-sizing: border-box;
}
.pay-offset-label .source-search > input:focus,
.form-grid .source-search > input:focus,
.posting-fields .source-search > input:focus,
.posting-fields .partner-search > input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px #2563eb18;
}
.posting-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #5b6b84;
}
/* Loại hạch toán bên trái — chọn trước; khách / bước 2 bên phải */
.posting-fields-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: start;
}
.posting-fields-step .pay-class-first {
  order: 0;
}
.posting-fields-step .pay-customer-second {
  order: 1;
}
.posting-fields-step:has(.pay-class-first:only-child),
.posting-fields-step .pay-class-first:only-child {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .posting-fields-step {
    grid-template-columns: 1fr;
  }
}
.source-search .partner-search-menu {
  max-height: 260px;
}
.source-search .source-clear-opt b {
  color: #64748b;
  font-weight: 600;
}
.source-search .partner-search-menu button[data-name].on,
.source-search .partner-search-menu button:hover {
  background: #edf3ff;
}
.payment-live .confirm-pay {
  width: 100%;
  margin-top: 12px;
}
.pay-history { margin-top: 12px; scroll-margin-top: 16px; }
.pay-banner-ledger-btn {
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 9px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pay-banner-ledger-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}
.pay-history-filters {
  padding: 10px 16px 4px;
  border-bottom: 1px solid #e8eef6;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pay-history-period-bar,
.pay-history-kind-bar,
.pay-history-scope-bar,
.pay-history-partner-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.pay-history-period-bar > b,
.pay-history-kind-bar > b,
.pay-history-scope-bar > b,
.pay-history-partner-bar > b {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 72px;
}
.pay-history-partner-bar .pay-history-partner-search,
.pay-history-partner-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
  max-width: 420px;
  flex: 1 1 280px;
  border: 1px solid #cbd5e4;
  border-radius: 10px;
  background: #fff;
  padding: 0 4px 0 8px;
  gap: 4px;
}
.pay-history-partner-search-wrap:focus-within {
  border-color: #2459e8;
  box-shadow: 0 0 0 3px #2459e815;
}
.pay-history-partner-search-wrap .ld-search-icon {
  display: flex;
  color: #94a3b8;
  flex-shrink: 0;
}
.pay-history-partner-search-wrap .ld-search-icon .material-symbols-outlined {
  font-size: 18px;
}
.pay-history-partner-bar .pay-history-partner-search > input,
.pay-history-partner-search-wrap > input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 10px 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #17233a;
}
.pay-history-partner-search-wrap > input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.pay-history-partner-search-wrap .ld-search-clear {
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 6px;
  display: flex;
}
.pay-history-partner-search-wrap .ld-search-clear:hover {
  background: #f1f5f9;
  color: #475569;
}
.pay-history-partner-search-wrap .partner-search-arrow {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 12px;
  padding-right: 6px;
  pointer-events: none;
}
.pay-history-partner-menu {
  z-index: 95 !important;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
.pay-history-partner-count {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}
.pay-bucket-filter-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.pay-history-summary {
  padding: 12px 16px 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .pay-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.pay-history-table tfoot td {
  background: #f8fafc;
  font-size: 12.5px;
  padding: 10px 12px;
  border-top: 2px solid #e2e8f0;
}
.pay-bucket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px 4px;
}
@media (max-width: 960px) {
  .pay-bucket-grid { grid-template-columns: 1fr; }
}
.pay-bucket-panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  min-height: 120px;
}
.pay-bucket-panel.pay-bucket-in {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 40px);
}
.pay-bucket-panel.pay-bucket-out {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 40px);
}
.pay-bucket-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #e8eef6;
}
.pay-bucket-panel-head h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pay-bucket-panel-head span {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.pay-bucket-empty {
  margin: 0;
  padding: 20px 14px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
}
.pay-bucket-table-wrap {
  max-height: min(32vh, 280px);
  overflow: auto;
}
.pay-bucket-table th,
.pay-bucket-table td {
  font-size: 12.5px;
  padding: 8px 10px;
}
.pay-bucket-table tbody tr {
  cursor: pointer;
  transition: background .12s ease;
}
.pay-bucket-table tbody tr:hover td {
  background: #f1f5f9 !important;
}
.pay-bucket-table tbody tr.is-bucket-on td {
  background: #dbeafe !important;
}
.pay-bucket-pct {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 90px;
}
.pay-bucket-bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
  min-width: 48px;
}
.pay-bucket-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #34d399, #10b981);
}
.pay-bucket-out .pay-bucket-bar i {
  background: linear-gradient(90deg, #fb923c, #f97316);
}
.pay-bucket-pct em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  min-width: 36px;
  text-align: right;
}
.pay-bucket-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 16px 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}
.pay-history-list-head {
  padding: 8px 16px 0 !important;
}
.pay-history-list-head h4 {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
}
.pay-history-list-head p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
/* Hiện full nội dung CK trong bảng từng giao dịch */
.pay-history-table {
  overflow-x: auto;
}
.pay-history-detail-table {
  min-width: 980px;
}
.pay-hist-content {
  min-width: 220px;
  max-width: 380px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
.pay-hist-content-full {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}
.pay-hist-date {
  white-space: nowrap;
}
.pay-hist-ft {
  max-width: 160px;
  word-break: break-all;
  color: #64748b;
  font-size: 11.5px;
}
.payment-ledger-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  cursor: pointer;
  transition: background .12s ease;
}
.payment-ledger-row:hover { background: #f5f8ff; }
.payment-ledger-row .row-edit-btn { flex-shrink: 0; }
.payment-row-clickable { cursor: pointer; }
.payment-row-clickable:hover td { background: #f5f8ff !important; }
.payment-edit-modal { z-index: 32; }
.payment-edit-modal form { width: min(720px, 96vw); }
.payment-edit-modal .modal-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pay-edit-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 24px 8px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #f0f6ff;
  border: 1px solid #d6e4ff;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.pay-edit-hint .material-symbols-outlined { color: #1d4ed8; font-size: 20px; }
.pay-edit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-edit-actions .spacer { flex: 1; }
/* Nút Lưu / Xoá dính trên đầu form — bấm được ngay không cần cuộn */
.payment-edit-modal form[data-form="edit-payment"] {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 900px);
}
.payment-edit-modal .pay-edit-actions-top {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
  padding: 10px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.payment-edit-modal .form-grid {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 8px;
}
.payment-edit-modal .pay-edit-actions-bottom {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.btn-danger:hover { background: #ffe4e6; }
.form-grid label.span-2,
.form-grid .span-2 { grid-column: 1 / -1; }

/* Nguồn tiền: chip thay select (tránh lỗi không chọn được trên modal) */
.cash-source-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cash-source-label {
  font-size: 11px;
  font-weight: 700;
  color: #5b6b84;
}
.cash-source-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cash-source-chips.three {
  grid-template-columns: 1fr 1fr 1fr;
}
.cash-source-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid #d5deeb;
  border-radius: 12px;
  background: #fff;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.cash-source-chip b {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
}
.cash-source-chip small {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.35;
}
.cash-source-chip:hover {
  border-color: #93b4f5;
  background: #f8faff;
}
.cash-source-chip.on {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px #2563eb18;
}
.cash-source-chip.on b { color: #1d4ed8; }
.cash-source-chip.on small { color: #3b5bdb; }
@media (max-width: 900px) {
  .cash-source-chips.three { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cash-source-chips { grid-template-columns: 1fr; }
}

/* =========================================================
   OVERRIDE: metric-card layout lock — bản gọn (bé hơn)
   ========================================================= */
.metric-card,
.metric-card.dash-kpi,
.dash-kpis > .metric-card,
.dash-debt-strip > .metric-card,
.cards > .metric-card,
.ledger-summary > .metric-card,
.report-kpis > .metric-card,
.report-kpis > .dash-kpi.metric-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 0 !important;
  min-height: 0 !important;
  padding: 10px 12px 9px !important;
  border: 1px solid var(--line) !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm) !important;
}
/* Giữ vạch accent trái (bản compact) — chỉ tắt after/legacy */
.metric-card::after,
.dash-kpi::after,
.dash-debt-strip article::before,
.ledger-summary article::before,
.cards article::before,
.cards article::after {
  display: none !important;
  content: none !important;
}
.metric-card::before {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 10px !important;
  bottom: 10px !important;
  width: 2.5px !important;
  border-radius: 0 3px 3px 0 !important;
  z-index: 2 !important;
}
.metric-card-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 28px !important;
  margin: 0 !important;
  order: 0 !important;
}
.metric-card-label {
  order: 0 !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  text-align: left !important;
  font-size: 10px !important;
}
.metric-card-icon {
  order: 1 !important;
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  border-radius: 8px !important;
}
.metric-card-icon .material-symbols-outlined {
  font-size: 16px !important;
}
.metric-card-value {
  order: 2 !important;
  margin: 6px 0 3px !important;
  text-align: left !important;
  font-size: 1.05rem !important;
  line-height: 1.2 !important;
}
.metric-card-meta {
  order: 3 !important;
  margin: 0 !important;
  text-align: left !important;
  font-size: 10.5px !important;
}
.metric-card-hint {
  order: 4 !important;
  margin-top: 4px !important;
  text-align: left !important;
  font-size: 10px !important;
}
/* Hide legacy icon wrappers if any remain */
.strip-icon,
.card-icon,
.sum-icon,
.kpi-icon { display: none !important; }

/* Kill legacy border accents from style.css */
.dash-kpi,
.dash-debt-strip article,
.ledger-summary article,
.cards article {
  border-top-color: var(--line) !important;
  border-top-width: 1px !important;
  border-top-style: solid !important;
}
.report-drill {
  border-top: 1px solid var(--line) !important;
  box-shadow: none !important;
}

@media (max-width: 1200px) {
  .report-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 1100px) {
  .metric-card-grid,
  .cards,
  .dash-kpis,
  .dash-debt-strip,
  .ledger-summary,
  .report-kpis.four,
  .report-kpis.six {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  .metric-card-grid,
  .cards,
  .dash-kpis,
  .dash-debt-strip,
  .ledger-summary,
  .report-kpis.four,
  .report-kpis.six {
    grid-template-columns: 1fr !important;
  }
}

/* Partner contact on add / detail */
.entity-fields-customer{grid-template-columns:1fr 1.3fr 1fr!important}
.entity-fields-supplier{grid-template-columns:1fr!important}
.entity-kind-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}
.entity-kind-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line, #b8d4ea);
  border-radius: 12px;
  background: var(--bg-soft, #f0f8fd);
  color: var(--ink-2, #1e3a5f);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.entity-kind-tab .material-symbols-outlined {
  font-size: 20px;
  color: var(--muted, #4a6d8c);
}
.entity-kind-tab:hover {
  border-color: var(--primary, #0284c7);
  background: #e0f2fe;
}
.entity-kind-tab.on {
  border-color: var(--primary, #0284c7);
  background: var(--primary-soft, rgba(2, 132, 199, 0.12));
  color: var(--primary-2, #0369a1);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
.entity-kind-tab.on .material-symbols-outlined {
  color: var(--primary, #0284c7);
}
.entity-supplier-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #b8d4ea);
  background: var(--bg-soft, #f0f8fd);
  font-size: 12px;
  color: var(--muted, #4a6d8c);
  line-height: 1.45;
}
.entity-supplier-hint .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary, #0284c7);
  flex-shrink: 0;
  margin-top: 1px;
}
.entity-add-split {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.entity-add-split .entity-btn,
.entity-add-split .pl-btn-primary,
.entity-add-split .pl-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pl-btn-secondary {
  border: 1px solid var(--line, #b8d4ea) !important;
  background: #fff !important;
  color: var(--primary-2, #0369a1) !important;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.pl-btn-secondary:hover {
  background: #e0f2fe !important;
  border-color: var(--primary, #0284c7) !important;
}
@media (max-width: 640px) {
  .entity-kind-tabs {
    grid-template-columns: 1fr;
  }
  .entity-add-split {
    width: 100%;
  }
  .entity-add-split .entity-btn,
  .entity-add-split button {
    flex: 1 1 auto;
    justify-content: center;
  }
}
.entity-contact-block{
  margin:0 24px 8px;
  padding:14px 16px;
  border:1px solid #e4ebf5;
  border-radius:14px;
  background:linear-gradient(180deg,#f8faff,#fff);
}
.entity-contact-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.entity-contact-head small{
  font-size:10px;
  font-weight:800;
  letter-spacing:.05em;
  color:#64748b;
}
.entity-contact-head span{font-size:11px;color:#94a3b8}
.entity-contact-grid{grid-template-columns:1fr 1fr!important;margin:0!important;gap:12px!important}
.entity-contact-grid label{margin:0}
.partner-contact-card{
  margin:0 22px 14px;
  padding:14px 16px;
  border:1px solid #e4ebf5;
  border-radius:14px;
  background:#f8faff;
}
.partner-contact-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.partner-contact-head b{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  color:#1e293b;
}
.partner-contact-head span{display:block;margin-top:3px;font-size:11px;color:#94a3b8;font-weight:500}
.partner-form{width:min(720px,96vw)!important}

/* Pay mode tabs + chi từ TK */
.pay-mode-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:16px;
}
.pay-mode-tab{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px 16px;
  border:1px solid #dbe3f0;
  border-radius:16px;
  background:#fff;
  cursor:pointer;
  text-align:left;
  transition:border-color .12s,box-shadow .12s,background .12s;
}
.pay-mode-tab .material-symbols-outlined{
  font-size:26px;
  color:#64748b;
  background:#f1f5f9;
  width:44px;height:44px;
  border-radius:12px;
  display:grid;place-items:center;
}
.pay-mode-tab span{display:flex;flex-direction:column;gap:3px}
.pay-mode-tab b{font-size:14px;color:#0f172a;font-weight:750}
.pay-mode-tab small{font-size:11.5px;color:#94a3b8;font-weight:500;line-height:1.35}
.pay-mode-tab:hover{border-color:#93c5fd;background:#f8fbff}
.pay-mode-tab.on{
  border-color:#2563eb;
  background:linear-gradient(180deg,#eff6ff,#dbeafe);
  box-shadow:0 0 0 1px #2563eb33,0 10px 24px #1d4ed818;
}
.pay-mode-tab.on .material-symbols-outlined{
  color:#fff;
  background:linear-gradient(145deg,#3b82f6,#1d4ed8);
}
.pay-mode-tab.on b{color:#1e3a8a}
.pay-mode-tab.on small{color:#3b5bdb}

/* Tab và phần nội dung Thu/Chi dùng chung một đường chia cột 50/50. */
.payment-grid,
.pay-out-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Chuẩn hóa các cặp panel: thẳng mép, cao bằng nhau và không tràn cột. */
.payment-grid,
.pay-out-layout,
.ledger-columns,
.pay-bucket-grid,
.settings-grid,
.lotus-tool-grid {
  align-items: stretch;
}
.payment-grid > *,
.pay-out-layout > *,
.ledger-columns > *,
.pay-bucket-grid > *,
.settings-grid > *,
.lotus-tool-grid > * {
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

.pay-out-layout{
  display:grid;
  gap:16px;
}
.pay-out-card,.pay-out-preview{
  background:#fff;
  border:1px solid #e4ebf5;
  border-radius:16px;
  box-shadow:0 4px 16px #0f172a08;
}
.pay-out-card{padding:18px 18px 16px}
.pay-out-card-head h3{
  display:flex;align-items:center;gap:8px;
  margin:0 0 6px;font-size:15px;font-weight:750;color:#0f172a;
}
.pay-out-card-head p{margin:0 0 14px;font-size:12.5px;color:#64748b;line-height:1.45}
/* Nhập thủ công CK — thu & chi */
.pay-manual-block{
  margin:14px 0 12px;
  padding:14px 14px 12px;
  border:1px solid var(--line,#d5deeb);
  border-radius:14px;
  background:var(--bg-soft,#f8fafc);
}
.pay-manual-head{margin-bottom:12px}
.pay-manual-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px 14px;
}
.pay-manual-grid label{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin:0;
  font-size:11px;
  font-weight:700;
  color:var(--muted,#64748b);
}
.pay-manual-grid input{
  width:100%;
  min-height:40px;
  padding:10px 12px;
  border:1px solid var(--line,#d5deeb);
  border-radius:10px;
  background:#fff;
  color:var(--ink,#0f172a);
  font:inherit;
  font-size:13px;
  font-weight:600;
  box-sizing:border-box;
}
.pay-manual-grid input:focus{
  outline:none;
  border-color:var(--primary,#2563eb);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.pay-manual-amount input{
  font-size:16px;
  font-weight:800;
  color:#0f766e;
}
.pay-manual-full{grid-column:1 / -1}
@media (max-width:720px){
  .pay-manual-grid{grid-template-columns:1fr}
}
.pay-out-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:14px 0;
}
.pay-out-fields label{
  display:flex;flex-direction:column;gap:6px;
  font-size:11px;font-weight:700;color:#64748b;
}
.pay-out-fields input{
  padding:11px 12px;border:1px solid #d5deeb;border-radius:10px;
  font-size:13px;font-weight:600;color:#0f172a;background:#fafbfd;
}
.pay-out-amount input{font-size:18px;font-weight:800;color:#be123c}
.expense-cat-block{margin:4px 0 12px}
.expense-cat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:8px;
}
.expense-cat-chip{
  display:flex;align-items:center;gap:8px;
  padding:10px 12px;
  border:1px solid #dbe3f0;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  font-size:12px;font-weight:650;color:#334155;
  transition:border-color .12s,background .12s,box-shadow .12s;
}
.expense-cat-chip .material-symbols-outlined{font-size:20px;color:#64748b}
.expense-cat-chip:hover{border-color:#93c5fd;background:#f8fbff}
.expense-cat-chip.on{
  border-color:#2563eb;
  background:linear-gradient(180deg,#eff6ff,#dbeafe);
  color:#1e3a8a;
  box-shadow:0 0 0 1px #2563eb22;
}
.expense-cat-chip.on .material-symbols-outlined{color:#1d4ed8}
.pay-out-side{position:sticky;top:16px}
.pay-out-preview{padding:16px}
.account-class.out{background:#fff7ed;border-color:#fed7aa}
.class-badge.out{background:#ffedd5;color:#c2410c}
.entry.out-entry{border-color:#fecdd3;background:#fff1f2}
.pay-out-note{
  display:flex;gap:8px;align-items:flex-start;
  margin:12px 0;padding:10px 12px;
  border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0;
  font-size:11.5px;color:#64748b;line-height:1.45;
}
.pay-out-note .material-symbols-outlined{font-size:18px;color:#64748b}
.pay-out-clear{width:100%;margin-top:8px;justify-content:center}
@media (max-width:960px){
  .pay-mode-tabs,.payment-grid,.pay-out-layout{grid-template-columns:1fr !important}
  .pay-out-fields{grid-template-columns:1fr}
}

/* =========================================================
   Partner ledger + detail modal redesign (v3)
   ========================================================= */

/* —— Main page toolbar —— */
.partner-ledger-page {
  gap: 18px !important;
}
.pl-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 18px 20px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  background:
    linear-gradient(135deg, #ffffff 0%, #f4f7ff 55%, #eef6ff 100%) !important;
  box-shadow: var(--shadow-sm) !important;
}
.pl-toolbar-copy h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--ink) !important;
  letter-spacing: -0.02em;
}
.pl-toolbar-copy p {
  margin: 5px 0 0 !important;
  color: var(--muted) !important;
  font-size: 12px !important;
}
.pl-toolbar-actions {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
.pl-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 14px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28) !important;
  cursor: pointer !important;
}
.pl-btn-primary:hover { filter: brightness(1.05); }
.pl-btn-soft {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 14px !important;
  border: 1px solid #c7d7f5 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #1e40af !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.pl-btn-soft:hover { background: #f0f5ff !important; }
.pl-search {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 240px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: var(--shadow-xs);
  color: var(--muted);
}
.pl-search .material-symbols-outlined { font-size: 18px; color: #94a3b8; }
.pl-search input {
  flex: 1 !important;
  min-width: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink) !important;
}
.pl-search:focus-within {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

/* Thẻ BSV — note phụ (meta chip dùng class riêng) */
.bsv-note {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}
.form-grid label.full-width { grid-column: 1 / -1; }

/* Ô tìm trong từng cột KH / NCC */
.pl-panel-search {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 12px 10px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--line-strong, #d5dde9) !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  color: var(--muted, #64748b);
  box-shadow: inset 0 1px 0 #fff;
}
.pl-panel-search .material-symbols-outlined {
  font-size: 18px;
  color: #94a3b8;
  flex: 0 0 auto;
}
.pl-panel-search input {
  flex: 1 !important;
  min-width: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink, #0f172a) !important;
}
.pl-panel-search input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.pl-panel-search:focus-within {
  border-color: #93c5fd !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}
.pl-panel-ar .pl-panel-search:focus-within {
  border-color: #fda4af !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1) !important;
}
.pl-panel-ap .pl-panel-search:focus-within {
  border-color: #fcd34d !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12) !important;
}
.pl-search-clear {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
.pl-search-clear:hover {
  background: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Lọc số dư: còn nợ / trả dư / số dư 0 */
.pl-balance-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 12px 10px !important;
  padding: 0 !important;
}
.pl-balance-filters .dash-chip {
  padding: 6px 10px !important;
  font-size: 11.5px !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
}
.pl-balance-filters .dash-chip small {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
  opacity: 0.9;
}
.pl-balance-filters .dash-chip.on small {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.pl-panel-ar .pl-balance-filters .dash-chip.on {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #be123c 100%) !important;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.28) !important;
}
.pl-panel-ap .pl-balance-filters .dash-chip.on {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #d97706 100%) !important;
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.28) !important;
}

/* —— Two columns —— */
.pl-columns {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  align-items: stretch !important;
}
.pl-panel {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden !important;
}
.pl-panel-ar { border-top: 3px solid #e11d48 !important; }
.pl-panel-ap { border-top: 3px solid #d97706 !important; }
.pl-panel-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 16px 16px 12px !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #fbfcfe, #fff) !important;
}
.pl-panel-title {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}
.pl-panel-icon {
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  flex: 0 0 auto !important;
}
.pl-panel-icon.ar {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}
.pl-panel-icon.ap {
  background: var(--warning-soft) !important;
  color: var(--warning) !important;
}
.pl-panel-icon .material-symbols-outlined { font-size: 22px; }
.pl-panel-title h3 {
  margin: 0 !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: var(--ink) !important;
  letter-spacing: -0.01em;
}
.pl-panel-title p {
  margin: 3px 0 0 !important;
  font-size: 11.5px !important;
  color: var(--muted) !important;
}
.pl-count {
  min-width: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.pl-count.ap {
  background: #fff7ed;
  color: #b45309;
}

/* —— List rows —— */
.pl-list {
  flex: 1 !important;
  max-height: min(62vh, 560px) !important;
  overflow-y: auto !important;
  padding: 6px !important;
  background: #f8fafc !important;
}
.pl-row-wrap {
  display: flex !important;
  align-items: stretch !important;
  gap: 4px !important;
  margin: 0 0 6px !important;
}
.pl-row-wrap:last-child { margin-bottom: 0 !important; }
.pl-list > .pl-row,
.pl-list .pl-row-wrap > .pl-row,
.ledger-list > button.pl-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 28px !important;
  gap: 10px !important;
  align-items: center !important;
  flex: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 12px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: var(--shadow-xs) !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: border-color .12s, box-shadow .12s, transform .12s, background .12s !important;
}
.pl-list > .pl-row:last-child { margin-bottom: 0 !important; }
.pl-list > .pl-row:hover,
.pl-row-wrap:hover > .pl-row {
  border-color: #bfdbfe !important;
  background: #f8fbff !important;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.08) !important;
  transform: translateY(-1px);
}
.pl-row-actions {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 4px !important;
  flex: 0 0 auto !important;
  opacity: 0.55 !important;
  transition: opacity .12s !important;
}
.pl-row-wrap:hover .pl-row-actions { opacity: 1 !important; }
.pl-row-act {
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #475569 !important;
  cursor: pointer !important;
  box-shadow: var(--shadow-xs) !important;
}
.pl-row-act .material-symbols-outlined { font-size: 18px !important; }
.pl-row-act:hover {
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  background: #eff6ff !important;
}
.pl-row-act.danger:hover {
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
  background: #fef2f2 !important;
}
.pl-person {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  gap: 0 !important;
}
.pl-av {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, #dbeafe, #eff6ff) !important;
  color: #1d4ed8 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.12);
}
.pl-av.ap {
  background: linear-gradient(145deg, #ffedd5, #fff7ed) !important;
  color: #c2410c !important;
  box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.12);
}
.pl-person p {
  min-width: 0 !important;
  margin: 0 0 0 11px !important;
}
.pl-person b {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: var(--ink) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}
.pl-person small {
  display: block !important;
  margin-top: 3px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: var(--muted-2) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
.pl-type {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}
.pl-amount {
  text-align: right !important;
  min-width: 118px;
}
.pl-amount small {
  display: inline-block !important;
  margin-bottom: 2px !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pl-amount .tag-debt { background: #fff1f2; color: #be123c; }
.pl-amount .tag-pay { background: #fff7ed; color: #c2410c; }
.pl-amount .tag-credit { background: #ecfdf5; color: #047857; }
.pl-amount .tag-zero { background: #f1f5f9; color: #64748b; }
.pl-amount b {
  display: block !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pl-amount b.red { color: #be123c !important; }
.pl-amount b.orange { color: #c2410c !important; }
.pl-amount b.green { color: #047857 !important; }
.pl-amount b.muted-bal { color: #64748b !important; }
.pl-amount em {
  display: block !important;
  margin-top: 2px !important;
  color: var(--muted-2) !important;
  font-size: 10.5px !important;
  font-style: normal !important;
}
.pl-mini-bar {
  width: 100%;
  max-width: 110px;
  height: 4px;
  margin: 6px 0 0 auto;
  border-radius: 99px;
  background: #fee2e2;
  overflow: hidden;
}
.pl-mini-bar.ap { background: #ffedd5; }
.pl-mini-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #fb7185, #e11d48);
}
.pl-mini-bar.ap > i {
  background: linear-gradient(90deg, #fdba74, #ea580c);
}
.pl-chevron {
  display: grid !important;
  place-items: center !important;
  color: #cbd5e1 !important;
  font-style: normal !important;
}
.pl-chevron .material-symbols-outlined { font-size: 20px; }
.pl-row:hover .pl-chevron { color: #2563eb !important; }

/* Pagination inside panel */
.pl-panel .ledger-pagination {
  padding: 8px 12px !important;
  border-bottom: 1px solid var(--line) !important;
  background: #fff !important;
}

/* —— Detail modal —— */
.ledger-detail-modal {
  z-index: 40 !important;
  backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.45) !important;
}
/* Form sửa vé / thu-chi phải nổi trên modal đối chiếu (z=40) khi bấm Sửa */
.transaction-edit-modal {
  z-index: 55 !important;
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.5) !important;
}

/* Chi phí nâng hạng vé O / BSV — thẻ lấy thưởng */
.expense-bsv-reward {
  border: 1px solid #c7d7f5 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #f8faff 0%, #fff 60%) !important;
  padding: 12px 14px !important;
}
.service-grid-bsv {
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 10px !important;
}
.service-grid-bsv label.full-width {
  grid-column: 1 / -1;
}
.expense-line-total {
  display: block;
  margin-top: 6px;
  font-size: 16px !important;
  color: #c2410c !important;
  font-variant-numeric: tabular-nums;
}
.expense-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.expense-hint.warn {
  color: #b45309;
}
/* Combobox thẻ BSV trong chi phí kèm theo */
.bsv-card-search {
  margin-top: 6px;
  z-index: 5;
}
.bsv-card-search .partner-search-menu {
  max-height: 280px;
  overflow-y: auto;
  z-index: 60;
}
.bsv-card-search .bsv-add-opt {
  border-top: 1px solid #e2e8f0 !important;
  background: #f0f7ff !important;
  color: #1d4ed8 !important;
}
.bsv-card-search .bsv-add-opt:hover {
  background: #dbeafe !important;
}
.bsv-card-search .bsv-search-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: #94a3b8;
}
/* Modal thêm/sửa thẻ BSV — có thanh cuộn dọc rõ ràng */
.bsv-card-modal {
  z-index: 70 !important;
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.55) !important;
  align-items: center;
  justify-content: center;
  padding: 12px !important;
}
.bsv-card-modal form[data-form="bsv"] {
  width: min(600px, 92vw) !important;
  max-width: 92vw !important;
  max-height: min(86vh, 760px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #7eb8e8 transparent;
}
.bsv-card-modal form[data-form="bsv"]::-webkit-scrollbar {
  width: 10px;
}
.bsv-card-modal form[data-form="bsv"]::-webkit-scrollbar-thumb {
  background: #7eb8e8;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.bsv-card-modal form[data-form="bsv"]::-webkit-scrollbar-thumb:hover {
  background: #5ba3d9;
  background-clip: padding-box;
}
.bsv-card-modal form[data-form="bsv"]::-webkit-scrollbar-track {
  background: rgba(126, 184, 232, 0.15);
  border-radius: 10px;
}
.bsv-card-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface) !important;
  flex-shrink: 0;
}
.bsv-card-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fafbfd !important;
  flex-shrink: 0;
}
.bsv-card-modal .form-grid,
.bsv-card-modal .bsv-family-block,
.bsv-card-modal .bsv-usage-block,
.bsv-card-modal .bsv-detail-block,
.bsv-card-modal .bsv-live-fetch-bar {
  flex-shrink: 0;
}
/* Khối thông tin thẻ (hạn · điểm · nguồn…) — cuộn riêng nếu dài */
.bsv-card-modal .bsv-detail-block .bsv-collapse-body {
  max-height: min(42vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #7eb8e8 transparent;
  padding-right: 4px;
}
.bsv-card-modal .bsv-detail-block .bsv-collapse-body::-webkit-scrollbar {
  width: 8px;
}
.bsv-card-modal .bsv-detail-block .bsv-collapse-body::-webkit-scrollbar-thumb {
  background: #7eb8e8;
  border-radius: 8px;
}
.bsv-card-modal .bsv-detail-block .bsv-collapse-body::-webkit-scrollbar-track {
  background: rgba(126, 184, 232, 0.12);
  border-radius: 8px;
}
.bsv-card-modal .bsv-usage-table-wrap {
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-height: min(220px, 32vh);
  -webkit-overflow-scrolling: touch;
}
.bsv-card-modal .bsv-usage-table {
  min-width: 680px; /* bảng rộng hơn khung → hiện thanh cuộn ngang */
  width: 100%;
}

/* Dòng vừa lưu sau khi sửa — flash nhẹ, không nhảy cuộn */
tr.row-just-saved td,
.payment-ledger-row.row-just-saved,
[data-open-payment].row-just-saved {
  background: #ecfdf5 !important;
  transition: background 0.8s ease;
}
.payment-ledger-row.row-just-saved {
  border-radius: 12px;
}

/* Bộ lọc báo cáo: gõ tìm đối tượng / nguồn vé */
.report-select-search {
  min-width: 180px;
}
.report-filter-search {
  min-width: 180px;
  margin-top: 0;
}
.report-filter-search > input {
  min-width: 180px !important;
  padding: 8px 28px 8px 10px !important;
  border: 1px solid #d5deeb !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #1c2941 !important;
}
.report-filter-search .partner-search-menu {
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
}
.payment-edit-modal {
  z-index: 56 !important;
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.5) !important;
}
.payment-edit-modal form[data-form="edit-payment"] input:not([type="hidden"]),
.payment-edit-modal form[data-form="edit-payment"] select,
.payment-edit-modal form[data-form="edit-payment"] textarea {
  background: #fff;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
  color: #0f172a;
}
.payment-edit-modal form[data-form="edit-payment"] input:focus,
.payment-edit-modal form[data-form="edit-payment"] select:focus,
.payment-edit-modal form[data-form="edit-payment"] textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.payment-edit-modal .expense-hint {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}
.pay-save-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .2s ease, transform .2s ease;
}
.pay-save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Check trùng thu/chi (ngày + số tiền) ---- */
.pay-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.pay-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pay-history-actions .pay-history-search {
  min-width: min(300px, 100%);
  max-width: 380px;
  flex: 1 1 220px;
}

/* Thu ngoài công nợ vé */
.class-badge.other-in {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #047857;
  border: 1px solid #6ee7b7;
}
.income-cat-block {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #d1fae5;
  border-radius: 14px;
  background: #f0fdf4;
}
.income-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

/* ---- Nhập sao kê Excel → thu/chi ---- */
.demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pay-stmt-upload {
  cursor: pointer;
  margin: 0;
}
.bank-stmt-modal {
  z-index: 58 !important;
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.5) !important;
}
.bank-stmt-shell {
  width: min(1280px, 98vw);
  max-height: min(92vh, 940px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.bank-stmt-shell .modal-head {
  padding: 16px 20px 10px;
  flex-shrink: 0;
}
.bank-stmt-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bank-stmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  padding: 0 20px 12px;
  border-bottom: 1px solid #e8eef6;
}
.bank-stmt-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  margin: 0;
}
.bank-stmt-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 20px;
  font-size: 12.5px;
  color: #64748b;
  background: #f8fafc;
}
.bank-stmt-stats .ok { color: #15803d; }
.bank-stmt-stats .ok-sub { color: #166534; font-weight: 600; }
.bank-stmt-default-kind select,
.bank-stmt-default-bank select {
  margin-left: 6px;
  min-width: 140px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}
.bank-stmt-kind-cell,
.bank-stmt-bank-cell {
  min-width: 148px;
  vertical-align: top;
}
.bank-stmt-kind,
.bank-stmt-bank,
.bank-stmt-income-cat {
  width: 100%;
  min-width: 132px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 5px 7px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  display: block;
}
.bank-stmt-kind:focus,
.bank-stmt-bank:focus,
.bank-stmt-income-cat:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.bank-stmt-income-cat {
  margin-top: 4px;
  font-weight: 600;
  color: #0f766e;
  border-color: #99f6e4;
  background: #f0fdfa;
}
.bank-stmt-kind-hint {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}
tr.is-sel .bank-stmt-kind { border-color: #86efac; background: #f0fdf4; color: #166534; }
tr.is-sel .bank-stmt-bank { border-color: #93c5fd; background: #eff6ff; color: #1e40af; }
.bank-stmt-bulk {
  display: flex;
  gap: 8px;
  padding: 8px 20px 4px;
}
.bank-stmt-section {
  padding: 0 12px 8px;
}
.bank-stmt-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px 6px;
}
.bank-stmt-section-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bank-stmt-section-head p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
.bank-stmt-dup-section {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #fdba74;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 40px);
  border-radius: 0 0 12px 12px;
}
.bank-stmt-dup-empty {
  margin: 0 8px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Panel trùng: cuộn ngang + dọc */
.bank-stmt-dup-scroll {
  margin: 0 8px 12px;
  max-height: min(42vh, 440px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #fdba74;
  border-radius: 14px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #fb923c #fff7ed;
}
.bank-stmt-dup-scroll::-webkit-scrollbar {
  height: 14px;
  width: 12px;
}
.bank-stmt-dup-scroll::-webkit-scrollbar-track {
  background: #fff7ed;
  border-radius: 0 0 14px 14px;
}
.bank-stmt-dup-scroll::-webkit-scrollbar-thumb {
  background: #fb923c;
  border-radius: 999px;
  border: 2px solid #fff7ed;
}
.bank-stmt-dup-scroll::-webkit-scrollbar-thumb:hover {
  background: #ea580c;
}
.bank-stmt-dup-list {
  min-width: 920px;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bank-stmt-dup-card {
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fffbeb;
  overflow: hidden;
}
.bank-stmt-dup-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
  border-bottom: 1px dashed #fdba74;
  background: #ffedd5;
}
.bank-stmt-dup-hint {
  font-size: 12px;
  color: #9a3412;
  font-weight: 600;
}
.bank-stmt-dup-compare {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 48px minmax(320px, 1fr);
  gap: 0;
  min-width: 880px;
  background: #fff;
}
.bank-stmt-dup-side {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.bank-stmt-dup-side.is-stmt {
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 48px);
  border-right: 1px solid #e2e8f0;
}
.bank-stmt-dup-side.is-ledger {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 48px);
}
.bank-stmt-dup-side header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.bank-stmt-dup-side header b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.bank-stmt-dup-side header small {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.bank-stmt-dup-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 800;
  font-size: 18px;
  border-left: 1px solid #fed7aa;
  border-right: 1px solid #fed7aa;
}
.bank-stmt-dup-vs small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bank-stmt-dup-field {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 10px;
  align-items: start;
  font-size: 12.5px;
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}
.bank-stmt-dup-field-edit {
  align-items: center;
}
.bank-stmt-dup-kind-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.bank-stmt-dup-field-edit .bank-stmt-kind,
.bank-stmt-dup-field-edit .bank-stmt-bank,
.bank-stmt-dup-field-edit .bank-stmt-income-cat,
.bank-stmt-dup-field-edit .bank-stmt-partner-input {
  width: 100%;
  min-width: 0;
}
.bank-stmt-dup-field-edit .bank-stmt-kind {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.bank-stmt-dup-field-edit .bank-stmt-bank {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}
.bank-stmt-dup-side .bank-stmt-partner-search {
  width: 100%;
}
.bank-stmt-dup-side .bank-stmt-kind-hint {
  margin-top: 0;
}
.bank-stmt-dup-field-lab {
  color: #64748b;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-top: 2px;
}
.bank-stmt-dup-field-val {
  color: #0f172a;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.35;
}
.bank-stmt-dup-field-val.gain { color: #15803d; }
.bank-stmt-dup-field-val.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.bank-stmt-dup-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  align-items: flex-end;
}
.bank-stmt-dup-act {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin: 0;
}
.bank-stmt-dup-act .bank-stmt-action {
  min-width: 140px;
}
.bank-stmt-del-btn {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 7px 10px !important;
  border-radius: 9px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-danger-outline {
  border: 1px solid #fca5a5;
  background: #fff;
  color: #b91c1c;
}
.btn-danger-outline:hover {
  background: #fef2f2;
  border-color: #f87171;
}
.bank-stmt-dup-missing {
  padding: 14px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}
.bank-stmt-stats .warn { color: #c2410c; font-weight: 700; }
.bank-stmt-action {
  min-width: 118px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}
.bank-stmt-action:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
tr.is-sel .bank-stmt-action { border-color: #86efac; background: #f0fdf4; color: #166534; }
tr.is-skip .bank-stmt-action,
tr.is-dup .bank-stmt-action { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.bank-stmt-table {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  margin: 0 0 8px;
  max-height: min(36vh, 360px);
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  /* Thanh kéo ngang rõ hơn (Windows / trackpad) */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}
.bank-stmt-table::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}
.bank-stmt-table::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 0 12px 12px;
}
.bank-stmt-table::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}
.bank-stmt-table::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.bank-stmt-dup-table {
  max-height: min(28vh, 280px);
  border-color: #fdba74;
}
.bank-stmt-dup-table::-webkit-scrollbar-track {
  background: #fff7ed;
}
.bank-stmt-dup-table::-webkit-scrollbar-thumb {
  background: #fb923c;
  border-color: #fff7ed;
}
.bank-stmt-dup-table::-webkit-scrollbar-thumb:hover {
  background: #ea580c;
}
/* Bảng rộng hơn khung → xuất hiện thanh kéo trái–phải */
.bank-stmt-table table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.bank-stmt-table th,
.bank-stmt-table td {
  white-space: nowrap;
  vertical-align: middle;
}
.bank-stmt-table th:nth-child(1),
.bank-stmt-table td:nth-child(1) { min-width: 120px; } /* QUYẾT ĐỊNH */
.bank-stmt-table th:nth-child(2),
.bank-stmt-table td:nth-child(2) { min-width: 150px; } /* NGHIỆP VỤ */
.bank-stmt-table th:nth-child(3),
.bank-stmt-table td:nth-child(3) { min-width: 100px; } /* NGÀY */
.bank-stmt-table th:nth-child(4),
.bank-stmt-table td:nth-child(4) { min-width: 110px; } /* SỐ TIỀN */
.bank-stmt-table th:nth-child(5),
.bank-stmt-table td:nth-child(5) { min-width: 180px; white-space: normal; } /* ĐỐI TƯỢNG */
.bank-stmt-table th:nth-child(6),
.bank-stmt-table td:nth-child(6) {
  min-width: 300px;
  max-width: 460px;
  white-space: normal;
} /* DIỄN GIẢI */
.bank-stmt-table th:nth-child(7),
.bank-stmt-table td:nth-child(7) { min-width: 150px; } /* MÃ FT */
.bank-stmt-table th:nth-child(8),
.bank-stmt-table td:nth-child(8) { min-width: 120px; } /* TT */
.bank-stmt-default-bank {
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
}
.bank-stmt-default-bank select {
  min-width: 200px !important;
  border-color: #93c5fd !important;
  background: #fff !important;
  color: #1e40af !important;
}
.bank-stmt-side-filter select,
.bank-stmt-default-out-kind select {
  margin-left: 6px;
  min-width: 150px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}
.bank-stmt-tag.out-room { background: #ffedd5; color: #9a3412; }
.bank-stmt-tag.out-debt { background: #fee2e2; color: #991b1b; }
.bank-stmt-tag.recurring { background: #e2e8f0; color: #475569; }
tr.is-out.is-sel { background: #fff7ed !important; }
/* Ưu tiên xem / sẽ nhập — nổi trên */
tr.is-priority.is-sel { box-shadow: inset 3px 0 0 #22c55e; }
/* Định kỳ / tiết kiệm / tự động — mờ, đẩy xuống dưới bằng sort */
tr.is-recurring {
  opacity: 0.72;
  background: #f8fafc !important;
}
tr.is-recurring td { color: #64748b; }
.bank-stmt-recurring-note {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
}
.bank-stmt-debt-hint {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: #b91c1c;
  line-height: 1.2;
}
.bank-stmt-partner-search.is-debt-ncc > input.bank-stmt-partner-input {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}
.bank-stmt-table tr.is-dup { background: #fff7ed; }
.bank-stmt-table tr.is-skip { opacity: 0.72; }
.bank-stmt-table tr.is-sel { background: #f0fdf4; }
.bank-stmt-partner-cell {
  min-width: 200px;
  max-width: 280px;
  vertical-align: top;
}
.bank-stmt-partner-search {
  position: relative;
  margin: 0;
  width: 100%;
}
.bank-stmt-partner-search > input.bank-stmt-partner-input {
  width: 100%;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 6px 28px 6px 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}
.bank-stmt-partner-search > input.bank-stmt-partner-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.bank-stmt-partner-search.is-unidentified > input.bank-stmt-partner-input {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}
.bank-stmt-partner-search.is-other-income > input.bank-stmt-partner-input {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}
.bank-stmt-other-hint {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.2;
}
.bank-stmt-partner-search .partner-search-arrow {
  right: 8px;
  font-size: 11px;
  color: #94a3b8;
}
.bank-stmt-partner-menu {
  /* position fixed set by JS — tránh bị cắt bởi overflow bảng */
  max-height: 280px;
  overflow-y: auto;
  z-index: 90;
}
.bank-stmt-partner-menu button.on {
  background: #edf3ff;
}
.bank-stmt-partner-menu .bank-stmt-partner-new {
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0 !important;
  border-radius: 7px;
  margin-bottom: 4px;
}
.bank-stmt-partner-menu .bank-stmt-partner-new b { color: #166534; }
.bank-stmt-partner-menu .bank-stmt-partner-new small { color: #15803d; }
.bank-stmt-ft {
  max-width: 180px;
  word-break: break-all;
  white-space: normal;
  color: #64748b;
  font-size: 11.5px;
}
.bank-stmt-desc {
  min-width: 280px;
  max-width: 420px;
  word-break: break-word;
  white-space: normal;
  vertical-align: top;
}
.bank-stmt-desc-full {
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  /* Hiện full nội dung — không cắt … */
  max-height: none;
}
.bank-stmt-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.bank-stmt-tag.new { background: #dcfce7; color: #166534; }
.bank-stmt-tag.dup { background: #ffedd5; color: #9a3412; }
.bank-stmt-tag.skip { background: #f1f5f9; color: #64748b; }
.bank-stmt-shell .modal-actions {
  padding: 12px 20px 16px;
  border-top: 1px solid #e8eef6;
  flex-shrink: 0;
}
.pay-history-actions .ghost-btn {
  border: 1px solid #d5deeb;
  background: #fff;
  color: #64748b;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pay-history-actions .ghost-btn:hover { background: #f8fafc; color: #334155; }
.pay-history-table {
  max-height: min(62vh, 720px);
  overflow: auto;
}

/* Ô tìm trong modal đối chiếu công nợ (chi tiết phát sinh / TT) */
.ld-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}
.ld-section-head .detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ld-search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: min(280px, 100%);
  max-width: 360px;
  flex: 1 1 200px;
  margin: 0;
  background: #fff;
  border: 1px solid #d5deeb;
  border-radius: 12px;
  padding: 0 8px 0 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ld-search-box:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.ld-search-box .ld-search-icon {
  display: grid;
  place-items: center;
  color: #94a3b8;
  flex-shrink: 0;
}
.ld-search-box .ld-search-icon .material-symbols-outlined {
  font-size: 18px;
}
.ld-search-box input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 9px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  outline: none;
}
.ld-search-box input[type="search"]::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.ld-search-box input[type="search"]::-webkit-search-cancel-button {
  display: none;
}
.ld-search-clear {
  display: grid;
  place-items: center;
  border: 0;
  background: #f1f5f9;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.ld-search-clear:hover {
  background: #e2e8f0;
  color: #334155;
}
.ld-search-clear .material-symbols-outlined {
  font-size: 16px;
}
/* Dòng thu/chi vừa lưu — highlight, không nhảy scroll trang */
tr.row-just-saved td,
.payment-ledger-row.row-just-saved,
[data-open-payment].row-just-saved {
  animation: pay-row-flash 1.2s ease;
}
@keyframes pay-row-flash {
  0% { background: #dbeafe; }
  100% { background: transparent; }
}
.pay-dup-idle,
.pay-dup-ok,
.pay-dup-result {
  margin: 0 18px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
}
.pay-dup-idle {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}
.pay-dup-ok {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.pay-dup-ok .material-symbols-outlined { color: #059669; font-size: 22px; }
.pay-dup-ok b { display: block; font-size: 13px; margin-bottom: 2px; }
.pay-dup-ok p { margin: 0; color: #047857; font-size: 12px; }
.pay-dup-result {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 0;
  overflow: hidden;
}
.pay-dup-result-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid #fde68a;
  background: #fff7ed;
}
.pay-dup-result-head .material-symbols-outlined { color: #d97706; font-size: 22px; }
.pay-dup-result-head b { display: block; color: #9a3412; font-size: 13.5px; }
.pay-dup-result-head p { margin: 3px 0 0; color: #b45309; font-size: 12px; }
.pay-dup-groups { display: flex; flex-direction: column; gap: 0; max-height: 420px; overflow: auto; }
.pay-dup-group {
  border-top: 1px solid #fde68a;
  background: #fff;
}
.pay-dup-group:first-child { border-top: 0; }
.pay-dup-group header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #fffbeb;
}
.pay-dup-group header strong {
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}
.pay-dup-group header > span {
  color: #78350f;
  font-size: 12px;
  flex: 1;
}
.pay-dup-skip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #fbbf24;
  background: #fff;
  color: #92400e;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.pay-dup-skip:hover { background: #fef3c7; }
.pay-dup-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pay-dup-group li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid #f3f4f6;
  flex-wrap: wrap;
}
.pay-dup-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  flex: 1;
  min-width: 200px;
  font-size: 12px;
}
.pay-dup-item-main b { color: #1e293b; }
.pay-dup-item-main .muted { color: #64748b; }
.pay-dup-item-main em {
  flex: 1 1 100%;
  font-style: normal;
  color: #94a3b8;
  font-size: 11px;
}
.pay-dup-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.pay-dup-item-actions .btn-danger {
  padding: 7px 10px;
  font-size: 11px;
}
.pay-row-dup td {
  background: #fff7ed !important;
}
.pay-dup-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fed7aa;
  color: #9a3412;
  font-size: 9px;
  font-weight: 800;
  vertical-align: middle;
}
/* Thêm đại lý / catalog mở từ form sửa — nổi trên cả form sửa */
.partner-add-modal,
.catalog-modal {
  z-index: 60 !important;
}
.ledger-detail-modal > section.ld-shell {
  width: min(1200px, 98vw) !important;
  max-height: 94vh !important;
  overflow: auto !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: #f4f6fb !important;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.28) !important;
}
.ld-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  background:
    radial-gradient(1200px 280px at 10% -20%, rgba(37, 99, 235, 0.18), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
  color: #fff;
}
.ld-supplier .ld-hero {
  background:
    radial-gradient(1200px 280px at 10% -20%, rgba(234, 88, 12, 0.22), transparent 55%),
    linear-gradient(135deg, #1c1917 0%, #9a3412 50%, #ea580c 100%);
}
.ld-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.ld-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}
.ld-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.78;
}
.ld-breadcrumb .material-symbols-outlined { font-size: 15px; }
.ld-hero-text h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.ld-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.ld-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 700;
}
.ld-chip.soft {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  opacity: 0.95;
}
.ld-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background .12s;
}
.ld-close:hover { background: rgba(255, 255, 255, 0.22); }
.ld-close .material-symbols-outlined { font-size: 20px; }

/* KPI strip — 4 cột: Đầu kỳ · Phát sinh · Đã thu/trả · Cuối kỳ */
.ld-kpis.detail-balance {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1.2fr !important;
  gap: 12px !important;
  margin: -14px 20px 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  position: relative;
  z-index: 2;
}
.ld-kpis.ld-kpis-4 {
  grid-template-columns: 1fr 1fr 1fr 1.2fr !important;
}
.ld-kpi {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: var(--shadow-md) !important;
  min-width: 0;
}
.ld-kpi small {
  color: var(--muted) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ld-kpi b {
  color: var(--ink) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.ld-kpi b.ok { color: var(--success) !important; }
.ld-kpi b.warn { color: #c2410c !important; }
.ld-kpi em {
  color: var(--muted-2) !important;
  font-size: 11px !important;
  font-style: normal !important;
}
.ld-kpi.highlight.is-debt {
  background: linear-gradient(180deg, #fff 0%, #fff1f2 100%) !important;
  border-color: #fecdd3 !important;
}
.ld-kpi.highlight.is-debt b { color: var(--danger) !important; }
.ld-kpi.highlight.is-credit {
  background: linear-gradient(180deg, #fff 0%, #ecfdf5 100%) !important;
  border-color: #a7f3d0 !important;
}
.ld-kpi.highlight.is-credit b { color: var(--success) !important; }
.ld-kpi.highlight.is-clear {
  background: linear-gradient(180deg, #fff 0%, #f0f9ff 100%) !important;
  border-color: #bae6fd !important;
}
.ld-bar {
  height: 5px;
  margin-top: 8px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}
.ld-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #34d399, #059669);
}

.ld-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 22px;
}
.ld-card {
  margin: 0 !important;
  padding: 16px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: var(--shadow-xs) !important;
}
.partner-contact-card.ld-card {
  background: #fff !important;
}
.partner-contact-card.is-collapsed {
  padding: 10px 14px !important;
}
.partner-contact-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
.partner-contact-head b {
  gap: 8px !important;
  font-size: 13.5px !important;
}
.ld-contact-toggle {
  display: flex !important;
  flex: 1 !important;
  min-width: 0 !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  border: 0 !important;
  background: transparent !important;
  text-align: left !important;
  cursor: pointer !important;
  color: inherit !important;
}
.ld-contact-toggle b {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  white-space: nowrap;
}
.ld-contact-summary {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #64748b !important;
}
.ld-contact-chevron {
  flex-shrink: 0 !important;
  display: grid !important;
  place-items: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
}
.ld-contact-toggle:hover .ld-contact-chevron {
  background: #e2e8f0 !important;
  color: #1d4ed8 !important;
}
.partner-contact-card.is-open .ld-contact-grid {
  margin-top: 12px !important;
}
.ld-contact-grid label span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.ld-contact-grid label span .mini-icon,
.ld-contact-grid .mini-icon {
  font-size: 14px !important;
  color: #94a3b8;
}
.ld-contact-grid input {
  border-radius: 11px !important;
  border-color: var(--line-strong) !important;
  padding: 10px 12px !important;
  font-weight: 600 !important;
}
.ld-btn-soft {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 9px 12px !important;
  border: 1px solid #c7d7f5 !important;
  border-radius: 11px !important;
  background: #f8faff !important;
  color: #1d4ed8 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.ld-btn-soft:hover { background: #eef4ff !important; }
.ld-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 11px 14px !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.25) !important;
  cursor: pointer !important;
  white-space: nowrap;
}
.ld-btn-ghost {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 9px 10px !important;
  border: 0 !important;
  background: transparent !important;
  color: #1d4ed8 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.ld-btn-ghost:hover { text-decoration: underline; }

/* Kỳ phát sinh theo tháng — modal đối chiếu */
.ld-period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 18px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.ld-period-copy small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ld-period-copy p {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}
.ld-period-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ld-period-month {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.ld-period-month input[type="month"] {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  min-width: 140px;
}
.ld-period-nav {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.ld-period-nav:hover { background: #f1f5f9; border-color: #94a3b8; }
.ld-period-nav .material-symbols-outlined { font-size: 20px; }
.ld-period-all,
.ld-period-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ld-period-all:hover,
.ld-period-pick:hover { background: #f8fafc; border-color: #94a3b8; }
.ld-period-all.on,
.ld-period-pick.on {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px #2563eb14;
}
.ld-period-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}
.ld-period-chip .material-symbols-outlined { font-size: 14px; }

/* Khoảng ngày tự chọn trên modal chi tiết công nợ */
.ld-period-bar {
  flex-direction: column;
  align-items: stretch;
}
.ld-period-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  margin-top: 2px;
}
.ld-period-range-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ld-period-range-label .material-symbols-outlined { font-size: 16px; color: #2563eb; }
.ld-period-day {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.ld-period-day input[type="date"] {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  min-width: 132px;
}
.ld-period-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Dòng DV kèm theo trên đối chiếu NCC */
.ld-expense-row td { background: #fffbeb !important; }
.ld-offset-row td { background: #f0fdf4 !important; }
.ld-op-expense {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fcd34d !important;
}
.ld-op-offset {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
}

/* Dual-role: vừa đại lý vừa NCC (VD HUE CUN) */
.ld-chip-dual {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #6ee7b7 !important;
  font-weight: 800 !important;
}
.ld-dual-banner {
  margin: 0 18px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
  border: 1px solid #a7f3d0;
  display: grid;
  gap: 12px;
}
.ld-dual-banner-text {
  display: grid;
  gap: 4px;
}
.ld-dual-banner-text b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #065f46;
  font-size: 12px;
}
.ld-dual-banner-text span {
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.ld-dual-banner-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ld-dual-banner-kpis span {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d1fae5;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}
.ld-dual-banner-kpis strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.ld-dual-banner-kpis .ld-dual-ap { color: #b45309; }
.ld-dual-banner-kpis .ok { color: #047857; }
.ld-offset-table thead th:nth-child(6) { color: #b45309; }
.ld-profit-summary {
  margin: 6px 0 0 !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.ld-profit-summary b { font-variant-numeric: tabular-nums; }
.ld-profit-summary .gain { color: #047857 !important; }
.ld-profit-summary .owed { color: #b91c1c !important; }
.ld-table tfoot tr.ld-table-foot td {
  background: #f8fafc !important;
  border-top: 2px solid #cbd5e1 !important;
  padding: 10px 12px !important;
  font-size: 12px !important;
  white-space: nowrap;
}
.ld-table tfoot .money-cell { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .ld-dual-banner-kpis { grid-template-columns: 1fr; }
}

.ld-opening {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 200px auto !important;
  gap: 14px !important;
  align-items: center !important;
  background: linear-gradient(135deg, #f8faff, #fff) !important;
}
.ld-opening-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: stretch !important;
  min-width: 0;
}
.ld-opening-actions .ld-btn-primary,
.ld-opening-actions .ld-btn-soft {
  justify-content: center !important;
  white-space: nowrap !important;
  width: 100%;
}
.ld-opening-actions .ld-btn-soft {
  padding: 10px 12px !important;
  font-size: 12px !important;
}
.ld-opening-info small {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #1e3a8a !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ld-opening-info p {
  margin: 5px 0 0 !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  line-height: 1.4;
}
.ld-opening-input {
  display: flex !important;
  align-items: center !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 12px !important;
  background: #fff !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-xs);
}
.ld-opening-input input {
  width: 100% !important;
  padding: 11px 12px !important;
  border: 0 !important;
  outline: 0 !important;
  text-align: right !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: var(--ink) !important;
  font-variant-numeric: tabular-nums;
}
.ld-opening-input span {
  padding-right: 12px !important;
  color: var(--muted-2) !important;
  font-weight: 700 !important;
}

.ld-tabs.ledger-detail-tabs {
  margin: 0 !important;
  padding: 5px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #e8eef8 !important;
  gap: 4px !important;
}
.ld-tabs button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  border-radius: 11px !important;
  font-size: 12.5px !important;
}
.ld-tabs button .material-symbols-outlined { font-size: 18px; }
.ld-tabs button.active {
  background: #fff !important;
  color: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}
.ld-tabs button span {
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbe3f3;
  font-size: 11px;
  font-weight: 800;
}
.ld-tabs button.active span {
  background: #dbeafe;
  color: #1d4ed8;
}

.ld-section-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 2px 2px 0 !important;
}
.ld-section-head h3 {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  color: var(--ink) !important;
}
.ld-section-head p {
  margin: 4px 0 0 !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}
.detail-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}

/* Thanh cuộn ngang phía trên bảng (đồng bộ với bảng) */
.ld-hscroll-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
  min-width: 0;
}
.ld-hscroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  height: 14px;
  margin: 0 0 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}
.ld-hscroll-top::-webkit-scrollbar {
  height: 10px;
}
.ld-hscroll-top::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
}
.ld-hscroll-top::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 8px;
}
.ld-hscroll-spacer {
  height: 1px;
  pointer-events: none;
}
.ld-table {
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  /* Cuộn ngang trái/phải khi nhiều cột (phải trả · thu · LN · Sửa) */
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-width: 100% !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  box-shadow: var(--shadow-xs);
  scrollbar-gutter: stable;
}
.ld-hscroll-wrap .ld-table {
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
}
.ld-table-scroll-hint {
  display: block !important;
  margin: 0 0 6px !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}
.ld-table table {
  margin: 0 !important;
  width: max-content !important;
  min-width: 100% !important;
  min-width: max(100%, 980px) !important;
}
.ld-table thead th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap !important;
  position: sticky;
  top: 0;
  z-index: 2;
}
.ld-table td {
  font-size: 12.5px !important;
  vertical-align: middle !important;
  white-space: nowrap;
}
.ld-table .ld-pnr {
  white-space: normal;
  min-width: 140px;
}
.ld-table .mono {
  font-variant-numeric: tabular-nums;
  color: #475569;
  white-space: nowrap;
}
/* Gợi ý có thể kéo ngang */
.ledger-detail-modal .ld-table::after {
  content: none;
}
.ld-table-scroll-hint {
  display: none;
}
@media (max-width: 1100px) {
  .ld-table-scroll-hint {
    display: block;
    margin: 0 0 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
  }
}
.ld-pnr strong {
  display: block;
  color: #1e3a8a;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ld-pnr b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.ld-pnr small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}
.ld-op {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}
.ld-table .money-cell {
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ld-payments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ld-payments .payment-ledger-row {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) auto auto !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 12px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  cursor: pointer !important;
  transition: border-color .12s, box-shadow .12s;
}
.ld-payments .payment-ledger-row:hover {
  border-color: #bfdbfe !important;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.08);
}
.ld-payments .payment-check {
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
  font-size: 0 !important;
}
.ld-payments .payment-check .material-symbols-outlined {
  font-size: 18px;
  font-weight: 700;
}
.ld-payments .payment-ledger-row p { margin: 0; min-width: 0; }
.ld-payments .payment-ledger-row b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}
.ld-payments .payment-ledger-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}
.ld-payments .payment-ledger-row strong {
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ld-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 36px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  text-align: center;
}
.ld-empty.compact {
  margin: 12px;
  padding: 28px 16px;
  background: transparent;
  border: 0;
}
.ld-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: #f1f5f9;
  color: #64748b;
}
.ld-empty-icon .material-symbols-outlined { font-size: 26px; }
.ld-empty b {
  color: var(--ink);
  font-size: 14px;
}
.ld-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

@media (max-width: 960px) {
  .pl-columns { grid-template-columns: 1fr !important; }
  .pl-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .pl-toolbar-actions { width: 100%; }
  .pl-search { min-width: 0 !important; flex: 1; width: 100%; }
  .ld-kpis.detail-balance,
  .ld-kpis.ld-kpis-4 { grid-template-columns: 1fr 1fr !important; margin-top: 12px !important; }
}
@media (max-width: 640px) {
  .ld-kpis.detail-balance,
  .ld-kpis.ld-kpis-4 { grid-template-columns: 1fr !important; }
  .ld-opening { grid-template-columns: 1fr !important; }
  .ld-opening-input { width: 100%; }
  .ld-opening-actions { width: 100%; }
  .ld-section-head { flex-direction: column; }
  .ld-payments .payment-ledger-row {
    grid-template-columns: 36px minmax(0, 1fr) !important;
  }
  .ld-payments .payment-ledger-row strong,
  .ld-payments .payment-ledger-row .row-edit-btn {
    grid-column: 2;
  }
}

/* =========================================================
   Theme v3 polish � surfaces, tables, chips, forms, pay
   Minimal � flat � consistent
   ========================================================= */

/* Panels / cards — glass nhẹ trên nền mesh */
.dash-panel,
.panel,
.receipt-box,
.posting-box,
.pay-bucket-panel,
.modal .modal-card,
.modal-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.05) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dash-toolbar {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dash-panel-head,
.panel > .toolbar,
.box-title {
  border-bottom-color: var(--line) !important;
  background: transparent !important;
}

/* Chips / filters */
.dash-chip,
.ticket-period-chips .dash-chip,
.filter {
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--muted) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: border-color .12s, background .12s, color .12s;
}
.dash-chip:hover,
.filter:hover {
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
  background: var(--bg-soft) !important;
}
.dash-chip.on,
.filter.on {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}

/* Secondary buttons */
.paste,
.excel-btn,
.entity-btn,
.excel-upload-btn,
.drive-upload-btn,
.f1-upload-btn,
.ghost-btn,
.row-edit-btn {
  border-radius: var(--radius) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: background .12s, border-color .12s, color .12s;
}
.paste {
  border: 1px solid var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--primary) !important;
}
.paste:hover { background: var(--primary-soft) !important; }
.excel-btn,
.excel-upload-btn {
  border: 1px solid #a7f3d0 !important;
  background: var(--success-soft) !important;
  color: var(--success) !important;
}
.ghost-btn {
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--muted) !important;
}
.ghost-btn:hover {
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
  background: var(--bg-soft) !important;
}

/* Tables */
table.dash-table,
.panel table,
.ld-table,
.pay-bucket-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
table.dash-table thead th,
.panel table thead th,
.ld-table thead th,
.pay-bucket-table thead th {
  background: var(--bg-soft) !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line) !important;
  padding: 10px 12px !important;
}
table.dash-table tbody td,
.panel table tbody td,
.ld-table tbody td,
.pay-bucket-table tbody td {
  border-bottom: 1px solid var(--line) !important;
  padding: 11px 12px !important;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
}
table.dash-table tbody tr:hover td,
.panel table tbody tr:hover td,
.ld-table tbody tr:hover td {
  background: var(--bg-soft) !important;
}

/* Forms */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="password"],
input[type="email"],
select,
textarea {
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-size: 13px !important;
  transition: border-color .12s, box-shadow .12s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Toolbar / filter bars */
.dash-toolbar,
.ticket-filterbar,
.pay-history-filters,
.pl-toolbar,
.ledger-toolbar {
  background: transparent !important;
}
.pay-history-filters {
  background: var(--bg-soft) !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 0 var(--radius) var(--radius);
}
.dash-month-picker {
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  border-radius: var(--radius-sm) !important;
}
.dash-range-label {
  color: var(--muted-2) !important;
  font-weight: 500 !important;
}

/* Demo banner / pay header */
.demo-banner,
.pay-page-banner,
.pay-banner {
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  background: var(--ink-2) !important;
}

/* Sample switch cards */
.sample-switch button {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  transition: border-color .12s, background .12s;
}
.sample-switch button.selected {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: none !important;
}

/* Paste zone */
.scan-preview,
.paste-zone {
  border-radius: var(--radius) !important;
  border-color: var(--line-strong) !important;
  background: var(--bg-soft) !important;
}
.paste-zone:hover,
.paste-zone:focus {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Room bank picker */
.pay-room-banks button,
.room-bank-card,
[class*="room-bank"] button {
  border-radius: var(--radius) !important;
}
.pay-out-banks,
.pay-room-bank-grid {
  gap: 10px;
}

/* Payment history list rows */
.ld-payments .payment-ledger-row {
  border-radius: var(--radius) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}
.ld-payments .payment-ledger-row:hover {
  border-color: var(--primary) !important;
  box-shadow: none !important;
  background: var(--primary-soft) !important;
}

/* Metric tone icons � flat soft fills */
.metric-card.tone-revenue .metric-card-icon,
.metric-card.tone-collected .metric-card-icon,
.metric-card.tone-debt .metric-card-icon,
.metric-card.tone-profit .metric-card-icon,
.metric-card.tone-warning .metric-card-icon,
.metric-card.debt .metric-card-icon,
.metric-card.receivable .metric-card-icon,
.metric-card.payable .metric-card-icon {
  box-shadow: none !important;
}
.metric-card.tone-revenue .metric-card-icon { background: var(--primary-soft) !important; color: var(--primary) !important; }
.metric-card.tone-collected .metric-card-icon { background: var(--success-soft) !important; color: var(--success) !important; }
.metric-card.tone-debt .metric-card-icon,
.metric-card.debt .metric-card-icon,
.metric-card.receivable .metric-card-icon { background: var(--danger-soft) !important; color: var(--danger) !important; }
.metric-card.tone-profit .metric-card-icon { background: var(--violet-soft) !important; color: var(--violet) !important; }
.metric-card.tone-warning .metric-card-icon,
.metric-card.payable .metric-card-icon { background: var(--warning-soft) !important; color: var(--warning) !important; }

.metric-card.tone-revenue::before { background: var(--primary) !important; }
.metric-card.tone-collected::before { background: var(--success) !important; }
.metric-card.tone-debt::before,
.metric-card.debt::before,
.metric-card.receivable::before { background: var(--danger) !important; }
.metric-card.tone-profit::before { background: var(--violet) !important; }
.metric-card.tone-warning::before,
.metric-card.payable::before { background: var(--warning) !important; }

/* Empty states */
.dash-empty,
.ld-empty,
.pay-bucket-empty {
  color: var(--muted) !important;
  font-size: 13px !important;
}

/* Scrollbars � subtle */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* Page header quieter */
.page-header-text h1,
.content > header h1 {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}
.page-header-text p,
.content > header p {
  color: var(--muted) !important;
  font-weight: 400 !important;
}

/* Modal */
.modal-backdrop,
.modal {
  backdrop-filter: blur(4px);
}
.modal-head h2 {
  font-weight: 700 !important;
  font-size: 1.1rem !important;
}

/* Partner ledger cards — gọn như KPI tổng quan */
.pl-kpis .metric-card,
.ledger-summary .metric-card {
  min-height: 0;
}

/* Flight panel badge */
.dash-flight-badge {
  border-radius: var(--radius-pill) !important;
  font-weight: 600 !important;
}

/* Sort heads cleaner */
.sort-head {
  font-weight: 700 !important;
  color: var(--muted) !important;
}
.sort-head.active { color: var(--primary) !important; }

/* Money colors stay clear */
.owed, .money-debt, td.owed, b.owed { color: var(--danger) !important; }
.gain, .money-gain, td.gain, b.gain { color: var(--success) !important; }
.supplier-value { color: var(--warning) !important; }

/* Boot loader simpler */
.boot-loader {
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius-lg) !important;
}
.boot-loader .boot-icon {
  border-radius: 12px !important;
  box-shadow: none !important;
}

/* BSV form: số thẻ + MK luôn hiện */
.bsv-card-modal .bsv-form-id-grid {
  padding-bottom: 8px;
}
.bsv-card-modal .bsv-form-detail-grid {
  padding: 12px 0 4px;
}

/* BSV collapsible blocks (thông tin / người thân / lịch sử điểm) */
.bsv-collapse-block {
  margin: 12px 20px 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}
.bsv-detail-block.bsv-collapse-block {
  margin-top: 4px;
}
.bsv-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.bsv-collapse-toggle:hover {
  background: rgba(36, 89, 232, 0.06);
}
.bsv-collapse-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.bsv-collapse-block.is-open .bsv-collapse-icon {
  background: var(--primary-soft, #e9efff);
  border-color: #c7d7fe;
}
.bsv-collapse-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bsv-collapse-text b {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.bsv-collapse-text small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.bsv-collapse-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}
.bsv-collapse-body[hidden] {
  display: none !important;
}

/* BSV usage history on card edit */
.bsv-usage-block {
  /* inherits .bsv-collapse-block */
}
.bsv-usage-intro {
  margin: 10px 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.bsv-usage-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  text-align: right;
}
.bsv-usage-summary-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  text-align: left;
}
.bsv-usage-summary .muted { color: var(--muted); }
.bsv-usage-table-wrap {
  max-height: 280px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.bsv-usage-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 12px;
}
.bsv-usage-table th,
.bsv-usage-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.bsv-usage-table th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  z-index: 1;
}
.bsv-usage-table tbody tr:last-child td { border-bottom: 0; }
.bsv-usage-table .bsv-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}
.bsv-usage-empty,
.bsv-usage-foot {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.bsv-usage-foot { margin-top: 10px; }

/* BSV family members on card */
.bsv-family-block {
  /* inherits .bsv-collapse-block */
}
.bsv-family-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.bsv-family-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 160px;
}
.bsv-family-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bsv-family-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.6fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.bsv-family-idx {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  padding-bottom: 10px;
}
.bsv-family-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 0;
}
.bsv-family-row input,
.bsv-family-row select {
  width: 100%;
  padding: 8px 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink) !important;
}
.bsv-family-empty {
  margin: 0;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
@media (max-width: 720px) {
  .bsv-family-row {
    grid-template-columns: 1fr;
  }
  .bsv-family-idx { padding-bottom: 0; }
}

/* BSV PIN field in modal */
.bsv-card-modal label:has([data-bsv-pin-input]) {
  position: relative;
}
.bsv-card-modal [data-bsv-pin-input] {
  padding-right: 40px !important;
}
.bsv-pin-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
}
.bsv-pin-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.bsv-pin-hint { color: var(--muted-2) !important; font-style: italic; }

/* Lấy thông tin thẻ từ Lotusmiles (bsv.php) */
.bsv-live-fetch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 20px 4px;
  padding: 0 0 4px;
}
.bsv-fetch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #c7d7fe;
  background: #eef3ff;
  color: #1d4ed8;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}
.bsv-fetch-btn:hover:not(:disabled) {
  background: #dbe6ff;
  border-color: #a8bffc;
}
.bsv-fetch-btn:disabled,
.bsv-fetch-btn.is-loading {
  opacity: 0.75;
  cursor: wait;
}
.bsv-fetch-hint {
  color: var(--muted, #8791a3);
  font-size: 11px;
  flex: 1 1 160px;
}
.bsv-fetch-msg {
  flex: 1 1 100%;
  max-width: 100%;
  max-height: 88px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  border: 1px solid #dfe5ee;
  background: #f8fafc;
  color: #334155;
  word-break: break-word;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
}
.bsv-fetch-msg::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.bsv-fetch-msg::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
}
.bsv-fetch-msg::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.bsv-fetch-msg::-webkit-scrollbar-track {
  background: transparent;
}
.bsv-fetch-msg.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.bsv-fetch-msg.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.bsv-fetch-msg.is-loading {
  border-color: #c7d7fe;
  background: #f5f8ff;
  color: #1d4ed8;
}

/* ========== BSV page — UI/UX polish (mobile-first) ========== */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bsv-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Banner */
.bsv-live-banner {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 20px !important;
  border-radius: 16px !important;
  background: linear-gradient(125deg, #12213e 0%, #1e3a6e 55%, #2459e8 140%) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(18, 33, 62, 0.18) !important;
}
.bsv-banner-copy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 220px;
}
.bsv-banner-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.bsv-banner-icon .material-symbols-outlined {
  font-size: 24px;
  color: #fff;
}
.bsv-live-banner b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff !important;
}
.bsv-live-banner p {
  margin: 4px 0 0 !important;
  color: #c7d7fe !important;
  font-size: 12.5px !important;
  line-height: 1.45;
  max-width: 52ch;
}
.bsv-live-tag {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}
.bsv-live-tag .material-symbols-outlined { font-size: 16px; color: #fff; }

/* KPI summary */
.bsv-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.bsv-summary > article.bsv-kpi,
.bsv-kpi {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 16px 16px 14px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-sm) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  min-width: 0;
}
.bsv-kpi:hover {
  border-color: #3b4a63;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.bsv-kpi-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.bsv-kpi-icon.tone-points { background: var(--success-soft); color: var(--success); }
.bsv-kpi-icon.tone-money { background: var(--coral-soft); color: var(--coral); }
.bsv-kpi-icon .material-symbols-outlined { font-size: 22px; color: inherit; }
.bsv-kpi small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.bsv-kpi b {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  word-break: break-word;
}
.bsv-kpi-unit {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--muted);
}
.bsv-kpi em {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-style: normal;
  color: var(--muted);
}

/* Panel */
.bsv-panel {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bsv-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.bsv-panel-title {
  min-width: 0;
  flex: 1 1 200px;
}
.bsv-panel-title h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.bsv-panel-title h3 .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary);
}
.bsv-panel-title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.bsv-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.bsv-search-box {
  min-width: 0;
  flex: 1 1 100%;
  max-width: 100%;
}
.bsv-sort-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 100%;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.bsv-sort-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.bsv-sort-box .bsv-sort-label {
  display: inline-flex;
  color: #94a3b8;
  line-height: 1;
  flex-shrink: 0;
}
.bsv-sort-box select {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text, #1e293b);
  cursor: pointer;
  outline: none;
  padding: 2px 0;
}

/* Buttons */
.bsv-sync-all-btn,
.bsv-panel-actions .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  flex: 1 1 auto;
}
.bsv-sync-all-btn {
  border: 1px solid #3b4a63;
  background: var(--primary-soft);
  color: var(--primary);
}
.bsv-sync-all-btn:hover:not(:disabled) {
  background: rgba(91, 141, 239, 0.22);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.bsv-sync-all-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.bsv-sync-all-btn .material-symbols-outlined,
.bsv-panel-actions .primary .material-symbols-outlined {
  font-size: 18px;
}
.bsv-panel-actions .primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(36, 89, 232, 0.25);
}

/* Sync banner */
.bsv-sync-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.bsv-sync-banner.is-running {
  border-color: #3b4a63;
  background: rgba(91, 141, 239, 0.1);
}
.bsv-sync-banner.is-ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--success-soft);
}
.bsv-sync-banner.is-partial {
  border-color: rgba(251, 191, 36, 0.35);
  background: var(--warning-soft);
}
.bsv-sync-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-soft);
  flex-shrink: 0;
}
.bsv-sync-banner.is-running .bsv-sync-icon .material-symbols-outlined {
  color: #2563eb;
  animation: bsv-spin 1.1s linear infinite;
}
.bsv-sync-banner.is-ok .bsv-sync-icon .material-symbols-outlined { color: #16a34a; }
.bsv-sync-banner.is-partial .bsv-sync-icon .material-symbols-outlined { color: #d97706; }
@keyframes bsv-spin {
  to { transform: rotate(360deg); }
}
.bsv-sync-main {
  flex: 1;
  min-width: 0;
}
.bsv-sync-main b {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.bsv-sync-main p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.bsv-sync-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 99px;
  background: var(--bg);
  overflow: hidden;
}
.bsv-sync-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 99px;
  transition: width 0.25s ease;
}
.bsv-sync-errors {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bsv-sync-errors li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: #b45309;
  line-height: 1.35;
}
.bsv-sync-errors .material-symbols-outlined {
  font-size: 16px;
  margin-top: 1px;
  color: #d97706;
}
.bsv-sync-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Desktop table */
.bsv-table-desktop {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.bsv-table {
  min-width: 860px;
}
.bsv-table th {
  vertical-align: middle;
}
.bsv-table th .material-symbols-outlined {
  font-size: 15px;
  color: #94a3b8;
  margin-right: 2px;
  vertical-align: -3px;
}
.bsv-panel .sort-head {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  color: inherit;
  transition: color 0.12s ease;
}
.bsv-panel .sort-head:hover,
.bsv-panel .sort-head.active {
  color: #1d4ed8;
}
.bsv-panel .sort-head.active .material-symbols-outlined {
  color: #2563eb;
}
.bsv-col-holder { min-width: 180px; max-width: 280px; }
.bsv-holder-name {
  display: block;
  font-size: 13px;
  color: var(--ink);
}
.bsv-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}
.bsv-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
}
.bsv-meta-chip .material-symbols-outlined {
  font-size: 13px;
  color: var(--muted-2);
}
.bsv-meta-pin {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}
.bsv-meta-pin .material-symbols-outlined { color: var(--primary); }
.bsv-meta-note {
  background: var(--coral-soft);
  color: var(--coral);
  border-color: transparent;
  white-space: normal;
  max-width: 28ch;
}
.bsv-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: 1%;
}
.bsv-row-actions .row-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  min-height: 32px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.bsv-row-actions .row-edit-btn:hover {
  transform: translateY(-1px);
}
.bsv-row-actions .row-edit-btn.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}
.bsv-row-actions .row-edit-btn.danger:hover {
  background: #ffe4e6;
  border-color: #e11d48;
}

/* Mobile card list (default hidden on desktop via media) */
.bsv-card-list-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.bsv-mcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bsv-mcard:hover {
  border-color: #3b4a63;
  box-shadow: var(--shadow-md);
}
.bsv-mcard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.bsv-mcard-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.bsv-mcard-idx {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.bsv-mcard-title b {
  display: block;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}
.bsv-mcard-num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.bsv-mcard-num .material-symbols-outlined {
  font-size: 15px;
  color: var(--muted-2);
}
.bsv-mcard-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bsv-mcard-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  min-width: 0;
}
.bsv-mcard-stats span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bsv-mcard-stats span .material-symbols-outlined {
  font-size: 14px;
}
.bsv-mcard-stats b {
  font-size: 13px;
  color: var(--ink);
  word-break: break-word;
}
.bsv-mcard-actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}
.bsv-mcard-actions .row-edit-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
}

/* Empty */
.bsv-empty {
  padding: 40px 20px !important;
  text-align: center;
}
.bsv-empty .ld-empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
}
.bsv-empty .ld-empty-icon .material-symbols-outlined {
  font-size: 28px;
  color: var(--primary);
}
.bsv-empty .primary,
.bsv-empty .ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

/* Guide */
.bsv-ledger {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.bsv-ledger > h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.bsv-ledger > h3 .material-symbols-outlined {
  font-size: 20px;
  color: var(--warning);
}
.bsv-hint-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bsv-hint-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.bsv-hint-row .ledger-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
  font-weight: 800;
}
.bsv-hint-row .ledger-icon .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary);
}
.bsv-hint-row p { margin: 0; min-width: 0; }
.bsv-hint-row b { display: block; font-size: 13px; color: var(--ink); }
.bsv-hint-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* Tier badge polish */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Modal form polish */
.bsv-modal-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.bsv-modal-title-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.bsv-modal-title-icon .material-symbols-outlined {
  font-size: 22px;
  color: var(--primary);
}
.bsv-modal-title h2 { margin: 0; color: var(--ink); }
.bsv-modal-title p { margin: 4px 0 0; color: var(--muted); }
.bsv-card-modal .modal-close-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.bsv-card-modal .modal-close-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.bsv-field-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.bsv-field-label .material-symbols-outlined {
  font-size: 15px;
  color: #94a3b8;
}
.bsv-collapse-text b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bsv-collapse-text b .material-symbols-outlined {
  font-size: 18px;
  color: #2563eb;
}
.bsv-collapse-icon {
  display: grid !important;
  place-items: center;
}
.bsv-collapse-icon .material-symbols-outlined {
  font-size: 22px;
  color: #2563eb;
}
.bsv-fetch-btn,
.bsv-card-modal .modal-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.bsv-fetch-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.bsv-fetch-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bsv-fetch-hint .material-symbols-outlined { font-size: 15px; }
.bsv-fetch-msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.bsv-fetch-msg .material-symbols-outlined {
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}
/* Nội dung text trong ô kết quả — cho phép cuộn ngang nếu 1 dòng dài */
.bsv-fetch-msg-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.bsv-family-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bsv-family-empty .material-symbols-outlined {
  font-size: 18px;
  color: #94a3b8;
}
.bsv-family-head p {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.bsv-family-head p .material-symbols-outlined {
  font-size: 16px;
  color: #64748b;
  margin-top: 2px;
}

/* Responsive: table desktop / cards mobile */
.bsv-table-desktop { display: none; }
.bsv-card-list-mobile { display: flex; }

@media (min-width: 640px) {
  .bsv-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  .bsv-panel-actions {
    width: auto;
    flex: 1 1 320px;
    justify-content: flex-end;
  }
  .bsv-search-box {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 320px;
  }
  .bsv-sort-box {
    flex: 0 1 220px;
    max-width: 260px;
  }
  .bsv-sync-all-btn,
  .bsv-panel-actions .primary {
    flex: 0 0 auto;
  }
}

/* Gift Card có 4 KPI: 4 trên desktop, 2 + 2 trên màn hình vừa. */
@media (min-width: 1101px) {
  .gift-card-page .gift-card-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 640px) and (max-width: 1100px) {
  .gift-card-page .gift-card-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .bsv-page { gap: 18px; }
  .bsv-table-desktop { display: block; }
  .bsv-card-list-mobile { display: none; }
  .bsv-live-banner { padding: 20px 22px !important; }
  .bsv-panel-head { padding: 18px 18px 16px; }
}

@media (max-width: 639px) {
  .bsv-live-banner {
    padding: 14px 14px !important;
  }
  .bsv-banner-icon {
    width: 36px;
    height: 36px;
  }
  .bsv-banner-icon .material-symbols-outlined { font-size: 20px; }
  .bsv-live-banner b { font-size: 14px; }
  .bsv-kpi { padding: 14px; }
  .bsv-kpi b { font-size: 1.05rem; }
  .bsv-sync-banner {
    flex-wrap: wrap;
  }
  .bsv-sync-action {
    width: 100%;
    justify-content: center;
  }
  .bsv-panel-head { padding: 14px; }
  .bsv-mcard-stats {
    grid-template-columns: 1fr 1fr;
  }
  /* Modal: stack credentials cleanly */
  .bsv-card-modal .bsv-form-id-grid {
    grid-template-columns: 1fr !important;
  }
  .bsv-card-modal .bsv-form-detail-grid {
    grid-template-columns: 1fr !important;
  }
  .bsv-live-fetch-bar {
    margin: 0 14px 4px;
  }
  .bsv-card-modal .modal-actions {
    flex-wrap: wrap;
  }
  .bsv-card-modal .modal-actions button {
    flex: 1 1 auto;
    min-height: 42px;
  }
}

@media (max-width: 380px) {
  .bsv-mcard-stats {
    grid-template-columns: 1fr;
  }
  .bsv-sync-all-btn,
  .bsv-panel-actions .primary {
    flex: 1 1 100%;
  }
}

/* =========================================================
   Dark dim overrides — chặn nền trắng / chữ tối hard-code
   ========================================================= */
.panel,
.dash-panel,
.ledger-panel,
.ledger-toolbar,
.report-filters,
.report-type-tabs,
.cards article,
.dash-kpi,
.metric-card,
.ld-empty,
.boot-loader {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

input,
select,
textarea,
.ld-search-box,
.pl-search,
.pl-panel-search,
.partner-search-menu {
  background: var(--bg-soft) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-2) !important;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

.modal,
.modal form,
.modal > section,
.modal > div,
.bsv-card-modal,
.transaction-edit-modal form,
.booking-modal form,
.payment-edit-modal form,
.ledger-detail-modal > section,
.ledger-detail-modal .ld-shell {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.modal-head,
.modal-actions {
  border-color: var(--line) !important;
}
.modal-head h2,
.modal-head h3,
.page-header-text h1,
.content > header h1 {
  color: var(--ink) !important;
}
.modal-head p,
.page-header-text p,
.content > header p {
  color: var(--muted) !important;
}

.row-edit-btn,
.ghost-btn,
.paste,
.excel-btn,
.excel-upload-btn {
  background: var(--bg-soft) !important;
  border-color: var(--line) !important;
  color: var(--ink-2) !important;
}
.row-edit-btn:hover,
.ghost-btn:hover,
.paste:hover {
  background: var(--surface-2) !important;
  border-color: var(--line-strong) !important;
}
.primary {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.bsv-fetch-btn {
  background: var(--primary-soft) !important;
  border-color: #3b4a63 !important;
  color: var(--primary) !important;
}
.bsv-fetch-msg {
  background: var(--bg-soft) !important;
  border-color: var(--line) !important;
  color: var(--ink-2) !important;
}
.bsv-fetch-msg.is-ok {
  background: var(--success-soft) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
  color: var(--success) !important;
}
.bsv-fetch-msg.is-error {
  background: var(--danger-soft) !important;
  border-color: rgba(248, 113, 113, 0.3) !important;
  color: var(--danger) !important;
}
.bsv-fetch-msg.is-loading {
  background: var(--primary-soft) !important;
  border-color: #3b4a63 !important;
  color: var(--primary) !important;
}

.bsv-collapse-block {
  background: var(--bg-soft) !important;
  border-color: var(--line) !important;
}
.bsv-collapse-toggle:hover {
  background: rgba(91, 141, 239, 0.08) !important;
}
.bsv-collapse-icon {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--primary) !important;
}
.bsv-collapse-text b { color: var(--ink) !important; }
.bsv-collapse-text small { color: var(--muted) !important; }

.bsv-note,
.bsv-pin-hint {
  color: var(--muted) !important;
}

.tier-badge {
  box-shadow: none;
}
.tier-badge.tier-platinum { background: #0a0a0a; color: #f5f5f5; }
.tier-badge.tier-gold { background: #b45309; color: #fff7ed; }
.tier-badge.tier-titanium { background: #1e3a8a; color: #dbeafe; }
.tier-badge.tier-diamond { background: #312e81; color: #e0e7ff; }
.tier-badge.tier-member { background: var(--surface-2); color: var(--muted); }

.partner-search-menu button,
.partner-search-menu p {
  color: var(--ink) !important;
}
.partner-search-menu button:hover {
  background: var(--primary-soft) !important;
}

/* Form grid labels trong modal */
.form-grid label,
.bsv-field-label {
  color: var(--muted) !important;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  background: var(--bg) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

/* Toolbar / filters */
.toolbar,
.ticket-filterbar,
.report-intro,
.pay-history {
  color: var(--ink);
}

/* Empty states */
.ld-empty b,
.bsv-empty b {
  color: var(--ink) !important;
}
.ld-empty p,
.bsv-empty p {
  color: var(--muted) !important;
}

/* Table wrap surfaces */
.table-wrap,
.dash-table-wrap,
.report-table-wrap,
.bsv-table-desktop {
  background: transparent;
  border-color: var(--line) !important;
}

/* Sidebar navy — nổi trên nền xanh da trời */
.app-sidebar {
  background: #0c4a6e !important;
  border-right-color: #075985 !important;
}

/* Import multi thẻ BSV */
.bsv-bulk-panel {
  padding: 16px 18px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bsv-bulk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bsv-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bsv-bulk-run {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.bsv-bulk-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.bsv-bulk-label textarea,
textarea[data-bsv-bulk-text] {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 12px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  letter-spacing: 0.01em;
}
.bsv-bulk-label textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  outline: none;
}
.bsv-bulk-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.bsv-bulk-hint .material-symbols-outlined {
  font-size: 16px;
  color: var(--primary);
  margin-top: 1px;
}
.bsv-bulk-count {
  margin-left: auto;
  font-style: normal;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
@media (max-width: 640px) {
  .bsv-bulk-head {
    flex-direction: column;
  }
  .bsv-bulk-actions {
    width: 100%;
  }
  .bsv-bulk-actions .ghost-btn,
  .bsv-bulk-run {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Scrollbar xanh */
*::-webkit-scrollbar-thumb {
  background: #7eb8e8;
}
*::-webkit-scrollbar-thumb:hover {
  background: #5ba3d9;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* Input / panel trên nền xanh */
.panel,
.dash-panel,
.ledger-panel,
.bsv-panel,
.bsv-bulk-panel,
.bsv-ledger {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: var(--line) !important;
}
input,
select,
textarea,
.ld-search-box,
.bsv-sort-box {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

/* ===== V� ch? xu?t / gi? ch? ===== */
.dash-hold-panel { border-color: #fdba74 !important; }
/* Cột PNR · Hành khách: khung hẹp + cuộn ngang khi tên dài */
.dash-flight-panel .dash-table-wrap,
.dash-hold-panel .dash-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-table th.col-pnr-pax,
.dash-table td.col-pnr-pax {
  width: 148px;
  max-width: 148px;
  min-width: 120px;
  vertical-align: middle;
}
.dash-table td.col-pnr-pax .pnr-pax-scroll {
  max-width: 148px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.dash-table td.col-pnr-pax .pnr-pax-scroll strong,
.dash-table td.col-pnr-pax .pnr-pax-scroll b,
.dash-table td.col-pnr-pax .pnr-pax-scroll small {
  display: block;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.dash-table td.col-pnr-pax .pnr-pax-scroll::-webkit-scrollbar {
  height: 5px;
}
.dash-table td.col-pnr-pax .pnr-pax-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dash-hold-panel .dash-flight-badge.hot {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}
.hold-table tr.urgency-expired { background: #fef2f2 !important; }
.hold-table tr.urgency-critical { background: #fff7ed !important; }
.hold-table tr.urgency-warn { background: #fffbeb !important; }
.hold-urgency-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hold-urgency-tag.expired { background: #fecaca; color: #991b1b; }
.hold-urgency-tag.critical { background: #fed7aa; color: #9a3412; }
.hold-urgency-tag.hot { background: #ffedd5; color: #c2410c; }
.hold-urgency-tag.warn { background: #fde68a; color: #92400e; }
.hold-urgency-tag.ok { background: #d1fae5; color: #065f46; }
.hold-table tr.urgency-hot { background: #fff7ed !important; }
.hold-remain { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.hold-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.hold-zalo-btn { color: #0068ff !important; border-color: #93c5fd !important; }
.hold-help-note {
  margin: 10px 14px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.hold-import-note { border-left: 3px solid #f59e0b !important; background: #fffbeb !important; }
.hold-convert-note { border-left: 3px solid #22c55e !important; background: #f0fdf4 !important; }
.chip-hold.is-hold strong { color: #c2410c; }
.hold-notify-chip {
  border-color: #fbbf24 !important;
  background: #fffbeb !important;
  color: #92400e !important;
}
.hold-alert-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(234, 88, 12, 0.35);
}
.hold-alert-bar.show { display: flex; }
.hold-alert-bar.urgency-expired { background: linear-gradient(90deg, #dc2626, #991b1b); }
.hold-alert-bar.urgency-critical { background: linear-gradient(90deg, #ea580c, #c2410c); }
.hold-alert-bar.urgency-warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.hold-alert-bar-text { flex: 1; min-width: 0; }
.hold-alert-bar-btn {
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.95);
  color: #9a3412;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}
.hold-alert-bar-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.9;
}
@media (max-width: 900px) {
  .hold-actions { flex-direction: column; }
  .hold-alert-bar { flex-wrap: wrap; }
}

/* ===== BSV: chip ngu?i th�n clickable + modal xem list ===== */
.bsv-meta-chip.bsv-meta-family.is-clickable {
  cursor: pointer;
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font: inherit;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  max-width: 100%;
  text-align: left;
  transition: background 0.12s, box-shadow 0.12s;
}
.bsv-meta-chip.bsv-meta-family.is-clickable:hover {
  background: #dbeafe !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.bsv-meta-chip.bsv-meta-family.is-clickable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.bsv-family-view-modal {
  z-index: 80;
}
.bsv-family-view-shell {
  width: min(440px, 94vw);
  max-height: min(85vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  padding: 0 0 12px;
}
.bsv-family-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8faff, #fff);
  position: sticky;
  top: 0;
  z-index: 1;
}
.bsv-family-view-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 4px;
}
.bsv-family-view-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}
.bsv-family-view-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.bsv-family-view-list {
  list-style: none;
  margin: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bsv-family-view-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}
.bsv-family-view-idx {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bsv-family-view-list b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.bsv-family-view-list small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.bsv-family-view-list small.muted { opacity: 0.75; font-style: italic; }
.bsv-family-view-actions {
  padding: 8px 14px 4px !important;
  margin: 0 !important;
  border-top: 1px solid var(--line);
}

/* ===== Login / Auth screen ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(14, 165, 233, 0.14), transparent 50%),
    linear-gradient(160deg, #0f2744 0%, #1e3a5f 40%, #0c4a6e 100%);
}
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 28px 26px 22px;
  border: 1px solid rgba(255,255,255,0.6);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8eef8;
}
.auth-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff !important;
  font-size: 24px !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}
.auth-brand b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.auth-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}
.auth-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}
.auth-lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}
.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.auth-retry {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 8px 10px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.auth-form label span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-form input,
.auth-form select {
  width: 100%;
  padding: 12px 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  min-height: 48px;
  box-sizing: border-box;
  color: #0f172a !important;
  background: #f8fafc !important;
}
.auth-form select {
  padding-right: 40px !important;
  cursor: pointer;
}
.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff !important;
}
.auth-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-pass-wrap input {
  padding-right: 44px !important;
}
.auth-pass-toggle {
  position: absolute;
  right: 6px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
}
.auth-pass-toggle:hover { background: #e2e8f0; color: #0f172a; }
.auth-submit {
  margin-top: 6px;
  width: 100%;
  justify-content: center !important;
  padding: 13px 16px !important;
  font-size: 15px !important;
  border-radius: 12px !important;
}
.auth-foot {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #64748b;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.user-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.auth-logout-btn {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #e2e8f0 !important;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.auth-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca !important;
}
.user-actions .auth-logout-btn[data-action="open-change-password"]:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(147, 197, 253, 0.55);
  color: #dbeafe !important;
}
.app-sidebar .user {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
}
.app-sidebar .user-text {
  min-width: 0;
}
.app-sidebar .user-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  width: 100%;
  margin-left: 0;
}
.auth-user-list {
  display: grid;
  gap: 6px;
  margin: 0 20px 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2, #f8fafc);
  max-height: 150px;
  overflow-y: auto;
}
.auth-user-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.auth-user-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-user-row small {
  color: var(--primary);
  font-weight: 700;
}
.auth-user-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}
.auth-user-meta small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
}
.auth-user-meta .is-current {
  background: #dcfce7;
  color: #15803d;
}
.employee-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.employee-account-panel {
  padding: 20px;
}
.employee-account-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.employee-account-panel .panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.employee-account-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
}
.employee-count {
  white-space: nowrap;
  color: var(--primary);
  font-weight: 700;
}
.employee-user-list,
.employee-add-form {
  margin: 0;
}
.employee-add-form .change-pass-actions {
  justify-content: flex-end;
}
@media (max-width: 900px) {
  .employee-account-grid { grid-template-columns: 1fr; }
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.settings-panel {
  padding: 20px;
}
.settings-panel .panel-head {
  margin-bottom: 16px;
}
.settings-panel .panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.settings-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.settings-form {
  margin: 0;
}
.settings-form .change-pass-actions {
  justify-content: flex-end;
}
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.audit-panel { padding: 20px; }
.combined-audit-page { display: grid; gap: 16px; }
.audit-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.audit-toolbar h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.audit-toolbar p { margin: 5px 0 0; color: var(--muted); }
.audit-actions { display: flex; gap: 8px; align-items: center; }
.audit-actions label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 280px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.audit-actions input { width: 100%; border: 0; outline: 0; background: transparent; padding: 9px 0; }
.audit-actions select { min-height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 650; }
.audit-no-change { color: var(--muted); font-size: 12px; }
.audit-table-wrap { max-height: calc(100vh - 240px); overflow: auto; }
.audit-table { min-width: 920px; }
.audit-table td { vertical-align: top; }
.audit-table td:first-child { white-space: nowrap; }
.audit-table code { display: block; max-width: 620px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; color: var(--muted); }
.audit-change-list { display: grid; gap: 6px; min-width: 360px; }
.audit-change-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(90px, 1fr) 18px minmax(90px, 1fr); gap: 7px; align-items: center; font-size: 12px; }
.audit-before, .audit-after, .audit-secret-change { padding: 5px 7px; border-radius: 7px; overflow-wrap: anywhere; }
.audit-before { color: #9f3a38; background: #fff0ef; text-decoration: line-through; }
.audit-after, .audit-secret-change { color: #087443; background: #e9f9f0; font-weight: 700; }
.audit-arrow { text-align: center; color: var(--muted); }
.audit-card-ref { margin-top: 7px; color: var(--muted); font-size: 11px; }
.audit-detail-summary { display: flex; flex-wrap: wrap; gap: 6px; max-width: 620px; }
.audit-detail-summary span { padding: 5px 8px; border-radius: 7px; background: var(--soft); color: var(--muted); font-size: 12px; }

/* Tự cân số phần tử trên mỗi hàng theo tổng số phần tử và chiều rộng thực tế. */
.auto-balanced-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--balanced-cols, 1), minmax(0, 1fr)) !important;
  align-items: stretch;
}
.auto-balanced-grid > * {
  min-width: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.ops-filter-buttons.auto-balanced-grid {
  align-items: stretch;
}
.ops-filter-buttons.auto-balanced-grid > button {
  justify-content: center;
  min-height: 38px;
}
@media (max-width: 900px) {
  .audit-toolbar { flex-direction: column; }
  .audit-actions { width: 100%; flex-wrap: wrap; }
  .audit-actions label { min-width: 0; flex: 1; }
}
.lotus-tool-tabs { display: inline-flex; gap: 6px; margin-bottom: 14px; padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.lotus-tool-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; padding: 9px 14px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.lotus-tool-tabs button.active { background: var(--primary); color: #fff; }
.lotus-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.lotus-tool-panel, .lotus-result-panel { padding: 20px; }
.lotus-tool-panel .panel-head, .lotus-result-panel .panel-head { margin-bottom: 16px; }
.lotus-tool-panel .panel-head h2, .lotus-result-panel .panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.lotus-tool-panel .panel-head p, .lotus-result-panel .panel-head p { margin: 5px 0 0; color: var(--muted); }
.lotus-silver-guide { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; margin: 0 0 16px; padding: 12px 13px; border: 1px solid #bfdbfe; border-radius: 12px; background: linear-gradient(135deg, #eff6ff, #f8fafc); color: #1e3a5f; }
.lotus-silver-guide > .material-symbols-outlined { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e2e8f0; color: #475569; }
.lotus-silver-guide b { display: block; font-size: 13px; }
.lotus-silver-guide p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.lotus-silver-guide button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border: 1px solid #93c5fd; border-radius: 9px; background: #fff; color: #0369a1; font-weight: 700; white-space: nowrap; cursor: pointer; }
.lotus-tool-form { margin: 0; }
.lotus-tool-form input,
.lotus-tool-form select {
  display: block;
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background-color: #f8fafc;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  line-height: 48px;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lotus-tool-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #475569 50%), linear-gradient(135deg, #475569 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.lotus-tool-form select option {
  color: #0f172a;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
}
.lotus-tool-form input:hover,
.lotus-tool-form select:hover { border-color: #94a3b8; background-color: #fff; }
.lotus-tool-form input:focus,
.lotus-tool-form select:focus {
  outline: 0;
  border-color: #0284c7;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
}
.lotus-tool-form input[type="date"] { line-height: normal; }
.lotus-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 48px;
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f1f5f9;
}
.lotus-choice-group.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lotus-choice-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}
.lotus-choice-group button:hover { background: rgba(255,255,255,.72); color: #0369a1; }
.lotus-choice-group button.active { border-color: #7dd3fc; background: #fff; color: #0284c7; box-shadow: 0 2px 7px rgba(2,132,199,.12); }
.lotus-choice-group button .material-symbols-outlined { font-size: 18px; }
.lotus-tool-form > button { margin-top: 16px; width: 100%; justify-content: center; }
.lotus-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lotus-success { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #dcfce7; color: #15803d; font-weight: 750; }
.lotus-member-card { position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 20px; overflow: hidden; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #082f49, #075985 65%, #ca8a04); box-shadow: 0 12px 28px rgba(8,47,73,.22); }
.lotus-member-card::after { content: "✦"; position: absolute; right: 20px; top: 13px; font-size: 44px; color: rgba(255,255,255,.2); }
.lotus-member-card small { color: #fde68a; font-weight: 750; letter-spacing: .08em; }
.lotus-member-card strong { margin-top: 22px; font-size: clamp(22px, 3vw, 30px); letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.lotus-member-card span { margin-top: 8px; font-weight: 650; text-transform: uppercase; }
.lotus-member-card em { position: absolute; right: 20px; bottom: 18px; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.16); font-style: normal; }
.lotus-result-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.lotus-result-sections.lookup { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lotus-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.lotus-metric { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: center; padding: 11px; border: 1px solid #bae6fd; border-radius: 12px; background: #f0f9ff; }
.lotus-metric > .material-symbols-outlined { color: #0284c7; }
.lotus-metric div { display: flex; flex-direction: column; min-width: 0; }
.lotus-metric small { color: var(--muted); font-size: 10px; }
.lotus-metric strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.lotus-metric span { color: var(--muted); font-size: 9px; }
.lotus-info-block { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.lotus-info-block h3, .lotus-relatives h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14px; }
.lotus-info-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.lotus-info-row:last-child { border-bottom: 0; }
.lotus-info-row span { color: var(--muted); }
.lotus-info-row b { overflow-wrap: anywhere; }
.lotus-credential-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lotus-credential-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.lotus-relatives { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.lotus-relatives p { margin: 0; color: var(--muted); }
.lotus-warning { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 10px 12px; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 12px; }
.lotus-technical { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lotus-technical summary { padding: 10px 12px; cursor: pointer; color: var(--muted); font-weight: 650; }
.lotus-technical pre { margin: 0; padding: 14px; max-height: 300px; overflow: auto; background: #0f172a; color: #dbeafe; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; }
@media (max-width: 1200px) { .lotus-result-sections.lookup { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lotus-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .lotus-tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .lotus-form-row, .lotus-result-sections, .lotus-result-sections.lookup, .lotus-metrics { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .lotus-choice-group.three { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .lotus-silver-guide { grid-template-columns: auto minmax(0, 1fr); } .lotus-silver-guide button { grid-column: 1 / -1; justify-content: center; } }
.lotus-progress { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.lotus-progress h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font-size: 14px; }
.lotus-progress ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lotus-progress li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.lotus-progress li > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #dcfce7; color: #16a34a; }
.lotus-progress li b { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lotus-progress li p { margin: 2px 0 0; font-size: 12px; line-height: 1.45; }
.lotus-progress li.running { border-color: #7dd3fc; background: #f0f9ff; }
.lotus-progress li.running > span { background: #e0f2fe; color: #0284c7; animation: lotus-progress-spin 1.2s linear infinite; }
.lotus-progress li.error { border-color: #fecaca; background: #fef2f2; }
.lotus-progress li.error > span { background: #fee2e2; color: #dc2626; }
@keyframes lotus-progress-spin { to { transform: rotate(360deg); } }
.lotus-accounts-panel { padding: 20px; }
.lotus-accounts-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.lotus-accounts-head h2 { display: flex; align-items: center; gap: 7px; margin: 0; }
.lotus-accounts-head p { margin: 5px 0 0; color: var(--muted); }
.lotus-accounts-head label { display: flex; align-items: center; gap: 7px; min-width: 300px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.lotus-accounts-head input { width: 100%; padding: 9px 0; border: 0; outline: 0; background: transparent; }
.lotus-accounts-tools { display: flex; align-items: center; gap: 8px; }
.lotus-accounts-tools > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 150px; height: 40px; margin: 0; white-space: nowrap; }
.lotus-accounts-tools > button .material-symbols-outlined { font-size: 18px; }
.lotus-accounts-tools > button:disabled .material-symbols-outlined { animation: lotus-progress-spin 1.2s linear infinite; }
.lotus-bulk-status { margin-bottom: 13px; padding: 11px 13px; border: 1px solid #bae6fd; border-radius: 11px; background: #f0f9ff; }
.lotus-bulk-status > div { display: flex; align-items: center; gap: 7px; color: #0369a1; }
.lotus-bulk-status > div span { margin-left: auto; color: var(--muted); font-size: 11px; }
.lotus-bulk-status progress { display: block; width: 100%; height: 7px; margin-top: 8px; accent-color: #0284c7; }
.lotus-bulk-status.done { border-color: #bbf7d0; background: #f0fdf4; }
.lotus-bulk-status.done > div { color: #15803d; }
.lotus-bulk-status.warning { border-color: #fde68a; background: #fffbeb; }
.lotus-bulk-status.warning > div { color: #a16207; }
.lotus-account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lotus-account-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.lotus-account-card.tier-register { border-top: 3px solid #d97706; }
.lotus-account-card.tier-silver { border-top: 3px solid #94a3b8; background: linear-gradient(180deg, #f8fafc, var(--surface) 42%); }
.lotus-account-card.tier-titanium { border-top: 3px solid #475569; background: linear-gradient(180deg, #f1f5f9, var(--surface) 42%); }
.lotus-account-card.tier-gold { border-top: 3px solid #ca8a04; background: linear-gradient(180deg, #fffbeb, var(--surface) 42%); }
.lotus-account-card.tier-platinum { border-top: 3px solid #64748b; background: linear-gradient(180deg, #eef2ff, var(--surface) 42%); }
.lotus-account-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lotus-account-card-head div { display: flex; flex-direction: column; }
.lotus-account-card-head small { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.lotus-account-card-head strong { margin-top: 3px; color: #075985; font-size: 19px; letter-spacing: .08em; }
.lotus-account-card-head > span { padding: 4px 8px; border-radius: 99px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 750; }
.lotus-account-card-head > span.tier-register { background: #ffedd5; color: #9a3412; }
.lotus-account-card-head > span.tier-silver { background: #e2e8f0; color: #334155; box-shadow: inset 0 0 0 1px #cbd5e1; }
.lotus-account-card-head > span.tier-titanium { background: #475569; color: #fff; }
.lotus-account-card-head > span.tier-gold { background: #fef3c7; color: #854d0e; box-shadow: inset 0 0 0 1px #fde68a; }
.lotus-account-card-head > span.tier-platinum { background: linear-gradient(135deg, #dbeafe, #e2e8f0); color: #3730a3; box-shadow: inset 0 0 0 1px #c7d2fe; }
.lotus-account-card h3 { margin: 13px 0 9px; font-size: 14px; text-transform: uppercase; }
.lotus-account-meta { display: grid; gap: 5px; }
.lotus-account-meta p { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.lotus-account-meta .material-symbols-outlined { font-size: 15px; }
.lotus-account-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.lotus-account-actions button { display: inline-flex; align-items: center; gap: 4px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; color: var(--text); font-size: 10px; font-weight: 700; cursor: pointer; }
.lotus-account-actions button:first-child { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.lotus-account-actions button.danger { margin-left: auto; color: #b91c1c; }
@media (max-width: 1200px) { .lotus-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .lotus-accounts-head, .lotus-accounts-tools { width: 100%; flex-direction: column; } .lotus-accounts-head label, .lotus-accounts-tools > button { width: 100%; min-width: 0; } .lotus-account-grid { grid-template-columns: 1fr; } }
.lotus-account-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.lotus-account-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.lotus-account-table th { padding: 11px 12px; background: #f8fafc; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.lotus-account-table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
.lotus-account-table tbody tr:hover { background: #f8fbff; }
.lotus-account-row.tier-register td:first-child { box-shadow: inset 3px 0 #d97706; }
.lotus-account-row.tier-silver td:first-child { box-shadow: inset 3px 0 #94a3b8; }
.lotus-account-row.tier-titanium td:first-child { box-shadow: inset 3px 0 #475569; }
.lotus-account-row.tier-gold td:first-child { box-shadow: inset 3px 0 #ca8a04; }
.lotus-account-row.tier-platinum td:first-child { box-shadow: inset 3px 0 #6366f1; }
.lotus-account-number { color: #075985; font-size: 14px; letter-spacing: .07em; white-space: nowrap; }
.lotus-tier-badge { display: inline-flex; padding: 4px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.lotus-tier-badge.tier-register { background: #ffedd5; color: #9a3412; }
.lotus-tier-badge.tier-silver { background: #e2e8f0; color: #334155; box-shadow: inset 0 0 0 1px #cbd5e1; }
.lotus-tier-badge.tier-titanium { background: #475569; color: #fff; }
.lotus-tier-badge.tier-gold { background: #fef3c7; color: #854d0e; }
.lotus-tier-badge.tier-platinum { background: #e0e7ff; color: #3730a3; }
.lotus-table-contact { display: grid; gap: 4px; max-width: 230px; }
.lotus-table-contact span { display: flex; align-items: center; gap: 5px; overflow-wrap: anywhere; color: var(--muted); }
.lotus-table-contact .material-symbols-outlined { flex: 0 0 auto; font-size: 14px; }
.lotus-account-table .lotus-account-actions { flex-wrap: nowrap; margin: 0; padding: 0; border: 0; }
.lotus-account-table .lotus-account-actions button.danger { margin-left: 0; }
.app-sidebar .user-actions .auth-logout-btn {
  width: 100%;
  height: 34px;
}

/* Modal đổi mật khẩu */
.change-pass-modal {
  z-index: 80;
}
.change-pass-card {
  width: min(420px, 94vw);
  max-width: 420px;
  padding: 0 0 8px;
}
.change-pass-card .modal-head {
  padding: 16px 18px 10px;
}
.change-pass-card .modal-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}
.change-pass-card .auth-error,
.change-pass-card .change-pass-ok {
  margin: 0 18px 10px;
}
.change-pass-ok {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #047857;
  font-size: 13px;
  font-weight: 600;
}
.change-pass-form {
  padding: 4px 18px 8px;
}
.change-pass-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.change-pass-card .auth-foot {
  margin: 4px 18px 12px;
  font-size: 11.5px;
}

/* ===== Gift Card ===== */
.gift-card-page .gc-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.gift-card-page .gc-status-tag.unused {
  background: #d1fae5;
  color: #065f46;
}
.gift-card-page .gc-status-tag.used {
  background: #fee2e2;
  color: #991b1b;
}
.gift-card-page .gc-status-tag.activated {
  background: #dbeafe;
  color: #1d4ed8;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
.gift-card-page .gc-status-tag.not-activated {
  background: #f1f5f9;
  color: #64748b;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
.gift-card-page .gc-status-tag.activated:hover,
.gift-card-page .gc-status-tag.not-activated:hover {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.gift-card-modal .gc-activated-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.gift-card-modal .gc-activated-check input {
  width: 18px;
  height: 18px;
}
.gift-card-modal .gc-activated-check b { font-size: 14px; color: var(--ink); }
.gift-card-modal .gc-activated-check small { color: var(--muted); font-weight: 500; font-size: 12px; }
.gc-field-highlight {
  grid-column: 1 / -1;
  padding: 10px 12px !important;
  border-radius: 12px;
  background: #eff6ff !important;
  border: 1px solid #93c5fd !important;
}
.gc-field-highlight input {
  border-color: #60a5fa !important;
  font-weight: 800 !important;
  font-size: 15px !important;
}
/* 2 ô GC: chặng dài/ngắn + nâng hạng */
.gc-dual-fields {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px 14px !important;
  align-items: start !important;
}
.gc-dual-fields .gc-dual-head {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gc-dual-fields .gc-dual-head b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1e3a8a;
}
.gc-dual-fields .gc-dual-head small {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}
.gc-dual-fields .gc-slot {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.gc-dual-fields .gc-slot > span {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
}
.gc-dual-fields .gc-slot > span em {
  font-style: normal;
  font-weight: 600;
  color: #64748b;
}
.gc-dual-fields .gc-slot input {
  width: 100%;
}
.gc-dual-fields .gc-dual-total {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 12.5px;
  font-weight: 600;
}
.gc-dual-fields .gc-dual-total b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .gc-dual-fields {
    grid-template-columns: 1fr !important;
  }
}
.gift-card-page tr.gc-row-used {
  background: #fffafa;
  opacity: 0.92;
}
.gift-card-page tr.gc-row-unused {
  background: #f0fdf9;
}
.gift-card-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.gift-card-pagination .gc-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.gift-card-pagination .gc-page-size select {
  padding: 6px 10px !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  min-width: 72px;
}
.gift-card-pagination .gc-page-info {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 140px;
}
.gift-card-pagination .ticket-page-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.gift-card-pagination .ticket-page-nav button {
  min-width: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.gift-card-pagination .ticket-page-nav button.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.gift-card-pagination .ticket-page-nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gift-card-pagination .page-dots {
  padding: 0 4px;
  color: var(--muted);
}
.gift-card-modal .form-grid label span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Gift Card — 3 loại thẻ: chặng dài / ngắn / nâng hạng */
.gift-card-modal .gc-class-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.gift-card-modal .gc-class-options-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .gift-card-modal .gc-class-options-3 {
    grid-template-columns: 1fr;
  }
}
/* Lọc loại thẻ — 1 nút + menu */
.gift-card-page .gc-class-filter {
  position: relative;
  display: inline-flex;
}
.gift-card-page .gc-class-filter-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 220px);
}
.gift-card-page .gc-class-filter-btn .material-symbols-rounded {
  font-size: 16px;
  flex: 0 0 auto;
}
.gift-card-page .gc-filter-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
  text-align: left;
}
.gift-card-page .gc-filter-btn-text small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.9;
}
.gift-card-page .gc-class-filter-btn.on .gc-filter-btn-text small {
  color: inherit;
  opacity: 0.85;
}
.gift-card-page .gc-filter-btn-text b {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.gift-card-page .gc-class-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Menu tình trạng 2 nhóm: xuất vé + kích hoạt (chọn đồng thời) */
.gift-card-page .gc-status-menu-dual {
  min-width: 220px;
  gap: 8px;
  padding: 8px;
}
.gift-card-page .gc-status-menu-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.gift-card-page .gc-status-menu-group:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.gift-card-page .gc-status-menu-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.gift-card-page .gc-status-menu-head .material-symbols-rounded {
  font-size: 14px;
}
.gift-card-page .gc-status-clear {
  margin-top: 2px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: var(--muted);
}
.gift-card-page .gc-class-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.gift-card-page .gc-class-menu-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.gift-card-page .gc-class-menu-item.on {
  background: var(--primary-soft);
  color: var(--primary);
}
.gift-card-page .gc-class-menu-item .material-symbols-rounded {
  font-size: 18px;
}
.gift-card-modal .gc-class-opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.gift-card-modal .gc-class-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.gift-card-modal .gc-class-opt b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}
.gift-card-modal .gc-class-opt small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
/* Chỉ tô xanh option đang chọn — không giữ .on cũ khi đổi radio */
.gift-card-modal .gc-class-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.gift-card-modal .gc-class-opt:not(:has(input:checked)) {
  border-color: var(--line);
  background: var(--bg-soft);
  box-shadow: none;
}
.gift-card-page .gc-class-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.gift-card-page .gc-class-tag.long {
  color: #1d4ed8;
  background: #dbeafe;
}
.gift-card-page .gc-class-tag.short {
  color: #0f766e;
  background: #ccfbf1;
}
.gift-card-page .gc-class-tag.upgrade {
  color: #a16207;
  background: #fef3c7;
}
.gift-card-page .gc-class-tag .material-symbols-rounded {
  font-size: 15px;
}

/* Gift Card — cảnh báo trùng số seri */
.gift-card-modal .gc-dup-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.gift-card-modal .gc-dup-alert > span {
  flex: 1 1 220px;
}
.gift-card-modal .gc-field-dup input[name="code"] {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}
.gift-card-modal .gc-dup-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.gift-card-modal button.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Gift Card modal — OCR dán ảnh */
.gift-card-modal .gc-ocr-block {
  margin: 0 0 14px;
  padding: 0 0 4px;
}
.gift-card-modal .gc-ocr-block .booking-ocr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.gift-card-modal .gc-ocr-block .booking-ocr-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.gift-card-modal .gc-ocr-block .booking-ocr-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.gift-card-modal .gc-paste-zone {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  outline: none;
}
.gift-card-modal .gc-paste-zone.has-image {
  flex-wrap: wrap;
}
.gift-card-modal .gc-paste-zone img.pay-preview-img {
  max-height: 120px;
  max-width: min(100%, 280px);
  border-radius: 8px;
  object-fit: contain;
  background: #0f172a0a;
}
.gift-card-modal .gc-paste-zone.drag-over {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
}
.gift-card-modal .gc-ocr-multi {
  margin-top: 10px;
}
.gift-card-modal .gc-ocr-multi small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.gift-card-modal .gc-chip-dup {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

/* Gift Card — ẩn MK mặc định, bấm icon mắt mới hiện */
.gift-card-modal .gc-pin-label {
  position: relative;
}
.gift-card-modal .gc-pin-label [data-gc-pin-input] {
  padding-right: 40px !important;
}
.gift-card-page .gc-pin-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.gift-card-page .gc-pin-masked {
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}
.gift-card-page .gc-pin-value {
  font-variant-numeric: tabular-nums;
}
.gift-card-page .gc-pin-reveal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
}
.gift-card-page .gc-pin-reveal-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.gift-card-page .gc-pin-reveal-btn .material-symbols-rounded {
  font-size: 18px;
}
