/* Custom Styles for Team Task & Attendance System */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100..900&family=Google+Sans:wght@400;500;700&display=swap');

:root {
  --font-thai: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-latin: 'Noto Sans Thai', 'Google Sans', sans-serif;
}

/* High-Performance Smooth 60/120 FPS Scrolling & Base Font Scaling */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  font-size: 16.5px;
}

body,
input,
button,
select,
textarea,
optgroup {
  font-family: var(--font-thai);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  font-size: 0.96rem; /* ~15.8px for comfortably larger readability */
  line-height: 1.55;
}

/* Default & Dark Mode Base App Background */
html.dark,
html.dark body {
  background: linear-gradient(180deg, #2b384e 0%, #222d3f 25%, #1a2230 55%, #141a25 80%, #0e131b 100%) !important;
  color: #f8fafc !important;
}

html.light,
html.light body,
html:not(.dark) body {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%) !important;
  color: #2b313b !important;
}

/* Hardware GPU Promotion for Standalone Interactive Elements */
.glass-card,
.kanban-card,
.member-welcome-banner,
.user-badge-pill {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.7);
}

/* Smooth Free-Style Scrolling Everywhere (No Scroll Trapping) */
*,
.overflow-y-auto,
.overflow-x-auto,
.custom-scrollbar,
.kanban-column,
.kanban-cards-container {
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: auto !important;
}

/* Glassmorphism Styles (Optimized for High FPS) */
.glass-panel {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.glass-card:hover {
  background: rgba(40, 53, 75, 0.9);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.glass-modal {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Drag & Drop Visual Effects */
.kanban-card {
  cursor: grab;
  user-select: none;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.96) rotate(1deg);
  border: 2px dashed #6366f1;
}

.kanban-column {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kanban-column.drag-over {
  background-color: rgba(99, 102, 241, 0.12) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.4);
}

/* Status Indicators and Glows */
.glow-red {
  box-shadow: 0 0 15px -3px rgba(239, 68, 68, 0.4);
}

.glow-amber {
  box-shadow: 0 0 15px -3px rgba(245, 158, 11, 0.3);
}

.glow-emerald {
  box-shadow: 0 0 15px -3px rgba(16, 185, 129, 0.3);
}

.glow-indigo {
  box-shadow: 0 0 15px -3px rgba(99, 102, 241, 0.35);
}

/* Pulsing Badge for Urgent / Overdue Tasks */
@keyframes pulse-fast {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.05);
  }
}

.animate-pulse-fast {
  animation: pulse-fast 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom Checkbox */
.custom-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #64748b;
  border-radius: 4px;
  background-color: transparent;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-checkbox:checked {
  background-color: #10b981;
  border-color: #10b981;
}

.custom-checkbox:checked::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Toast Notifications */
.toast-enter {
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-exit {
  animation: toastOut 0.25s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

/* Toast Contrast Protection (Ensures 100% Crisp Visibility in Light and Dark Mode) */
#toast-container > div,
#toast-container > div span,
#toast-container > div i,
#toast-container > div button {
  color: #ffffff !important;
}

html:not(.dark) #toast-container > div,
html.light #toast-container > div {
  color: #ffffff !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.35), 0 8px 10px -6px rgba(15, 23, 42, 0.2) !important;
}

html:not(.dark) #toast-container > div span,
html.light #toast-container > div span {
  color: #ffffff !important;
  font-weight: 600 !important;
}

html:not(.dark) #toast-container > div.toast-success,
html.light #toast-container > div.toast-success {
  background-color: #065f46 !important;
  border-color: #10b981 !important;
}

html:not(.dark) #toast-container > div.toast-warning,
html.light #toast-container > div.toast-warning {
  background-color: #92400e !important;
  border-color: #f59e0b !important;
}

html:not(.dark) #toast-container > div.toast-error,
html.light #toast-container > div.toast-error {
  background-color: #9f1239 !important;
  border-color: #f43f5e !important;
}

html:not(.dark) #toast-container > div.toast-info,
html.light #toast-container > div.toast-info {
  background-color: #312e81 !important;
  border-color: #6366f1 !important;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

/* =========================================================
   LIGHT THEME OVERRIDES (when html is not dark or has .light)
   ========================================================= */

html:not(.dark),
html:not(.dark) body,
html.light,
html.light body {
  background: #ffffff !important;
  color: #2b313b;
}

/* Light Scrollbars */
html:not(.dark)::-webkit-scrollbar-track,
html.light::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html:not(.dark)::-webkit-scrollbar-thumb,
html.light::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
html:not(.dark)::-webkit-scrollbar-thumb:hover,
html.light::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Light Glass Panels & Cards (Optimized without Heavy Blurs) */
html:not(.dark) .glass-panel,
html.light .glass-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

html:not(.dark) .glass-card,
html.light .glass-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

html:not(.dark) .glass-card:hover,
html.light .glass-card:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.12);
}

html:not(.dark) .glass-modal,
html.light .glass-modal {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

html:not(.dark) .modal-backdrop,
html.light .modal-backdrop {
  background-color: rgba(15, 23, 42, 0.6);
}

/* Light Utility Overrides */
html:not(.dark) .bg-slate-950,
html:not(.dark) .bg-slate-900,
html.light .bg-slate-950,
html.light .bg-slate-900 {
  background-color: #fafcfe !important;
}

html:not(.dark) .bg-slate-950\/80,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-950\/60,
html:not(.dark) .bg-slate-900\/60,
html:not(.dark) .bg-slate-950\/50,
html:not(.dark) .bg-slate-900\/40,
html:not(.dark) .bg-slate-900\/90,
html.light .bg-slate-950\/80,
html.light .bg-slate-900\/80,
html.light .bg-slate-950\/60,
html.light .bg-slate-900\/60,
html.light .bg-slate-950\/50,
html.light .bg-slate-900\/40,
html.light .bg-slate-900\/90 {
  background-color: #f8fafc !important;
}

html:not(.dark) .bg-slate-800,
html:not(.dark) .bg-slate-800\/80,
html:not(.dark) .bg-slate-800\/60,
html:not(.dark) .bg-slate-800\/90,
html.light .bg-slate-800,
html.light .bg-slate-800\/80,
html.light .bg-slate-800\/60,
html.light .bg-slate-800\/90 {
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
}

html:not(.dark) .hover\:bg-slate-800:hover,
html:not(.dark) .hover\:bg-slate-700:hover,
html.light .hover\:bg-slate-800:hover,
html.light .hover\:bg-slate-700:hover {
  background-color: #e2e8f0 !important;
  color: #2b313b !important;
}

/* Soft Light Borders in Light Mode (กรอบสีเทาอ่อน ไม่เข้ม ไม่กระด้าง) */
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-600,
html:not(.dark) .border-slate-800\/80,
html:not(.dark) .border-slate-800\/60,
html:not(.dark) .border-slate-700\/60,
html:not(.dark) .glass-card,
html:not(.dark) .glass-panel,
html:not(.dark) .kanban-card,
html:not(.dark) .border,
html.light .border-slate-800,
html.light .border-slate-700,
html.light .border-slate-600,
html.light .border-slate-800\/80,
html.light .border-slate-800\/60,
html.light .border-slate-700\/60,
html.light .glass-card,
html.light .glass-panel,
html.light .kanban-card,
html.light .border {
  border-color: #e2e8f0 !important;
}

html:not(.dark) .divide-slate-800\/60,
html:not(.dark) .divide-slate-800,
html:not(.dark) .divide-slate-700,
html.light .divide-slate-800\/60,
html.light .divide-slate-800,
html.light .divide-slate-700 {
  border-color: #f1f5f9 !important;
}

/* =========================================================
   SIDEBAR MENU SQUEEZE & BALANCED FONT STYLING (~215px)
   ========================================================= */
#app-sidebar {
  padding-left: 0.65rem !important;
  padding-right: 0.65rem !important;
}

#navigation-tabs button {
  font-size: 12.5px !important;
  font-weight: 400 !important;
  padding: 0.4rem 0.55rem !important;
  gap: 0.55rem !important;
  border-radius: 0.5rem !important;
}

#navigation-tabs button.bg-indigo-600,
#navigation-tabs button.tab-active {
  font-weight: 500 !important;
  font-size: 12.5px !important;
}

/* =========================================================
   TYPOGRAPHY SCALING: BALANCED & REFINED FONT WEIGHTS
   ========================================================= */
.font-black {
  font-weight: 700 !important;
}

.font-extrabold {
  font-weight: 650 !important;
}

.font-bold,
b,
strong {
  font-weight: 600 !important;
}

.font-semibold {
  font-weight: 500 !important;
}

h1, .text-3xl { font-size: 1.95rem !important; font-weight: 700 !important; }
h2, .text-2xl { font-size: 1.6rem !important; font-weight: 600 !important; }
h3, .text-xl  { font-size: 1.35rem !important; font-weight: 600 !important; }
h4, .text-lg  { font-size: 1.18rem !important; font-weight: 600 !important; }
h5, .text-base { font-size: 1.05rem !important; font-weight: 500 !important; }

.text-sm { font-size: 0.925rem !important; }
.text-xs { font-size: 0.825rem !important; }
.text-\[10px\], .text-\[10\.5px\], .text-\[11px\], .text-\[11\.5px\] {
  font-size: 0.775rem !important;
}

