/* ==========================================================================
   BUN MARKETING OS — BỘ GIAO DIỆN CHUẨN V5.1 (LẦN 1)
   Màu gốc: Obsidian #0B0914 · Tím BUN #8A2BE2 · Vàng #FFD700 · Xanh ngọc #10B981
   Font: Montserrat (hỗ trợ đầy đủ dấu tiếng Việt)
   Khổ chuẩn: 1440px (Máy tính) · 884px (Fold mở / Tablet) · 412px (Điện thoại)
   ========================================================================== */

:root {
  /* MẶC ĐỊNH: THEME SÁNG (Marketing Dashboard sáng, thẻ trắng bo tròn, gradient hồng–tím) */
  --bg-obsidian: #F6F5FB;
  --bg-panel: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-card-hover: #FAF8FD;
  --bg-input: #F3F1F8;
  --bg-elevated: #F3F1F8;

  --border-subtle: #EEEAF5;
  --border-strong: #DFD8EC;

  --bun-pink: #FF3D8B;
  --bun-pink-text: #C2185B;
  --bun-pink-soft: #FFE4F0;
  --bun-purple: #8A2BE2;
  --bun-purple-hover: #7B22CC;
  --bun-purple-soft: rgba(138, 43, 226, 0.1);
  --bun-primary-grad: linear-gradient(135deg, #D6246E 0%, #8A2BE2 100%);
  --bun-primary-grad-hover: linear-gradient(135deg, #C2185B 0%, #7B22CC 100%);

  --bun-blue: #3B82F6;
  --bun-orange: #FF8A3D;
  --bun-chart-green: #22C55E;

  /* Vàng thương hiệu #FFD700 dành riêng cho giá tiền/CP và đồng xu BUN */
  --bun-coin-gold: #FFD700;
  --bun-gold: #C2185B;
  --bun-gold-hover: #AD1457;
  --bun-gold-soft: #FFE4F0;

  --bun-green: #166534;
  --bun-green-soft: #DCFCE7;

  --bun-red: #B91C1C;
  --bun-red-soft: #FEE2E2;

  --bun-amber: #B45309;
  --bun-amber-soft: #FEF3C7;

  --bun-gray: #6E6E8A;
  --bun-gray-soft: #F3F1F8;

  --text-heading: #1A1A3A;
  --text-main: #1A1A3A;
  --text-sub: #4A4A68;
  --text-secondary: #4A4A68;
  --text-muted: #6E6E8A;

  --topbar-h: 58px;
  --sidebar-w: 242px;
  --drawer-w: 420px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px rgba(30, 20, 60, 0.06);
  --shadow-lg: 0 12px 32px rgba(30, 20, 60, 0.12);
}

/* LỰA CHỌN PHỤ: THEME TỐI (Giữ nguyên bảng màu tối gốc) */
html[data-theme="dark"] {
  --bg-obsidian: #0B0914;
  --bg-panel: #131022;
  --bg-card: #17132A;
  --bg-surface: #151226;
  --bg-card-hover: #1F1A38;
  --bg-input: #100D1D;
  --bg-elevated: #221C3D;

  --border-subtle: #282145;
  --border-strong: #3B3066;

  --bun-pink: #FF3D8B;
  --bun-pink-soft: rgba(255, 61, 139, 0.18);
  --bun-purple: #8A2BE2;
  --bun-purple-hover: #9D44F2;
  --bun-purple-soft: rgba(138, 43, 226, 0.18);
  --bun-primary-grad: linear-gradient(135deg, #FF3D8B 0%, #8A2BE2 100%);
  --bun-primary-grad-hover: linear-gradient(135deg, #F02E7C 0%, #7B22CC 100%);

  --bun-coin-gold: #FFD700;
  --bun-gold: #FFD700;
  --bun-gold-hover: #FFE033;
  --bun-gold-soft: rgba(255, 215, 0, 0.15);

  --bun-green: #10B981;
  --bun-green-soft: rgba(16, 185, 129, 0.16);

  --bun-red: #EF4444;
  --bun-red-soft: rgba(239, 68, 68, 0.16);

  --bun-amber: #F59E0B;
  --bun-amber-soft: rgba(245, 158, 11, 0.16);

  --bun-gray: #64748B;
  --bun-gray-soft: rgba(100, 116, 139, 0.2);

  --text-heading: #F8FAFC;
  --text-main: #F8FAFC;
  --text-sub: #CBD5E1;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none !important;
}

/* ================== NÚT BẤM & BADGE THỐNG NHẤT (B2, B4) ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-gold {
  background: var(--bun-gold);
  color: #0B0914;
  border-color: var(--bun-gold);
}

.btn-gold:hover:not(:disabled) {
  background: var(--bun-gold-hover);
}

.btn-purple {
  background: var(--bun-purple);
  color: #FFFFFF;
  border-color: var(--bun-purple);
}

.btn-purple:hover:not(:disabled) {
  background: var(--bun-purple-hover);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--bun-purple);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.08);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-danger-outline:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-sub);
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--bun-purple);
  color: var(--text-main);
}

.ghost-icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
}

.ghost-icon-btn:hover {
  color: var(--text-main);
}

.text-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #C084FC;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
}

.text-link-btn:hover {
  text-decoration: underline;
}

/* Badge màu chuẩn B2 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.badge-green {
  background: var(--bun-green-soft);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-gold {
  background: var(--bun-gold-soft);
  color: #FDE047;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.badge-amber {
  background: var(--bun-amber-soft);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.38);
}

.badge-red {
  background: var(--bun-red-soft);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.42);
}

.badge-gray {
  background: var(--bun-gray-soft);
  color: #CBD5E1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-purple {
  background: var(--bun-purple-soft);
  color: #D8B4FE;
  border: 1px solid rgba(138, 43, 226, 0.45);
}

/* Chấm đỏ cảnh báo phòng nghẽn & trạng thái máy */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: var(--bun-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

.dot-red {
  background: var(--bun-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.75);
}

.dot-amber {
  background: var(--bun-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.65);
}

/* Thanh tiến độ chuẩn B4 */
.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bun-purple), var(--bun-green));
  transition: width 0.28s ease;
}

.progress-fill.is-slow {
  background: linear-gradient(90deg, #DC2626, var(--bun-amber));
}

.progress-fill.is-warn {
  background: linear-gradient(90deg, var(--bun-amber), var(--bun-gold));
}

/* ================== MÀN ĐĂNG NHẬP (C0) ================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 15%, rgba(138, 43, 226, 0.22), transparent 42%),
    radial-gradient(circle at 80% 85%, rgba(255, 215, 0, 0.1), transparent 40%),
    var(--bg-obsidian);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 26px 22px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.25));
}

.auth-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--bun-purple);
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.25);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 58px;
}

.password-input-wrap .ghost-icon-btn {
  position: absolute;
  right: 6px;
}

.form-error {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bun-red-soft);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #FCA5A5;
  font-size: 12.5px;
  font-weight: 600;
}

.demo-accounts-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.demo-accounts-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.demo-accounts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.demo-acc-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.demo-acc-btn:hover {
  border-color: var(--bun-purple);
  background: var(--bg-card-hover);
}

.demo-acc-btn strong {
  font-size: 13px;
  color: var(--text-main);
}

.demo-acc-btn small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.auth-switch-row {
  margin-top: 12px;
}

.auth-footer-note {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ================== THANH TRÊN 1 HÀNG (B5) ================== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(19, 16, 34, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  padding: 4px 2px;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-text {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.brand-accent {
  color: var(--bun-gold);
}

.topbar-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 35px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--bun-purple);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 65;
  padding: 6px;
}

.search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #FDE68A;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.worker-status-anchor,
.account-menu-anchor {
  position: relative;
}

.worker-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 600;
}

.worker-status-btn:hover {
  border-color: var(--bun-purple);
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 700;
}

.account-btn:hover {
  border-color: var(--bun-purple);
}

.account-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--bun-purple);
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 65;
  padding: 12px;
}

.worker-popover {
  width: 330px;
}

.account-dropdown {
  width: 230px;
  padding: 8px;
}

.menu-list-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: var(--text-main);
}

.menu-list-btn:hover {
  background: var(--bg-card-hover);
}

.menu-list-btn.danger {
  color: #FCA5A5;
}

/* ================== BỐ CỤC MENU TRÁI + NỘI DUNG ================== */
.shell-body {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: stretch;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  align-self: stretch;
  min-height: calc(100vh - var(--topbar-h));
  height: auto;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  padding: 12px 10px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  max-height: calc(100vh - var(--topbar-h) - 24px);
  overflow-y: auto;
}

.nav-item-btn {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.nav-item-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.nav-item-btn.active {
  background: var(--bun-purple-soft);
  border-color: rgba(138, 43, 226, 0.55);
  color: #FFFFFF;
  font-weight: 700;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: normal;
  line-height: 1.28;
  overflow-wrap: break-word;
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.18);
  color: var(--bun-gold);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-badge.is-alert {
  background: rgba(239, 68, 68, 0.22);
  color: #FCA5A5;
}

.workspace-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.system-kpi-region {
  padding: 16px 22px 0;
}

.main-view {
  flex: 1;
  padding: 16px 22px 28px;
  min-width: 0;
}

.app-footer {
  margin-top: auto;
  padding: 12px 22px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ================== 6 Ô SỐ LIỆU HỆ THỐNG (B4, B5) ================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.kpi-card:hover {
  border-color: var(--bun-purple);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.kpi-value {
  font-size: 21px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.kpi-delta {
  font-size: 11px;
  font-weight: 700;
  color: #34D399;
}

.kpi-delta.neutral {
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Thanh KPI 1 dòng mỏng khi ở ngoài Tổng quan */
.kpi-slim-bar {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-slim-items {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  min-width: 0;
  scrollbar-width: none;
}

.kpi-slim-items::-webkit-scrollbar {
  display: none;
}

.kpi-slim-pill {
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-sub);
}

.kpi-slim-pill strong {
  color: var(--text-main);
  font-weight: 800;
  margin-left: 4px;
}

/* ================== KHỐI DÙNG CHUNG TRONG TRANG ================== */
.section-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.section-block {
  margin-top: 20px;
}

.section-block:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.panel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.inline-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.banner-red {
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.42);
  color: #FECACA;
}

.banner-purple {
  background: rgba(138, 43, 226, 0.14);
  border: 1px solid rgba(138, 43, 226, 0.42);
  color: #E9D5FF;
}

/* Thẻ mục chuẩn B4: TÊN · TRẠNG THÁI (badge) · tối đa 1–2 NÚT CHÍNH */
.item-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

.item-row-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
}

.item-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ================== TỔNG QUAN (C1) ================== */
.overview-top-split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}

.rooms-grid-12 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.room-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.room-tile:hover {
  border-color: var(--bun-purple);
  background: var(--bg-card-hover);
}

.room-tile.is-bottleneck {
  border-color: rgba(239, 68, 68, 0.5);
}

.room-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.room-code-tag {
  font-size: 11px;
  font-weight: 800;
  color: #D8B4FE;
  background: var(--bun-purple-soft);
  padding: 2px 7px;
  border-radius: 6px;
}

.room-tile-name {
  font-size: 14px;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text-main);
}

.room-tile-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.room-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

/* Dòng thời gian hôm nay */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 52px 14px 1fr;
  align-items: start;
  gap: 8px;
  font-size: 12.5px;
}

.timeline-time {
  font-weight: 800;
  color: var(--bun-gold);
  font-size: 12px;
}

.timeline-dot-col {
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.timeline-title {
  font-weight: 700;
  color: var(--text-main);
}

.timeline-detail {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ================== XƯỞNG SẢN XUẤT & PHÒNG POV (C2, D1, D3) ================== */
.room-strip-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.room-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.room-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.room-chip-btn:hover {
  border-color: var(--bun-purple);
  color: var(--text-main);
}

.room-chip-btn.active {
  background: var(--bun-purple);
  border-color: var(--bun-purple);
  color: #FFFFFF;
}

.room-chip-code {
  font-weight: 800;
}

/* 1. Đầu phòng */
.room-header-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.room-header-left {
  flex: 1;
  min-width: 240px;
}

.room-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-main-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.room-quota-wrap {
  margin-top: 8px;
  max-width: 440px;
}

.room-quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.room-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* Bộ lọc chip + tìm */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}

.filter-chip.active {
  background: var(--bun-purple-soft);
  border-color: var(--bun-purple);
  color: #FFFFFF;
}

.inline-search-input {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12.5px;
  min-width: 210px;
}

/* 2. Plan tháng (Lịch 7 cột trên PC/Fold, danh sách ngày trên ĐT) */
.plan-calendar-desktop {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-weekday {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
}

.cal-day-cell {
  min-height: 76px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-day-cell.is-today {
  border-color: var(--bun-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.35);
}

.cal-day-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.cal-post-pill {
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--bg-elevated);
  text-align: left;
  font-size: 11px;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-post-pill:hover {
  border-color: var(--bun-purple);
}

.cal-post-pill.st-published {
  border-left: 3px solid var(--bun-green);
}

.cal-post-pill.st-approved {
  border-left: 3px solid #34D399;
}

.cal-post-pill.st-pending_review {
  border-left: 3px solid var(--bun-gold);
  background: rgba(255, 215, 0, 0.09);
}

.cal-post-pill.st-in_progress {
  border-left: 3px solid var(--bun-amber);
}

.cal-post-pill.st-planned {
  border-left: 3px solid var(--bun-gray);
}

.plan-list-mobile {
  display: none;
  flex-direction: column;
  gap: 8px;
}

/* 3. Lưới thẻ bài chờ duyệt 9:16 (D1.3) */
.pov-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}

.pov-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.pov-post-card:hover {
  border-color: var(--bun-purple);
}

.pov-post-card.is-qa-warn {
  border-color: rgba(245, 158, 11, 0.55);
}

/* Khung xem trước video dọc 9:16 thu gọn */
.pov-preview-916 {
  position: relative;
  aspect-ratio: 9 / 13;
  max-height: 270px;
  width: 100%;
  background:
    radial-gradient(circle at 50% 25%, rgba(138, 43, 226, 0.35), transparent 65%),
    linear-gradient(180deg, #161129 0%, #0B0914 100%);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.pov-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pov-game-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(11, 9, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #E2E8F0;
}

.pov-duration-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #FFF;
}

/* Hộp chữ POV chuẩn brand_kit: nền vàng #FFD700, chữ đen #000 */
.pov-hook-caption-box {
  background: var(--bun-gold);
  color: #000000;
  font-weight: 800;
  font-size: 11.5px;
  line-height: 1.32;
  padding: 7px 8px;
  border-radius: 6px;
  border: 2px solid #000000;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pov-bill-receipt-mock {
  background: rgba(19, 16, 34, 0.9);
  border: 1px dashed rgba(255, 215, 0, 0.5);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 10.5px;
  color: #E2E8F0;
}

.pov-cta-bar-mock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(138, 43, 226, 0.28);
  border: 1px solid rgba(138, 43, 226, 0.6);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 10.5px;
  font-weight: 800;
}

.pov-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.pov-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.38;
}

.pov-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pov-card-actions {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  gap: 8px;
}

/* 4. Nguyên liệu của chị & Ô nạp kéo-thả (B4, D1.4) */
.upload-dropzone {
  margin-top: 12px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(16, 13, 29, 0.7);
  padding: 18px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone.dragover {
  border-color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.07);
}

.upload-queue-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

/* 5. Hiệu quả phòng & Top 5 bài */
.perf-4-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.chart-canvas-wrap {
  position: relative;
  height: 190px;
  width: 100%;
}

.expert-review-box {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(138, 43, 226, 0.09);
  border-left: 3px solid var(--bun-purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.expert-review-box strong {
  color: var(--bun-gold);
}

/* ================== TRẠNG THÁI TRỐNG / ĐANG TẢI / LỖI (B4) ================== */
.empty-state-box {
  background: var(--bg-panel);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 34px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bun-purple-soft);
  color: #D8B4FE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.skeleton-line {
  height: 16px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1A1530 25%, #2A224A 50%, #1A1530 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================== NGĂN CHI TIẾT BÊN PHẢI (B4) ================== */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 10, 0.66);
  z-index: 78;
}

.modal-backdrop-layer {
  z-index: 92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-w);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #C084FC;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drawer-title {
  margin: 3px 0 0;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.35;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body > *,
.chat-messages > * {
  flex-shrink: 0;
}

.drawer-body > * {
  flex-shrink: 0;
}

.drawer-footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-obsidian);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Nhóm thông tin gấp/mở trong Ngăn Chi tiết */
.fold-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.fold-group summary {
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fold-group summary::-webkit-details-marker {
  display: none;
}

.fold-group summary::after {
  content: "▾";
  color: var(--text-muted);
  font-size: 12px;
}

.fold-group:not([open]) summary::after {
  content: "▸";
}

.fold-content {
  padding: 0 12px 12px;
  font-size: 12.5px;
  color: var(--text-sub);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.hook-option-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  margin-bottom: 8px;
  cursor: pointer;
}

.hook-option-label.selected {
  border-color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.07);
}

.reason-input-row {
  display: flex;
  gap: 6px;
}

.reason-input-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12.5px;
}

.drawer-btn-row {
  display: flex;
  gap: 8px;
}

.drawer-btn-row .btn {
  flex: 1;
}

/* ================== HỘP THOẠI MODAL (B4) ================== */
.modal-dialog {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ================== MASCOT TRỢ LÝ BUN & PANEL CHAT (C10) ================== */
.mascot-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mascot-launcher {
  position: relative;
  width: 78px;
  height: 86px;
  border: none;
  background: radial-gradient(circle at 50% 55%, rgba(138, 43, 226, 0.35), rgba(19, 16, 34, 0.92) 72%);
  border: 1.5px solid rgba(255, 215, 0, 0.55);
  border-radius: 22px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 18px rgba(138, 43, 226, 0.4);
}

.mascot-launcher:hover {
  border-color: var(--bun-gold);
}

.mascot-media-slot {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Chuyển động CSS nhẹ cho ảnh PNG/WebP; tự tắt khi dùng video .webm loop (.is-video) */
.mascot-launcher.state-idle .mascot-media:not(.is-video) {
  animation: mascotIdleFloat 3.2s ease-in-out infinite;
}

.mascot-launcher.state-wave .mascot-media:not(.is-video) {
  animation: mascotWaveBounce 2.1s ease-in-out infinite;
}

.mascot-launcher.state-talk .mascot-media:not(.is-video) {
  animation: mascotTalkPulse 0.55s ease-in-out infinite alternate;
}

@keyframes mascotIdleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

@keyframes mascotWaveBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-4px) rotate(-6deg); }
  40% { transform: translateY(-4px) rotate(6deg); }
  60% { transform: translateY(-2px) rotate(-4deg); }
}

@keyframes mascotTalkPulse {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.06) translateY(-3px); }
}

