/* ===== REPORTNEW UI - LANDSCAPE / DESKTOP ===== */

body {
  padding-top: calc(var(--header-h) + var(--safe-area-top));
  padding-bottom: calc(var(--footer-h) + 18px + var(--safe-area-bottom));
}

body.logged-in {
  --header-h: 64px;
  --sidebar-width: 280px !important;
  padding-top: 0;
  padding-left: var(--sidebar-width) !important;
}

body.logged-out #sidebar,
body.logged-out #contentWrap,
body.logged-out #agentSelection,
body.logged-out #tocMobile,
body.logged-out .welcome-banner,
body.logged-out .mobile-update-date,
body.logged-out .mobile-viewing-info {
  display: none !important;
}

body.logged-out {
  min-height: 100vh;
  padding: 0;
  background: linear-gradient(135deg, #013d30 0%, #025b48 45%, #04604e 75%, #00875a 100%);
}

/* ===== LOGIN SCREEN — see styles/login.css (shared HL + MODULAR) ===== */

body:not(.logged-in) .print-btn {
  display: none !important;
}

body.logged-in .login-only {
  display: none !important;
}

.logout-only {
  display: none !important;
}

#headerMobileLogoutBtn {
  display: none;
}

body.logged-in .logout-only {
  display: inline-flex !important;
}

body.logged-in .login-cluster {
  display: none !important;
}

/* ===== LOGIN SCREEN — see styles/login.css ===== */
/* ===== MAIN HEADER + SIDEBAR — see styles/components/header.css ===== */

/* ===== BUTTONS ===== */
.print-btn,
#supportFooter,
.group-print-btn,
.search-agent-btn,
.view-my-report-btn,
.view-other-agent-btn,
.mobile-view-other-btn,
.mobile-logout-btn,
.header-reset-btn,
.nut_tinh_may_tinh {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  padding: 8px 14px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
  line-height: 1.15;
  transition: var(--transition);
}

.print-btn:hover,
#supportFooter:hover,
.group-print-btn:hover,
.search-agent-btn:hover,
.view-my-report-btn:hover,
.view-other-agent-btn:hover,
.nut_tinh_may_tinh:hover {
  background: #014d3c;
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}

/* ===== SIDEBAR + HEADER — see styles/components/header.css ===== */

.welcome-banner {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-area-top));
  left: 0;
  right: 0;
  z-index: var(--z-banner);
  display: none;
  padding: 6px 16px;
  background: linear-gradient(90deg, var(--brand) 0%, #047a60 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

body.logged-in .welcome-banner {
  display: none !important;
}

body.logged-in.sidebar-open .welcome-banner,
body.force-desktop-landscape.logged-in.sidebar-open .welcome-banner {
  left: var(--sidebar-width);
}

body.logged-in .welcome-banner {
  top: calc(var(--header-h) + var(--safe-area-top));
  left: var(--sidebar-width);
  right: 0;
}

body.logged-in:not(.sidebar-open) .welcome-banner {
  left: 0;
}

#tocMobile,
.mobile-update-date,
.mobile-viewing-info {
  display: none !important;
}

#contentWrap {
  position: relative;
  z-index: var(--z-content);
  margin-left: 0;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

body.logged-in main {
  padding-top: 24px;
}

.section {
  position: relative;
  z-index: var(--z-content);
}

.section-container {
  margin-top: 24px;
  padding: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.section-container.modern-info-container {
  padding: 16px;
}

.info-groups-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

#sectionManulifePro .info-groups-container,
#sectionMbaPro .info-groups-container,
#sectionChucDanh .info-groups-container {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-group {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: var(--transition);
}

.info-group:not(.collapsed),
.info-group.full-width,
#sectionManulifePro .info-group,
#sectionMbaPro .info-group,
#sectionChucDanh .info-group {
  grid-column: 1 / -1;
}

.info-group-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--brand) 0%, #047a60 100%);
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}