table th, .gsheet-progress-table th {
  font-size: 0.86rem !important;
  font-weight: 600 !important;
}
table td, .gsheet-progress-table td {
  font-size: 0.84rem !important;
}

/* =========================================================
   LIGHT MODE: MONOCHROME SOFT CHARCOAL (#2b313b) FONT RULES
   (เธ—เธธเธเธเธญเธเธ•เนเน€เธเนเธเธชเธต #2b313b เธเธกเธเธฑเธ” เธเธธเนเธกเธเธงเธฅ เนเธกเนเธ”เธณเธชเธเธดเธ— เนเธกเนเธเธนเธ”เธเธฒเธ”)
   ========================================================= */
html:not(.dark),
html.light {
  color: #2b313b !important;
}

html:not(.dark) body,
html.light body {
  color: #2b313b !important;
}

/* Headings in Light Mode */
html:not(.dark) h1, html:not(.dark) h2, html:not(.dark) h3, html:not(.dark) h4, html:not(.dark) h5, html:not(.dark) h6,
html.light h1, html.light h2, html.light h3, html.light h4, html.light h5, html.light h6 {
  color: #2b313b !important;
}

/* Paragraphs, labels, spans in Light Mode */
html:not(.dark) p, html:not(.dark) label,
html.light p, html.light label {
  color: #2b313b !important;
}

/* Transform all colorful text in Light Mode to #2b313b */
html:not(.dark) .text-indigo-600, html:not(.dark) .text-indigo-500, html:not(.dark) .text-indigo-700, html:not(.dark) .text-indigo-400,
html:not(.dark) .text-blue-600, html:not(.dark) .text-blue-500, html:not(.dark) .text-blue-700, html:not(.dark) .text-blue-400,
html:not(.dark) .text-purple-600, html:not(.dark) .text-purple-500, html:not(.dark) .text-violet-600, html:not(.dark) .text-violet-500,
html:not(.dark) .text-cyan-600, html:not(.dark) .text-cyan-500, html:not(.dark) .text-teal-600, html:not(.dark) .text-teal-500,
html:not(.dark) .text-emerald-600, html:not(.dark) .text-emerald-500, html:not(.dark) .text-green-600, html:not(.dark) .text-green-500,
html:not(.dark) .text-amber-600, html:not(.dark) .text-amber-500, html:not(.dark) .text-orange-600, html:not(.dark) .text-orange-500,
html:not(.dark) .text-yellow-600, html:not(.dark) .text-fuchsia-600, html:not(.dark) .text-pink-600,
html.light .text-indigo-600, html.light .text-indigo-500, html.light .text-indigo-700, html.light .text-indigo-400,
html.light .text-blue-600, html.light .text-blue-500, html.light .text-blue-700, html.light .text-blue-400,
html.light .text-purple-600, html.light .text-purple-500, html.light .text-violet-600, html.light .text-violet-500,
html.light .text-cyan-600, html.light .text-cyan-500, html.light .text-teal-600, html.light .text-teal-500,
html.light .text-emerald-600, html.light .text-emerald-500, html.light .text-green-600, html.light .text-green-500,
html.light .text-amber-600, html.light .text-amber-500, html.light .text-orange-600, html.light .text-orange-500,
html.light .text-yellow-600, html.light .text-fuchsia-600, html.light .text-pink-600 {
  color: #2b313b !important;
}

/* Secondary & Muted text in Light Mode */
html:not(.dark) .text-slate-400, html:not(.dark) .text-slate-500, html:not(.dark) .text-slate-600,
html:not(.dark) .text-gray-400, html:not(.dark) .text-gray-500, html:not(.dark) .text-gray-600,
html.light .text-slate-400, html.light .text-slate-500, html.light .text-slate-600,
html.light .text-gray-400, html.light .text-gray-500, html.light .text-gray-600 {
  color: #555e6d !important;
}

html:not(.dark) .text-slate-100, html:not(.dark) .text-slate-200, html:not(.dark) .text-slate-300,
html.light .text-slate-100, html.light .text-slate-200, html.light .text-slate-300 {
  color: #2b313b !important;
}

/* Eliminate any remaining white font in Light Mode except on dark buttons */
html:not(.dark) .text-white:not(.btn-white-text):not(.bg-indigo-600):not(.bg-rose-600):not(.bg-emerald-600):not(.tab-active):not(.bg-indigo-500):not(.bg-rose-500):not(.bg-emerald-500),
html.light .text-white:not(.btn-white-text):not(.bg-indigo-600):not(.bg-rose-600):not(.bg-emerald-600):not(.tab-active):not(.bg-indigo-500):not(.bg-rose-500):not(.bg-emerald-500) {
  color: #2b313b !important;
}

html:not(.dark) main .text-white:not(.btn-white-text):not(.bg-indigo-600):not(.bg-rose-600):not(.bg-emerald-600),
html.light main .text-white:not(.btn-white-text):not(.bg-indigo-600):not(.bg-rose-600):not(.bg-emerald-600) {
  color: #2b313b !important;
}

/* =========================================================
   DARK MODE: MONOCHROME SOFT OFF-WHITE (#eae9e9) FONT RULES
   (เธ—เธธเธเธเธญเธเธ•เนเน€เธเนเธเธชเธต #eae9e9 เธชเธงเนเธฒเธเธเธธเนเธกเธเธงเธฅ เนเธกเนเธเธฒเธงเธเนเธฒเธชเธเธดเธ— เนเธกเนเธเธนเธ”เธเธฒเธ”)
   ========================================================= */
html.dark {
  color: #eae9e9 !important;
}

html.dark body {
  color: #eae9e9 !important;
}

/* Headings in Dark Mode */
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 {
  color: #eae9e9 !important;
}

/* Paragraphs, labels, spans in Dark Mode */
html.dark p, html.dark label {
  color: #eae9e9;
}

/* Transform all colorful text in Dark Mode to #eae9e9 */
html.dark .text-indigo-400, html.dark .text-indigo-300, html.dark .text-indigo-500, html.dark .text-indigo-600,
html.dark .text-blue-400, html.dark .text-blue-300, html.dark .text-blue-500, html.dark .text-blue-600,
html.dark .text-purple-400, html.dark .text-purple-300, html.dark .text-violet-400, html.dark .text-violet-300,
html.dark .text-cyan-400, html.dark .text-cyan-300, html.dark .text-teal-400, html.dark .text-teal-300,
html.dark .text-emerald-400, html.dark .text-emerald-300, html.dark .text-green-400, html.dark .text-green-300,
html.dark .text-amber-400, html.dark .text-amber-300, html.dark .text-orange-400, html.dark .text-orange-300,
html.dark .text-yellow-400, html.dark .text-yellow-300, html.dark .text-fuchsia-400, html.dark .text-pink-400,
html.dark .text-rose-400, html.dark .text-rose-300 {
  color: #eae9e9 !important;
}

/* Secondary & Muted text in Dark Mode */
html.dark .text-slate-400, html.dark .text-slate-500,
html.dark .text-gray-400, html.dark .text-gray-500 {
  color: #c5cad3 !important;
}

html.dark .text-slate-300, html.dark .text-slate-200, html.dark .text-slate-100 {
  color: #eae9e9 !important;
}

html.dark .text-white {
  color: #eae9e9 !important;
}

/* Navigation items */
html.dark #navigation-tabs button {
  color: #cbd5e1 !important;
}
html.dark #navigation-tabs button.tab-active {
  color: #eae9e9 !important;
  font-weight: 700 !important;
}

html:not(.dark) #navigation-tabs button,
html.light #navigation-tabs button {
  color: #334155 !important;
}
html:not(.dark) #navigation-tabs button.tab-active,
html.light #navigation-tabs button.tab-active {
  color: #2b313b !important;
  font-weight: 700 !important;
}

/* Clean Neutral Badges & Pills in Light Mode */
html:not(.dark) .kanban-card .bg-slate-950,
html:not(.dark) .kanban-card .bg-amber-500\/20,
html:not(.dark) .kanban-card .bg-blue-500\/20,
html:not(.dark) .kanban-card .bg-emerald-500\/20,
html.light .kanban-card .bg-slate-950,
html.light .kanban-card .bg-amber-500\/20,
html.light .kanban-card .bg-blue-500\/20,
html.light .kanban-card .bg-emerald-500\/20 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #2b313b !important;
}

/* Clean Neutral Badges & Pills in Dark Mode */
html.dark .kanban-card .bg-slate-950,
html.dark .kanban-card .bg-amber-500\/20,
html.dark .kanban-card .bg-blue-500\/20,
html.dark .kanban-card .bg-emerald-500\/20 {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #eae9e9 !important;
}

/* Form Inputs & Selects in Light Mode */
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea,
html.light input,
html.light select,
html.light textarea {
  background-color: #fafcfe !important;
  color: #2b313b !important;
  border-color: #cbd5e1 !important;
  font-weight: 500 !important;
}

html:not(.dark) option,
html.light option {
  background-color: #fafcfe !important;
  color: #2b313b !important;
}

html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus,
html.light input:focus,
html.light select:focus,
html.light textarea:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder,
html.light input::placeholder,
html.light textarea::placeholder {
  color: #64748b !important;
}