.mascot-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bun-red);
  color: #FFF;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-obsidian);
}

.mascot-caption-pill {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--bun-gold);
  line-height: 1;
  margin-top: 2px;
}

/* Khung chat rộng ~380px, cao ~70% màn */
.mascot-chat-panel {
  width: 380px;
  height: min(70vh, 620px);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(138, 43, 226, 0.25), rgba(19, 16, 34, 0.95));
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-header-avatar img,
.chat-header-avatar video {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.chat-header-title {
  font-size: 14px;
  font-weight: 800;
}

.chat-header-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.45;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--bun-purple);
  color: #FFF;
  font-weight: 600;
}

.chat-source-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: var(--text-muted);
}

.chat-card-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11.5px;
}

.chat-summary-table td {
  padding: 4px 6px;
  border: 1px solid var(--border-subtle);
}

.chat-quick-prompts {
  padding: 8px 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-quick-prompts::-webkit-scrollbar {
  display: none;
}

.quick-prompt-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: #E9D5FF;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-prompt-chip:hover {
  border-color: var(--bun-gold);
}

.chat-input-row {
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  background: var(--bg-obsidian);
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
}

/* ================== THÔNG BÁO TOAST GÓC TRÊN PHẢI (KHÔNG ĐÈ MENU TRÁI) ================== */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  right: 20px;
  left: auto;
  bottom: auto;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--bun-green);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.toast-item.warn {
  border-left-color: var(--bun-amber);
}

.toast-item.error {
  border-left-color: var(--bun-red);
}

/* ==========================================================================
   KHỔ FOLD MỞ / TABLET (761px – 1099px, chuẩn kiểm thử 884px)
   Menu trái thu thành icon; dải phòng ngang; KPI 3 cột
   ========================================================================== */
@media (max-width: 1099px) and (min-width: 761px) {
  :root {
    --sidebar-w: 68px;
    --drawer-w: 400px;
  }

  .sidebar {
    padding: 12px 8px;
  }

  .nav-item-btn {
    justify-content: center;
    padding: 11px 6px;
  }

  .nav-label {
    display: none;
  }

  .nav-badge {
    position: absolute;
    top: 3px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-top-split {
    grid-template-columns: 1fr;
  }

  .rooms-grid-12 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .perf-4-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   KHỔ ĐIỆN THOẠI (≤ 760px, chuẩn kiểm thử 412px)
   Thanh trên 1 hàng (logo + ☰); menu trong ☰; dải phòng 1 dòng mã phòng;
   Chi tiết & Chat mở toàn màn hình; nội dung chính ở nửa trên màn hình
   ========================================================================== */
@media (max-width: 760px) {
  :root {
    --topbar-h: 52px;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .sidebar-mobile-head.mobile-only {
    display: flex !important;
  }

  /* Trên điện thoại: logo trái, nút ☰ nằm gọn bên phải thanh trên 1 hàng, không cắt avatar */
  .topbar-left {
    gap: 6px;
    min-width: 0;
    flex: 1;
  }

  .brand-text {
    font-size: 13.5px;
    white-space: nowrap;
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
  }

  .topbar-right {
    gap: 4px;
    flex-shrink: 0;
  }

  #mobile-menu-btn {
    order: 2;
    flex-shrink: 0;
  }

  .topbar {
    padding: 0 8px;
    gap: 4px;
    max-width: 100vw;
    overflow: hidden;
  }

  /* Bố trí logo bên trái, nút ☰ ở thanh trên 1 hàng gọn gàng */
  .topbar-search-wrap {
    display: none;
  }

  .topbar-search-wrap.mobile-open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: none;
    height: var(--topbar-h);
    background: var(--bg-panel);
    padding: 8px 10px;
    z-index: 72;
  }

  .topbar-search-wrap.mobile-open #mobile-search-close {
    display: inline-flex;
    position: absolute;
    right: 8px;
  }

  .worker-status-label,
  .account-name-label {
    display: none;
  }

  .worker-status-btn {
    padding: 0 9px;
  }

  .account-btn {
    padding: 0 6px;
  }

  .readonly-pill {
    font-size: 10px;
    padding: 2px 6px;
    white-space: nowrap;
  }

  @media (max-width: 420px) {
    .brand-logo-wrap {
      width: 28px;
      height: 28px;
    }
    .brand-text {
      font-size: 13px;
    }
    .icon-btn,
    .worker-status-btn {
      width: 32px;
      height: 32px;
      padding: 0 6px;
    }
    .account-btn {
      height: 32px;
      padding: 0 4px;
    }
    .account-avatar {
      width: 24px;
      height: 24px;
      font-size: 11px;
    }
    .readonly-pill {
      display: none;
    }
  }

  .worker-popover {
    width: calc(100vw - 24px);
    right: -44px;
  }

  /* Menu trong ☰ (off-canvas) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    min-height: 100dvh;
    height: 100dvh;
    overflow-y: auto;
    z-index: 84;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    padding: 14px 12px;
  }

  .sidebar-nav {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 14px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .system-kpi-region {
    padding: 10px 12px 0;
  }

  .main-view {
    padding: 10px 12px 84px;
  }

  /* 6 ô số liệu xếp 1 cột gọn gàng ở khổ điện thoại, không xuống dòng vụn */
  .kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kpi-card {
    flex: none;
    width: 100%;
    padding: 12px 14px;
  }

  .kpi-value {
    font-size: 17.5px;
  }

  .overview-top-split {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rooms-grid-12 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .room-tile {
    padding: 11px;
  }

  /* Dải phòng 1 dòng nút nhỏ chỉ hiện MÃ PHÒNG */
  .room-strip-bar {
    margin-bottom: 10px;
  }

  .room-chip-name {
    display: none;
  }

  .room-chip-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .room-header-card {
    padding: 12px;
  }

  .room-main-title {
    font-size: 17px;
  }

  .room-header-actions {
    width: 100%;
  }

  .room-header-actions .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Lịch tháng chuyển thành danh sách gọn trên ĐT */
  .plan-calendar-desktop {
    display: none;
  }

  .plan-list-mobile {
    display: flex;
  }

  .pov-cards-grid {
    grid-template-columns: 1fr;
  }

  .perf-4-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .demo-accounts-grid {
    grid-template-columns: 1fr;
  }

  .item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Chi tiết & Chat mở toàn màn hình trên điện thoại */
  .detail-drawer {
    width: 100vw;
    inset: 0;
    border-left: none;
  }

  .mascot-root {
    right: 12px;
    bottom: 12px;
  }

  .mascot-launcher {
    width: 64px;
    height: 70px;
    border-radius: 18px;
  }

  .mascot-media-slot {
    width: 46px;
    height: 46px;
  }

  .mascot-chat-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    z-index: 88;
  }
}