.info-group-header:hover {
  background: linear-gradient(90deg, #014d3c 0%, var(--brand-2) 100%);
}

.info-group-icon {
  width: 24px;
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.info-group-title {
  flex: 1;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}

.info-group-toggle {
  color: #ffffff;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.info-group.collapsed .info-group-toggle {
  transform: rotate(180deg);
}

.info-group-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: 2400px;
  overflow: hidden;
  padding: 12px;
  background: var(--surface-soft);
  transition: max-height 0.25s ease, padding 0.25s ease;
}

/* Parent-group: flex column, không grid. Các sub-group bên trong cũng flex column */
.info-group-content.parent-group-content,
.info-group-content.parent-group-content .info-group-content {
  display: flex !important;
  flex-direction: column;
  gap: 0.5rem;
}

.info-group-content.two-columns,

.info-group-content.two-columns,
#sectionMStar .info-group-content.two-columns,
#sectionChucDanh .info-group-content.two-columns,
#sectionMbaPro .info-group-content.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#sectionManulifePro .info-group-content.three-row-layout,
#sectionManulifePro .info-group-content.two-row-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Fast-Track subgroups */
.fasttrack-subgroup {
  grid-column: 1 / -1;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px;
  background: #f9fafb;
  margin-bottom: 10px;
}
.fasttrack-subgroup-title {
  font-size: 14px;
  font-weight: 800;
  color: #1e40af;
  margin-bottom: 2px;
}
.fasttrack-subgroup-subtitle {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 10px;
  font-weight: 600;
}
.fasttrack-subgroup-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
/* Subgroup 2 (Đào tạo): 3 fields → 3 cột */
.fasttrack-subgroup:nth-child(2) .fasttrack-subgroup-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* Subgroup 3 (Kết quả): 2 fields → 2 cột */
.fasttrack-subgroup:nth-child(3) .fasttrack-subgroup-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* Subgroup 4 (Thưởng): 3 fields → 3 cột */
.fasttrack-subgroup:nth-child(4) .fasttrack-subgroup-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#sectionMStar .info-group-content,
#sectionMbaPro .mbaProGroupContent {
  display: grid;
}

/* MDRT+ pair layout: desktop 2 cột ngang, mobile 1 cột dọc */
.mstar-pair-wrapper {
  grid-column: 1 / -1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  margin-bottom: 10px;
}
.mstar-pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  width: 100%;
}
.mstar-pair-item {
  border: none;
  padding: 0;
  background: none;
  box-shadow: none;
}
.mstar-pair-left {
  border-right: 2px solid #e2e8f0;
  padding-right: 15px;
}
.mstar-pair-right .info-value {
  text-align: right;
}
#sectionMStar .mstar-pair-row {
  grid-column: 1 / -1;
}

.info-group.collapsed .info-group-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.info-item,
.info-item-modern {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: var(--transition);
}

.info-item-modern:hover,
.info-item:hover {
  background: #f8fcfb;
  border-color: var(--brand);
}

