@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-white: #ffffff;
  --bg-surface: #f8fafc;
  --bg-card-gray: #f4f5f8;
  --bg-advisor-pink: #fdf2f8;
  --bg-pastel-yellow: #fffbeb;

  --pink-main: #f472b6;
  --pink-deep: #db2777;
  --pink-soft: #fce7f3;
  --pink-pastel: #fdf2f8;
  --pink-border: #fbcfe8;
  --pink-grad: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);

  --yellow-main: #fbbf24;
  --yellow-deep: #b45309;
  --yellow-soft: #fef3c7;
  --yellow-border: #fde68a;

  --green-badge-bg: #dcfce7;
  --green-badge-text: #15803d;
  --green-text: #059669;

  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;

  --border-light: #e2e8f0;
  --border-soft: #e2e8f0;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 22px rgba(236, 72, 153, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  background: linear-gradient(180deg, #fdf2f8 0%, #fef9c3 100%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ==================== APP SHELL (FULL SCREEN WORKSPACE) ==================== */
.app-container {
  max-width: 1540px;
  min-height: calc(100vh - 28px);
  margin: 0 auto;
  background: var(--bg-white);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
  display: grid;
  grid-template-columns: 68px 1fr;
  overflow-x: clip;
  border: 1px solid var(--border-light);
  position: relative;
}

/* ==================== LEFT ICON-ONLY SIDEBAR ==================== */
.left-rail {
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  align-self: flex-start;
  z-index: 90;
}

.brand-sq {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--pink-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
  cursor: pointer;
  transition: transform 0.16s ease;
  flex-shrink: 0;
}

.brand-sq:hover {
  transform: scale(1.06);
}

.rail-menu {
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  gap: 12px;
}

.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.rail-btn {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.16s ease;
}

.rail-btn svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-btn:hover {
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.rail-btn.active {
  background: var(--pink-soft);
  color: var(--pink-deep);
  box-shadow: inset 0 0 0 1.5px var(--pink-main);
}

.rail-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 54px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: all 0.15s ease;
  z-index: 90;
}

.rail-btn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ==================== MAIN FULL-SCREEN WORKSPACE ==================== */
.main-workspace {
  padding: 22px 28px 76px;
  background: #EFF3F8;
  min-height: calc(100vh - 28px);
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== FULL-SCREEN NAVIGATION & BREADCRUMB BAR ==================== */
.fullscreen-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  flex-wrap: wrap;
}