/* ==========================================================================
   CẬP NHẬT LẦN 2 — BỔ SUNG 7 ĐIỂM CHỐT LẦN 1 + 11 PHÒNG + KHO CHUNG + THÊM PHÒNG
   ========================================================================== */

/* Dòng dịch tiếng Việt nhỏ ngay dưới nội dung tiếng Anh (Hook / Sub / Caption) */
.bilingual-vi {
  font-size: 11.5px;
  color: #94A3B8;
  line-height: 1.38;
  margin-top: 3px;
  font-weight: 500;
}

.card-vi-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.room-open-lbl {
  font-size: 11.5px;
  color: #C084FC;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Thẻ bài lỗi cứng viền đỏ rõ ràng */
.pov-post-card.is-qa-hard {
  border-color: rgba(239, 68, 68, 0.65);
}

/* Nút "+ Thêm phòng" nằm chung trong 1 dải chọn phòng duy nhất */
.room-chip-btn.add-room-chip {
  border-style: dashed;
  border-color: rgba(255, 215, 0, 0.55);
  color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.06);
}

.room-chip-btn.add-room-chip:hover {
  border-color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.14);
}

/* Trên máy tính (>= 1180px): Dải chọn phòng tự xuống đúng 2 hàng, thấy đủ 12 phòng không cần cuộn ngang */
@media (min-width: 1180px) {
  .room-strip-bar {
    display: block;
  }

  .room-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .room-strip.cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .room-chip-btn {
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
    font-size: 12px;
    justify-content: flex-start;
  }

  .room-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ================== PHÒNG WI: DẢI 8 TRẠM (ĐẶT GIỮA ĐẦU PHÒNG & PLAN THÁNG) ================== */
.wi-pipeline-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
}

.wi-station-bar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 14px;
}

.wi-station-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
  min-width: 0;
}

.wi-station-pill:hover:not(.is-locked) {
  border-color: var(--bun-purple);
}

.wi-station-pill.is-done {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.wi-station-pill.is-current {
  border-color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.09);
}

.wi-station-pill.is-selected {
  box-shadow: 0 0 0 2px var(--bun-purple);
}

.wi-station-pill.is-locked {
  opacity: 0.52;
  cursor: not-allowed;
}

.wi-st-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.wi-st-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.wi-st-state {
  font-size: 10.5px;
  font-weight: 700;
}

.wi-workspace-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.wi-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.wi-ref-sheet-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wi-4angle-mock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--bg-obsidian);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px;
  text-align: center;
  font-size: 10px;
  color: #D8B4FE;
}

.wi-4angle-mock span {
  background: rgba(138, 43, 226, 0.16);
  border-radius: 4px;
  padding: 8px 2px;
  font-weight: 700;
}

.wi-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.wi-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.wi-data-table th,
.wi-data-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.wi-data-table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

.wi-video-review-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 14px;
}

/* ================== PHÒNG REV: 4 CỔNG DUYỆT TUẦN TỰ TRÊN THẺ ================== */
.rev-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.rev-gates-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.rev-gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
}

.rev-gate-row.is-approved {
  border-color: rgba(16, 185, 129, 0.4);
}

.rev-gate-row.is-pending {
  border-color: rgba(255, 215, 0, 0.55);
  background: rgba(255, 215, 0, 0.06);
}

.rev-gate-row.is-locked {
  opacity: 0.56;
}

/* ================== THẺ ĐẶC THÙ: BLOG (BÀI VIẾT), CODE (MÃ TO), ITEM (BẢNG GIÁ), LIVE ================== */
.wide-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.blog-article-preview {
  background: linear-gradient(180deg, #191430 0%, #100D1E 100%);
  padding: 13px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.blog-answer-box {
  background: rgba(16, 185, 129, 0.09);
  border-left: 3px solid var(--bun-green);
  border-radius: 0 6px 6px 0;
  padding: 7px 9px;
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.4;
}

.redeem-code-hero {
  background: #090710;
  border: 2px dashed var(--bun-gold);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--bun-gold);
  word-break: break-all;
}

.redeem-code-hero.is-mismatch {
  border-color: var(--bun-red);
  color: #FCA5A5;
}

.item-price-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  background: rgba(11, 9, 20, 0.78);
  border-radius: 6px;
  overflow: hidden;
}

.item-price-mini-table th,
.item-price-mini-table td {
  padding: 5px 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
}

.item-price-mini-table th {
  color: var(--text-muted);
  font-size: 10.5px;
}

.live-drive-path {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 7px 9px;
  font-family: 'Consolas', monospace;
  font-size: 11.5px;
  color: #D8B4FE;
  word-break: break-all;
}

/* ================== MỤC 3: KHO TƯ LIỆU CHUNG (C3) ================== */
.vault-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.vault-tab-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vault-tab-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-sub);
  font-weight: 700;
  font-size: 13px;
}

.vault-tab-btn.active {
  background: var(--bun-purple);
  border-color: var(--bun-purple);
  color: #FFF;
}

.vault-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
}

.vault-col-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.vault-col-card:hover,
.vault-col-card.selected {
  border-color: var(--bun-purple);
  background: var(--bg-card-hover);
}

.vault-col-card.is-low {
  border-color: rgba(245, 158, 11, 0.55);
}

.vault-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 12px;
}

.vault-file-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vault-file-card:hover {
  border-color: var(--bun-purple);
}

.vault-file-thumb {
  height: 92px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.22), rgba(16, 13, 29, 0.95));
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #E9D5FF;
  cursor: pointer;
}

.vault-batch-bar {
  background: rgba(138, 43, 226, 0.18);
  border: 1px solid var(--bun-purple);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ================== THÊM PHÒNG MỚI: FORM 4 BƯỚC (C2) ================== */
.wizard-steps-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.wizard-step-pill {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.wizard-step-pill.active {
  border-color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.1);
  color: var(--text-main);
}

.wizard-step-pill.done {
  border-color: rgba(16, 185, 129, 0.45);
  color: #34D399;
}

.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ================== ĐÁP ỨNG KHỔ 884PX & 412PX CHO CÁC PHẦN LẦN 2 ================== */
@media (max-width: 1099px) {
  .wi-station-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wi-video-review-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  /* Sửa lỗi chữ chân thẻ LIVE ở 412px luôn gọn trên 1 hàng, không tràn */
  .room-tile-foot {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .room-tile-foot .badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .room-open-lbl {
    font-size: 10.5px;
  }

  .wi-station-bar {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }

  .wi-station-pill {
    flex: 0 0 132px;
  }

  .rev-cards-grid,
  .wide-cards-grid,
  .vault-col-grid,
  .vault-files-grid,
  .form-2col {
    grid-template-columns: 1fr;
  }

  .wizard-steps-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .redeem-code-hero {
    font-size: 17px;
    letter-spacing: 0.12em;
  }

  .toast-container {
    top: calc(var(--topbar-h) + 8px);
    right: 10px;
    left: 10px;
    align-items: stretch;
    max-width: none;
  }
}


/* ==========================================================================
   PHẦN MỞ RỘNG LẦN 3: ĐĂNG BÀI, R&D, SỐ LIỆU, CẢI TIẾN, KHO TRI THỨC,
   AI & MÁY LÀM VIỆC, QUẢN TRỊ TÀI KHOẢN & BẢNG DẠNG THẺ TRÊN ĐIỆN THOẠI
   ========================================================================== */

/* Dải tab con dùng chung ở các mục Đăng bài, R&D, Số liệu, Kho tri thức, AI & Máy */
.subtabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 700;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.subtab-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.subtab-btn.active {
  background: rgba(138, 43, 226, 0.22);
  border-color: rgba(168, 85, 247, 0.65);
  color: #FFFFFF;
}

/* Bố cục lưới thẻ 2 cột / 3 cột / 4 cột */
.cards-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cards-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Lịch đăng tuần (7 cột ngày ở máy tính) */
.pub-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.pub-day-col {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pub-day-col.is-today {
  border-color: rgba(255, 215, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.2);
}

.pub-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 800;
}

.pub-slot-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.14s ease;
  min-width: 0;
}

.pub-slot-card:hover {
  border-color: var(--bun-purple);
}

/* Cây thư mục Drive giao bên đăng */
.drive-tree-box {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #E2E8F0;
  overflow-x: auto;
}

/* Kanban 4 cột ở mục Cải tiến */
.kanban-4col {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.kanban-col {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 800;
}

.kanban-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.kanban-item-card:hover {
  border-color: rgba(168, 85, 247, 0.55);
}

/* Lưới báo cáo tuần 9 phần / báo cáo phân tích 8 phần */
.report-sections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-part-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.report-part-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--bun-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Thanh tiến trình credit Google Flow / mẫu thử nghiệm */
.meter-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bun-purple), var(--bun-gold));
}

/* Hộp kết quả nạp tư liệu Kho chung (báo rõ trùng nội dung & tự đổi tên _2, _3) */
.vault-upload-log-card {
  background: rgba(138, 43, 226, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vault-upload-log-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

/* Bảng nhiều cột dùng chung (.resp-table kế thừa kiểu .wi-data-table) */
.resp-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.resp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.resp-table th,
.resp-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.resp-table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

.resp-table tr.is-leading-row td {
  background: rgba(255, 215, 0, 0.06);
}

/* Đáp ứng máy tính bảng 884px */
@media (max-width: 1179px) {
  .pub-week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kanban-4col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-3col,
  .report-sections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Đáp ứng điện thoại ≤ 760px (chuẩn 412px):
   1. Mọi bảng nhiều cột (.wi-data-table, .resp-table) tự chuyển thành danh sách thẻ (mỗi dòng 1 thẻ)
   2. Các lưới nhiều cột xếp dọc 1 cột gọn gàng, không cuộn ngang */
@media (max-width: 760px) {
  .subtabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .subtabs-bar::-webkit-scrollbar {
    display: none;
  }

  .subtab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 11px;
    font-size: 12px;
  }

  .pub-week-grid,
  .kanban-4col,
  .cards-3col,
  .cards-2col,
  .report-sections-grid {
    grid-template-columns: 1fr;
  }

  .vault-upload-log-item {
    flex-direction: column;
  }

  .inline-search-input {
    max-width: 100%;
    width: 100%;
    min-width: 0 !important;
  }

  /* Bảng nhiều cột -> Danh sách thẻ (mỗi hàng 1 thẻ độc lập, không cuộn ngang bảng) */
  .wi-table-scroll,
  .resp-table-wrap {
    overflow-x: visible;
  }

  .wi-data-table,
  .wi-data-table tbody,
  .resp-table,
  .resp-table tbody {
    display: block;
    width: 100%;
  }

  .wi-data-table thead,
  .resp-table thead {
    display: none;
  }

  .wi-data-table tbody tr,
  .resp-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    margin-bottom: 10px;
  }

  .wi-data-table tbody tr:last-child,
  .resp-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .wi-data-table tbody td,
  .resp-table tbody td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0;
    border-bottom: none;
    word-break: break-word;
  }

  .wi-data-table tbody td[data-label]::before,
  .resp-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
}


