/* Playful Pink & Clean White Design System */

:root {
    --font-sans: 'Plus Jakarta Sans', 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    background-color: #fff5f7;
}

.font-mono {
    font-family: var(--font-mono);
}

.font-display {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.02em;
}

/* Global Fit to Screen Guarantee */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden !important;
}

/* Sleek Pink Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #fff0f3;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #fbcfe8;
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #f472b6;
}

/* Nav Page Tab Active State */
.nav-page-tab.active {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3) !important;
}

/* Text Selection */
::selection {
    background: #f472b6;
    color: #ffffff;
}

/* Table Hover & Row Striping */
#detailsTbody tr:hover {
    background-color: #fdf2f8 !important;
}
#detailsTbody tr:nth-child(even) {
    background-color: #ffffff;
}
#detailsTbody tr:nth-child(odd) {
    background-color: #fff9fa;
}

/* Daily Table styling */
#dailyRcvBody tr:hover, #dailySendBody tr:hover {
    background-color: #fdf2f8 !important;
}
#dailyRcvBody tr:nth-child(even), #dailySendBody tr:nth-child(even) {
    background-color: #ffffff;
}
#dailyRcvBody tr:nth-child(odd), #dailySendBody tr:nth-child(odd) {
    background-color: #fff9fa;
}

/* Custom shadows */
.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}
.shadow-2xs {
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.03);
}

/* Sticky Header and Sticky Footer for Table */
#detailsTable thead th {
    position: sticky;
    top: 0;
    z-index: 20;
}
#detailsTable tfoot tr td {
    position: sticky;
    bottom: 0;
    z-index: 20;
    box-shadow: 0 -2px 6px rgba(244, 114, 182, 0.15);
}

/* Unified Daily Matrix Table - Crisp Excel Grid Lines */
#unifiedDailyTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: 1px solid #cbd5e1 !important;
    border-left: 1px solid #cbd5e1 !important;
}

#unifiedDailyTable th {
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #94a3b8 !important;
    background-color: #f1f5f9;
}

#unifiedDailyTable td {
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

/* Distinct separator line between groups (Style+Job+Combi+TH) */
#unifiedDailyTable tr.daily-group-last td,
#unifiedDailyTable tr.daily-row-collapsed td {
    border-bottom: 2px solid #64748b !important;
}

/* Strong vertical freeze boundary separating metadata (Process EMB) from scrollable dates */
#unifiedDailyTable th.daily-col-process,
#unifiedDailyTable td.daily-col-process {
    border-right: 2.5px solid #475569 !important;
    box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.15) !important;
}

/* Crisp styling for Total Column */
#unifiedDailyTable th.daily-col-total {
    border-left: 2px solid #ec4899 !important;
    border-right: 1px solid #cbd5e1 !important;
    background-color: #fce7f3 !important;
    color: #831843 !important;
}

#unifiedDailyTable td.daily-col-total {
    border-left: 2px solid #ec4899 !important;
    border-right: 1px solid #cbd5e1 !important;
}

/* Solid background for sticky cells to prevent text bleed-through */
#unifiedDailyTable th.sticky {
    background-color: #f1f5f9 !important;
}
#unifiedDailyTable td.sticky {
    background-color: #ffffff;
}
#unifiedDailyTable tr:hover td.sticky {
    background-color: #fdf2f8 !important;
}
#unifiedDailyTable tr:hover td.sticky.bg-pink-50 {
    background-color: #fce7f3 !important;
}

/* Mini Daily Scan Tables - Freeze boundary & solid opaque backgrounds */
#miniDailyRcvTable, #miniDailySendTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow-y: hidden !important;
}
#miniDailyRcvContainer, #miniDailySendContainer {
    overflow-y: hidden !important;
}
#miniDailyRcvContainer > div,
#miniDailySendContainer > div {
    overflow-y: hidden !important;
}
#miniDailyRcvTable th.sticky.left-0,
#miniDailySendTable th.sticky.left-0 {
    z-index: 25 !important;
}
#miniDailyRcvTable td.sticky.left-0,
#miniDailySendTable td.sticky.left-0 {
    z-index: 15 !important;
    background-color: #ffffff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.06);
}
#miniDailyRcvTable tr:hover td.sticky.left-0,
#miniDailySendTable tr:hover td.sticky.left-0 {
    background-color: #f8fafc !important;
}
#miniDailyRcvTable tr:last-child td.sticky.left-0 {
    background-color: #a7f3d0 !important;
    z-index: 20 !important;
}
#miniDailySendTable tr:last-child td.sticky.left-0 {
    background-color: #e9d5ff !important;
    z-index: 20 !important;
}

/* ==========================================================================
   THEME: EXECUTIVE BLUE-GREEN-WHITE (ฟ้า-เขียว-ขาว สำหรับนำเสนอผู้บริหาร)
   ========================================================================== */

/* Main Canvas Background: Clean Slate / Mint Ice */
body.theme-executive,
body.theme-executive main {
    background-color: #f8fafc !important;
}

/* Header & Sidebar borders */
body.theme-executive header {
    border-bottom-color: #e2e8f0 !important;
}

body.theme-executive aside {
    border-right-color: #e2e8f0 !important;
}