.info-label,
.thin,
.li-label {
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-value,
.info-item .val,
.hl {
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  word-break: break-word;
  text-align: right;
}

/* Value > 0 khi label chứa "Cần thêm" → tô đỏ */
.has-can-them .info-value,
.has-can-them .info-item .val,
.has-can-them .hl {
  color: #dc2626 !important;
}

.info-note,
.warning-text,
.warning-item .info-value {
  color: var(--danger);
  font-weight: 900;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.subsec,
.target-section-title,
.subsection-title {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.sub-block,
.sub-content,
.subsection {
  display: grid;
  gap: 12px;
}

.sub-block,
.subsection {
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.sub-content-full,
.full-row,
.note-row,
.stage-allocation-warning,
.pinned-warning,
.warning-section {
  grid-column: 1 / -1;
}

.list-dot,
.bullet-strong {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-dot li,
.bullet-strong li {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}

.list-dot li:last-child,
.bullet-strong li:last-child {
  border-bottom: 0;
}

.thumbnail-slideshow {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-area-top));
  left: 0;
  right: 0;
  bottom: var(--footer-h);
  z-index: var(--z-content);
  display: none;
  background: #e0f2fe;
}

body.logged-out .thumbnail-slideshow {
  display: none !important;
}

body.logged-in .thumbnail-slideshow,
body.logged-in:not(.section-selected) .thumbnail-slideshow {
  display: none !important;
}

body.section-selected .thumbnail-slideshow {
  display: none !important;
}

body.sidebar-open .thumbnail-slideshow {
  left: var(--sidebar-width);
}

body.logged-in .thumbnail-slideshow {
  left: var(--sidebar-width);
}

.slideshow-container,
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
}

.slide.prev {
  transform: translateX(-100%);
}

.slide img {
  width: 95%;
  height: 95%;
  object-fit: contain;
}

.agent-selection,
.search-result,
.filter-results,
.manulife-pro-filters,
.target-container {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.agent-selection {
  margin: 20px auto 0;
  padding: 14px 16px;
}

.selection-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.search-wrapper,
.agent-search-container {
  width: min(860px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.agent-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  font-weight: 700;
}

.search-agent-btn,
.view-my-report-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.region-filter-section {
  flex: 0 0 150px;
  width: 150px;
}

.manulife-pro-filters {
  clear: both;
  align-self: stretch;
}

.custom-dropdown {
  position: relative;
}

.dropdown-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  display: none;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.dropdown-menu.show {
  display: block;
}

.dropdown-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.dropdown-action-btn {
  flex: 1;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.select-all-btn {
  background: #dbeafe;
  color: #1e40af;
}

.clear-all-btn {
  background: #fee2e2;
  color: var(--danger);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.manulife-pro-filters {
  width: 100%;
  margin-top: 16px;
  padding: 18px;
}

.filter-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.filter-btn {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  transition: var(--transition);
}

.filter-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

.pro-bac-btn { background: #f1f5f9; color: #334155; }
.pro-vang-btn { background: #fff7ed; color: #b45309; }
.pro-bachkim-btn { background: #eef2ff; color: #4338ca; }
.mdrt-btn { background: #ecfeff; color: #0e7490; }
.m0-chua-active-btn,
.m1-chua-active-btn { background: #fef2f2; color: var(--danger); }
.pro-potential-btn { background: #f0fdf4; color: #15803d; }
.quan-ly-dtcd-btn { background: #eff6ff; color: #1d4ed8; }
.tiem-nang-thang-cap-btn { background: #f5f3ff; color: #6d28d9; }
.duy-tri-chuc-danh-btn { background: #fff1f2; color: #be123c; }
.mba-pro-btn { background: #ecfeff; color: #0e7490; }
.mdrt-simple-btn { background: #faf5ff; color: #7c3aed; }

.view-other-btn {
  grid-column: 1 / -1;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--warning);
  color: #ffffff;
  font-weight: 900;
}

.search-result,
.filter-results {
  margin-top: 16px;
  padding: 16px;
}

.agent-results,
.pro-results {
  display: grid;
  gap: 10px;
}

.agent-result-item {
  width: 100%;
}

.agent-result-btn {
  width: 100%;
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  transition: var(--transition);
}

.agent-result-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}

.agent-result-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}
.agent-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.2;
  background: linear-gradient(135deg, #22c55e, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.agent-result-header-text {
  flex: 1;
  min-width: 0;
}
.agent-result-name {
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.agent-result-sub {
  font-size: 11px;
  color: var(--muted, #6b7280);
  font-weight: 600;
}

.agent-result-mos-ngn {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.filter-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.filter-results-header h4 {
  margin: 0;
  color: var(--brand);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.export-buttons-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-filter-btn {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.agent-card,
.agent-result,
.pro-result-item,
.result-card,
.no-results {
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ── MOS filter bar ── */
.mos-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
}
.mos-filter-label {
  font-weight: 800;
  font-size: 13px;
  color: var(--muted, #4a5568);
  margin-right: 4px;
}
.mos-filter-btn {
  padding: 5px 10px;
  border: 1px solid var(--brand-border, #b3d9d0);
  border-radius: var(--radius, 8px);
  background: #fff;
  color: var(--brand, #025b48);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.mos-filter-btn.active {
  background: var(--brand, #025b48);
  color: #fff;
  border-color: var(--brand, #025b48);
}
.mos-filter-btn:hover:not(.active) {
  background: var(--brand-soft, #e6f4f1);
}

/* ── Make result cards stand out ── */
.pro-result-item {
  border: 1px solid var(--brand-border, #b3d9d0);
  box-shadow: var(--shadow-brand, 0 2px 10px rgba(2,91,72,0.12));
  border-top: 4px solid var(--brand, #025b48);
  padding: 12px 14px;
}

.agent-result-btn {
  border: 1px solid var(--brand-border, #b3d9d0);
  box-shadow: var(--shadow-brand, 0 2px 10px rgba(2,91,72,0.12));
  border-top: 3px solid var(--blue, #2563eb);
  cursor: pointer;
  text-align: left;
}

.agent-result-btn table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 6px 0;
}
.agent-result-btn th {
  background: #f1f5f9;
  color: #374151;
  font-weight: 800;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  text-align: center;
  text-transform: uppercase;
}
.agent-result-btn td {
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-weight: 700;
}
.agent-result-btn .metric-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.badge-mos {
  display: inline-block;
  background: #f0fdf4;
  color: #15803d;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  vertical-align: middle;
}
.badge-ngn {
  display: inline-block;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  vertical-align: middle;
}

/* Table kẻ ô rõ ràng cho kết quả lọc Pro (giống mobile) */
/* ── Tab bar cho kết quả lọc Pro ── */
.pro-tab-bar { display: flex; gap: 0; margin: 0 0 12px; border-radius: var(--radius, 8px); overflow: hidden; border: 1px solid var(--brand, #025b48); }
.pro-tab-btn { flex: 1; padding: 8px 12px; border: 0; background: #fff; color: var(--brand, #025b48); font-weight: 800; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.pro-tab-btn.active { background: var(--brand, #025b48); color: #fff; }
.pro-tab-btn:not(.active):hover { background: var(--brand-soft, #e8f5f0); }
.pro-tab-content { display: flex; flex-direction: column; gap: 10px; }

.pro-result-item table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 6px 0;
}
.pro-result-item th {
  background: #f1f5f9;
  color: #374151;
  font-weight: 800;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  text-align: center;
  text-transform: uppercase;
}
.pro-result-item td {
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-weight: 700;
}
.pro-result-item .metric-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.agent-name {
  color: var(--brand);
  font-weight: 900;
}

.agent-msdl {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.warning-section,
.pinned-warning,
.pro-alert,
.stage-allocation-warning,
.custom-confirm-modal,
.popup-content,
.loading-content {
  border-radius: var(--radius-lg);
}

.warning-section,
.pinned-warning {
  margin: 0;
  padding: 16px;
  background: linear-gradient(180deg, #fff5f5 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.pinned-warning .info-group-header {
  background: var(--danger);
}

.pro-alert,
.stage-allocation-warning {
  padding: 12px 14px;
  border: 1px solid #fca5a5;
  background: #fff5f5;
  color: #b91c1c;
  font-weight: 900;
}

.stage-allocation-warning.info {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.stage-allocation-warning.success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.loading-screen,
.popup-overlay,
.custom-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
}

.loading-screen {
  z-index: var(--z-loading);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(5px);
}

.loading-content,
.popup-content,
.custom-confirm-modal {
  width: min(92vw, 460px);
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--brand);
  font-weight: 900;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.popup-header h3,
.custom-confirm-title {
  margin: 0;
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
}

.popup-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: #f3f4f6;
  color: #6b7280;
  font-size: 24px;
  line-height: 1;
}

.popup-buttons,
.custom-confirm-buttons {
  display: flex;
  gap: 10px;
}

.popup-buttons {
  flex-direction: column;
}

.popup-btn,
.custom-confirm-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  text-align: left;
}

.popup-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.btn-icon {
  font-size: 22px;
}

.btn-title {
  color: var(--brand);
  font-weight: 900;
}

.btn-desc {
  color: var(--muted);
  font-size: 13px;
}

.custom-confirm-btn-cancel {
  background: #e5e7eb;
  color: #374151;
}

.custom-confirm-btn-confirm,
.header-reset-btn,
.mobile-logout-btn {
  background: var(--danger);
  color: #ffffff;
}

.income-container,
.income-section,
.income-group,
.income-collapse-group,
.income-stage,
.collapsible-stage {
  display: grid;
  gap: 12px;
}

#sectionIncome .section-container {
  display: grid;
  gap: 16px;
}

.income-input-row,
.income-input-row-4-col,
.subsection-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.income-group-1,
.income-input-row-2-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.income-form-group,
.income-input-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.income-form-group label,
.income-input-field label {
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.income-input-field input,
.info-value input {
  width: 100%;
  padding: 0 10px;
  font-weight: 800;
}

.field-highlight {
  border-width: 2px !important;
  border-color: var(--brand) !important;
  background: #ffffff !important;
}

#pageFooter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-footer);
  min-height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 20px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

body.logged-in #pageFooter {
  left: var(--sidebar-width);
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-left {
  flex-direction: column;
  gap: 2px;
}

#pageFooter img {
  height: 18px;
  width: auto;
}

#supportDesk {
  position: fixed;
  right: 18px;
  bottom: calc(var(--footer-h) + 10px);
  z-index: var(--z-support);
  display: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-panel);
}

body.logged-in #supportDesk {
  display: block;
}

/* ===== ERROR TOP — handled by login.css .thong_bao_loi ===== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

@media (max-width: 1199px) {
  .info-groups-container,
  .info-group-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-buttons,
  .income-input-row,
  .income-input-row-4-col,
  .subsection-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== THEO DÕI CHỨC DANH — SECTION RIÊNG ===== */
#sectionChucDanh .info-item-modern {
  gap: 0;
  min-height: 0;
  padding: 8px 6px;
}
#sectionChucDanh .info-item-modern .info-label {
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sectionChucDanh .info-group-header {
  min-height: 36px;
  padding: 6px 12px;
}
#sectionChucDanh .info-group-title {
  white-space: nowrap;
}

.label-desk { display: inline; }
.label-mob { display: none; }
.promo-desk { display: block; grid-column: 1 / -1; }
.promo-mob { display: none; }