/* ============================================================================
   VÒNG 4 — ĐỢT 1: TRANG CHI TIẾT TOÀN MÀN HÌNH, BỘ CHỌN KỲ CHUNG (B2),
   THANH CẬP NHẬT LÚC / LÀM MỚI (B4) & THÀNH PHẦN BẢNG DÙNG CHUNG (B1–B5)
   ============================================================================ */

/* B4: Thanh "Cập nhật lúc …" + nút Làm mới trên mọi trang */
.page-freshness-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 12px;
  margin-bottom: 12px;
  background: rgba(18, 20, 32, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-sub);
}

.page-freshness-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.page-freshness-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.65);
  flex-shrink: 0;
}

.page-freshness-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* B2: Bộ chọn khoảng thời gian dùng chung */
.shared-date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  margin-bottom: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.shared-date-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.shared-date-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--bun-gold);
  white-space: nowrap;
}

.shared-date-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.date-preset-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-sub);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.date-preset-btn:hover {
  border-color: var(--bun-purple);
  color: var(--text-main);
}

.date-preset-btn.active {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.35), rgba(168, 85, 247, 0.22));
  border-color: #C084FC;
  color: #FFFFFF;
}

.shared-date-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.shared-date-custom input[type="date"] {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 11.5px;
  padding: 4px 8px;
}

.shared-date-period-note {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* B1, B3, B5: Thành phần bảng dùng chung (SmartTable) cho cả 14 bảng */
.smart-table-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smart-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: rgba(12, 13, 22, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
}

.smart-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 240px;
  min-width: 0;
}

.smart-toolbar-search {
  max-width: 280px;
  width: 100%;
  min-width: 0;
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
}

.smart-toolbar-count {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.smart-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.smart-mobile-sort {
  display: none;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.smart-mobile-sort select {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
}

.bun-smart-table th.is-sortable {
  padding: 0;
}

.smart-th-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.smart-th-btn:hover {
  color: var(--bun-gold);
  background: rgba(168, 85, 247, 0.08);
}

.smart-th-btn.is-sorted {
  color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.06);
}

.smart-sort-ind {
  font-size: 11px;
  opacity: 0.55;
  flex-shrink: 0;
}

.smart-th-btn.is-sorted .smart-sort-ind {
  opacity: 1;
  color: var(--bun-gold);
}

.bun-smart-table tbody tr.smart-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bun-smart-table tbody tr.smart-row-clickable:hover {
  background: rgba(168, 85, 247, 0.11);
}

.smart-row-open-hint {
  font-size: 11px;
  font-weight: 700;
  color: #C084FC;
  white-space: nowrap;
}

/* Trang chi tiết toàn màn hình (thay thế hoàn toàn ngăn bên phải) */
.fullpage-detail-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 130px);
  padding: 16px 20px 28px;
  animation: fpFadeIn 0.16s ease-out;
}

@keyframes fpFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fullpage-topbar {
  position: sticky;
  top: 58px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(13, 15, 25, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.fullpage-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.1);
  color: var(--bun-gold);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fullpage-back-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--bun-gold);
}

.fullpage-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-sub);
}

.fullpage-hero-card {
  background: linear-gradient(145deg, rgba(28, 22, 48, 0.92), rgba(16, 18, 30, 0.96));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.fullpage-eyebrow {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #C084FC;
  margin-bottom: 4px;
}

.fullpage-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.32;
  color: var(--text-main);
}

.fullpage-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fullpage-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fullpage-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.fullpage-kv-box {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px 12px;
}

.fullpage-kv-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fullpage-kv-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
  word-break: break-word;
}

.fullpage-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(13, 15, 25, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
}

.viewer-lock-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #CBD5E1;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 760px) {
  .fullpage-detail-view {
    padding: 10px 10px 22px;
  }

  .fullpage-title {
    font-size: 16.5px;
  }

  .fullpage-grid-2col {
    grid-template-columns: 1fr;
  }

  .smart-mobile-sort {
    display: flex;
  }

  .smart-toolbar-search {
    max-width: 100%;
  }

  .bun-smart-table tbody tr.smart-row-clickable {
    border-color: rgba(168, 85, 247, 0.32);
  }
}

/* ============================================================================
   VÒNG 4 — ĐỢT 2: KPI CHI TIẾT (1), Ô PHÒNG & VIỆC CẦN LÀM (2),
   CHI TIẾT BÀI 1→5 (6), THÔNG TIN PHÒNG SỬA TRỰC TIẾP (7), A3 & MASCOT ĐÁY
   ============================================================================ */

/* Đẩy mascot lên trên thanh nút cố định ở đáy màn hình */
.mascot-root {
  transition: bottom 0.18s ease, transform 0.18s ease;
}

body.has-sticky-bottom-bar .mascot-root {
  bottom: var(--sticky-bottom-offset, 108px);
}

/* Mục 2 — Chấm tròn đỏ có số việc N & lý do chậm nhịp */
.room-task-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
  flex-shrink: 0;
}

.room-task-count-badge.is-sm {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  font-size: 10.5px;
  box-shadow: none;
}

.room-slow-reason {
  margin-top: 2px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #FCA5A5;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.room-todo-card {
  border-color: rgba(239, 68, 68, 0.36);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.07), rgba(22, 24, 38, 0.96));
}

.room-todo-card.is-all-clear {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06), rgba(22, 24, 38, 0.96));
}

.room-todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-todo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 17, 29, 0.86);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.14s ease, background 0.14s ease;
}

.room-todo-row:hover {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.06);
}

.room-todo-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.room-todo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-todo-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Mục 1 — Trang chi tiết 6 KPI */
.kpi-slim-pill.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.kpi-slim-pill.is-clickable:hover {
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

.kpi-assistant-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.38);
}

.kpi-assistant-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(15, 17, 28, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.kpi-assistant-avatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.kpi-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.kpi-split-2col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
}

.kpi-chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kpi-chart-canvas-wrap {
  position: relative;
  height: 220px;
  width: 100%;
}

.kpi-funnel-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi-funnel-step {
  padding: 14px;
  border-radius: 12px;
  background: rgba(15, 17, 29, 0.88);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.kpi-funnel-step .funnel-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0;
}

.kpi-comment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi-comment-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 17, 29, 0.85);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.14s ease;
}

.kpi-comment-card:hover {
  border-color: rgba(168, 85, 247, 0.5);
}

.kpi-dest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.kpi-dest-card {
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 17, 29, 0.85);
  border: 1px solid var(--border-subtle);
}

/* Mục 6 — Trang chi tiết bài thứ tự 1 → 5 */
.post-prev-next-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-media-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-variant-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.post-variant-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-media-viewport {
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.22), rgba(11, 13, 23, 0.96));
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 20px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.post-caption-textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(10, 12, 22, 0.9);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.post-metrics-5grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.post-metric-tile {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(13, 15, 26, 0.88);
  border: 1px solid var(--border-subtle);
}

.post-metric-tile .pm-label {
  font-size: 11px;
  color: var(--text-muted);
}

.post-metric-tile .pm-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 3px;
}

.post-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(13, 15, 26, 0.78);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

/* Mục 7 — Thông tin phòng sửa trực tiếp mọi thứ */
.ri-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ri-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ri-field-group.is-full {
  grid-column: 1 / -1;
}

.ri-field-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.ri-inline-input,
.ri-inline-select,
.ri-inline-textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(12, 14, 24, 0.92);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
}

.ri-inline-textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

.ri-inline-input:disabled,
.ri-inline-select:disabled,
.ri-inline-textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ri-dest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ri-dest-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(13, 15, 26, 0.85);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  cursor: pointer;
}

.ri-step-editor-card {
  padding: 12px;
  border-radius: 10px;
  background: rgba(13, 15, 26, 0.88);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ri-step-editor-card.is-dragging {
  opacity: 0.55;
  border-color: var(--accent-orange);
}

.ri-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(13, 15, 26, 0.82);
  border: 1px solid var(--border-subtle);
}

/* A3 — Tách riêng phòng LIVE bên dưới bảng 11 phòng */
.analytics-live-separate-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.09), rgba(22, 24, 38, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.34);
}

.analytics-live-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .kpi-split-2col,
  .kpi-dest-grid,
  .post-metrics-5grid,
  .analytics-live-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  body.has-sticky-bottom-bar .mascot-root {
    bottom: var(--sticky-bottom-offset, 132px);
  }

  .kpi-split-2col,
  .kpi-funnel-steps,
  .kpi-comment-grid,
  .kpi-dest-grid,
  .post-metrics-5grid,
  .ri-inline-grid,
  .ri-dest-grid,
  .analytics-live-metrics-row {
    grid-template-columns: 1fr;
  }

  .room-todo-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   VÒNG 4 — ĐỢT 3: TRỢ LÝ BUN 3 CỘT (~90% MÀN HÌNH), KHO TƯ LIỆU ĐỘNG,
   LUẬT & SOP GOOGLE DRIVE, THÔNG BÁO KHẨN TELEGRAM
   ========================================================================== */

/* Đảm bảo Modal & Toast luôn nổi trên khung Chat 90% màn hình */
.modal-backdrop-layer {
  z-index: 420 !important;
}

.toast-container {
  z-index: 500 !important;
}

/* Icon Mascot góc dưới phải: CHỈ hình mascot + số chưa đọc, gọn tròn không chữ */
.mascot-root {
  z-index: 330;
}

.mascot-launcher {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 5px;
}

/* Lớp mờ nền phía sau khung Chat 90% */
.mascot-chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 15, 0.72);
  backdrop-filter: blur(5px);
  z-index: 325;
}

/* Khung Chat ~90% màn hình đặt giữa trên máy tính */
.mascot-chat-panel {
  position: fixed;
  top: 5vh;
  left: 5vw;
  width: 90vw;
  height: 90vh;
  max-width: none;
  max-height: 90vh;
  background: var(--bg-panel);
  border: 1.5px solid rgba(168, 85, 247, 0.55);
  border-radius: 18px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.78), 0 0 36px rgba(138, 43, 226, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 335;
}

.chat-header {
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(138, 43, 226, 0.28), rgba(19, 16, 34, 0.98));
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-esc-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(13, 15, 26, 0.65);
}

/* Thanh 3 tab cột trên điện thoại (ẩn trên máy tính) */
.chat-mobile-col-tabs {
  display: none;
  background: var(--bg-obsidian);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 10px;
  gap: 6px;
  flex-shrink: 0;
}

.chat-mob-tab {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.chat-mob-tab.active {
  background: rgba(168, 85, 247, 0.22);
  border-color: var(--bun-gold);
  color: #FFF;
}

/* Bố cục 3 cột trên máy tính */
.chat-workspace-3col {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  overflow: hidden;
}

.chat-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-col-inbox {
  border-right: 1px solid var(--border-subtle);
  background: rgba(13, 15, 26, 0.72);
  overflow-y: auto;
  padding: 12px;
  gap: 12px;
}

.chat-col-center {
  background: rgba(18, 20, 34, 0.92);
}

.chat-col-context {
  border-left: 1px solid var(--border-subtle);
  background: rgba(13, 15, 26, 0.72);
  overflow-y: auto;
  padding: 12px;
  gap: 12px;
}

/* Khối con trong cột Hộp việc & cột Ngữ cảnh */
.chat-side-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-side-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
}