/* Center Executive Banner: Ocean Blue -> Teal -> Emerald Green */
body.theme-executive #mainBannerTitle {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 50%, #059669 100%) !important;
    border-color: rgba(94, 234, 212, 0.4) !important;
    box-shadow: 0 4px 18px rgba(13, 148, 136, 0.3) !important;
}

/* Sidebar Report Pages box */
body.theme-executive #mainPageTabsContainer {
    background-color: #f0fdfa !important;
    border-color: #ccfbf1 !important;
}

body.theme-executive .nav-page-tab.active {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%) !important;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35) !important;
    color: #ffffff !important;
}

body.theme-executive .nav-page-tab:not(.active):hover {
    color: #0f766e !important;
    background-color: #f0fdfa !important;
}

/* Sidebar Slicers (Plant & Outsource) */
body.theme-executive aside .border-pink-100 {
    border-color: #e2e8f0 !important;
}

/* Quick Action Buttons in Top Header */
body.theme-executive #btnOpenImportModal {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%) !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25) !important;
}

body.theme-executive #btnQuickSync {
    color: #0d9488 !important;
    border-color: #ccfbf1 !important;
}
body.theme-executive #btnQuickSync:hover {
    background-color: #f0fdfa !important;
}

body.theme-executive #liveClock {
    color: #0f766e !important;
}

/* Map All Pink Elements to Crisp Teal/Emerald/Cyan */
body.theme-executive .bg-pink-50,
body.theme-executive [class*="bg-pink-50"] {
    background-color: #f0fdfa !important;
}

body.theme-executive .bg-pink-100,
body.theme-executive [class*="bg-pink-100"] {
    background-color: #ccfbf1 !important;
}

body.theme-executive .bg-pink-200,
body.theme-executive [class*="bg-pink-200"] {
    background-color: #99f6e4 !important;
}

body.theme-executive .border-pink-100,
body.theme-executive [class*="border-pink-100"] {
    border-color: #e2e8f0 !important;
}

body.theme-executive .border-pink-200,
body.theme-executive [class*="border-pink-200"] {
    border-color: #ccfbf1 !important;
}

body.theme-executive .border-pink-300,
body.theme-executive [class*="border-pink-300"] {
    border-color: #99f6e4 !important;
}

body.theme-executive .text-pink-500,
body.theme-executive .text-pink-600 {
    color: #0d9488 !important;
}

body.theme-executive .text-pink-700,
body.theme-executive .text-pink-800 {
    color: #0f766e !important;
}

body.theme-executive .text-pink-900,
body.theme-executive .text-pink-950 {
    color: #134e4a !important;
}

body.theme-executive .hover\:bg-pink-50:hover,
body.theme-executive [class*="hover:bg-pink-50"]:hover {
    background-color: #f0fdfa !important;
}

body.theme-executive .hover\:bg-pink-100:hover,
body.theme-executive [class*="hover:bg-pink-100"]:hover {
    background-color: #ccfbf1 !important;
}

body.theme-executive .hover\:text-pink-600:hover,
body.theme-executive .hover\:text-pink-700:hover {
    color: #0d9488 !important;
}

/* WIP Details Table (Page 1) Header: Mint/Cyan Ice */
body.theme-executive #detailsTheadRow {
    background-color: #ccfbf1 !important;
    color: #134e4a !important;
    border-color: #5eead4 !important;
}

body.theme-executive #detailsTheadRow th:hover {
    background-color: #99f6e4 !important;
}

body.theme-executive #btnExportCsv {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%) !important;
}

body.theme-executive #btnClearAllFilters {
    background-color: #f0fdfa !important;
    color: #0f766e !important;
    border-color: #ccfbf1 !important;
}
body.theme-executive #btnClearAllFilters:hover {
    background-color: #ccfbf1 !important;
}

body.theme-executive #filteredRowCount {
    background-color: #ccfbf1 !important;
    color: #0f766e !important;
    border-color: #99f6e4 !important;
}

body.theme-executive #wipSortBadge {
    background-color: #f0fdfa !important;
    color: #0f766e !important;
    border-color: #99f6e4 !important;
}

/* Daily Scan Collapse toggle */
body.theme-executive #btnToggleDailyCollapse {
    background-color: #f0fdfa !important;
    color: #0f766e !important;
    border-color: #ccfbf1 !important;
}

/* Scrollbars */
body.theme-executive .custom-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc !important;
}
body.theme-executive .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}
body.theme-executive .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Text Selection */
body.theme-executive ::selection {
    background: #2dd4bf !important;
    color: #134e4a !important;
}

/* Table Hover */
body.theme-executive #detailsTbody tr:hover {
    background-color: #f0fdfa !important;
}
body.theme-executive #detailsTbody tr:nth-child(odd) {
    background-color: #f8fafc;
}

/* Modal Styling in Executive Theme */
body.theme-executive #importModal .bg-gradient-to-r.from-pink-500.to-rose-500 {
    background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%) !important;
}
body.theme-executive #btnModalSyncAll {
    background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%) !important;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25) !important;
}
body.theme-executive #importModal .border-pink-200 {
    border-color: #99f6e4 !important;
}
body.theme-executive #importModal .bg-\[\#fffafb\] {
    background-color: #f8fafc !important;
}
body.theme-executive #importModal .text-pink-700 {
    color: #0f766e !important;
}
body.theme-executive #importModal .border-t.border-pink-100 {
    border-color: #ccfbf1 !important;
}
