/* theme_upgraded.css */
/* Premium Glassmorphic & Infinite Canvas Engine for VNPT Cà Mau Command Center */

/* 1. Reset Background & Scrollbar inside Iframe */
.in-iframe body {
  background: transparent !important;
}

.in-iframe .max-w-\[1800px\],
.in-iframe .max-w-\[1500px\] {
  padding: 0 !important;
  max-width: 100% !important;
}

/* Hide local aside & sidebar inside iframe completely */
.in-iframe aside,
.in-iframe #sidebar,
.in-iframe #standaloneSidebar,
.in-iframe .main-sidebar,
.in-iframe .sidebar,
.in-iframe [class*="w-sidebar"],
.in-iframe .header-brand-container,
.in-iframe .standalone-only {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide local header inside iframe completely */
.in-iframe header,
.in-iframe header.fixed,
.in-iframe header#standaloneHeader,
.in-iframe body > header:not(.table-header):not(.card-header) {
  display: none !important;
}

/* Make iframe layout more compact and comfortable with 100% full width */
.in-iframe main,
.in-iframe .main-content,
.in-iframe [class*="ml-sidebar"],
.in-iframe [class*="pl-sidebar"],
.in-iframe body.sidebar-collapsed main {
  margin-left: 0 !important;
  padding-left: 0 !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Hide local theme switcher buttons inside iframe */
.in-iframe button[onclick="toggleTheme()"],
.in-iframe button[title*="Sáng/Tối"] {
  display: none !important;
}

/* Custom Scrollbar for inner pages */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(76, 184, 255, 0.3);
}

/* 2. Intelligent Header Hiding inside Iframe */
/* Hide the VNPT Logo and local dark mode button, but KEEP the dynamic date range title (#acDataDateTitle) visible! */
.in-iframe div.flex.flex-col.md\:flex-row.md\:items-center.md\:justify-between > div.flex.items-center.gap-3 > img,
.in-iframe div.flex.flex-col.md\:flex-row.md\:items-center.md\:justify-between > div.flex.items-center.gap-3 + button,
.in-iframe a[href*="index_bsckpi_program_overview.html"],
.in-iframe #themeIcon,
.in-iframe button[title*="Sáng/Tối"] {
  display: none !important;
}

/* Align date title to the left and filter selectors to the right beautifully with generous breathing padding */
.in-iframe div.flex.flex-col.md\:flex-row.md\:items-center.md\:justify-between {
  justify-content: space-between !important;
  margin-bottom: 16px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Add an extra touch of premium offset for the date title to prevent touching the edges */
.in-iframe #acDataDateTitle {
  margin-left: 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* ==========================================================================
   ✦ DARK MODE OVERRIDES (GIAO DIỆN TỐI)
   ========================================================================== */

/* Upgrading Cards to High-End Dark Glassmorphism */
.dark .in-iframe .bg-white,
.dark .in-iframe .dark\:bg-\[\#1e293b\]\/60,
.dark .in-iframe .bg-slate-900,
.dark .in-iframe .bg-slate-800,
.dark .in-iframe .rounded-xl.border,
.dark .in-iframe .rounded-2xl.border {
  background: rgba(255, 255, 255, 0.015) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Glow indicators for active elements */
.dark .in-iframe .border-t-4 {
  border-top-width: 3px !important;
  position: relative;
}

.dark .in-iframe .border-t-\[\#60a5fa\] {
  box-shadow: inset 0 1px 0 rgba(96, 165, 250, 0.15), 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.dark .in-iframe .border-t-\[\#fb923c\] {
  box-shadow: inset 0 1px 0 rgba(251, 146, 60, 0.15), 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.dark .in-iframe .border-t-\[\#a855f7\] {
  box-shadow: inset 0 1px 0 rgba(168, 85, 247, 0.15), 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.dark .in-iframe .border-t-\[\#34d399\] {
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.15), 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Elegant and Modern Dark Tables */
.dark .in-iframe .thin-table,
.dark .in-iframe .matrix-table {
  background: transparent !important;
}

.dark .in-iframe th {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
}

.dark .in-iframe td {
  border-color: rgba(255, 255, 255, 0.04) !important;
  color: #cbd5e1 !important;
}

.dark .in-iframe tbody tr:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

.dark .in-iframe tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.005) !important;
}

.dark .in-iframe .matrix-group {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #ffffff !important;
}

.dark .in-iframe .matrix-sub {
  background: rgba(255, 255, 255, 0.015) !important;
}

/* Interactive custom styled dropdowns in Dark Mode */
.dark .in-iframe select,
.dark .in-iframe input[type="date"] {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 10px !important;
  color: #e2e8f0 !important;
  transition: all 0.2s ease !important;
}

.dark .in-iframe select:focus,
.dark .in-iframe input[type="date"]:focus {
  border-color: rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1) !important;
}

.dark .in-iframe select option {
  background: #0f172a !important;
  color: #ffffff !important;
}


/* ==========================================================================
   ✦ LIGHT MODE OVERRIDES (GIAO DIỆN SÁNG)
   ========================================================================== */

/* Upgrading Cards to High-End Light Glassmorphism (exclude buttons & colored badges/alerts) */
:not(.dark) .in-iframe .bg-white,
:not(.dark) .in-iframe div.rounded-xl.border:not([class*="bg-"]):not(.exec-subtab-btn):not(.oper-subtab-btn):not(.warn-subtab-btn),
:not(.dark) .in-iframe div.rounded-2xl.border:not([class*="bg-"]) {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-color: rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.04) !important;
}

/* Light Mode Borders with subtle colorful shadows */
:not(.dark) .in-iframe .border-t-4 {
  border-top-width: 3px !important;
}

:not(.dark) .in-iframe .border-t-\[\#60a5fa\] {
  box-shadow: inset 0 1px 0 rgba(96, 165, 250, 0.15), 0 8px 32px rgba(31, 38, 135, 0.04) !important;
}

:not(.dark) .in-iframe .border-t-\[\#fb923c\] {
  box-shadow: inset 0 1px 0 rgba(251, 146, 60, 0.15), 0 8px 32px rgba(31, 38, 135, 0.04) !important;
}

:not(.dark) .in-iframe .border-t-\[\#a855f7\] {
  box-shadow: inset 0 1px 0 rgba(168, 85, 247, 0.15), 0 8px 32px rgba(31, 38, 135, 0.04) !important;
}

:not(.dark) .in-iframe .border-t-\[\#34d399\] {
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.15), 0 8px 32px rgba(31, 38, 135, 0.04) !important;
}

/* Pristine and Clean Light Tables */
:not(.dark) .in-iframe .thin-table,
:not(.dark) .in-iframe .matrix-table {
  background: transparent !important;
}

:not(.dark) .in-iframe table:not(.report-table) th:not([style*="background"]):not([class*="bg-"]) {
  background: rgba(241, 245, 249, 0.8) !important;
  border-color: rgba(226, 232, 240, 0.8) !important;
  font-weight: 700 !important;
}

:not(.dark) .in-iframe table:not(.report-table) th:not([class*="text-"]):not([style*="color"]):not([style*="background"]):not([class*="bg-"]) {
  color: #475569 !important;
}

:not(.dark) .in-iframe td {
  border-color: rgba(226, 232, 240, 0.8) !important;
}

:not(.dark) .in-iframe td:not([class*="text-"]):not([style*="color"]) {
  color: #334155 !important;
}

:not(.dark) .in-iframe tbody tr:hover {
  background: rgba(241, 245, 249, 0.5) !important;
}

:not(.dark) .in-iframe tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5) !important;
}