.btn-back-fullscreen {
  border: 1.5px solid var(--pink-main);
  background: #ffffff;
  color: var(--pink-deep);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 13px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-back-fullscreen:hover {
  background: var(--pink-grad);
  color: #ffffff;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.crumb-current {
  color: var(--text-main);
  font-weight: 800;
}

/* ==================== TOP HEADER BAR ==================== */
.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.title-group h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-group p {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

/* BADGES — ĐỒNG BỘ CỠ CHỮ NHỎ GỌN 11PX */
.badge-green {
  background: var(--green-badge-bg);
  color: var(--green-badge-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-pink {
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-yellow {
  background: var(--yellow-soft);
  color: var(--yellow-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

/* SMART SEARCH BAR */
.smart-search-wrap {
  position: relative;
  width: 360px;
  max-width: 100%;
}

.smart-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 99px;
  padding: 7px 15px;
  transition: all 0.18s;
}

.smart-search-bar:focus-within {
  background: #ffffff;
  border-color: var(--pink-main);
  box-shadow: 0 3px 12px rgba(244, 114, 182, 0.14);
}

.smart-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
}

.search-suggest-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--pink-border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 60;
  display: none;
}

.search-suggest-dropdown.open {
  display: block;
}

.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s;
}

.suggest-item:hover {
  background: var(--bg-advisor-pink);
}

/* ==================== SECTION HEADERS ==================== */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sec-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* DATE FILTER BAR */
.date-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-input {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: 9px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.quick-date-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.q-link {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.q-link.active {
  background: var(--pink-soft);
  color: var(--pink-deep);
}

/* ==================== KPI CARDS (PHÂN CẤP RÕ: SỐ TO 24PX · NHÃN 12PX · GHI CHÚ 11PX) ==================== */
.perf-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.perf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.perf-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.perf-card {
  background: #FFFFFF;
  border-radius: 15px;
  padding: 14px 16px;
  position: relative;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid #CBD5E1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.perf-card:hover {
  background: #FFFFFF;
  border-color: var(--pink-main);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.perf-card.highlight-pastel-pink {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: #f9a8d4;
  border-top: 4px solid #EC4899;
}

.perf-card.highlight-pastel-yellow {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
  border-top: 4px solid #F59E0B;
}

.perf-label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

/* SỐ LIỆU CHÍNH: TO, ĐẬM, NỔI BẬT NHẤT (23PX) */
.perf-val {
  font-size: 23px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  letter-spacing: -0.4px;
}

/* GHI CHÚ PHỤ: NHỎ GỌN 11.5PX, MÀU DỊU */
.perf-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

/* GOLDEN BORDERLESS DEEP-ANALYSIS ICON */
.advisor-icon-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: #f59e0b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.16s ease, color 0.16s ease;
}

.advisor-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: none;
}

.advisor-icon-btn:hover {
  color: #d97706;
  transform: translateY(-1px) scale(1.14);
}

/* ==================== BUTTONS ==================== */
.btn-primary-pink {
  border: none;
  background: var(--pink-grad);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.24);
  transition: transform 0.15s;
  white-space: nowrap;
}

.btn-primary-pink:hover {
  transform: translateY(-1px);
}

.btn-soft {
  background: #ffffff;
  color: var(--text-sub);
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-soft:hover {
  background: var(--pink-pastel);
  color: var(--pink-deep);
  border-color: var(--pink-main);
}

/* ==================== BUN SEEDING BABE BANNER (TINH GỌN, SẠCH SẼ) ==================== */
.advisor-banner {
  background: linear-gradient(135deg, #fdf2f8 0%, #fffbeb 100%);
  border: 1px solid var(--pink-border);
  border-radius: 15px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.advisor-summary-main {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.advisor-kpi-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.advisor-pill-item {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text-sub);
  font-weight: 600;
}

.advisor-pill-item b {
  color: var(--pink-deep);
  font-weight: 800;
}

/* ==================== 11 PLATFORM LOGOS (ĐỒNG ĐỀU, SỐ LIỆU CHÍNH NỔI BẬT, GHI CHÚ NHỎ GỌN) ==================== */
.platforms-11-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 9px;
  margin-bottom: 20px;
}

.plat-logo-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
}

.plat-logo-card:hover {
  border-color: var(--pink-main);
  background: var(--bg-advisor-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.plat-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

/* Tên nền tảng: 12.5px đậm vừa */
.plat-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Số liệu quan trọng nhất trên thẻ Platform: +112 khách (14px đậm nổi bật) */
.plat-primary-val {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--pink-deep);
  line-height: 1.2;
}

/* Ghi chú phụ số luồng: 11px nhỏ gọn màu xám */
.plat-sub-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==================== 6 ANALYTICS DASHBOARDS (.chart-card CÓ KHUNG RÕ RÀNG, SẠCH SẼ) ==================== */
.dashboards-6-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.chart-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.16s ease;
}

.chart-card:hover {
  background: #FFFFFF;
  border-color: var(--pink-main);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.chart-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.chart-type-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--pink-deep);
  background: var(--pink-soft);
  padding: 2px 8px;
  border-radius: 99px;
}

/* Ghi chú đọc vị dưới đáy biểu đồ: Nhỏ gọn 11.5px, không lấn át biểu đồ */
.chart-takeaway-box {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-sub);
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-left: 3px solid var(--pink-main);
  padding: 7px 11px;
  border-radius: 8px;
  line-height: 1.4;
}

/* 1. Biểu đồ Đường Đôi & Vùng */
.dual-line-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  padding: 0 4px;
}

.dual-line-svg-wrap {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 12px 4px;
}

/* 2. Biểu đồ Phễu 4 Bước */
.funnel-steps-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 12px;
}

.funnel-step-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
}

.funnel-step-bar b {
  font-size: 12.5px;
  font-weight: 800;
}

/* 3. Biểu đồ Vòng Tròn Donut */
.donut-chart-layout {
  display: grid;
  grid-template-columns: 126px 1fr;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 14px;
}

.donut-svg-box {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center-label {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.donut-center-label .d-num {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.05;
}

.donut-center-label .d-txt {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donut-legend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--bg-surface);
}

.donut-legend-item b {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
}

/* 4. Biểu đồ Cột Ngang Đa Chiều */
.multibar-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 12px;
}