/* Table in Light Mode */
html:not(.dark) thead,
html.light thead {
  background-color: #f1f5f9 !important;
  color: #2b313b !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) th,
html.light th {
  color: #2b313b !important;
  font-weight: 700 !important;
}

html:not(.dark) td,
html.light td {
  color: #2b313b !important;
}

html:not(.dark) tbody tr:hover,
html.light tbody tr:hover {
  background-color: #f1f5f9 !important;
}

/* Kanban in Light Mode */
html:not(.dark) .kanban-column,
html.light .kanban-column {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) .kanban-card,
html.light .kanban-card {
  background-color: #fafcfe !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: #2b313b !important;
}

html:not(.dark) .kanban-card .font-medium,
html:not(.dark) .kanban-card .font-semibold,
html.light .kanban-card .font-medium,
html.light .kanban-card .font-semibold {
  color: #2b313b !important;
}

/* Banner Gradient in Light Mode */
html:not(.dark) .bg-gradient-to-r.from-indigo-950\/60,
html.light .bg-gradient-to-r.from-indigo-950\/60 {
  background-image: linear-gradient(to right, #e0e7ff, #f8fafc, #ede9fe) !important;
  border-color: #c7d2fe !important;
}

/* Active Nav Tabs in Light Mode */
html:not(.dark) #navigation-tabs button:not(.bg-indigo-600),
html.light #navigation-tabs button:not(.bg-indigo-600) {
  color: #475569 !important;
}
html:not(.dark) #navigation-tabs button:not(.bg-indigo-600):hover,
html.light #navigation-tabs button:not(.bg-indigo-600):hover {
  background-color: #e2e8f0 !important;
  color: #2b313b !important;
}
/* =========================================================
   DASHBOARD HERO BANNER (Fastwork Gradient & Concentric Rings - Image 2)
   ========================================================= */

/* Dark Mode Banner (Transparent & Clean) */
html.dark .dashboard-hero-banner,
.dashboard-hero-banner {
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  overflow: visible;
  color: #eae9e9 !important;
}

/* Light Mode Banner (Transparent & Clean) */
html:not(.dark) .dashboard-hero-banner,
html.light .dashboard-hero-banner,
html:not(.dark) .bg-gradient-to-r.from-indigo-950\/60,
html.light .bg-gradient-to-r.from-indigo-950\/60 {
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  overflow: visible;
}
  color: #1a1f2e !important;
}