.morning-brief-box {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(138, 43, 226, 0.14));
  border-color: rgba(255, 215, 0, 0.38);
}

.chat-alert-item {
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(11, 13, 22, 0.84);
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-alert-item.lvl-urgent {
  border-left-color: #EF4444;
}

.chat-alert-item.lvl-decision {
  border-left-color: #F59E0B;
}

.chat-alert-item.lvl-info {
  border-left-color: #94A3B8;
}

.chat-alert-item.is-resolved {
  opacity: 0.52;
}

.chat-decision-line {
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 13, 22, 0.78);
  color: var(--text-main);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-decision-line:hover {
  border-color: var(--bun-gold);
}

.chat-conv-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 13, 22, 0.72);
  color: var(--text-sub);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-conv-item.active {
  border-color: var(--bun-gold);
  background: rgba(168, 85, 247, 0.18);
  color: #FFF;
}

/* Thanh tin đã ghim ở đầu cột Trò chuyện */
.chat-pinned-bar {
  padding: 8px 14px;
  background: rgba(255, 215, 0, 0.08);
  border-bottom: 1px solid rgba(255, 215, 0, 0.25);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
}

/* Tin nhắn giàu thông tin trong cột giữa */
.chat-messages {
  padding: 16px 18px;
  gap: 14px;
}

.chat-msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg.assistant {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.chat-msg.user {
  max-width: 78%;
  background: linear-gradient(135deg, #7E22CE, #6D28D9);
  border: 1px solid rgba(216, 180, 254, 0.35);
}

.chat-mini-bars {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(11, 13, 22, 0.75);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-mini-bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

.chat-mini-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.chat-mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #A855F7, #FFD700);
}

/* Bảng xác nhận an toàn (Đồng ý / Sửa / Bỏ) trước khi thực thi thay đổi */
.chat-confirm-gate {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-confirm-gate.is-done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(52, 211, 153, 0.45);
}

.chat-confirm-gate.is-cancelled {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-subtle);
  opacity: 0.75;
}

/* Thẻ duyệt bài trực tiếp trong khung Chat */
.chat-inline-post-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-inline-post-card {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(11, 13, 22, 0.86);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Khung nhập lớn nhiều dòng + thanh công cụ đính kèm / dán ảnh / mic */
.chat-attachments-bar {
  padding: 6px 14px;
  background: rgba(138, 43, 226, 0.12);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.chat-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.45);
  font-size: 11.5px;
  color: #FDE047;
}

.chat-composer-box {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg-obsidian);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-composer-box textarea {
  width: 100%;
  min-height: 52px;
  max-height: 132px;
  resize: vertical;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  outline: none;
}

.chat-composer-box textarea:focus {
  border-color: var(--bun-gold);
}

.chat-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-send-btn {
  padding: 7px 18px;
  font-weight: 800;
}

/* Cột phải Ngữ cảnh */
.context-preview-media {
  padding: 14px 12px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, rgba(168, 85, 247, 0.28), rgba(9, 11, 20, 0.96));
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* MỤC 4: Nút menu ⋯ trên thẻ kho con & thanh tạo tab/kho mới */
.vault-col-card {
  position: relative;
}

.vault-col-more-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 13, 22, 0.85);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.vault-col-more-btn:hover {
  border-color: var(--bun-gold);
  color: var(--bun-gold);
}

/* MỤC 5: Thẻ tài liệu Google Drive Luật chung & SOP */
.drive-sync-banner {
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(138, 43, 226, 0.14));
  border: 1px solid rgba(96, 165, 250, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-provenance-strip {
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 12px;
  color: #D1FAE5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.drive-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.drive-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.16s ease;
}

.drive-doc-card:hover {
  border-color: rgba(255, 215, 0, 0.5);
}

.drive-doc-summary-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.45;
}

/* MÃ E6: Lưới chọn loại tin khẩn gửi qua Telegram */
.tg-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tg-cat-card {
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(13, 15, 26, 0.84);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.tg-cat-card.is-enabled {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.07);
}

@media (max-width: 1180px) {
  .chat-workspace-3col {
    grid-template-columns: 270px minmax(0, 1fr) 275px;
  }

  .drive-doc-grid,
  .tg-cat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .mascot-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
  }

  .mascot-chat-panel {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .chat-mobile-col-tabs {
    display: flex;
  }

  .chat-workspace-3col {
    display: flex;
    flex-direction: column;
  }

  .chat-workspace-3col > .chat-col {
    display: none;
    flex: 1;
    width: 100%;
    border: none;
  }

  .chat-workspace-3col.active-col-inbox > .chat-col-inbox,
  .chat-workspace-3col.active-col-chat > .chat-col-center,
  .chat-workspace-3col.active-col-context > .chat-col-context {
    display: flex;
  }

  .chat-msg,
  .chat-msg.user {
    max-width: 96%;
  }

  .chat-mini-bar-row {
    grid-template-columns: 96px minmax(0, 1fr) 70px;
  }
}

/* ==========================================================================
   VÒNG 4 — ĐỢT 4: C1–C6, D1–D9, E1–E5
   ========================================================================== */

/* C1: Chế độ duyệt tập trung toàn màn hình */
.focus-review-banner {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.22), rgba(255, 215, 0, 0.14));
  border: 1px solid rgba(255, 215, 0, 0.48);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.focus-review-progress-bar {
  background: rgba(11, 13, 22, 0.92);
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.focus-shortcut-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: var(--bun-gold);
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
}

/* C2: Hoàn tác 10 giây trong Toast */
.toast-item.has-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 310px;
  max-width: 520px;
}

.toast-undo-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--bun-gold);
  background: rgba(255, 215, 0, 0.18);
  color: var(--bun-gold);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.toast-undo-btn:hover {
  background: var(--bun-gold);
  color: #090A10;
}

/* C3: Dòng bấm được trong Hôm nay bộ máy đã làm & Sắp làm hôm nay */
.timeline-item.is-clickable {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.timeline-item.is-clickable:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
}

/* C5: Xem trước thật trong lưới Kho tư liệu chung (Ảnh, Video rê chuột, Audio nghe thử) */
.vault-media-preview {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(22, 25, 43, 0.96), rgba(44, 24, 78, 0.85));
}

.vault-media-preview.is-playing {
  border-color: var(--bun-gold);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.25);
}

.vault-video-scrubber {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  margin-top: 6px;
}

.vault-video-scrubber-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--bun-purple), var(--bun-gold));
  transition: width 0.2s linear;
}

.vault-audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.vault-audio-waves span {
  display: inline-block;
  width: 4px;
  height: 6px;
  border-radius: 2px;
  background: #C084FC;
  transition: height 0.18s ease;
}

.vault-media-preview.is-playing .vault-audio-waves span:nth-child(odd) {
  height: 20px;
  background: var(--bun-gold);
}

.vault-media-preview.is-playing .vault-audio-waves span:nth-child(even) {
  height: 12px;
  background: #34D399;
}

/* C6: Thanh nút cố định đáy màn hình trên điện thoại cho Duyệt · Trả lại · Bài sau */
.mobile-sticky-post-bar {
  display: none;
}

@media (max-width: 760px) {
  .mobile-sticky-post-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    padding: 10px 12px;
    background: rgba(11, 13, 22, 0.97);
    border-top: 1px solid rgba(255, 215, 0, 0.45);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.65);
  }
}

/* D1 & D3: Lịch đăng kéo thả & Gợi ý giờ đăng tốt nhất */
.pub-day-col.drag-over {
  border-color: var(--bun-gold);
  background: rgba(255, 215, 0, 0.08);
}

.pub-slot-card[draggable="true"] {
  cursor: grab;
}

.pub-slot-card.is-dragging {
  opacity: 0.45;
  border-color: var(--bun-gold);
}

.best-time-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.best-time-card {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(13, 15, 26, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.28);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
}

/* D6: Ảnh bài nổi bật của đối thủ & hộp BUN nên làm gì */
.comp-featured-thumb {
  border-radius: 9px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.38), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(168, 85, 247, 0.34);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  word-break: break-word;
}

.comp-featured-thumb.tone-gold {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.42), rgba(15, 23, 42, 0.92));
  border-color: rgba(250, 204, 21, 0.42);
}

.comp-featured-thumb.tone-green {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.48), rgba(15, 23, 42, 0.92));
  border-color: rgba(52, 211, 153, 0.42);
}

.segmented-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(11, 13, 24, 0.92);
  border: 1px solid var(--border-strong);
}

.seg-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-main);
  background: rgba(168, 85, 247, 0.14);
}

.seg-btn.active {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #FFFFFF;
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.comp-bun-action-box {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 215, 0, 0.09);
  border: 1px solid rgba(255, 215, 0, 0.35);
  font-size: 12px;
  color: #FEF08A;
  line-height: 1.45;
}

/* E2 & E3: Băng rôn tạm dừng toàn bộ bộ máy & Lưới 6 gói hạn mức AI */
.engine-paused-global-banner {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.26), rgba(245, 158, 11, 0.2));
  border: 1px solid rgba(248, 113, 113, 0.65);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-quota-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1100px) {
  .tool-quota-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tool-quota-grid {
    grid-template-columns: 1fr;
  }
}

/* Lịch tổng toàn xưởng — Dạng Lịch Tháng (ô ngày, chấm màu theo phòng, ngày dày/trống nhìn ra ngay) */
.mp-cal-legend-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(12, 14, 24, 0.88);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.mp-cal-density-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.mp-room-legend-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.mp-room-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}

.mp-room-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.mp-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.mp-cal-weekday {
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  padding: 4px 0;
  text-transform: uppercase;
}

.mp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mp-cal-cell {
  min-height: 104px;
  border-radius: 10px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  font-family: inherit;
  color: var(--text-main);
  position: relative;
}

.mp-cal-cell.is-pad {
  background: rgba(9, 10, 18, 0.35);
  border: 1px dashed rgba(148, 163, 184, 0.1);
  opacity: 0.42;
  cursor: default;
  min-height: 88px;
}

.mp-cal-cell.is-empty {
  background: rgba(11, 13, 22, 0.55);
  border: 1px dashed rgba(148, 163, 184, 0.24);
}

.mp-cal-cell.is-normal {
  background: rgba(20, 16, 38, 0.88);
  border: 1px solid rgba(168, 85, 247, 0.36);
}

.mp-cal-cell.is-dense {
  background: linear-gradient(155deg, rgba(59, 7, 100, 0.55) 0%, rgba(120, 53, 15, 0.34) 100%);
  border: 1px solid rgba(250, 204, 21, 0.58);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.14);
}

.mp-cal-cell:not(.is-pad):hover {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 0, 0.72);
}

.mp-cal-cell.is-selected {
  border: 2px solid var(--bun-gold) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.18);
}