.multibar-item {
  padding: 3px 0;
}

.multibar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.multibar-track {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.multibar-fill {
  height: 100%;
  border-radius: 99px;
}

/* 5. Ma Trận Nhiệt Độ Giờ Vàng */
.heatmap-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  font-size: 11.5px;
}

.heatmap-matrix-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding: 3px;
}

.heatmap-matrix-table td.hm-region {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.hm-cell {
  text-align: center;
  padding: 7px 6px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
}

.hm-hot {
  background: var(--pink-grad);
  color: #ffffff;
}

.hm-warm {
  background: var(--pink-soft);
  color: var(--pink-deep);
}

.hm-med {
  background: var(--yellow-soft);
  color: var(--yellow-deep);
}

.hm-cool {
  background: var(--bg-surface);
  color: var(--text-muted);
}

/* 6. Biểu đồ Cột Chồng 7 Ngày */
.v-cols-7d-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 138px;
  padding: 16px 10px 6px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  gap: 8px;
}

.v-col-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.v-col-top-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--pink-deep);
  margin-bottom: 4px;
}

.v-col-bar-stack {
  width: 26px;
  border-radius: 6px 6px 3px 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.v-col-day {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ==================== TOP STREAMS & SURFACE BOXES ==================== */
.surface-box {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.16s ease;
}

.stream-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 3.5px solid var(--pink-main);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stream-row:hover {
  border-color: var(--pink-main);
  background: var(--pink-pastel);
}

.stream-plat-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stream-main-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.stream-sub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.stream-kpi-right {
  text-align: right;
}

.stream-lead-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--pink-deep);
}

/* ==================== MENU 1: PROJECT BOXES GRID ==================== */
.project-boxes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.project-box-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-top: 4px solid #EC4899;
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-box-card:hover {
  background: #FFFFFF;
  border-color: var(--pink-main);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.project-box-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.project-box-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
}

.project-kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.project-kpi-mini {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 11px;
  padding: 10px;
  text-align: center;
  transition: all 0.15s ease;
}

.project-kpi-mini:hover {
  border-color: var(--pink-main);
  background: var(--pink-pastel);
}

.project-kpi-mini .k-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.project-kpi-mini .k-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

/* ==================== MENU 2 & 3: AREA SWITCHER, TABS & CLEAN DATA TABLE ==================== */
.area-switcher {
  display: inline-flex;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--border-light);
  gap: 4px;
}

.area-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}

.area-btn.active {
  background: var(--pink-grad);
  color: #ffffff;
}

.sub-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  background: var(--bg-surface);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.sub-tab-btn {
  border: 1px solid transparent;
  background: #ffffff;
  color: var(--text-sub);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sub-tab-btn.active {
  background: var(--pink-soft);
  border-color: var(--pink-main);
  color: var(--pink-deep);
}

.toolbar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.toolbar-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #fdf2f8;
  color: #9d174d;
  font-weight: 800;
  font-size: 11.5px;
  border-bottom: 1px solid var(--pink-border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: #fffdf9;
}

.egg-progress-wrap {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.egg-progress-fill {
  height: 100%;
  border-radius: 99px;
}

/* ==================== MENU 4: UNIFIED INBOX SPLIT LAYOUT ==================== */
.inbox-split-layout {
  display: grid;
  grid-template-columns: 340px 1fr 300px;
  gap: 14px;
  min-height: 560px;
}

.inbox-list-pane,
.inbox-chat-pane,
.inbox-meta-pane {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.16s ease;
}

.inbox-pane-header {
  padding: 12px 15px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
}

.inbox-conv-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.inbox-conv-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.inbox-conv-item:hover,
.inbox-conv-item.active {
  border-color: var(--pink-main);
  background: var(--pink-pastel);
}

.inbox-messages-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.msg-bubble {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 3.5px solid var(--pink-main);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.45;
}

.msg-bubble.customer {
  background: #fffbeb;
  border-left-color: var(--yellow-main);
}

.inbox-composer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
}

.inbox-composer input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.inbox-meta-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-block {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.16s ease;
}

.meta-block:hover {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.meta-block-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ==================== FORMS ==================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.form-control {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
}

/* ==================== FLOATING BUN SEEDING BABE FAB ==================== */
.floating-advisor-fab {
  position: fixed;
  right: 26px;
  bottom: 24px;
  width: auto;
  height: 46px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f472b6 0%, #db2777 65%, #f59e0b 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 26px rgba(219, 39, 119, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.floating-advisor-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 30px rgba(219, 39, 119, 0.45);
}

.floating-babe-label {
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* ==================== BUN SEEDING BABE PROACTIVE ISSUE CARDS ==================== */
.babe-alerts-section {
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.babe-alerts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #92400E;
  margin-bottom: 10px;
}

.babe-alert-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #EC4899;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: all 0.16s ease;
}

.babe-alert-card:last-child {
  margin-bottom: 0;
}

.babe-alert-card.is-resolved {
  background: #F0FDF4;
  border-color: #BBF7D0;
  border-left-color: #16A34A;
  opacity: 0.9;
}

.babe-alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.babe-alert-title {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
}

.babe-alert-body {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 8px;
}

.babe-alert-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* TOAST */
.toast-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  z-index: 200;
  display: none;
}

.toast-bar.show {
  display: block;
}

/* ==================== MANAGER UI REFINEMENTS (ACTION CENTER · SEGMENTED TABS · CLEAN CARDS) ==================== */
.action-center-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.action-center-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #EC4899;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.16s ease;
}