/* Dashboard Banner Header Title in Dark Mode */
html.dark .dashboard-hero-banner h2,
html.dark .dashboard-hero-banner .banner-title,
.dashboard-hero-banner h2,
.dashboard-hero-banner .banner-title {
  color: #eae9e9 !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Dashboard Banner Header Title in Light Mode */
html:not(.dark) main .dashboard-hero-banner h2,
html.light main .dashboard-hero-banner h2,
html:not(.dark) .dashboard-hero-banner h2,
html.light .dashboard-hero-banner h2,
html:not(.dark) main .dashboard-hero-banner .banner-title,
html.light main .dashboard-hero-banner .banner-title {
  color: #1a1f2e !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  text-shadow: none !important;
}

/* Subtitle & Descriptions */
html.dark .dashboard-hero-banner .text-slate-400 {
  color: #e2e8f0 !important;
  font-weight: 500 !important;
}

html:not(.dark) .dashboard-hero-banner .text-slate-400,
html.light .dashboard-hero-banner .text-slate-400 {
  color: #50555e !important;
  font-weight: 500 !important;
}

/* Role Pills in Hero Banner */
html.dark .dashboard-hero-banner .bg-indigo-500\/20 {
  background-color: rgba(255, 255, 255, 0.16) !important;
  color: #eae9e9 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 700 !important;
}

html:not(.dark) .dashboard-hero-banner .bg-indigo-500\/20,
html.light .dashboard-hero-banner .bg-indigo-500\/20 {
  background-color: #fafcfe !important;
  color: #1a1f2e !important;
  border: 1px solid #d0e4fc !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-weight: 700 !important;
}

/* ---------------------------------------------------------
   DARK MODE: Banner Pill Buttons (#20242f + White Text & Icon)
   --------------------------------------------------------- */
html.dark .dashboard-hero-banner .banner-pill-btn,
.dashboard-hero-banner .banner-pill-btn {
  background-color: #20242f !important;
  background-image: none !important;
  color: #eae9e9 !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html.dark .dashboard-hero-banner .banner-pill-btn:hover,
.dashboard-hero-banner .banner-pill-btn:hover {
  background-color: #2a3140 !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #eae9e9 !important;
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45) !important;
}

html.dark .dashboard-hero-banner .banner-pill-btn span,
.dashboard-hero-banner .banner-pill-btn span {
  color: #eae9e9 !important;
  font-weight: 700 !important;
}

html.dark .dashboard-hero-banner .banner-pill-btn i,
.dashboard-hero-banner .banner-pill-btn i {
  color: #eae9e9 !important;
}

/* ---------------------------------------------------------
   LIGHT MODE: Banner Pill Buttons (#fcfeff + #2b313b Text)
   --------------------------------------------------------- */
html:not(.dark) .dashboard-hero-banner .banner-pill-btn,
html.light .dashboard-hero-banner .banner-pill-btn,
html:not(.dark) main .dashboard-hero-banner .banner-pill-btn,
html.light main .dashboard-hero-banner .banner-pill-btn {
  background-color: #fcfeff !important;
  background-image: none !important;
  color: #2b313b !important;
  border-radius: 9999px !important;
  border: 1px solid #dbeafe !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html:not(.dark) .dashboard-hero-banner .banner-pill-btn:hover,
html.light .dashboard-hero-banner .banner-pill-btn:hover,
html:not(.dark) main .dashboard-hero-banner .banner-pill-btn:hover,
html.light main .dashboard-hero-banner .banner-pill-btn:hover {
  background-color: #fafcfe !important;
  color: #2b313b !important;
  border-color: #bfdbfe !important;
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.18) !important;
}

html:not(.dark) .dashboard-hero-banner .banner-pill-btn span,
html.light .dashboard-hero-banner .banner-pill-btn span,
html:not(.dark) main .dashboard-hero-banner .banner-pill-btn span,
html.light main .dashboard-hero-banner .banner-pill-btn span {
  color: #2b313b !important;
  font-weight: 700 !important;
}

/* Action Buttons in Banner */
html:not(.dark) .bg-gradient-to-r.from-teal-600,
html.light .bg-gradient-to-r.from-teal-600 {
  background-image: linear-gradient(to right, #0d9488, #059669) !important;
  color: #eae9e9 !important;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3) !important;
}

html:not(.dark) .bg-gradient-to-r.from-indigo-600\/80,
html.light .bg-gradient-to-r.from-indigo-600\/80 {
  background-image: linear-gradient(to right, #8164eb, #6366f1) !important;
  color: #eae9e9 !important;
  box-shadow: 0 4px 12px rgba(129, 100, 235, 0.3) !important;
}

html:not(.dark) .bg-gradient-to-r.from-indigo-600,
html.light .bg-gradient-to-r.from-indigo-600 {
  background-image: linear-gradient(to right, #4f46e5, #4338ca) !important;
  color: #eae9e9 !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35) !important;
}

/* Light Mode 10 Stage Cards */
html:not(.dark) .bg-rose-950\/20, html.light .bg-rose-950\/20 { background-color: #fff1f2 !important; border-color: #fecdd3 !important; }
html:not(.dark) .text-rose-400, html.light .text-rose-400 { color: #e11d48 !important; }
html:not(.dark) .text-rose-300, html.light .text-rose-300 { color: #be123c !important; }

html:not(.dark) .bg-orange-950\/20, html.light .bg-orange-950\/20 { background-color: #fff7ed !important; border-color: #fed7aa !important; }
html:not(.dark) .text-orange-400, html.light .text-orange-400 { color: #ea580c !important; }
html:not(.dark) .text-orange-300, html.light .text-orange-300 { color: #c2410c !important; }

html:not(.dark) .bg-amber-950\/20, html.light .bg-amber-950\/20 { background-color: #fffbeb !important; border-color: #fde68a !important; }
html:not(.dark) .text-amber-400, html.light .text-amber-400 { color: #d97706 !important; }
html:not(.dark) .text-amber-300, html.light .text-amber-300 { color: #b45309 !important; }

html:not(.dark) .bg-yellow-950\/20, html.light .bg-yellow-950\/20,
html:not(.dark) .bg-yellow-950\/30, html.light .bg-yellow-950\/30 { background-color: #fefce8 !important; border-color: #fef08a !important; }
html:not(.dark) .text-yellow-400, html.light .text-yellow-400 { color: #ca8a04 !important; }
html:not(.dark) .text-yellow-300, html.light .text-yellow-300 { color: #a16207 !important; }
html:not(.dark) .text-yellow-200, html.light .text-yellow-200 { color: #854d0e !important; }

html:not(.dark) .bg-lime-950\/20, html.light .bg-lime-950\/20 { background-color: #f7fee7 !important; border-color: #d9f99d !important; }
html:not(.dark) .text-lime-400, html.light .text-lime-400 { color: #65a30d !important; }
html:not(.dark) .text-lime-300, html.light .text-lime-300 { color: #4d7c0f !important; }

html:not(.dark) .bg-emerald-950\/20, html.light .bg-emerald-950\/20,
html:not(.dark) .bg-emerald-950\/30, html.light .bg-emerald-950\/30 { background-color: #ecfdf5 !important; border-color: #a7f3d0 !important; }
html:not(.dark) .text-emerald-400, html.light .text-emerald-400 { color: #059669 !important; }
html:not(.dark) .text-emerald-300, html.light .text-emerald-300 { color: #047857 !important; }
html:not(.dark) .text-emerald-200, html.light .text-emerald-200 { color: #065f46 !important; }

html:not(.dark) .bg-teal-950\/30, html.light .bg-teal-950\/30 { background-color: #f0fdfa !important; border-color: #99f6e4 !important; }
html:not(.dark) .text-teal-300, html.light .text-teal-300 { color: #0d9488 !important; }
html:not(.dark) .text-teal-200, html.light .text-teal-200 { color: #0f766e !important; }

html:not(.dark) .bg-indigo-950\/40, html.light .bg-indigo-950\/40 { background-color: #eef2ff !important; border-color: #c7d2fe !important; }
html:not(.dark) .text-indigo-200, html.light .text-indigo-200 { color: #4338ca !important; }

/* =========================================================
   RESPONSIVE SIDEBAR (Persistent on Desktop, Slide-over on Mobile)
   ========================================================= */

#sidebar-backdrop {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

/* Mobile Slide-over Drawer (< 1024px) */
@media (max-width: 1023px) {
  .app-shell-container {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  #app-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    z-index: 50 !important;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.32s ease;
    will-change: transform;
  }

  #app-sidebar.sidebar-open {
    transform: translateX(0) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.2) !important;
  }

  #app-sidebar:not(.sidebar-open) {
    transform: translateX(-100%) !important;
  }
}

/* Desktop Persistent Left Sidebar (>= 1024px) */
@media (min-width: 1024px) {
  #app-sidebar,
  #app-sidebar:not(.sidebar-open),
  #app-sidebar.sidebar-open {
    display: flex !important;
    position: static !important;
    transform: none !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    flex-shrink: 0 !important;
  }

  #sidebar-backdrop {
    display: none !important;
    pointer-events: none !important;
  }

  #sidebar-toggle-btn {
    display: none !important;
  }
}

/* =========================================================
   PAGE TRANSITION & MENU INTERACTION ANIMATIONS
   ========================================================= */

@keyframes viewFadeInScale {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.995);
    filter: blur(2px);
  }
  60% {
    opacity: 0.95;
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

.tab-transition-enter {
  animation: viewFadeInScale 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform, filter;
}

/* Staggered Entry for Child Cards */
.tab-transition-enter > div > div:nth-child(1),
.tab-transition-enter > div:nth-child(1) {
  animation: cardCascadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) 0.02s backwards;
}

.tab-transition-enter > div > div:nth-child(2),
.tab-transition-enter > div:nth-child(2) {
  animation: cardCascadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.06s backwards;
}

.tab-transition-enter > div > div:nth-child(3),
.tab-transition-enter > div:nth-child(3) {
  animation: cardCascadeIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) 0.10s backwards;
}

.tab-transition-enter > div > div:nth-child(4),
.tab-transition-enter > div:nth-child(4) {
  animation: cardCascadeIn 0.40s cubic-bezier(0.16, 1, 0.3, 1) 0.14s backwards;
}

@keyframes cardCascadeIn {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   NOTIFICATION CENTER & BELL BADGE
   ========================================================= */
#notification-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  line-height: 18px;
  border-radius: 9999px;
  background-color: #ef4444 !important;
  color: #eae9e9 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -3px;
  right: -3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  animation: badgePulse 2.2s infinite ease-in-out;
  pointer-events: none;
  z-index: 10;
}

#notification-badge.hidden,
#notification-badge:empty {
  display: none !important;
}

html.dark #notification-badge {
  box-shadow: 0 0 0 2px #272b36 !important;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
  }
}

#notification-dropdown {
  transform-origin: top right;
  animation: notifDropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100 !important;
}

@keyframes notifDropdownIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html.dark #notification-dropdown {
  background-color: #272b36 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6) !important;
}

html:not(.dark) #notification-dropdown,
html.light #notification-dropdown {
  background-color: #fafcfe !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12) !important;
}

/* Navigation Button Interactions & Active Glow */
#navigation-tabs button {
  font-family: inherit;
  outline: none;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease,
              color 0.2s ease,
              box-shadow 0.2s ease;
  transform-origin: left center;
}

#navigation-tabs button:hover {
  transform: translateX(4px);
}

#navigation-tabs button:active {
  transform: scale(0.96) translateX(2px);
}

#navigation-tabs button.bg-indigo-600 {
  animation: activeTabPulse 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.45) !important;
}

#navigation-tabs button.bg-indigo-600 i {
  animation: iconBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes activeTabPulse {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes iconBounce {
  0% {
    transform: scale(0.75) rotate(-10deg);
  }
  60% {
    transform: scale(1.2) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Dark Mode Body & Shell (#272b36) - Global Lock */
html.dark,
html.dark body,
html.dark .app-shell-container,
html.dark #top-app-header,
html.dark header#top-app-header,
html.dark #app-sidebar,
html.dark aside#app-sidebar {
  background-color: #272b36 !important;
  color: #f8fafc;
  transition: none !important;
}

/* Light Mode Body & Shell (#fcfcfd) - Unified Header & Sidebar */
html:not(.dark),
html.light,
html:not(.dark) body,
html.light body,
html:not(.dark) .app-shell-container,
html.light .app-shell-container,
html:not(.dark) #top-app-header,
html.light #top-app-header,
html:not(.dark) header#top-app-header,
html.light header#top-app-header,
html:not(.dark) #app-sidebar,
html.light #app-sidebar,
html:not(.dark) aside#app-sidebar,
html.light aside#app-sidebar {
  background-color: #fcfcfd !important;
  color: #1e293b;
  transition: none !important;
}

html:not(.dark) .app-shell-container,
html.light .app-shell-container,
html.dark .app-shell-container {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* =========================================================
   LIGHT & DARK MODE: UNIFIED HEADER & SIDEBAR + CURVED CANVAS
   ========================================================= */

/* Main Canvas with Curved Top-Left Corner (Permanent Anchor Match) */
.main-canvas-bg {
  min-height: calc(100vh - 61px);
  border-radius: 0 !important;
  overflow-y: auto;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 100% !important;
  position: relative;
  margin: 0 !important;
}

html:not(.dark) .main-canvas-bg,
html.light .main-canvas-bg,
html:not(.dark) #main-content-canvas,
html.light #main-content-canvas {
  background-image: linear-gradient(180deg, #c8d7fe 0%, #dbe7fa 120px, #eaeff9 260px, #f4f5f7 460px) !important;
  background-repeat: no-repeat !important;
  background-attachment: local !important;
  background-color: #f4f5f7 !important;
}

html.dark .main-canvas-bg,
html.dark #main-content-canvas {
  background-image: linear-gradient(180deg, #223a5a 0%, #23334a 120px, #282e40 240px, #2c303b 440px) !important;
  background-repeat: no-repeat !important;
  background-attachment: local !important;
  background-color: #2c303b !important;
}

/* 1. Top App Bar in Light Mode (Exact same #fcfcfd as Sidebar) */
html:not(.dark) header#top-app-header,
html.light header#top-app-header,
html:not(.dark) #top-app-header,
html.light #top-app-header {
  background-color: #fcfcfd !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

html:not(.dark) header h1,
html:not(.dark) header .brand-connect-text,
html.light header h1,
html.light header .brand-connect-text {
  color: #1a1f2e !important;
}

html:not(.dark) header h1 .text-rose-500,
html:not(.dark) header h1 .brand-win-text,
html.light header h1 .text-rose-500,
html.light header h1 .brand-win-text {
  color: #f43f5e !important;
}

/* Install App button in top bar */
html:not(.dark) #pwa-install-btn,
html.light #pwa-install-btn {
  background-color: #059669 !important;
  color: #ffffff !important;
}

html:not(.dark) #pwa-install-btn span,
html:not(.dark) #pwa-install-btn i,
html.light #pwa-install-btn span,
html.light #pwa-install-btn i {
  color: #ffffff !important;
}

/* Header Action Buttons in Light Mode */
html:not(.dark) header #sidebar-toggle-btn,
html:not(.dark) header #theme-toggle-btn,
html:not(.dark) header #notification-bell-btn,
html.light header #sidebar-toggle-btn,
html.light header #theme-toggle-btn,
html.light header #notification-bell-btn {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

html:not(.dark) header #sidebar-toggle-btn:hover,
html:not(.dark) header #theme-toggle-btn:hover,
html:not(.dark) header #notification-bell-btn:hover,
html.light header #sidebar-toggle-btn:hover,
html.light header #theme-toggle-btn:hover,
html.light header #notification-bell-btn:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* User Switcher in Light Mode */
html:not(.dark) header #user-switcher-container .bg-slate-900\/90,
html.light header #user-switcher-container .bg-slate-900\/90 {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) header #user-switcher-container select,
html.light header #user-switcher-container select {
  color: #1e293b !important;
}

html:not(.dark) header #user-switcher-container select option,
html.light header #user-switcher-container select option {
  background-color: #ffffff !important;
  color: #1e293b !important;
}

/* Sidebar Footer Account Card in Light Mode */
html:not(.dark) #sidebar-footer-container > div,
html.light #sidebar-footer-container > div {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) #sidebar-footer-container > div .text-slate-200,
html.light #sidebar-footer-container > div .text-slate-200 {
  color: #1e293b !important;
}

html:not(.dark) #sidebar-footer-container > div .text-slate-400,
html.light #sidebar-footer-container > div .text-slate-400 {
  color: #64748b !important;
}

html:not(.dark) #sidebar-footer-container button,
html.light #sidebar-footer-container button {
  color: #64748b !important;
}

html:not(.dark) #sidebar-footer-container button:hover,
html.light #sidebar-footer-container button:hover {
  background-color: #ffe4e6 !important;
  color: #e11d48 !important;
}

/* 2. Sidebar in Light Mode (Exact same #fcfcfd as Header) */
html:not(.dark) #app-sidebar,
html.light #app-sidebar,
html:not(.dark) aside#app-sidebar,
html.light aside#app-sidebar {
  background-color: #fcfcfd !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #50555e !important;
}

/* Dark Mode: Unified Header & Sidebar with exact same #272b36 */
header#top-app-header,
#top-app-header,
html.dark header#top-app-header,
html.dark #top-app-header {
  background-color: #272b36 !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

#app-sidebar,
aside#app-sidebar,
html.dark #app-sidebar,
html.dark aside#app-sidebar {
  background-color: #272b36 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html:not(.dark) #app-sidebar h3,
html.light #app-sidebar h3 {
  color: #50555e !important;
  font-weight: 700 !important;
}

html:not(.dark) #app-sidebar .text-slate-400,
html.light #app-sidebar .text-slate-400 {
  color: #64748b !important;
}

/* Section Titles (แดชบอร์ด & ภาพรวม, การติดตาม & แผนงาน, บันทึกเวลาทีม) */
html:not(.dark) #navigation-tabs .text-slate-400,
html.light #navigation-tabs .text-slate-400,
html:not(.dark) #navigation-tabs .uppercase,
html.light #navigation-tabs .uppercase {
  color: #8d9197 !important;
  font-weight: 700 !important;
}

/* Inactive Navigation Buttons */
/* Sidebar Navigation Buttons - Clean, Flat, No Inactive Outline, Dark Gray Icons */
html:not(.dark) #navigation-tabs button:not(.bg-indigo-600),
html.light #navigation-tabs button:not(.bg-indigo-600) {
  color: #374151 !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html:not(.dark) #navigation-tabs button:not(.bg-indigo-600) span,
html.light #navigation-tabs button:not(.bg-indigo-600) span {
  color: #374151 !important;
}