.mp-cal-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.mp-cal-day-num {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.mp-cal-cell.is-empty .mp-cal-day-num {
  color: var(--text-muted);
}

.mp-cal-count-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.mp-cal-count-pill.count-zero {
  background: rgba(148, 163, 184, 0.1);
  color: #94A3B8;
}

.mp-cal-count-pill.count-normal {
  background: rgba(168, 85, 247, 0.22);
  color: #E9D5FF;
}

.mp-cal-count-pill.count-dense {
  background: rgba(255, 215, 0, 0.22);
  color: #FDE047;
  border: 1px solid rgba(255, 215, 0, 0.42);
}

.mp-cal-dots-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.mp-cal-room-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1.5px 5px;
  border-radius: 6px;
  background: rgba(8, 10, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
}

.mp-day-detail-box {
  border-radius: 12px;
  padding: 14px;
  background: rgba(15, 13, 30, 0.94);
  border: 1px solid rgba(255, 215, 0, 0.42);
  margin-top: 4px;
}

@media (max-width: 980px) {
  .mp-cal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mp-cal-weekdays,
  .mp-cal-cell.is-pad {
    display: none;
  }
}

@media (max-width: 600px) {
  .mp-cal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mp-cal-cell {
    min-height: 88px;
  }
}

/* ==========================================================================
   HỆ THỐNG GIAO DIỆN SÁNG / TỐI (LIGHT THEME MẶC ĐỊNH — MARKETING DASHBOARD)
   Bảng màu Sáng:
   - Nền trang: #F6F5FB · Thẻ: #FFFFFF · Bo góc: 16px · Bóng: 0 4px 20px rgba(30,20,60,0.06) · Viền: #EEEAF5
   - Chữ tiêu đề: #1A1A3A · Chữ thường: #4A4A68 · Chữ phụ: #8A8AA3
   - Gradient chính: #FF3D8B → #8A2BE2 · Vàng #FFD700 chỉ dùng cho giá/CP & xu BUN
   - Tăng: #16A34A / #DCFCE7 · Giảm: #DC2626 / #FEE2E2
   ========================================================================== */

/* Cấu trúc chung 6 ô KPI có vòng tròn icon màu bên trái (dùng cho cả Sáng & Tối) */
.kpi-card.kpi-card-with-icon {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
}

.kpi-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
  margin-top: 2px;
}

.kpi-icon-circle svg {
  width: 20px;
  height: 20px;
}