:not(.dark) .in-iframe .matrix-group {
  background: rgba(241, 245, 249, 0.9) !important;
  color: #0f172a !important;
}

:not(.dark) .in-iframe .matrix-sub {
  background: rgba(248, 250, 252, 0.8) !important;
}

/* Interactive Dropdowns in Light Mode */
:not(.dark) .in-iframe select,
:not(.dark) .in-iframe input[type="date"] {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 10px !important;
  color: #334155 !important;
  transition: all 0.2s ease !important;
}

:not(.dark) .in-iframe select:focus,
:not(.dark) .in-iframe input[type="date"]:focus {
  border-color: rgba(19, 127, 236, 0.5) !important;
  box-shadow: 0 0 10px rgba(19, 127, 236, 0.08) !important;
}


/* ==========================================================================
   ✦ CAPTURE TOOLBAR & GENERAL UTILITIES
   ========================================================================== */

.in-iframe #capture_toolbar {
  border-color: rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  padding: 6px 12px !important;
  border-radius: 12px !important;
  margin-bottom: 8px !important;
}

.dark .in-iframe .capture-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: #94a3b8 !important;
}

.dark .in-iframe .capture-btn:hover {
  background: rgba(14, 165, 233, 0.15) !important;
  border-color: #0ea5e9 !important;
  color: #ffffff !important;
}

:not(.dark) .in-iframe .capture-btn {
  background: rgba(241, 245, 249, 0.9) !important;
  border-color: rgba(226, 232, 240, 0.9) !important;
  color: #475569 !important;
}

:not(.dark) .in-iframe .capture-btn:hover {
  background: rgba(19, 127, 236, 0.08) !important;
  border-color: #137fec !important;
  color: #137fec !important;
}

/* ==========================================================================
   ✦ CRISP READABILITY FOR LIGHT MODE TEXTS (KHẮC PHỤC CHỮ MỜ TRONG LIGHT MODE)
   — Chỉ áp dụng cho các phần tử chữ xám/mờ hoặc chưa gắn class màu riêng
   ========================================================================== */
:not(.dark) .in-iframe .text-slate-400,
:not(.dark) .in-iframe .text-white\/40,
:not(.dark) .in-iframe .text-slate-500,
:not(.dark) .in-iframe .text-white\/60,
:not(.dark) .in-iframe label:not([class*="text-"]):not([style*="color"]) {
  color: #475569 !important;
}

:not(.dark) .in-iframe h2:not([class*="text-"]):not([style*="color"]),
:not(.dark) .in-iframe h3:not([class*="text-"]):not([style*="color"]),
:not(.dark) .in-iframe .text-slate-800 {
  color: #0f172a !important;
}

:not(.dark) .in-iframe p:not([class*="text-"]):not([style*="color"]),
:not(.dark) .in-iframe span:not(.material-symbols-outlined):not([class*="text-"]):not([style*="color"]):not([class*="risk"]):not(#drawerCountdown):not(#drawerStatusBadge) {
  color: #1e293b !important;
}