/* Inactive Icons - Dark Gray (สีไอคอนเป็นสีเทาเข้ม) */
html:not(.dark) #navigation-tabs button:not(.bg-indigo-600) i,
html.light #navigation-tabs button:not(.bg-indigo-600) i {
  color: #4b5563 !important;
}

html.dark #navigation-tabs button:not(.bg-indigo-600) i {
  color: #94a3b8 !important;
}

html:not(.dark) #navigation-tabs button:not(.bg-indigo-600):hover,
html.light #navigation-tabs button:not(.bg-indigo-600):hover {
  background-color: #f1f5f9 !important;
  color: #111827 !important;
  border-color: transparent !important;
}

html:not(.dark) #navigation-tabs button:not(.bg-indigo-600):hover span,
html.light #navigation-tabs button:not(.bg-indigo-600):hover span {
  color: #111827 !important;
}

html:not(.dark) #navigation-tabs button:not(.bg-indigo-600):hover i,
html.light #navigation-tabs button:not(.bg-indigo-600):hover i {
  color: #111827 !important;
}

/* Active Navigation Button - Outline only when active / clicked */
html:not(.dark) #navigation-tabs button.bg-indigo-600,
html.light #navigation-tabs button.bg-indigo-600,
#navigation-tabs button.bg-indigo-600 {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
  border: 1px solid rgba(165, 180, 252, 0.7) !important;
}

html:not(.dark) #navigation-tabs button.bg-indigo-600 span,
html.light #navigation-tabs button.bg-indigo-600 span,
#navigation-tabs button.bg-indigo-600 span {
  color: #ffffff !important;
}

html:not(.dark) #navigation-tabs button.bg-indigo-600 i,
html.light #navigation-tabs button.bg-indigo-600 i,
#navigation-tabs button.bg-indigo-600 i,
html:not(.dark) #navigation-tabs button.bg-indigo-600 svg,
html.light #navigation-tabs button.bg-indigo-600 svg,
#navigation-tabs button.bg-indigo-600 svg,
html:not(.dark) #navigation-tabs button.bg-indigo-600 .lucide,
html.light #navigation-tabs button.bg-indigo-600 .lucide,
#navigation-tabs button.bg-indigo-600 .lucide {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* =========================================================
   BRIGHT ICON HARMONY: Ensure all Lucide icons match bright text on colored buttons & toasts
   ========================================================= */
button.bg-indigo-600 i, button.bg-indigo-600 svg, button.bg-indigo-600 .lucide,
button.bg-emerald-600 i, button.bg-emerald-600 svg, button.bg-emerald-600 .lucide,
button.bg-amber-600 i, button.bg-amber-600 svg, button.bg-amber-600 .lucide,
button.bg-rose-600 i, button.bg-rose-600 svg, button.bg-rose-600 .lucide,
button.bg-purple-600 i, button.bg-purple-600 svg, button.bg-purple-600 .lucide,
button.bg-indigo-500 i, button.bg-indigo-500 svg, button.bg-indigo-500 .lucide,
button.bg-emerald-500 i, button.bg-emerald-500 svg, button.bg-emerald-500 .lucide,
button.bg-amber-500 i, button.bg-amber-500 svg, button.bg-amber-500 .lucide,
button.bg-rose-500 i, button.bg-rose-500 svg, button.bg-rose-500 .lucide,
button.bg-purple-500 i, button.bg-purple-500 svg, button.bg-purple-500 .lucide,
button[class*="bg-gradient"] i, button[class*="bg-gradient"] svg, button[class*="bg-gradient"] .lucide,
#toast-container > div i, #toast-container > div svg, #toast-container > div .lucide,
.toast-notification i, .toast-notification svg, .toast-notification .lucide {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* File Attachment Action Buttons (Download & Delete - High Visibility) */
button.file-action-download i,
button.file-action-download svg,
button.file-action-download .lucide {
  color: #4f46e5 !important;
  stroke: #4f46e5 !important;
}
html.dark button.file-action-download i,
html.dark button.file-action-download svg,
html.dark button.file-action-download .lucide {
  color: #818cf8 !important;
  stroke: #818cf8 !important;
}

button.file-action-delete i,
button.file-action-delete svg,
button.file-action-delete .lucide {
  color: #e11d48 !important;
  stroke: #e11d48 !important;
}
html.dark button.file-action-delete i,
html.dark button.file-action-delete svg,
html.dark button.file-action-delete .lucide {
  color: #fb7185 !important;
  stroke: #fb7185 !important;
}

/* Close (✕) Button in Light Mode Sidebar */
html:not(.dark) #app-sidebar button[title*="ปิดเมนู"],
html.light #app-sidebar button[title*="ปิดเมนู"] {
  background-color: #fafcfe !important;
  border-color: #e2e8f0 !important;
  color: #50555e !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) #app-sidebar button[title*="ปิดเมนู"]:hover,
html.light #app-sidebar button[title*="ปิดเมนู"]:hover {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #e11d48 !important;
}

/* Online Status in Light Mode Sidebar */
html:not(.dark) #app-sidebar .bg-slate-950\/60,
html.light #app-sidebar .bg-slate-950\/60 {
  background-color: #fafcfe !important;
  border-color: #e2e8f0 !important;
  color: #50555e !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

html:not(.dark) #app-sidebar .bg-slate-950\/60 span,
html.light #app-sidebar .bg-slate-950\/60 span {
  color: #50555e !important;
}

/* Logout Button in Light Mode Sidebar */
html:not(.dark) #app-sidebar .bg-rose-950\/40,
html.light #app-sidebar .bg-rose-950\/40 {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #e11d48 !important;
}

html:not(.dark) #app-sidebar .bg-rose-950\/40:hover,
html.light #app-sidebar .bg-rose-950\/40:hover {
  background-color: #ffe4e6 !important;
  color: #be123c !important;
}

/* =========================================================
   GOOGLE SHEET PROGRESS TABLE - LIGHT & DARK MODES
   ========================================================= */

.gsheet-progress-table,
table.gsheet-progress-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-family: inherit !important;
}

/* ---------------------------------------------------------
   ☀️ LIGHT MODE (Image 1 Badges + #d9d2e9 Rows + #2b313b Font)
   --------------------------------------------------------- */
html:not(.dark) .gsheet-progress-table,
html.light .gsheet-progress-table {
  background-color: #fafcfe !important;
  border: 1px solid #1a1f2e !important;
  color: #2b313b !important;
}

html:not(.dark) .gsheet-progress-table th,
html:not(.dark) .gsheet-progress-table td,
html.light .gsheet-progress-table th,
html.light .gsheet-progress-table td {
  border: 1px solid #1a1f2e !important;
}

/* Light Mode Tier 1 Header Badges (According to Image 1) */
html:not(.dark) .gsheet-progress-table .th-counta,
html.light .gsheet-progress-table .th-counta {
  background-color: #fafcfe !important;
  color: #2b313b !important;
}

