/* Theme: dark mode overrides */
html[data-theme="dark"], body[data-theme="dark"] {
  background-color: #121212;
  color: #eaeaea;
}
[data-theme="sunset"], html[data-theme="sunset"], body[data-theme="sunset"] {
  --bs-body-bg: #2b1b1f;
  --bs-body-color: #f3e7e9;
  --bs-border-color: #5a3b44;
  --bs-card-bg: #3a2329;
  --bs-card-border-color: #5a3b44;
  --bs-link-color: #ffb199;
  background-color: #2b1b1f; color: #f3e7e9;
}
[data-theme="sunset"] .bg-gradient-primary { background: linear-gradient(180deg,#ff7e5f 10%,#2b1b1f 100%) !important; }
[data-theme="sunset"] .sidebar { background: linear-gradient(180deg,#3a2329 10%,#2b1b1f 100%) !important; }
[data-theme="sunset"] .card, [data-theme="sunset"] .modal-content { background-color: #3a2329 !important; color: #f3e7e9 !important; }
[data-theme="sunset"] .dropdown-menu { background-color: #3a2329 !important; color: #f3e7e9 !important; }
[data-theme="sunset"] .navbar, [data-theme="sunset"] .topbar { background-color: #2b1b1f !important; }
[data-theme="sunset"] .btn-primary { background-color: #ff7e5f !important; border-color: #ff7e5f !important; }
[data-theme="sunset"] .btn-outline-primary { color: #ffd1c7 !important; border-color: #ff7e5f !important; }

[data-theme="sunrise"], html[data-theme="sunrise"], body[data-theme="sunrise"] {
  --bs-body-bg: #fff4e6;
  --bs-body-color: #4a3d2c;
  --bs-border-color: #e6d5c3;
  --bs-card-bg: #fff1db;
  --bs-card-border-color: #e6d5c3;
  --bs-link-color: #ff8c42;
  background-color: #fff4e6; color: #4a3d2c;
}
[data-theme="sunrise"] .bg-gradient-primary { background: linear-gradient(180deg,#ffb347 10%,#e6d5c3 100%) !important; }
[data-theme="sunrise"] .sidebar { background: linear-gradient(180deg,#ffcc99 10%,#e6d5c3 100%) !important; }
[data-theme="sunrise"] .card, [data-theme="sunrise"] .modal-content { background-color: #fff1db !important; color: #4a3d2c !important; }
[data-theme="sunrise"] .dropdown-menu { background-color: #fff1db !important; color: #4a3d2c !important; }
[data-theme="sunrise"] .navbar, [data-theme="sunrise"] .topbar { background-color: #fff4e6 !important; }
[data-theme="sunrise"] .btn-primary { background-color: #ff8c42 !important; border-color: #ff8c42 !important; }
[data-theme="sunrise"] .btn-outline-primary { color: #ff8c42 !important; border-color: #ff8c42 !important; }

[data-theme="winter"], html[data-theme="winter"], body[data-theme="winter"] {
  --bs-body-bg: #eaf3fb;
  --bs-body-color: #1f2d3d;
  --bs-border-color: #bcd3e8;
  --bs-card-bg: #f3f9ff;
  --bs-card-border-color: #bcd3e8;
  --bs-link-color: #2b6cb0;
  background-color: #eaf3fb; color: #1f2d3d;
}
[data-theme="winter"] .bg-gradient-primary { background: linear-gradient(180deg,#3b7dbf 10%,#bcd3e8 100%) !important; }
[data-theme="winter"] .sidebar { background: linear-gradient(180deg,#cfe2f3 10%,#bcd3e8 100%) !important; }
[data-theme="winter"] .card, [data-theme="winter"] .modal-content { background-color: #f3f9ff !important; color: #1f2d3d !important; }
[data-theme="winter"] .dropdown-menu { background-color: #f3f9ff !important; color: #1f2d3d !important; }
[data-theme="winter"] .navbar, [data-theme="winter"] .topbar { background-color: #eaf3fb !important; }
[data-theme="winter"] .btn-primary { background-color: #3b7dbf !important; border-color: #3b7dbf !important; }
[data-theme="winter"] .btn-outline-primary { color: #3b7dbf !important; border-color: #3b7dbf !important; }
[data-theme="dark"] {
  /* Bootstrap variables override */
  --bs-body-bg: #121212;
  --bs-body-color: #eaeaea;
  --bs-border-color: #333;
  --bs-card-bg: #1e1e1e;
  --bs-card-border-color: #333;
  --bs-dropdown-bg: #1e1e1e;
  --bs-dropdown-link-color: #eaeaea;
  --bs-dropdown-link-hover-bg: #2a2a2a;
  --bs-secondary-bg: #2a2a2a;
  --bs-link-color: #9ecbff;
}
[data-theme="dark"] .sidebar,
[data-theme="dark"] .bg-gradient-primary {
  background: linear-gradient(180deg,#2c3e50 10%,#1c2833 100%) !important;
}

/* Common components in dark mode */
[data-theme="dark"] .bg-white { background-color: #1f1f1f !important; }
[data-theme="dark"] .card, [data-theme="dark"] .modal-content { background-color: #1e1e1e !important; color: #eaeaea !important; }
[data-theme="dark"] .dropdown-menu { background-color: #1e1e1e !important; color: #eaeaea !important; }
[data-theme="dark"] .navbar-light .navbar-nav .nav-link { color: #ddd !important; }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select, [data-theme="dark"] .input-group-text { background-color: #222; color: #eee; border-color: #444; }
[data-theme="dark"] .table { color: #ddd !important; }
[data-theme="dark"] .table thead { background-color: #2a2a2a !important; }
[data-theme="dark"] .text-gray-800 { color: #ddd !important; }
[data-theme="dark"] .navbar, [data-theme="dark"] .navbar-light, [data-theme="dark"] .topbar { background-color: #151515 !important; border-color: #333 !important; }
[data-theme="dark"] .sticky-footer, [data-theme="dark"] .sticky-footer.bg-white { background-color: #151515 !important; color: #ddd !important; }
[data-theme="dark"] #content-wrapper { background-color: #121212 !important; }
[data-theme="dark"] .bg-light { background-color: #222 !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-top, [data-theme="dark"] .border-bottom, [data-theme="dark"] .border-left, [data-theme="dark"] .border-right { border-color: #333 !important; }
[data-theme="dark"] .dropdown-item { color: #eaeaea !important; }
[data-theme="dark"] .btn-outline-primary { color: #9ecbff !important; border-color: #3b5b99 !important; }
[data-theme="dark"] .btn-primary { background-color: #2b4d8f !important; border-color: #2b4d8f !important; }

/* Ensure all text is bright and legible in DARK and SUNSET themes */
[data-theme="dark"] a, [data-theme="dark"] .nav-link { color: #e6f0ff !important; }
[data-theme="dark"] .nav-link:hover { color: #ffffff !important; }
[data-theme="dark"] .text-muted, [data-theme="dark"] .text-secondary, [data-theme="dark"] .small, [data-theme="dark"] .form-text { color: #cfcfcf !important; opacity: 1 !important; }
[data-theme="dark"] .text-dark { color: #eaeaea !important; }
[data-theme="dark"] .text-gray-300 { color: #f2f2f2 !important; }
[data-theme="dark"] .text-gray-600, [data-theme="dark"] .text-gray-700 { color: #dddddd !important; }
[data-theme="dark"] .card-header, [data-theme="dark"] .modal-header { color: #eaeaea !important; border-color: #333 !important; }
[data-theme="dark"] .list-group-item { color: #eaeaea !important; background-color: #1a1a1a !important; border-color: #333 !important; }
[data-theme="dark"] .breadcrumb .breadcrumb-item, [data-theme="dark"] .pagination .page-link { color: #eaeaea !important; }
[data-theme="dark"] .badge { color: #fff !important; }

[data-theme="sunset"] a, [data-theme="sunset"] .nav-link, [data-theme="sunset"] .navbar-light .navbar-nav .nav-link { color: #f3e7e9 !important; }
[data-theme="sunset"] .nav-link:hover { color: #ffe3dd !important; }
[data-theme="sunset"] .text-muted, [data-theme="sunset"] .text-secondary, [data-theme="sunset"] .small, [data-theme="sunset"] .form-text { color: #f3e7e9 !important; opacity: 1 !important; }
[data-theme="sunset"] .text-dark { color: #f3e7e9 !important; }
[data-theme="sunset"] .text-gray-300 { color: #f8eeef !important; }
[data-theme="sunset"] .text-gray-600, [data-theme="sunset"] .text-gray-700, [data-theme="sunset"] .text-gray-800 { color: #f3e7e9 !important; }
[data-theme="sunset"] .card-header, [data-theme="sunset"] .modal-header { color: #f3e7e9 !important; border-color: #5a3b44 !important; }
[data-theme="sunset"] .list-group-item { color: #f3e7e9 !important; background-color: #342027 !important; border-color: #5a3b44 !important; }
[data-theme="sunset"] .breadcrumb .breadcrumb-item, [data-theme="sunset"] .pagination .page-link { color: #f3e7e9 !important; }
[data-theme="sunset"] .badge { color: #fff !important; }

/* Tables: ensure bright text inside DARK and SUNSET themes */
[data-theme="dark"] .table { background-color: #1a1a1a !important; color: #eaeaea !important; }
[data-theme="dark"] .table {
  --bs-table-color: #eaeaea;
  --bs-table-bg: #1a1a1a;
  --bs-table-border-color: #333;
  --bs-table-striped-bg: #1e1e1e;
  --bs-table-striped-color: #eaeaea;
  --bs-table-hover-bg: #2a2a2a;
  --bs-table-hover-color: #eaeaea;
}
[data-theme="dark"] .table td,
[data-theme="dark"] .table th { color: #eaeaea !important; }
[data-theme="dark"] .table a { color: #e6f0ff !important; }
[data-theme="dark"] .table .text-dark,
[data-theme="dark"] .table .text-body,
[data-theme="dark"] .table .text-gray-800,
[data-theme="dark"] .table .text-gray-900 { color: #eaeaea !important; }
[data-theme="dark"] .table td, [data-theme="dark"] .table th { border-color: #333 !important; }
[data-theme="dark"] .table thead, [data-theme="dark"] .table thead th { background-color: #222 !important; color: #eaeaea !important; }
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) { background-color: #1e1e1e !important; }
[data-theme="dark"] .table-striped tbody tr:nth-of-type(even) { background-color: #191919 !important; }
[data-theme="dark"] .table-hover tbody tr:hover { background-color: #2a2a2a !important; }
[data-theme="dark"] .table .text-muted { color: #cfcfcf !important; }

[data-theme="sunset"] .table { background-color: #342027 !important; color: #f3e7e9 !important; }
[data-theme="sunset"] .table {
  --bs-table-color: #f3e7e9;
  --bs-table-bg: #342027;
  --bs-table-border-color: #5a3b44;
  --bs-table-striped-bg: #3a2329;
  --bs-table-striped-color: #f3e7e9;
  --bs-table-hover-bg: #483038;
  --bs-table-hover-color: #f3e7e9;
}
[data-theme="sunset"] .table td,
[data-theme="sunset"] .table th { color: #f3e7e9 !important; }
[data-theme="sunset"] .table a { color: #ffd1c7 !important; }
[data-theme="sunset"] .table .text-dark,
[data-theme="sunset"] .table .text-body,
[data-theme="sunset"] .table .text-gray-800,
[data-theme="sunset"] .table .text-gray-900 { color: #f3e7e9 !important; }
[data-theme="sunset"] .table td, [data-theme="sunset"] .table th { border-color: #5a3b44 !important; }
[data-theme="sunset"] .table thead, [data-theme="sunset"] .table thead th { background-color: #3a2329 !important; color: #f3e7e9 !important; }
[data-theme="sunset"] .table-striped tbody tr:nth-of-type(odd) { background-color: #3a2329 !important; }
[data-theme="sunset"] .table-striped tbody tr:nth-of-type(even) { background-color: #2b1b1f !important; }
[data-theme="sunset"] .table-hover tbody tr:hover { background-color: #483038 !important; }
[data-theme="sunset"] .table .text-muted { color: #f3e7e9 !important; }

/* Summernote: make editor and toolbar bright/legible in DARK and SUNSET */
[data-theme="dark"] .note-editor.note-frame { background-color: #1e1e1e !important; color: #eaeaea !important; border-color: #333 !important; }
[data-theme="dark"] .note-toolbar { background-color: #151515 !important; border-color: #333 !important; }
[data-theme="dark"] .note-toolbar .note-btn { color: #ddd !important; background-color: #222 !important; border-color: #444 !important; }
[data-theme="dark"] .note-editable { background-color: #1e1e1e !important; color: #eaeaea !important; }
[data-theme="dark"] .note-dropdown-menu { background-color: #1e1e1e !important; color: #eaeaea !important; border-color: #333 !important; }
[data-theme="dark"] .note-dropdown-item { color: #eaeaea !important; }
[data-theme="dark"] .note-statusbar { background-color: #151515 !important; border-top-color: #333 !important; }

[data-theme="sunset"] .note-editor.note-frame { background-color: #3a2329 !important; color: #f3e7e9 !important; border-color: #5a3b44 !important; }
[data-theme="sunset"] .note-toolbar { background-color: #2b1b1f !important; border-color: #5a3b44 !important; }
[data-theme="sunset"] .note-toolbar .note-btn { color: #f3e7e9 !important; background-color: #342027 !important; border-color: #5a3b44 !important; }
[data-theme="sunset"] .note-editable { background-color: #3a2329 !important; color: #f3e7e9 !important; }
[data-theme="sunset"] .note-dropdown-menu { background-color: #3a2329 !important; color: #f3e7e9 !important; border-color: #5a3b44 !important; }
[data-theme="sunset"] .note-dropdown-item { color: #f3e7e9 !important; }
[data-theme="sunset"] .note-statusbar { background-color: #2b1b1f !important; border-top-color: #5a3b44 !important; }