.kpi-icon-pink {
  background: linear-gradient(135deg, #FF5E9E 0%, #FF3D8B 100%);
  box-shadow: 0 6px 14px rgba(255, 61, 139, 0.28);
}

.kpi-icon-purple {
  background: linear-gradient(135deg, #A855F7 0%, #8A2BE2 100%);
  box-shadow: 0 6px 14px rgba(138, 43, 226, 0.28);
}

.kpi-icon-blue {
  background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.28);
}

.kpi-icon-orange {
  background: linear-gradient(135deg, #FFA260 0%, #FF8A3D 100%);
  box-shadow: 0 6px 14px rgba(255, 138, 61, 0.28);
}

.kpi-icon-green {
  background: linear-gradient(135deg, #4ADE80 0%, #22C55E 100%);
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.28);
}

.kpi-icon-indigo {
  background: linear-gradient(135deg, #FF3D8B 0%, #8A2BE2 100%);
  box-shadow: 0 6px 14px rgba(138, 43, 226, 0.25);
}

.kpi-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.kpi-delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}

.kpi-delta-pill.is-up {
  background: #DCFCE7;
  color: #166534;
}

.kpi-delta-pill.is-down {
  background: #FEE2E2;
  color: #B91C1C;
}

.kpi-delta-pill.is-neutral,
.kpi-delta-pill.neutral {
  background: #F3F1F8;
  color: #4A4A68;
}

/* Nút chuyển Sáng / Tối trong menu tài khoản */
.theme-toggle-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.theme-toggle-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.theme-switch-pills {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.theme-pill-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-pill-btn.active {
  background: var(--bun-primary-grad);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(255, 61, 139, 0.28);
}

/* Bố cục đôi cho biểu đồ đường + biểu đồ vành khuyên trên màn Số liệu */
.analytics-charts-split {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 980px) {
  .analytics-charts-split {
    grid-template-columns: 1fr;
  }
}

/* Vàng thương hiệu #FFD700 dành riêng cho giá tiền/CP và đồng xu BUN */
.cp-gold-tag,
.bun-coin-gold {
  color: #B45309;
  background: rgba(255, 215, 0, 0.24);
  border: 1px solid #FFD700;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}

/* ================== QUY TẮC CHI TIẾT CHO THEME SÁNG (MẶC ĐỊNH) ================== */
html:not([data-theme="dark"]) body {
  background-color: #F6F5FB;
  color: #4A4A68;
}

/* Chữ tiêu đề #1A1A3A, chữ thường #4A4A68, chữ phụ #8A8AA3 */
html:not([data-theme="dark"]) h1,
html:not([data-theme="dark"]) h2,
html:not([data-theme="dark"]) h3,
html:not([data-theme="dark"]) h4,
html:not([data-theme="dark"]) strong,
html:not([data-theme="dark"]) .section-title,
html:not([data-theme="dark"]) .room-main-title,
html:not([data-theme="dark"]) .fullpage-title,
html:not([data-theme="dark"]) .drawer-title,
html:not([data-theme="dark"]) .modal-title,
html:not([data-theme="dark"]) .item-row-title,
html:not([data-theme="dark"]) .timeline-title,
html:not([data-theme="dark"]) .room-tile-name,
html:not([data-theme="dark"]) .pov-card-title,
html:not([data-theme="dark"]) .chat-header-title,
html:not([data-theme="dark"]) .chat-side-title {
  color: #1A1A3A;
}

/* Số liệu đậm 600–700 */
html:not([data-theme="dark"]) .kpi-value,
html:not([data-theme="dark"]) .pm-val,
html:not([data-theme="dark"]) .funnel-val,
html:not([data-theme="dark"]) .cal-day-num,
html:not([data-theme="dark"]) .mp-cal-day-num {
  color: #1A1A3A;
  font-weight: 700;
}

/* Tiêu đề lớn & điểm nhấn thương hiệu dùng gradient Hồng → Tím (#D6246E → #8A2BE2) */
html:not([data-theme="dark"]) .auth-title,
html:not([data-theme="dark"]) .brand-accent {
  background: linear-gradient(135deg, #D6246E 0%, #8A2BE2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nút chính: Gradient #D6246E → #8A2BE2, chữ trắng (độ tương phản ≥ 4,5:1) */
html:not([data-theme="dark"]) .btn-gold,
html:not([data-theme="dark"]) .btn-purple {
  background: linear-gradient(135deg, #D6246E 0%, #8A2BE2 100%);
  color: #FFFFFF !important;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(214, 36, 110, 0.24);
}

html:not([data-theme="dark"]) .btn-gold:hover:not(:disabled),
html:not([data-theme="dark"]) .btn-purple:hover:not(:disabled) {
  background: linear-gradient(135deg, #C2185B 0%, #7B22CC 100%);
  box-shadow: 0 6px 18px rgba(214, 36, 110, 0.34);
}

html:not([data-theme="dark"]) .btn-outline {
  background: #FFFFFF;
  color: #1A1A3A;
  border-color: #DFD8EC;
}

html:not([data-theme="dark"]) .btn-outline:hover:not(:disabled) {
  background: #FAF8FD;
  border-color: #FF3D8B;
  color: #C2185B;
}

html:not([data-theme="dark"]) .btn-danger-outline {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FECACA;
}

html:not([data-theme="dark"]) .btn-danger-outline:hover:not(:disabled) {
  background: #FECACA;
}

html:not([data-theme="dark"]) .text-link-btn,
html:not([data-theme="dark"]) .room-open-lbl,
html:not([data-theme="dark"]) .smart-row-open-hint {
  color: #8A2BE2;
}

/* Thanh trên cùng nền trắng, ô tìm kiếm bo tròn nền #F3F1F8 */
html:not([data-theme="dark"]) .topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #EEEAF5;
  box-shadow: 0 2px 12px rgba(30, 20, 60, 0.04);
}

html:not([data-theme="dark"]) .search-box input {
  background: #F3F1F8;
  border: 1px solid #EEEAF5;
  border-radius: 999px;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .search-box input::placeholder {
  color: #6E6E8A;
}

html:not([data-theme="dark"]) .search-box input:focus {
  background: #FFFFFF;
  border-color: #FF3D8B;
  box-shadow: 0 0 0 3px rgba(255, 61, 139, 0.12);
}

html:not([data-theme="dark"]) .worker-status-btn,
html:not([data-theme="dark"]) .account-btn,
html:not([data-theme="dark"]) .icon-btn {
  background: #F3F1F8;
  border-color: #EEEAF5;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .account-avatar {
  background: linear-gradient(135deg, #D6246E 0%, #8A2BE2 100%);
  color: #FFFFFF;
}

html:not([data-theme="dark"]) .readonly-pill {
  background: #FEF3C7;
  border-color: #FDE68A;
  color: #B45309;
}

/* Menu trái nền trắng; mục đang chọn nền hồng nhạt #FFE4F0, chữ & icon #C2185B */
html:not([data-theme="dark"]) .sidebar {
  background: #FFFFFF;
  border-right: 1px solid #EEEAF5;
}

html:not([data-theme="dark"]) .nav-item-btn {
  color: #4A4A68;
  border-radius: 12px;
  font-weight: 600;
}

html:not([data-theme="dark"]) .nav-item-btn:hover {
  background: #FAF8FD;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .nav-item-btn.active {
  background: #FFE4F0;
  border-color: rgba(194, 24, 91, 0.24);
  color: #C2185B;
  font-weight: 700;
}

html:not([data-theme="dark"]) .nav-item-btn.active .nav-icon {
  color: #C2185B;
}

html:not([data-theme="dark"]) .nav-badge {
  background: #FFE4F0;
  color: #C2185B;
}

html:not([data-theme="dark"]) .nav-badge.is-alert {
  background: #FEE2E2;
  color: #B91C1C;
}

/* Thẻ trắng #FFFFFF, bo góc 16px, đổ bóng mềm (0 4px 20px rgba(30,20,60,0.06)), viền #EEEAF5 */
html:not([data-theme="dark"]) .kpi-card,
html:not([data-theme="dark"]) .panel-card,
html:not([data-theme="dark"]) .section-card,
html:not([data-theme="dark"]) .room-tile,
html:not([data-theme="dark"]) .room-header-card,
html:not([data-theme="dark"]) .pov-post-card,
html:not([data-theme="dark"]) .chart-box,
html:not([data-theme="dark"]) .kpi-chart-card,
html:not([data-theme="dark"]) .wi-pipeline-card,
html:not([data-theme="dark"]) .kanban-col,
html:not([data-theme="dark"]) .report-part-card,
html:not([data-theme="dark"]) .auth-card,
html:not([data-theme="dark"]) .fullpage-hero-card,
html:not([data-theme="dark"]) .post-media-stage,
html:not([data-theme="dark"]) .kpi-slim-bar,
html:not([data-theme="dark"]) .shared-date-bar {
  background: #FFFFFF;
  border: 1px solid #EEEAF5;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(30, 20, 60, 0.06);
}

html:not([data-theme="dark"]) .kpi-card:hover,
html:not([data-theme="dark"]) .room-tile:hover,
html:not([data-theme="dark"]) .pov-post-card:hover {
  border-color: rgba(255, 61, 139, 0.45);
  box-shadow: 0 8px 26px rgba(30, 20, 60, 0.1);
}

html:not([data-theme="dark"]) .room-tile.is-bottleneck {
  border-color: rgba(220, 38, 38, 0.42);
}

html:not([data-theme="dark"]) .room-code-tag {
  background: #F3E8FF;
  color: #7E22CE;
}

/* Nhãn trạng thái (Chờ duyệt, Đạt, Lỗi…) dạng viên thuốc màu nhạt chữ đậm */
html:not([data-theme="dark"]) .badge {
  border-radius: 999px;
  font-weight: 700;
}

html:not([data-theme="dark"]) .badge-green {
  background: #DCFCE7;
  color: #166534;
  border-color: #BBF7D0;
}

html:not([data-theme="dark"]) .badge-red {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FECACA;
}

html:not([data-theme="dark"]) .badge-gold {
  background: #FFE4F0;
  color: #C2185B;
  border-color: #FBCFE8;
}

html:not([data-theme="dark"]) .badge-amber {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
}

html:not([data-theme="dark"]) .badge-purple {
  background: #F3E8FF;
  color: #7E22CE;
  border-color: #E9D5FF;
}

html:not([data-theme="dark"]) .badge-gray {
  background: #F3F1F8;
  color: #4A4A68;
  border-color: #E2DFEC;
}

/* Bảng: tiêu đề cột chữ xám nhỏ (#6E6E8A), dòng phân cách mảnh (#EEEAF5), dòng rê chuột nền #FAF8FD */
html:not([data-theme="dark"]) .resp-table th,
html:not([data-theme="dark"]) .wi-data-table th,
html:not([data-theme="dark"]) .bun-smart-table th {
  color: #6E6E8A;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #FAF8FD;
  border-bottom: 1px solid #EEEAF5;
}

html:not([data-theme="dark"]) .resp-table td,
html:not([data-theme="dark"]) .wi-data-table td,
html:not([data-theme="dark"]) .bun-smart-table td {
  border-bottom: 1px solid #EEEAF5;
  color: #4A4A68;
}

html:not([data-theme="dark"]) .resp-table tbody tr:hover td,
html:not([data-theme="dark"]) .wi-data-table tbody tr:hover td,
html:not([data-theme="dark"]) .bun-smart-table tbody tr:hover td,
html:not([data-theme="dark"]) .bun-smart-table tbody tr.smart-row-clickable:hover {
  background: #FAF8FD !important;
}

html:not([data-theme="dark"]) .smart-th-btn:hover,
html:not([data-theme="dark"]) .smart-th-btn.is-sorted {
  color: #C2185B;
  background: #FFE4F0;
}

html:not([data-theme="dark"]) .smart-th-btn.is-sorted .smart-sort-ind {
  color: #C2185B;
}

html:not([data-theme="dark"]) .smart-table-toolbar {
  background: #FAF8FD;
  border-color: #EEEAF5;
}

html:not([data-theme="dark"]) .smart-toolbar-search {
  background: #F3F1F8;
  border-color: #EEEAF5;
  color: #1A1A3A;
}

/* Các thanh tiến độ, chip, tab con, dải chọn phòng trong Theme Sáng */
html:not([data-theme="dark"]) .progress-track,
html:not([data-theme="dark"]) .meter-track {
  background: #EEEAF5;
}

html:not([data-theme="dark"]) .progress-fill {
  background: linear-gradient(90deg, #FF3D8B 0%, #8A2BE2 100%);
}

html:not([data-theme="dark"]) .room-chip-btn,
html:not([data-theme="dark"]) .filter-chip,
html:not([data-theme="dark"]) .date-preset-btn {
  background: #FFFFFF;
  border-color: #EEEAF5;
  color: #4A4A68;
}

html:not([data-theme="dark"]) .room-chip-btn.active,
html:not([data-theme="dark"]) .filter-chip.active,
html:not([data-theme="dark"]) .date-preset-btn.active,
html:not([data-theme="dark"]) .subtab-btn.active,
html:not([data-theme="dark"]) .seg-btn.active {
  background: linear-gradient(135deg, #D6246E 0%, #8A2BE2 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(214, 36, 110, 0.24);
}

html:not([data-theme="dark"]) .room-chip-btn.add-room-chip {
  background: #FFE4F0;
  border-color: rgba(255, 61, 139, 0.45);
  color: #C2185B;
}

html:not([data-theme="dark"]) .subtabs-bar,
html:not([data-theme="dark"]) .segmented-switch {
  background: #F3F1F8;
  border-color: #EEEAF5;
}

/* Màn đăng nhập (Login) ở Theme Sáng */
html:not([data-theme="dark"]) .auth-screen {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 61, 139, 0.12), transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(138, 43, 226, 0.12), transparent 42%),
    #F6F5FB;
}

html:not([data-theme="dark"]) .demo-acc-btn {
  background: #FAF8FD;
  border-color: #EEEAF5;
}

html:not([data-theme="dark"]) .demo-acc-btn:hover {
  background: #FFE4F0;
  border-color: #FF3D8B;
}

/* Thanh trạng thái trang, banner Duyệt tập trung, chi tiết toàn màn hình, Trợ lý BUN */
html:not([data-theme="dark"]) .page-freshness-bar {
  background: #FFFFFF;
  border-color: #EEEAF5;
  color: #4A4A68;
  box-shadow: 0 2px 10px rgba(30, 20, 60, 0.03);
}

html:not([data-theme="dark"]) .focus-review-banner {
  background: linear-gradient(135deg, #FFF5F9 0%, #F5F0FF 100%) !important;
  border: 1px solid #FBCFE8 !important;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(30, 20, 60, 0.05);
}

html:not([data-theme="dark"]) .fullpage-topbar,
html:not([data-theme="dark"]) .fullpage-sticky-footer {
  background: rgba(255, 255, 255, 0.96);
  border-color: #EEEAF5;
  box-shadow: 0 4px 20px rgba(30, 20, 60, 0.08);
}

html:not([data-theme="dark"]) .fullpage-back-btn {
  background: #FFE4F0;
  border-color: #FBCFE8;
  color: #C2185B;
}

html:not([data-theme="dark"]) .fullpage-back-btn:hover {
  background: #FBCFE8;
}

html:not([data-theme="dark"]) .fullpage-eyebrow,
html:not([data-theme="dark"]) .drawer-eyebrow {
  color: #C2185B;
}

html:not([data-theme="dark"]) .item-row,
html:not([data-theme="dark"]) .kanban-item-card,
html:not([data-theme="dark"]) .cal-day-cell,
html:not([data-theme="dark"]) .pub-day-col,
html:not([data-theme="dark"]) .fullpage-kv-box,
html:not([data-theme="dark"]) .fold-group {
  background: #FAF8FD;
  border-color: #EEEAF5;
}

html:not([data-theme="dark"]) .cal-post-pill,
html:not([data-theme="dark"]) .pub-slot-card {
  background: #FFFFFF;
  border-color: #EEEAF5;
}

/* Trợ lý BUN 3 cột ở Theme Sáng */
html:not([data-theme="dark"]) .mascot-launcher {
  background: radial-gradient(circle at 50% 50%, #FFE4F0, #FFFFFF 75%);
  border-color: #FF3D8B;
  box-shadow: 0 8px 24px rgba(255, 61, 139, 0.25);
}

html:not([data-theme="dark"]) .mascot-chat-backdrop,
html:not([data-theme="dark"]) .backdrop {
  background: rgba(26, 26, 58, 0.35);
}

html:not([data-theme="dark"]) .mascot-chat-panel {
  background: #FFFFFF;
  border-color: #EEEAF5;
  box-shadow: 0 20px 60px rgba(30, 20, 60, 0.18);
}

html:not([data-theme="dark"]) .chat-header {
  background: linear-gradient(90deg, #FFF0F6 0%, #F5F0FF 100%);
  border-bottom: 1px solid #EEEAF5;
}

html:not([data-theme="dark"]) .chat-esc-hint {
  background: #FFFFFF;
  border-color: #EEEAF5;
  color: #4A4A68;
}

html:not([data-theme="dark"]) .chat-col-inbox,
html:not([data-theme="dark"]) .chat-col-context {
  background: #F6F5FB;
  border-color: #EEEAF5;
}

html:not([data-theme="dark"]) .chat-col-center {
  background: #FFFFFF;
}

html:not([data-theme="dark"]) .chat-side-section {
  background: #FFFFFF;
  border-color: #EEEAF5;
  box-shadow: 0 2px 10px rgba(30, 20, 60, 0.04);
}

html:not([data-theme="dark"]) .chat-alert-item,
html:not([data-theme="dark"]) .chat-decision-line {
  background: #FAF8FD;
  border-color: #EEEAF5;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .chat-msg.assistant {
  background: #F6F5FB;
  border-color: #EEEAF5;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .chat-msg.user {
  background: linear-gradient(135deg, #D6246E 0%, #8A2BE2 100%);
  color: #FFFFFF;
}

html:not([data-theme="dark"]) .quick-prompt-chip {
  background: #FAF8FD;
  border-color: #DFD8EC;
  color: #7E22CE;
}

html:not([data-theme="dark"]) .quick-prompt-chip:hover {
  background: #FFE4F0;
  border-color: #FF3D8B;
  color: #C2185B;
}

/* Khung chi tiết bài, R&D, Số liệu, Cải tiến, Kho tri thức, AI & Máy làm việc ở Theme Sáng */
html:not([data-theme="dark"]) .kpi-funnel-step,
html:not([data-theme="dark"]) .kpi-comment-card,
html:not([data-theme="dark"]) .kpi-dest-card,
html:not([data-theme="dark"]) .post-metric-tile,
html:not([data-theme="dark"]) .post-channel-row,
html:not([data-theme="dark"]) .ri-dest-check,
html:not([data-theme="dark"]) .ri-step-editor-card,
html:not([data-theme="dark"]) .ri-history-row,
html:not([data-theme="dark"]) .room-todo-row,
html:not([data-theme="dark"]) .mp-cal-legend-bar,
html:not([data-theme="dark"]) .mp-day-detail-box,
html:not([data-theme="dark"]) .drive-tree-box {
  background: #FAF8FD;
  border-color: #EEEAF5;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .ri-inline-input,
html:not([data-theme="dark"]) .ri-inline-select,
html:not([data-theme="dark"]) .ri-inline-textarea,
html:not([data-theme="dark"]) .post-caption-textarea {
  background: #F3F1F8;
  border-color: #DFD8EC;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .room-todo-card {
  background: linear-gradient(180deg, #FFF5F5 0%, #FFFFFF 100%);
  border-color: #FECACA;
}

html:not([data-theme="dark"]) .room-todo-card.is-all-clear {
  background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 100%);
  border-color: #BBF7D0;
}

html:not([data-theme="dark"]) .analytics-live-separate-card {
  background: linear-gradient(135deg, #F0F9FF 0%, #FAF8FD 100%);
  border-color: #BAE6FD;
}

html:not([data-theme="dark"]) .kpi-assistant-callout {
  background: linear-gradient(135deg, #FFF0F6 0%, #F5F0FF 100%);
  border-color: #FBCFE8;
}

html:not([data-theme="dark"]) .kpi-assistant-avatar {
  background: #FFFFFF;
  border-color: #FBCFE8;
}

html:not([data-theme="dark"]) .upload-dropzone {
  background: #FAF8FD;
  border-color: #DFD8EC;
}

html:not([data-theme="dark"]) .pov-preview-916,
html:not([data-theme="dark"]) .post-media-viewport {
  --text-main: #F8FAFC;
  --text-sub: #E2E8F0;
  --text-muted: #CBD5E1;
  --bun-gold: #FFD700;
  color: #F8FAFC;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 61, 139, 0.16), transparent 65%),
    linear-gradient(180deg, #2A1B4E 0%, #1A1A3A 100%);
}

html:not([data-theme="dark"]) .pov-preview-916 *,
html:not([data-theme="dark"]) .post-media-viewport * {
  --text-muted: #CBD5E1;
  --bun-gold: #FFD700;
}

html:not([data-theme="dark"]) .pov-preview-916 .pov-bill-receipt-mock,
html:not([data-theme="dark"]) .pov-preview-916 .pov-cta-bar-mock {
  color: #F8FAFC;
}

html:not([data-theme="dark"]) .pov-preview-916 .pov-cta-bar-mock {
  background: #2D1B54;
  border-color: rgba(167, 139, 250, 0.55);
}

html:not([data-theme="dark"]) .pov-preview-916 .pov-hook-caption-box {
  color: #000000 !important;
}

html:not([data-theme="dark"]) .pov-preview-916 [style*="color:#E2E8F0"],
html:not([data-theme="dark"]) .pov-preview-916 [style*="color:#CBD5E1"],
html:not([data-theme="dark"]) .pov-preview-916 [style*="color:#F8FAFC"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:#E2E8F0"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:#CBD5E1"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:#F8FAFC"] {
  color: #F8FAFC !important;
}

html:not([data-theme="dark"]) .pov-preview-916 [style*="color:var(--text-muted)"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:var(--text-muted)"] {
  color: #CBD5E1 !important;
}

html:not([data-theme="dark"]) .pov-preview-916 [style*="color:var(--bun-gold)"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:var(--bun-gold)"] {
  color: #FFD700 !important;
}

html:not([data-theme="dark"]) .chat-mini-bars {
  background: #FAF8FD !important;
  border: 1px solid #EEEAF5 !important;
  border-radius: 12px;
  padding: 10px 12px;
}

html:not([data-theme="dark"]) .chat-mini-bar-row {
  color: #1A1A3A !important;
}

html:not([data-theme="dark"]) .chat-mini-bar-track {
  background: #EEEAF5 !important;
}

html:not([data-theme="dark"]) .vault-file-thumb {
  background: linear-gradient(135deg, #FFE4F0 0%, #F3E8FF 100%);
  color: #1A1A3A;
  border-color: #EEEAF5;
}

html:not([data-theme="dark"]) .mp-cal-cell.is-empty {
  background: #FAF8FD;
  border-color: #DFD8EC;
}

html:not([data-theme="dark"]) .mp-cal-cell.is-normal {
  background: #FFFFFF;
  border-color: #E9D5FF;
}

html:not([data-theme="dark"]) .mp-cal-cell.is-dense {
  background: linear-gradient(155deg, #FFF0F6 0%, #F3E8FF 100%);
  border-color: #FF3D8B;
}

html:not([data-theme="dark"]) .mp-cal-room-tag {
  background: #F3F1F8;
  border-color: #EEEAF5;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .comp-bun-action-box {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

/* Sửa độ tương phản cho các banner, thẻ bài nổi bật R&D, khung giờ vàng Đăng bài và nút dẫn chứng Cải tiến */
html:not([data-theme="dark"]) .banner-red {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

html:not([data-theme="dark"]) .banner-purple {
  background: #F5F3FF;
  border-color: #DDD6FE;
  color: #5B21B6;
}

html:not([data-theme="dark"]) .qa-provenance-strip {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

html:not([data-theme="dark"]) .drive-sync-banner {
  background: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 100%);
  border-color: #C7D2FE;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .comp-featured-thumb {
  background: linear-gradient(135deg, #FFF0F6 0%, #F3E8FF 100%);
  border-color: #E9D5FF;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .comp-featured-thumb.tone-gold {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-color: #FDE68A;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .comp-featured-thumb.tone-green {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border-color: #A7F3D0;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .comp-featured-thumb [style*="color:#FFF"],
html:not([data-theme="dark"]) .comp-featured-thumb [style*="color: #FFF"],
html:not([data-theme="dark"]) .comp-featured-thumb div:not([style*="color"]) {
  color: #1A1A3A !important;
}

.best-time-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.best-time-chip {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.best-time-chip:hover {
  border-color: var(--bun-pink);
  transform: translateY(-1px);
}

html:not([data-theme="dark"]) .kanban-item-card button:not(.btn) {
  background: #F3F1F8;
  border: 1px solid #DFD8EC;
  border-radius: 8px;
  padding: 6px 10px;
  color: #4A4A68;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
}

html:not([data-theme="dark"]) .kanban-item-card button:not(.btn):hover {
  background: #FFE4F0;
  border-color: #FF3D8B;
  color: #1A1A3A;
}

/* Chuyển đổi tự động các style inline nền tối / chữ pastel trong JS sang Theme Sáng */
html:not([data-theme="dark"]) [style*="background:rgba(13,15,26"],
html:not([data-theme="dark"]) [style*="background: rgba(13, 15, 26"],
html:not([data-theme="dark"]) [style*="background:rgba(15,17,29"],
html:not([data-theme="dark"]) [style*="background:rgba(12,14,24"],
html:not([data-theme="dark"]) [style*="background:rgba(11,13,22"],
html:not([data-theme="dark"]) [style*="background:rgba(10,12,22"],
html:not([data-theme="dark"]) [style*="background:rgba(9,11,20"],
html:not([data-theme="dark"]) [style*="background:rgba(16,13,29"],
html:not([data-theme="dark"]) [style*="background:rgba(19,16,34"],
html:not([data-theme="dark"]) [style*="background:rgba(20,16,36"],
html:not([data-theme="dark"]) [style*="background:rgba(9,11,19"],
html:not([data-theme="dark"]) [style*="background:rgba(15,17,28"],
html:not([data-theme="dark"]) [style*="background:rgba(14,16,27"],
html:not([data-theme="dark"]) [style*="background:linear-gradient(160deg, rgba(16,13,29"],
html:not([data-theme="dark"]) [style*="background:rgba(8,10,18"] {
  background: #FAF8FD !important;
  border-color: #EEEAF5 !important;
}

html:not([data-theme="dark"]) .post-media-viewport > div:last-child span {
  color: #E2E8F0 !important;
}

html:not([data-theme="dark"]) [style*="color:#FDE047"],
html:not([data-theme="dark"]) [style*="color: #FDE047"],
html:not([data-theme="dark"]) [style*="color:#FCD34D"],
html:not([data-theme="dark"]) [style*="color: #FCD34D"],
html:not([data-theme="dark"]) [style*="color:#FEF08A"],
html:not([data-theme="dark"]) [style*="color:#FDE68A"],
html:not([data-theme="dark"]) [style*="color:#FBBF24"],
html:not([data-theme="dark"]) [style*="color:#FDBA74"] {
  color: #92400E !important;
}

html:not([data-theme="dark"]) [style*="color:#34D399"],
html:not([data-theme="dark"]) [style*="color: #34D399"],
html:not([data-theme="dark"]) [style*="color:#6EE7B7"],
html:not([data-theme="dark"]) [style*="color:#A7F3D0"],
html:not([data-theme="dark"]) [style*="color:#86EFAC"],
html:not([data-theme="dark"]) [style*="color:#4ADE80"] {
  color: #166534 !important;
}

html:not([data-theme="dark"]) [style*="color:#38BDF8"],
html:not([data-theme="dark"]) [style*="color: #38BDF8"],
html:not([data-theme="dark"]) [style*="color:#7DD3FC"],
html:not([data-theme="dark"]) [style*="color:#93C5FD"],
html:not([data-theme="dark"]) [style*="color:#60A5FA"] {
  color: #1D4ED8 !important;
}

html:not([data-theme="dark"]) [style*="color:#FCA5A5"],
html:not([data-theme="dark"]) [style*="color: #FCA5A5"],
html:not([data-theme="dark"]) [style*="color:#FECACA"],
html:not([data-theme="dark"]) [style*="color:#F87171"] {
  color: #B91C1C !important;
}

html:not([data-theme="dark"]) [style*="color:#C084FC"],
html:not([data-theme="dark"]) [style*="color: #C084FC"],
html:not([data-theme="dark"]) [style*="color:#D8B4FE"],
html:not([data-theme="dark"]) [style*="color:#E9D5FF"],
html:not([data-theme="dark"]) [style*="color:#A5B4FC"] {
  color: #6D28D9 !important;
}

html:not([data-theme="dark"]) [style*="color:#E2E8F0"],
html:not([data-theme="dark"]) [style*="color:#CBD5E1"],
html:not([data-theme="dark"]) [style*="color:#F8FAFC"] {
  color: #1A1A3A !important;
}

/* Giữ chữ sáng trên khung xem trước video nền tím đậm ở Xưởng & Chi tiết bài */
html:not([data-theme="dark"]) .pov-preview-916,
html:not([data-theme="dark"]) .pov-preview-916 [style*="color:#E2E8F0"],
html:not([data-theme="dark"]) .pov-preview-916 [style*="color:#CBD5E1"],
html:not([data-theme="dark"]) .pov-preview-916 [style*="color:#F8FAFC"],
html:not([data-theme="dark"]) .pov-preview-916 .pov-hook-sub,
html:not([data-theme="dark"]) .post-media-viewport,
html:not([data-theme="dark"]) .post-media-viewport [style*="color:#E2E8F0"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:#CBD5E1"],
html:not([data-theme="dark"]) .post-media-viewport [style*="color:#F8FAFC"] {
  color: #F8FAFC !important;
}

html:not([data-theme="dark"]) .pov-preview-916 [style*="background:rgba(11,9,20"] {
  background: rgba(11, 9, 20, 0.86) !important;
  color: #E2E8F0 !important;
}

html:not([data-theme="dark"]) .pov-preview-916 .pov-bill-receipt-mock [style*="color:var(--bun-gold)"] {
  color: #FFD700 !important;
}

/* Sửa tương phản badge đỏ, lý do chậm nhịp, nút ⋯ kho và thẻ Telegram ở Theme Sáng */
html:not([data-theme="dark"]) .room-task-count-badge {
  background: #DC2626;
  color: #FFFFFF;
}

html:not([data-theme="dark"]) .room-slow-reason {
  background: #FEE2E2;
  border-color: rgba(185, 28, 28, 0.28);
  color: #B91C1C;
}

html:not([data-theme="dark"]) .vault-col-more-btn {
  background: #FFFFFF;
  border-color: #D8D2E8;
  color: #1A1A3A;
}

html:not([data-theme="dark"]) .tg-cat-card {
  background: #FAF8FD;
  border-color: #EEEAF5;
}

html:not([data-theme="dark"]) .tg-cat-card.is-enabled {
  background: #EFF6FF;
  border-color: rgba(29, 78, 216, 0.35);
}

html:not([data-theme="dark"]) .vault-img-badge,
html:not([data-theme="dark"]) .vault-img-filename,
html:not([data-theme="dark"]) .vault-img-meta,
html:not([data-theme="dark"]) .vault-preview-zoom-chip,
html:not([data-theme="dark"]) .vault-video-timer {
  color: #F8FAFC !important;
}

html:not([data-theme="dark"]) .vault-preview-zoom-chip {
  background: rgba(15, 17, 29, 0.82) !important;
}

html:not([data-theme="dark"]) .drive-sync-banner [style*="color:var(--text-muted)"],
html:not([data-theme="dark"]) .drive-sync-banner [style*="color: var(--text-muted)"] {
  color: #4A4A68 !important;
}

html:not([data-theme="dark"]) .kpi-delta:not(.kpi-delta-pill) {
  color: #166534;
}

html:not([data-theme="dark"]) .kpi-delta:not(.kpi-delta-pill).is-down {
  color: #B91C1C;
}

html:not([data-theme="dark"]) .kpi-delta:not(.kpi-delta-pill).neutral {
  color: #6E6E8A;
}

html:not([data-theme="dark"]) .viewer-lock-banner {
  background: #F3E8FF;
  border-color: rgba(91, 33, 182, 0.28);
  color: #5B21B6;
}

/* ==================== TINH GỌN GIAO DIỆN (VÒNG 6) ==================== */
.info-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
}
.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft, #f3f1f8);
  color: #4A4A68;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.info-tip-btn:hover,
.info-tip-btn:focus-visible {
  color: var(--text);
  border-color: var(--accent, #C2185B);
}
.info-tip-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: min(320px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card, #ffffff);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(20, 14, 45, 0.14);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
}
.info-tip-wrap.is-open .info-tip-pop,
.info-tip-wrap:hover .info-tip-pop {
  display: block;
}

details.collapsible-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-top: 14px;
}
details.collapsible-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  user-select: none;
}
details.collapsible-card > summary::-webkit-details-marker {
  display: none;
}
details.collapsible-card > summary::after {
  content: "▾ Mở";
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #6E6E8A);
  flex-shrink: 0;
}
details.collapsible-card[open] > summary::after {
  content: "▴ Thu gọn";
}
details.collapsible-card > .collapsible-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.compact-row-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 14px;
}
.compact-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.compact-row-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-row-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text);
}
.compact-row-item:not(.is-expanded) .compact-row-detail {
  display: none;
}

.show-more-bar {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.subtab-more-wrap {
  position: relative;
  display: inline-block;
}
.subtab-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(20, 14, 45, 0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subtab-more-menu.hidden {
  display: none;
}