html:not(.dark) .gsheet-progress-table .th-badge,
html.light .gsheet-progress-table .th-badge {
  color: #eae9e9 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge .badge-minus,
html.light .gsheet-progress-table .th-badge .badge-minus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  color: #eae9e9 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-0,
html.light .gsheet-progress-table .th-badge-0 {
  background-color: #e53935 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-10,
html.light .gsheet-progress-table .th-badge-10 {
  background-color: #f4511e !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-30,
html.light .gsheet-progress-table .th-badge-30 {
  background-color: #fb8c00 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-40,
html.light .gsheet-progress-table .th-badge-40 {
  background-color: #fbc02d !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-50,
html.light .gsheet-progress-table .th-badge-50 {
  background-color: #fdd835 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-60,
html.light .gsheet-progress-table .th-badge-60 {
  background-color: #c0ca33 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-70,
html.light .gsheet-progress-table .th-badge-70 {
  background-color: #9e9d24 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-80,
html.light .gsheet-progress-table .th-badge-80 {
  background-color: #7cb342 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-90,
html.light .gsheet-progress-table .th-badge-90 {
  background-color: #43a047 !important;
}

html:not(.dark) .gsheet-progress-table .th-badge-total,
html.light .gsheet-progress-table .th-badge-total {
  background-color: #fafcfe !important;
  color: #2b313b !important;
}

/* Light Mode Tier 2 Headers */
html:not(.dark) .gsheet-progress-table .thead-tier-2 th,
html.light .gsheet-progress-table .thead-tier-2 th {
  background-color: #fafcfe !important;
  color: #2b313b !important;
}

/* Light Mode Assignee Group Header Row */
html:not(.dark) .gsheet-progress-table .row-assignee-header td,
html.light .gsheet-progress-table .row-assignee-header td {
  background-color: #fafcfe !important;
  color: #2b313b !important;
}

html:not(.dark) .gsheet-progress-table .assignee-minus-box,
html.light .gsheet-progress-table .assignee-minus-box {
  background-color: #fafcfe !important;
  border: 1px solid #1a1f2e !important;
  color: #2b313b !important;
}

html:not(.dark) .gsheet-progress-table .assignee-name,
html.light .gsheet-progress-table .assignee-name,
html:not(.dark) .gsheet-progress-table .open-sheet-hint,
html.light .gsheet-progress-table .open-sheet-hint {
  color: #2b313b !important;
}

/* Light Mode Rows (Improvement & RAUG = #d9d2e9) */
html:not(.dark) .gsheet-progress-table .row-improvement td,
html:not(.dark) .gsheet-progress-table .row-raug td,
html.light .gsheet-progress-table .row-improvement td,
html.light .gsheet-progress-table .row-raug td {
  background-color: #d9d2e9 !important;
  color: #2b313b !important;
}

html:not(.dark) .gsheet-progress-table .row-improvement:hover td,
html:not(.dark) .gsheet-progress-table .row-raug:hover td,
html.light .gsheet-progress-table .row-improvement:hover td,
html.light .gsheet-progress-table .row-raug:hover td {
  background-color: #cbbede !important;
}

/* Light Mode Footer Row */
html:not(.dark) .gsheet-progress-table .tfoot-row td,
html.light .gsheet-progress-table .tfoot-row td {
  background-color: #fafcfe !important;
  color: #2b313b !important;
}

html:not(.dark) .gsheet-progress-table .cell-dash,
html.light .gsheet-progress-table .cell-dash {
  color: #8c93a0 !important;
}


/* ---------------------------------------------------------
   🌙 DARK MODE (Image 2: Dark Bg, White Names, Colored Stage Numbers)
   --------------------------------------------------------- */
html.dark .gsheet-progress-table {
  background-color: #0b1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
}

html.dark .gsheet-progress-table th,
html.dark .gsheet-progress-table td {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Dark Mode Tier 1 Header Badges (Monochrome White on Soft Dark Badges) */
html.dark .gsheet-progress-table .thead-tier-1 th {
  background-color: #080d1a !important;
  color: #eae9e9 !important;
}

html.dark .gsheet-progress-table .th-badge-0,
html.dark .gsheet-progress-table .th-badge-10,
html.dark .gsheet-progress-table .th-badge-30,
html.dark .gsheet-progress-table .th-badge-40,
html.dark .gsheet-progress-table .th-badge-50,
html.dark .gsheet-progress-table .th-badge-60,
html.dark .gsheet-progress-table .th-badge-70,
html.dark .gsheet-progress-table .th-badge-80,
html.dark .gsheet-progress-table .th-badge-90,
html.dark .gsheet-progress-table .th-badge-total {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #eae9e9 !important;
}

/* Dark Mode Tier 2 Stage Header Descriptions (Monochrome White / Light Gray) */
html.dark .gsheet-progress-table .thead-tier-2 th {
  background-color: #0d1527 !important;
}

html.dark .gsheet-progress-table .th-desc-assignee,
html.dark .gsheet-progress-table .th-desc-project,
html.dark .gsheet-progress-table .th-desc-0,
html.dark .gsheet-progress-table .th-desc-10,
html.dark .gsheet-progress-table .th-desc-30,
html.dark .gsheet-progress-table .th-desc-40,
html.dark .gsheet-progress-table .th-desc-50,
html.dark .gsheet-progress-table .th-desc-60,
html.dark .gsheet-progress-table .th-desc-70,
html.dark .gsheet-progress-table .th-desc-80,
html.dark .gsheet-progress-table .th-desc-90,
html.dark .gsheet-progress-table .th-desc-total {
  color: #f8fafc !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
  font-weight: 700 !important;
}

/* Dark Mode Assignee Header Row */
html.dark .gsheet-progress-table .row-assignee-header td {
  background-color: rgba(15, 23, 42, 0.7) !important;
  color: #eae9e9 !important;
}

html.dark .gsheet-progress-table .assignee-minus-box {
  background-color: #38bdf8 !important;
  color: #2b313b !important;
}

html.dark .gsheet-progress-table .assignee-name {
  color: #eae9e9 !important;
}

html.dark .gsheet-progress-table .open-sheet-hint {
  color: #94a3b8 !important;
}

/* Dark Mode Data Rows (Backgrounds) */
html.dark .gsheet-progress-table .row-improvement td {
  background-color: rgba(15, 23, 42, 0.5) !important;
}

html.dark .gsheet-progress-table .row-raug td {
  background-color: rgba(15, 23, 42, 0.8) !important;
}

html.dark .gsheet-progress-table .row-improvement:hover td,
html.dark .gsheet-progress-table .row-raug:hover td {
  background-color: rgba(30, 41, 59, 0.85) !important;
}

/* Dark Mode Text Colors: Thai & English Names = Pure White */
html.dark .gsheet-progress-table .col-assignee,
html.dark .gsheet-progress-table .col-project {
  color: #eae9e9 !important;
  font-weight: 700 !important;
}

/* Dark Mode Column Stage Numbers (Monochrome Crisp White) */
html.dark .gsheet-progress-table .col-stage-0,
html.dark .gsheet-progress-table .col-stage-10,
html.dark .gsheet-progress-table .col-stage-30,
html.dark .gsheet-progress-table .col-stage-40,
html.dark .gsheet-progress-table .col-stage-50,
html.dark .gsheet-progress-table .col-stage-60,
html.dark .gsheet-progress-table .col-stage-70,
html.dark .gsheet-progress-table .col-stage-80,
html.dark .gsheet-progress-table .col-stage-90,
html.dark .gsheet-progress-table .col-total {
  color: #eae9e9 !important;
  font-weight: 700 !important;
}

html.dark .gsheet-progress-table .cell-dash {
  color: #64748b !important;
}

/* Dark Mode Footer Row (Image 2) */
html.dark .gsheet-progress-table .tfoot-row td {
  background-color: #080d1a !important;
}

html.dark .gsheet-progress-table .tfoot-label {
  color: #eae9e9 !important;
  font-weight: 650 !important;
}

/* =========================================================
   GOOGLE SHEET DETAIL DRILL-DOWN MODAL
   ========================================================= */
#gsheet-detail-modal .glass-modal {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html:not(.dark) #gsheet-detail-modal .glass-modal,
html.light #gsheet-detail-modal .glass-modal {
  background: #ffffff !important;
  border: 1px solid #d0e4fc !important;
  box-shadow: 0 25px 60px -15px rgba(56, 189, 248, 0.25) !important;
  color: #2b313b !important;
}

html:not(.dark) #gsheet-detail-modal thead,
html.light #gsheet-detail-modal thead {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

html:not(.dark) #gsheet-detail-modal table,
html.light #gsheet-detail-modal table {
  background: #ffffff !important;
  color: #2b313b !important;
}

html:not(.dark) #gsheet-detail-modal tbody tr,
html.light #gsheet-detail-modal tbody tr {
  border-bottom: 1px solid #e2e8f0 !important;
}

html:not(.dark) #gsheet-detail-modal tbody tr:hover,
html.light #gsheet-detail-modal tbody tr:hover {
  background: #f8fafc !important;
}

html.dark #gsheet-detail-modal .glass-modal {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8) !important;
  color: #eae9e9 !important;
}

/* =========================================================
   ACCOUNT SETTINGS & PROFILE MODAL (FASTWORK STYLE)
   ========================================================= */
html:not(.dark) #profile-modal .glass-modal,
html.light #profile-modal .glass-modal {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.15) !important;
  color: #1e293b !important;
}

html:not(.dark) #profile-modal .bg-slate-900\/60,
html.light #profile-modal .bg-slate-900\/60 {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) #profile-modal .bg-slate-950\/40,
html.light #profile-modal .bg-slate-950\/40 {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) #profile-modal .bg-slate-900\/30,
html.light #profile-modal .bg-slate-900\/30 {
  background: #ffffff !important;
}

html:not(.dark) #profile-modal input,
html.light #profile-modal input,
html:not(.dark) #profile-modal select,
html.light #profile-modal select {
  background-color: #fafcfe !important;
  border-color: #cbd5e1 !important;
  color: #2b313b !important;
}

html:not(.dark) #profile-modal input:focus,
html.light #profile-modal input:focus,
html:not(.dark) #profile-modal select:focus,
html.light #profile-modal select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

html:not(.dark) #profile-modal label,
html.light #profile-modal label {
  color: #1e293b !important;
}

html:not(.dark) #profile-modal h3,
html.light #profile-modal h3,
html:not(.dark) #profile-modal h4,
html.light #profile-modal h4 {
  color: #2b313b !important;
}