.action-center-card:hover {
  border-color: var(--pink-main);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.ac-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.ac-metric {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.text-pink-bold {
  color: var(--pink-deep);
}

.text-green-bold {
  color: var(--green-text);
}

.analytics-segmented-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
  gap: 4px;
}

.seg-tab-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-tab-btn.active {
  background: #ffffff;
  color: var(--pink-deep);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.project-kpi-3-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.project-kpi-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}

.project-kpi-pill .pk-label,
.project-kpi-pill .k-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.project-kpi-pill .pk-val,
.project-kpi-pill .k-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.inbox-preview-ellipsis {
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.settings-readonly-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== MULTI-MORPHOLOGY DATA-TRUTH CHARTS ==================== */
.chart-insight-footer {
  margin-top: 12px;
  padding: 9px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-insight-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #78350f;
  line-height: 1.4;
  flex: 1;
  min-width: 180px;
}

.chart-callout-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  color: #be185d;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Donut Layout */
.donut-chart-layout {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 6px 0;
}

.donut-svg-box {
  position: relative;
  width: 146px;
  height: 146px;
  flex-shrink: 0;
}

.donut-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center-num {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.donut-center-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.donut-legend-list {
  flex: 1;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 12px;
}

.donut-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #1e293b;
}

.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Stacked 100% Composition Bar */
.stacked-bar-track {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  margin: 8px 0 12px;
}

.stacked-bar-seg {
  height: 100%;
  transition: width 0.25s ease;
}

/* Vertical Bar Chart */
.vbar-chart-wrap {
  position: relative;
  padding: 10px 8px 4px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
}

/* True-Scale Funnel */
.true-funnel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.true-funnel-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.true-funnel-bar {
  border-radius: 9px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 170px;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.true-funnel-arrow {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.true-funnel-arrow.bottleneck {
  color: #be123c;
  background: #ffe4e6;
  padding: 2px 8px;
  border-radius: 999px;
}

/* RAM Bullet Gauge & Proxy Cards */
.ram-gauge-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.ram-gauge-track {
  position: relative;
  height: 14px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: visible;
  margin: 8px 0 4px;
}

.ram-gauge-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.ram-gauge-threshold {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2.5px;
  background: #dc2626;
  border-radius: 2px;
}

.proxy-latency-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.proxy-latency-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

/* Platform highlight badges */
.multibar-item.is-top-performer {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 7px 10px;
}

.multibar-item.is-lagging-performer {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 7px 10px;
}

.multibar-list.is-scrollable-11 {
  max-height: 295px;
  overflow-y: auto;
  padding-right: 6px;
}
.multibar-list.is-scrollable-11 .multibar-item {
  margin-bottom: 2px;
}
.donut-legend-row[onclick]:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
.data-table td {
  overflow-wrap: anywhere;
}

/* ==================== COUNT PILL GREEN & VISUAL FOCUS ==================== */
.count-pill-green {
  background: #16A34A;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.35);
  line-height: 1;
  vertical-align: middle;
}

.tab-btn-muted {
  color: #64748B !important;
  opacity: 0.78;
}

.tab-btn-muted:hover {
  opacity: 1;
  color: #0F172A !important;
}

/* Giảm badge pastel loãng rải rác ở các cột phụ trong bảng, giữ nổi cột Trạng thái & Kết quả */
.data-table td:not(:last-child):not(:nth-last-child(2)) .badge-pink,
.data-table td:not(:last-child):not(:nth-last-child(2)) .badge-yellow {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
}

/* ==================== GLOBAL LOOKUP BUTTON & OVERLAY (CTRL+K) ==================== */
.global-lookup-trigger {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.global-lookup-trigger:hover {
  border-color: var(--pink-main);
  color: var(--pink-deep);
  background: var(--pink-pastel);
  transform: translateY(-1px);
}

.global-lookup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
}

.global-lookup-overlay.open {
  display: flex;
}

.global-lookup-modal {
  width: 660px;
  max-width: calc(100vw - 32px);
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-top: 4px solid #EC4899;
  border-radius: 16px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.global-lookup-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #E2E8F0;
}

.global-lookup-input-row input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #0F172A;
  background: transparent;
}

.global-lookup-kbd {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748B;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 2px 6px;
}

.global-lookup-close {
  border: none;
  background: #F1F5F9;
  color: #475569;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.global-lookup-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 12px;
}

.plat-svg-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==================== BRAIN & FINE-TUNE + PROJECT CREATE COMPACT ==================== */
.plat-select-pill {
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  border-radius: 10px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.plat-select-pill:hover {
  border-color: var(--pink-main);
  background: var(--pink-pastel);
}

.plat-select-pill.selected {
  border-color: #DB2777;
  background: #FDF2F8;
  box-shadow: 0 0 0 2px rgba(219, 39, 119, 0.18);
  color: #9D174D;
}

.brain-diff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.brain-diff-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brain-before-box {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 3.5px solid #EF4444;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12px;
  color: #7F1D1D;
  line-height: 1.5;
}

.brain-after-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 3.5px solid #16A34A;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12px;
  color: #14532D;
  line-height: 1.5;
}

.brain-vault-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.shield-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 4px solid #16A34A;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #14532D;
}

.project-create-layout {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
}

.advisor-workspace-layout {
  grid-template-columns: 1fr 340px;
  height: calc(100vh - 280px);
}

.grid-auto-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-auto-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.heatmap-table-wrap {
  background: #FFFFFF;
  border: 1px solid #F1F5F9;
  border-radius: 12px;
  padding: 10px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.inline-input-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-input-action .form-control {
  min-width: 0;
  flex: 1 1 150px;
}

.inline-input-action button {
  max-width: 100%;
}

/* ==================== RESPONSIVE: SAMSUNG GALAXY Z FOLD 6 (MÀN TRONG & MÀN NGOÀI) ==================== */
@media (max-width: 980px) {
  body {
    overflow-x: hidden;
  }
  .main-workspace {
    padding: 14px 14px 86px;
    min-width: 0;
  }
  .chart-card,
  .surface-box,
  .perf-card,
  .action-center-card,
  .project-box-card {
    min-width: 0;
    max-width: 100%;
  }
  .home-topbar,
  .fullscreen-nav-bar,
  .sec-head,
  .toolbar-actions,
  .chart-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .home-topbar > div,
  .fullscreen-nav-bar > div,
  .sec-head > div {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .perf-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .perf-grid-4,
  .project-kpi-3-row,
  .brain-diff-grid,
  .brain-vault-grid,
  .dashboards-6-grid,
  .action-center-grid,
  .form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .platforms-11-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .inbox-split-layout {
    grid-template-columns: 240px 1fr;
  }
  .inbox-meta-pane {
    grid-column: 1 / -1;
  }
  .project-create-layout,
  .project-boxes-grid {
    grid-template-columns: 1fr;
  }
  .advisor-workspace-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .data-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sub-tabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .sub-tab-btn {
    flex-shrink: 0;
  }
  /* Chuẩn Touch Target cho cả Z Fold 6 mở (673px) và gập (344px) */
  .btn-primary-pink,
  .btn-back-fullscreen,
  .sub-tab-btn,
  .area-btn,
  .seg-tab-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .btn-soft {
    min-height: 36px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .data-table .btn-soft,
  .data-table .btn-primary-pink {
    white-space: nowrap !important;
    min-width: max-content;
  }
  .q-link {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
  }
  .global-lookup-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    flex-shrink: 0;
  }
  .advisor-icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
  .date-filter-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .brain-vault-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  html, body {
    overflow-x: hidden;
    padding: 0 !important;
    margin: 0;
    max-width: 100vw;
  }
  .app-container {
    grid-template-columns: 1fr;
    border-radius: 0;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    box-shadow: none;
  }
  .left-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: calc(58px + env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border-light);
    border-right: none;
    border-radius: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 250;
    gap: 4px;
  }
  .brand-sq {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin: 0;
  }
  .rail-menu {
    flex-direction: row;
    align-items: center;
    margin-top: 0;
    gap: 4px;
    flex-shrink: 0;
  }
  .rail-bottom {
    flex-direction: row;
    align-items: center;
    margin-top: 0;
    gap: 4px;
    flex-shrink: 0;
  }
  .rail-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    flex-shrink: 0;
  }
  .rail-btn::after,
  .rail-btn:hover::after {
    display: none !important;
    content: none !important;
  }
  .main-workspace {
    padding: 10px 10px calc(116px + env(safe-area-inset-bottom));
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .home-topbar > div:last-child {
    flex-wrap: wrap;
    width: 100%;
  }
  .date-filter-bar {
    width: 100%;
    gap: 6px;
  }
  .date-input {
    min-width: 0;
    max-width: 100%;
    font-size: 11.5px;
    padding: 4px 6px;
  }
  .floating-advisor-fab {
    bottom: calc(66px + env(safe-area-inset-bottom));
    right: 10px;
    padding: 8px 12px;
    min-height: 40px;
    max-width: calc(100vw - 20px);
  }
  .floating-babe-label {
    font-size: 12px;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .perf-grid-5,
  .perf-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .perf-grid-5 > :last-child {
    grid-column: 1 / -1;
  }
  .perf-card {
    padding: 10px;
    min-width: 0;
    overflow: hidden;
  }
  .perf-card .perf-val {
    font-size: 17px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .platforms-11-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .action-center-grid,
  .dashboards-6-grid,
  .project-kpi-3-row,
  .brain-diff-grid,
  .brain-vault-grid,
  .form-grid-2,
  .inbox-split-layout,
  .advisor-workspace-layout,
  .perf-grid-3,
  .project-boxes-grid,
  .donut-chart-layout,
  .proxy-latency-grid,
  .grid-auto-3,
  .grid-auto-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-kpi-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stream-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
  }
  .stream-row > :nth-child(n+3),
  .stream-kpi-right {
    grid-column: 1 / -1;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .badge-green,
  .badge-pink,
  .badge-yellow {
    white-space: normal;
    word-break: break-word;
    text-align: left;
    line-height: 1.35;
  }
  .inbox-list-pane {
    max-height: 240px;
    overflow-y: auto;
  }
  .inbox-list-pane,
  .inbox-chat-pane,
  .inbox-meta-pane {
    min-width: 0;
    max-width: 100%;
  }
  .inbox-pane-header,
  .inbox-chat-header,
  .inbox-composer,
  .inbox-reply-box,
  .action-center-card,
  .babe-alert-actions,
  .babe-alert-card,
  .advisor-chat-input-row,
  .advisor-input-bar,
  .sec-head {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .action-center-card > div,
  .babe-alert-card > div,
  .inbox-pane-header > div {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 160px;
  }
  .sec-head > div,
  .sec-title {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .inbox-composer input,
  #advisorWorkspaceInput {
    min-width: 0;
    flex: 1 1 160px;
    width: 100%;
  }
  .global-lookup-modal {
    width: calc(100vw - 20px);
    max-height: 85vh;
  }
  .btn-primary-pink,
  .btn-soft {
    max-width: 100%;
    min-width: 0;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
    justify-content: center;
    min-height: 40px;
    box-sizing: border-box;
    flex-shrink: 1;
  }
  .btn-back-fullscreen,
  .sub-tab-btn,
  .area-btn,
  .seg-tab-btn {
    min-height: 40px;
  }
  .surface-box,
  .chart-card,
  .action-center-card,
  .project-box-card {
    padding: 12px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .home-topbar .title-group h1 {
    font-size: 18px;
    flex-wrap: wrap;
  }
}