html:not(.dark) #profile-modal .text-slate-400,
html.light #profile-modal .text-slate-400 {
  color: #64748b !important;
}

html:not(.dark) #profile-modal .text-slate-500,
html.light #profile-modal .text-slate-500 {
  color: #94a3b8 !important;
}

/* =========================================================
   MEMBER WELCOME BANNER (Images 2, 3, 4)
   ========================================================= */
.member-welcome-banner {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode (Image 3: Clean White-Lavender Card, Black Font) */
html:not(.dark) .member-welcome-banner,
html.light .member-welcome-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f4f6fc 100%) !important;
  border: 1px solid #dce4f0 !important;
  box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html:not(.dark) .member-welcome-banner .banner-title,
html.light .member-welcome-banner .banner-title {
  color: #2b313b !important; /* สีดำ คมชัด */
  font-weight: 650 !important;
}

html:not(.dark) .member-welcome-banner .banner-subtitle,
html.light .member-welcome-banner .banner-subtitle {
  color: #475569 !important; /* Dark Slate Subtitle */
}

/* Dark Mode (Image 4: Deep Midnight Navy Card, White Font) */
html.dark .member-welcome-banner {
  background: linear-gradient(135deg, #182030 0%, #101522 100%) !important;
  border: 1px solid #263248 !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.6) !important;
}

html.dark .member-welcome-banner .banner-title {
  color: #eae9e9 !important; /* สีขาว คมชัด */
  font-weight: 650 !important;
}

html.dark .member-welcome-banner .banner-subtitle {
  color: #94a3b8 !important;
}

/* =========================================================
   USER BADGE PILL (Image 5: Name and Email Header Badge)
   ========================================================= */
.user-badge-pill {
  transition: all 0.2s ease;
}

/* Light Mode (Image 5: White Pill, Black Name Font) */
html:not(.dark) .user-badge-pill,
html.light .user-badge-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .user-badge-pill:hover,
html.light .user-badge-pill:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15) !important;
}

html:not(.dark) .user-badge-name,
html.light .user-badge-name {
  color: #2b313b !important; /* สีดำ */
}

html:not(.dark) .user-badge-email,
html.light .user-badge-email {
  color: #475569 !important; /* Darker Slate for High Contrast */
}

html:not(.dark) .user-badge-chevron,
html.light .user-badge-chevron {
  color: #64748b !important;
}

/* Dark Mode: Dark Navy Pill, White Name Font */
html.dark .user-badge-pill {
  background: #131926 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.dark .user-badge-pill:hover {
  border-color: #3b82f6 !important;
}

html.dark .user-badge-name {
  color: #eae9e9 !important; /* สีขาว */
}

html.dark .user-badge-email {
  color: #94a3b8 !important;
}

html.dark .user-badge-chevron {
  color: #94a3b8 !important;
}

/* =========================================================
   AUTHENTICATION MODAL & SPARKLE STARS (Images 2 & 3)
   ========================================================= */
#auth-modal-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sparkle Stars Animation & Colors */
.auth-star {
  filter: drop-shadow(0 0 6px currentColor);
  animation: authStarTwinkle 3s ease-in-out infinite alternate;
}
.auth-star-tl { animation-delay: 0s; }
.auth-star-ml { animation-delay: 0.8s; }
.auth-star-tr { animation-delay: 0.4s; }
.auth-star-fr { animation-delay: 1.2s; }

@keyframes authStarTwinkle {
  0% { transform: scale(0.85) rotate(0deg); opacity: 0.7; }
  100% { transform: scale(1.15) rotate(12deg); opacity: 1; }
}

/* Light Mode Card (Image 2: Soft Ice Blue to White Card with Sparkle Stars) */
html:not(.dark) #auth-modal-card,
html.light #auth-modal-card {
  background: linear-gradient(180deg, #edf2fc 0%, #f7f9fd 45%, #ffffff 100%) !important;
  border: 1px solid #dce4f2 !important;
  box-shadow: 0 25px 60px -15px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
}

html:not(.dark) .auth-brand-connect,
html.light .auth-brand-connect {
  color: #2b313b !important; /* Font คำว่า CONNECT ในโหมด Light เป็นสีดำ */
}

html:not(.dark) .auth-label,
html.light .auth-label {
  color: #1e293b !important;
}

html:not(.dark) .auth-input,
html.light .auth-input {
  background-color: #fafcfe !important;
  border: 1px solid #cbd5e1 !important;
  color: #2b313b !important;
}

html:not(.dark) .auth-input::placeholder,
html.light .auth-input::placeholder {
  color: #94a3b8 !important;
}

html:not(.dark) .auth-input:focus,
html.light .auth-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

html:not(.dark) #auth-tabs-container,
html.light #auth-tabs-container {
  background-color: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
}

html:not(.dark) #auth-tabs-container button:not(.bg-indigo-600),
html.light #auth-tabs-container button:not(.bg-indigo-600) {
  color: #475569 !important;
}

html:not(.dark) .auth-star-tl,
html.light .auth-star-tl { color: #8b5cf6 !important; }

html:not(.dark) .auth-star-ml,
html.light .auth-star-ml { color: #a78bfa !important; }

html:not(.dark) .auth-star-tr,
html.light .auth-star-tr { color: #38bdf8 !important; }

html:not(.dark) .auth-star-fr,
html.light .auth-star-fr { color: #818cf8 !important; }

/* Dark Mode Card (Image 3: Deep Midnight Navy Card with Glowing Sparkle Stars) */
html.dark #auth-modal-card {
  background: linear-gradient(180deg, #182033 0%, #111726 100%) !important;
  border: 1px solid #28344d !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8) !important;
}

html.dark .auth-brand-connect {
  color: #eae9e9 !important; /* Font คำว่า CONNECT ในโหมด Dark เป็นสีขาว */
}

html.dark .auth-label {
  color: #e2e8f0 !important;
}

html.dark .auth-input {
  background-color: #090e17 !important;
  border: 1px solid #28344d !important;
  color: #eae9e9 !important;
}

html.dark .auth-input::placeholder {
  color: #64748b !important;
}

html.dark .auth-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

html.dark #auth-tabs-container {
  background-color: #090e17 !important;
  border: 1px solid #28344d !important;
}

html.dark .auth-star-tl { color: #a78bfa !important; }
html.dark .auth-star-ml { color: #c4b5fd !important; }
html.dark .auth-star-tr { color: #38bdf8 !important; }
html.dark .auth-star-fr { color: #818cf8 !important; }

/* =========================================================
   MEMBERS PAGE STYLES (Image 2 Match: Light & Dark Modes)
   ========================================================= */

/* Light Mode Members View */
html:not(.dark) .members-page-title,
html.light .members-page-title {
  color: #2b313b !important;
}

html:not(.dark) .members-controls-bar,
html.light .members-controls-bar {
  background-color: #fafcfe !important;
  border: 1px solid #cbd5e1 !important;
}

html:not(.dark) #members-role-filter-select,
html.light #members-role-filter-select,
html:not(.dark) #members-search-input,
html.light #members-search-input {
  background-color: #fafcfe !important;
  border: 1px solid #cbd5e1 !important;
  color: #2b313b !important;
}

html:not(.dark) #members-search-input::placeholder,
html.light #members-search-input::placeholder {
  color: #94a3b8 !important;
}

html:not(.dark) .members-table-card,
html.light .members-table-card {
  background-color: #fafcfe !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .members-table-card thead tr,
html.light .members-table-card thead tr {
  background-color: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html:not(.dark) .members-table-card tbody tr,
html.light .members-table-card tbody tr {
  border-bottom: 1px solid #f1f5f9 !important;
}

html:not(.dark) .members-table-card tbody tr:hover,
html.light .members-table-card tbody tr:hover {
  background-color: #f8fafc !important;
}

html:not(.dark) .member-row-name,
html.light .member-row-name {
  color: #2b313b !important;
}

html:not(.dark) .member-row-title,
html.light .member-row-title {
  color: #475569 !important;
}

html:not(.dark) .members-table-footer,
html.light .members-table-footer {
  background-color: #f8fafc !important;
  color: #64748b !important;
  border-top: 1px solid #e2e8f0 !important;
}

/* Generously Rounded Modals & Dropdown Windows (Image 2) */
.glass-modal,
.modal-backdrop > div,
.modal-content,
#notification-dropdown,
.dropdown-panel,
.dropdown-menu {
  border-radius: 1.25rem !important;
}

select {
  border-radius: 9999px !important;
}


/* =========================================================
   AUTHENTIC v9.0.6 ARCHITECTURE & DARK/LIGHT THEME
   ========================================================= */

/* Dark Mode Global Backgrounds */
html.dark body {
  background-color: #272b36 !important;
  color: #f1f5f9 !important;
}

html.dark header#top-app-header,
html.dark #top-app-header {
  background-color: #272b36 !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

html.dark #app-sidebar,
html.dark aside#app-sidebar {
  background-color: #272b36 !important;
  border: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

html.dark .dashboard-hero-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
  border: 1px solid rgba(51, 65, 85, 0.8) !important;
}

/* Sidebar Permanent Display & Unified Fixed Shell on Desktop/Laptop */
@media (min-width: 1024px) {
  html, body {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
  }

  header#top-app-header,
  #top-app-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 40 !important;
    flex-shrink: 0 !important;
  }

  .app-shell-container {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    height: calc(100vh - 58px) !important;
    max-height: calc(100vh - 58px) !important;
    overflow: hidden !important;
  }

  #app-sidebar,
  aside#app-sidebar {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
    z-index: 30 !important;
  }

  #main-content-canvas,
  main#main-content-canvas {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: calc(100% - 260px) !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-top-left-radius: 24px !important;
  }
}

/* =========================================================
   TASK MODAL & LLD REPORT LIGHT MODE CLARITY FIXES
   ========================================================= */
/* 1. Report Type Selection Cards (Image 1) */
html:not(.dark) .report-type-option,
html.light .report-type-option {
  background-color: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .report-type-option:hover,
html.light .report-type-option:hover {
  border-color: #6366f1 !important;
  background-color: #faf5ff !important;
}

html:not(.dark) .report-type-option:has(input:checked),
html.light .report-type-option:has(input:checked) {
  background-color: #eef2ff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 1px #4f46e5 !important;
}

html:not(.dark) .report-type-option .text-indigo-200,
html.light .report-type-option .text-indigo-200,
html:not(.dark) .report-type-option .text-white,
html.light .report-type-option .text-white {
  color: #1e293b !important;
  font-weight: 700 !important;
}

html:not(.dark) .report-type-option .text-slate-400,
html.light .report-type-option .text-slate-400 {
  color: #64748b !important;
}

/* Badge "เธขเธญเธ”เธเธดเธขเธก" */
html:not(.dark) .report-type-option .bg-amber-500\/30,
html.light .report-type-option .bg-amber-500\/30 {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
  font-weight: 700 !important;
}

/* 2. LLD Section Header Banner (Image 2) */
html:not(.dark) #lld-report-items-section > div:first-child,
html.light #lld-report-items-section > div:first-child {
  background-color: #eff6ff !important;
  border: 1.5px solid #bfdbfe !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) #lld-report-items-section > div:first-child .text-white,
html.light #lld-report-items-section > div:first-child .text-white {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html:not(.dark) #lld-report-items-section > div:first-child .text-slate-400,
html.light #lld-report-items-section > div:first-child .text-slate-400 {
  color: #475569 !important;
}

html:not(.dark) #lld-report-items-section > div:first-child i,
html:not(.dark) #lld-report-items-section > div:first-child svg,
html.light #lld-report-items-section > div:first-child i,
html.light #lld-report-items-section > div:first-child svg {
  color: #d97706 !important;
  stroke: #d97706 !important;
}

/* 3. Export File Explorer (.ZIP) Button (Image 3) */
html:not(.dark) #task-modal-export-btn,
html.light #task-modal-export-btn,
html:not(.dark) .bg-amber-950\/40,
html.light .bg-amber-950\/40 {
  background-color: #fef3c7 !important;
  border: 1.5px solid #fcd34d !important;
  color: #92400e !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) #task-modal-export-btn:hover,
html.light #task-modal-export-btn:hover {
  background-color: #fde68a !important;
  color: #78350f !important;
}

html:not(.dark) #task-modal-export-btn i,
html:not(.dark) #task-modal-export-btn svg,
html:not(.dark) #task-modal-export-btn .lucide,
html.light #task-modal-export-btn i,
html.light #task-modal-export-btn svg,
html.light #task-modal-export-btn .lucide {
  color: #b45309 !important;
  stroke: #b45309 !important;
}

/* 4. Sub-Report Items Container (Image 4) */
html:not(.dark) #modal-report-items-container > div,
html.light #modal-report-items-container > div {
  background-color: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) #modal-report-items-container > div.ring-1,
html.light #modal-report-items-container > div.ring-1 {
  background-color: #f8faff !important;
  border-color: #c7d2fe !important;
  box-shadow: 0 0 0 1px #c7d2fe, 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) #modal-report-items-container h5,
html.light #modal-report-items-container h5 {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html:not(.dark) #modal-report-items-container p,
html.light #modal-report-items-container p {
  color: #64748b !important;
}

html:not(.dark) #modal-report-items-container .bg-indigo-500\/20,
html.light #modal-report-items-container .bg-indigo-500\/20 {
  background-color: #e0e7ff !important;
  color: #4338ca !important;
  font-weight: 700 !important;
}

html:not(.dark) #modal-report-items-container h5 i,
html:not(.dark) #modal-report-items-container h5 svg,
html.light #modal-report-items-container h5 i,
html.light #modal-report-items-container h5 svg {
  color: #d97706 !important;
  stroke: #d97706 !important;
}

/* Status Badge inside sub-report item */
html:not(.dark) #modal-report-items-container span.bg-emerald-500\/20,
html.light #modal-report-items-container span.bg-emerald-500\/20 {
  background-color: #dcfce7 !important;
  border: 1px solid #86efac !important;
  color: #15803d !important;
  font-weight: 700 !important;
}

html:not(.dark) #modal-report-items-container span.bg-emerald-500\/20 i,
html:not(.dark) #modal-report-items-container span.bg-emerald-500\/20 svg,
html.light #modal-report-items-container span.bg-emerald-500\/20 i,
html.light #modal-report-items-container span.bg-emerald-500\/20 svg {
  color: #15803d !important;
  stroke: #15803d !important;
}

html:not(.dark) #modal-report-items-container span.bg-slate-800,
html.light #modal-report-items-container span.bg-slate-800 {
  background-color: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

/* Text Inputs inside Sub-report items (Notes) */
html:not(.dark) #modal-report-items-container input[type="text"],
html.light #modal-report-items-container input[type="text"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

/* Attached File Chips inside Sub-report items */
html:not(.dark) #modal-report-items-container .bg-slate-950\/80,
html.light #modal-report-items-container .bg-slate-950\/80,
html:not(.dark) #modal-report-items-container .bg-slate-900\/90,
html.light #modal-report-items-container .bg-slate-900\/90 {
  background-color: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html:not(.dark) #modal-report-items-container .bg-slate-950\/80 span,
html.light #modal-report-items-container .bg-slate-950\/80 span {
  color: #0f172a !important;
}

html:not(.dark) #modal-report-items-container .bg-slate-950\/80 span.text-slate-500,
html.light #modal-report-items-container .bg-slate-950\/80 span.text-slate-500 {
  color: #64748b !important;
}

/* File Attachment Badges & Action Buttons */
.bg-purple-500\/15 i, .bg-purple-500\/15 svg, .bg-purple-500\/15 .lucide { color: #9333ea !important; stroke: #9333ea !important; }
.bg-rose-500\/15 i, .bg-rose-500\/15 svg, .bg-rose-500\/15 .lucide { color: #e11d48 !important; stroke: #e11d48 !important; }
.bg-emerald-500\/15 i, .bg-emerald-500\/15 svg, .bg-emerald-500\/15 .lucide { color: #059669 !important; stroke: #059669 !important; }
.bg-blue-500\/15 i, .bg-blue-500\/15 svg, .bg-blue-500\/15 .lucide { color: #2563eb !important; stroke: #2563eb !important; }
.bg-amber-500\/15 i, .bg-amber-500\/15 svg, .bg-amber-500\/15 .lucide { color: #d97706 !important; stroke: #d97706 !important; }
.bg-orange-500\/15 i, .bg-orange-500\/15 svg, .bg-orange-500\/15 .lucide { color: #ea580c !important; stroke: #ea580c !important; }
.bg-indigo-500\/15 i, .bg-indigo-500\/15 svg, .bg-indigo-500\/15 .lucide { color: #4f46e5 !important; stroke: #4f46e5 !important; }

html.dark .bg-purple-500\/15 i, html.dark .bg-purple-500\/15 svg { color: #d8b4fe !important; stroke: #d8b4fe !important; }
html.dark .bg-rose-500\/15 i, html.dark .bg-rose-500\/15 svg { color: #fda4af !important; stroke: #fda4af !important; }
html.dark .bg-emerald-500\/15 i, html.dark .bg-emerald-500\/15 svg { color: #6ee7b7 !important; stroke: #6ee7b7 !important; }
html.dark .bg-blue-500\/15 i, html.dark .bg-blue-500\/15 svg { color: #93c5fd !important; stroke: #93c5fd !important; }
html.dark .bg-amber-500\/15 i, html.dark .bg-amber-500\/15 svg { color: #fcd34d !important; stroke: #fcd34d !important; }
html.dark .bg-orange-500\/15 i, html.dark .bg-orange-500\/15 svg { color: #fdba74 !important; stroke: #fdba74 !important; }
html.dark .bg-indigo-500\/15 i, html.dark .bg-indigo-500\/15 svg { color: #a5b4fc !important; stroke: #a5b4fc !important; }