/* ==========================================================================
   TileCat — Complete Dark Theme System
   Active when <html class="dark"> or <html data-theme="dark">
   ========================================================================== */

/* ─── CSS Variables for Dark Theme ────────────────────────────────────────── */
html.dark {
  color-scheme: dark;
}

html.dark,
html[data-theme="dark"] {
  --gold: #D4A85B;
  --gold-dim: #B0803A;
  --gold-light: #2D2418;
  --gold-bg: #090D16;

  --ink: #0B0F19;
  --panel: #111827;
  --panel-2: #161F30;
  --pit: #080C14;
  --line: #1E293B;
  --line-soft: #1E293B;
  --text: #F8FAFC;
  --text-dim: #CBD5E1;
  --text-faint: #94A3B8;
  --lime: #38BDF8;
  --lime-dim: #0284C7;
  --cyan: #38BDF8;
  --paper: #111827;
}

/* ─── Global Background & Base Text ───────────────────────────────────────── */
html.dark body {
  background-color: #090D16 !important;
  color: #F8FAFC !important;
}

/* ─── Global Buttons System in Dark Mode ──────────────────────────────────── */

/* Generic button fallback */
html.dark .btn:not(.btn-primary):not(.btn-danger):not(.btn-danger-solid):not(.btn-ghost):not(.pag-btn):not(.btn-leave-primary):not(.btn-leave-danger):not(.lib-card-open):not(.btn-black):not(.login-btn-black) {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #CBD5E1 !important;
}

html.dark .btn:not(.btn-primary):not(.btn-danger):not(.btn-danger-solid):not(.btn-ghost):not(.pag-btn):not(.btn-leave-primary):not(.btn-leave-danger):not(.lib-card-open):not(.btn-black):not(.login-btn-black):hover:not(:disabled) {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

/* Primary buttons */
html.dark .btn-primary {
  background: #F8FAFC !important;
  border-color: #F8FAFC !important;
  color: #090D16 !important;
  font-weight: 600 !important;
}

html.dark .btn-primary:hover:not(:disabled) {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

/* Black/Dark buttons -> converted to high-contrast white in dark mode */
html.dark .btn-black,
html.dark .login-btn-black,
html.dark .btn-login {
  background: #F8FAFC !important;
  border-color: #F8FAFC !important;
  color: #090D16 !important;
}

html.dark .btn-black:hover:not(:disabled),
html.dark .login-btn-black:hover:not(:disabled),
html.dark .btn-login:hover:not(:disabled) {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

/* White buttons -> converted to slate dark buttons in dark mode */
html.dark .btn-white {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #CBD5E1 !important;
}

html.dark .btn-white:hover:not(:disabled) {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

/* Ghost buttons */
html.dark .btn-ghost {
  background: transparent !important;
  border-color: transparent !important;
  color: #94A3B8 !important;
}

html.dark .btn-ghost:hover:not(:disabled) {
  background: #1E293B !important;
  border-color: transparent !important;
  color: #F8FAFC !important;
}

/* Danger buttons (soft red) */
html.dark .btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #F87171 !important;
}

html.dark .btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

/* Danger solid buttons (vivid red) */
html.dark .btn-danger-solid {
  background: #EF4444 !important;
  border: 1px solid #EF4444 !important;
  color: #FFFFFF !important;
}

html.dark .btn-danger-solid:hover:not(:disabled) {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
}

/* ─── Theme Toggle Button in Topbar ───────────────────────────────────────── */
.btn-theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #94A3B8;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  transform: scale(1.08);
}

.btn-theme-toggle .theme-icon-sun {
  display: none !important;
}

.btn-theme-toggle .theme-icon-moon {
  display: block !important;
}

html.dark .btn-theme-toggle .theme-icon-sun {
  display: block !important;
  color: #F59E0B !important;
}

html.dark .btn-theme-toggle .theme-icon-moon {
  display: none !important;
}

/* ─── Topbar / Navigation ─────────────────────────────────────────────────── */
html.dark .topbar {
  background: #0B0F19 !important;
  border-bottom: 1px solid #1E293B !important;
}

html.dark .brand {
  color: #F8FAFC !important;
}

html.dark .brand-mark i {
  background: #F8FAFC !important;
}

html.dark #btnBack {
  color: #CBD5E1 !important;
}

html.dark #btnBack:hover {
  color: #FFFFFF !important;
}

html.dark .doc-title {
  color: #F8FAFC !important;
  background: transparent !important;
  border-color: transparent !important;
}

html.dark .doc-title:hover {
  border-color: #1E293B !important;
}

html.dark .doc-title:focus {
  background: #111827 !important;
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html.dark .savestate {
  color: #64748B !important;
}

html.dark .savestate[data-state="saved"] {
  color: #10B981 !important;
}

html.dark .savestate[data-state="dirty"] {
  color: #F59E0B !important;
}

html.dark .topbar-icon {
  color: #94A3B8 !important;
}

html.dark .topbar-icon:hover {
  color: #F8FAFC !important;
}

html.dark .topbar span.mono {
  color: #64748B !important;
}

html.dark .topbar .tool-sep {
  background: #1E293B !important;
}

/* Topbar button specific styling */
html.dark .topbar .btn {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #CBD5E1 !important;
}

html.dark .topbar .btn:hover:not(:disabled) {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

html.dark .topbar .btn[aria-pressed="true"] {
  background: #1E293B !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

html.dark .topbar #btnExport {
  background: #F8FAFC !important;
  border-color: #F8FAFC !important;
  color: #090D16 !important;
  font-weight: 600 !important;
}

html.dark .topbar #btnExport:hover:not(:disabled) {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

/* ─── Dashboard / Library Page ────────────────────────────────────────────── */
html.dark .idx-wrap {
  background: #090D16 !important;
}

html.dark .idx-head-container .eyebrow {
  color: #38BDF8 !important;
}

html.dark .idx-head-container .idx-title {
  color: #F8FAFC !important;
}

html.dark .idx-head-container .idx-sub {
  color: #94A3B8 !important;
}

html.dark #btnNewCatalogue {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border-color: #F8FAFC !important;
}

html.dark #btnNewCatalogue:hover {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

/* Stat Cards */
html.dark .idx-stat-card {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

html.dark .idx-stat-card div[style*="font-size: 26px"],
html.dark .idx-stat-card div[style*="font-size: 15px"],
html.dark .idx-stat-card div[style*="font-size: 24px"] {
  color: #F8FAFC !important;
}

html.dark .idx-stat-card div[style*="color: #64748B"] {
  color: #94A3B8 !important;
}

/* Import Card & Dropzone */
html.dark .idx-import-card {
  background: #111827 !important;
  border: 1px dashed #334155 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

html.dark .idx-import-card h3,
html.dark .idx-import-card .idx-drop-title {
  color: #F8FAFC !important;
}

html.dark .idx-import-card p,
html.dark .idx-import-card .idx-drop-sub {
  color: #94A3B8 !important;
}

html.dark .idx-import-card div[style*="border: 1px dashed"] {
  background: #0B0F19 !important;
  border-color: #334155 !important;
}

html.dark .idx-import-card span[style*="color: #334155"] {
  color: #CBD5E1 !important;
}

html.dark .idx-fmt-pill {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #94A3B8 !important;
}

html.dark #btnChoosePdf {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border: 1px solid #F8FAFC !important;
}

html.dark #btnChoosePdf:hover {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

/* Library Toolbar Controls */
html.dark .idx-lib-title {
  color: #F8FAFC !important;
}

html.dark .idx-lib-badge {
  background: #1E293B !important;
  color: #94A3B8 !important;
}

html.dark #searchCatalogues {
  background: #111827 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark #searchCatalogues::placeholder {
  color: #64748B !important;
}

html.dark #searchCatalogues:focus {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html.dark #btnFilter {
  background: #111827 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark #btnFilter:hover {
  background: #1E293B !important;
  border-color: #334155 !important;
}

html.dark #filterMenu {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.55) !important;
}

html.dark .lib-menu-item {
  color: #CBD5E1 !important;
}

html.dark .lib-menu-item:hover {
  background: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .filter-opt.active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
}

/* View toggle container */
html.dark div[style*="border: 1px solid #E2E8F0; border-radius: 8px; overflow: hidden; background: #FFFFFF;"] {
  background: #111827 !important;
  border-color: #1E293B !important;
}

/* View toggle buttons */
html.dark #btnViewList,
html.dark #btnViewGrid {
  border-color: #1E293B !important;
}

html.dark #btnViewList[style*="#000000"],
html.dark #btnViewList[style*="rgb(0, 0, 0)"],
html.dark #btnViewGrid[style*="#000000"],
html.dark #btnViewGrid[style*="rgb(0, 0, 0)"] {
  background: #334155 !important;
  color: #FFFFFF !important;
}

html.dark #btnViewList[style*="transparent"],
html.dark #btnViewGrid[style*="transparent"] {
  background: transparent !important;
  color: #94A3B8 !important;
}

html.dark #btnViewList:hover,
html.dark #btnViewGrid:hover {
  color: #FFFFFF !important;
}

/* ─── List View (Dark) ────────────────────────────────────────────────────── */
html.dark .idx-lib-list-container:not(.grid-view) {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

html.dark .idx-lib-list-header {
  background: #0B0F19 !important;
  border-bottom: 1px solid #1E293B !important;
  color: #94A3B8 !important;
}

html.dark .idx-lib-row {
  border-bottom: 1px solid #1E293B !important;
}

html.dark .idx-lib-row:hover {
  background: #151E2E !important;
}

html.dark .idx-catalogue-title {
  color: #F8FAFC !important;
}

html.dark .idx-catalogue-id {
  color: #64748B !important;
}

html.dark .idx-col-pages,
html.dark .idx-col-size {
  color: #CBD5E1 !important;
}

html.dark .idx-col-date .idx-date-val {
  color: #CBD5E1 !important;
}

html.dark .idx-col-date .idx-time-val {
  color: #64748B !important;
}

html.dark .idx-lib-list-container:not(.grid-view) .lib-card-open {
  background: #151E2E !important;
  border-color: #243042 !important;
  color: #F8FAFC !important;
}

html.dark .idx-lib-list-container:not(.grid-view) .lib-card-open:hover {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

html.dark .idx-lib-list-container:not(.grid-view) .js-menu {
  background: #151E2E !important;
  border-color: #243042 !important;
  color: #94A3B8 !important;
}

html.dark .idx-lib-list-container:not(.grid-view) .js-menu:hover {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

/* ─── Grid View (Dark) ────────────────────────────────────────────────────── */
html.dark .idx-lib-list-container.grid-view .idx-lib-row {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html.dark .idx-lib-list-container.grid-view .idx-lib-row:hover {
  border-color: #334155 !important;
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.5) !important;
}

html.dark .idx-lib-list-container.grid-view .idx-col-catalogue > a:first-child {
  background: #0B0F19 !important;
}

html.dark .idx-lib-list-container.grid-view .idx-catalogue-title {
  color: #F8FAFC !important;
}

html.dark .idx-lib-list-container.grid-view .idx-catalogue-title:hover {
  color: #38BDF8 !important;
}

html.dark .idx-lib-list-container.grid-view .idx-catalogue-id {
  color: #64748B !important;
}

html.dark .idx-lib-list-container.grid-view .idx-col-date .idx-date-val {
  color: #CBD5E1 !important;
}

html.dark .idx-lib-list-container.grid-view .idx-col-date .idx-time-val {
  color: #64748B !important;
}

html.dark .idx-lib-list-container.grid-view .idx-col-status {
  background: rgba(17, 24, 39, 0.94) !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
  color: #F8FAFC !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.dark .idx-lib-list-container.grid-view .idx-col-actions {
  background: #0B0F19 !important;
  border-top-color: #1E293B !important;
}

html.dark .idx-lib-list-container.grid-view .lib-card-open {
  background: #F8FAFC !important;
  color: #0B0F19 !important;
  border-color: #F8FAFC !important;
}

html.dark .idx-lib-list-container.grid-view .lib-card-open:hover {
  background: #E2E8F0 !important;
  color: #000000 !important;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.22) !important;
}

html.dark .idx-lib-list-container.grid-view .js-menu {
  background: #151E2E !important;
  border-color: #243042 !important;
  color: #94A3B8 !important;
}

html.dark .idx-lib-list-container.grid-view .js-menu:hover {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

html.dark .lib-actions-menu {
  background: #151E2E !important;
  border-color: #243042 !important;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6) !important;
}

html.dark .lib-menu-item--danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #F87171 !important;
}

/* ─── Pagination (Dark) ───────────────────────────────────────────────────── */
html.dark .pag-btn {
  background: #111827 !important;
  border-color: #1E293B !important;
  color: #CBD5E1 !important;
}

html.dark .pag-btn:hover:not(.disabled) {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

html.dark .pag-btn.active {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border-color: #F8FAFC !important;
}

html.dark .pag-btn.disabled {
  opacity: 0.35 !important;
}

html.dark #paginationInfo {
  color: #94A3B8 !important;
}

/* ─── Footer (Dark) ───────────────────────────────────────────────────────── */
html.dark .idx-footer {
  border-top-color: #1E293B !important;
  color: #64748B !important;
}

html.dark .idx-footer a {
  color: #94A3B8 !important;
}

html.dark .idx-footer a:hover {
  color: #F8FAFC !important;
}

/* ─── Editor Layout (Dark) ────────────────────────────────────────────────── */
html.dark .rail {
  background: #0B0F19 !important;
  border-right-color: #1E293B !important;
}

html.dark .rail::before {
  background: #0B0F19 !important;
  border-bottom-color: #1E293B !important;
  color: #94A3B8 !important;
}

html.dark .thumb {
  background: #111827 !important;
  border-color: #1E293B !important;
}

html.dark .thumb:hover,
html.dark .thumb.active {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

html.dark .thumb-frame {
  background: #111827 !important;
  border-color: #1E293B !important;
}

html.dark .thumb-page-label {
  color: #94A3B8 !important;
}

html.dark .pit {
  background: #080C14 !important;
}

html.dark .slot,
html.dark .slot.selected,
html.dark .pit.show-slots .slot {
  outline-color: #38BDF8 !important;
}

html.dark .slot-tile-border {
  border-color: #38BDF8 !important;
}

html.dark .tbox,
html.dark .tbox.edited,
html.dark .tbox.tbox-light-ink,
html.dark .tbox.selected,
html.dark .tbox.editing,
html.dark .pit.show-slots .tbox,
html.dark .pit.show-slots .tbox.tbox-light-ink {
  outline-color: #38BDF8 !important;
}

html.dark .inspector {
  background: #0B0F19 !important;
  border-left-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .insp-section {
  border-bottom-color: #1E293B !important;
}

html.dark .insp-section > .eyebrow {
  color: #38BDF8 !important;
}

html.dark .tabs {
  background: #0B0F19 !important;
  border-bottom-color: #1E293B !important;
}

html.dark .tab-btn {
  color: #94A3B8 !important;
}

html.dark .tab-btn:hover {
  color: #F8FAFC !important;
}

html.dark .tab-btn.active {
  color: #F8FAFC !important;
  border-bottom-color: #38BDF8 !important;
}

html.dark .inspector .field label {
  color: #CBD5E1 !important;
}

html.dark .inspector input[type="text"],
html.dark .inspector textarea {
  background-color: #111827 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .inspector select,
html.dark select {
  background-color: #111827 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: right 12px center !important;
  background-repeat: no-repeat !important;
  background-size: 12px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 36px !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
  cursor: pointer !important;
}

html.dark select option,
html.dark .inspector select option {
  background-color: #111827 !important;
  color: #F8FAFC !important;
}

html.dark .inspector input[type="text"]:focus,
html.dark .inspector select:focus,
html.dark .inspector textarea:focus {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html.dark .inspector input[type="color"] {
  background: #111827 !important;
  border-color: #1E293B !important;
}

html.dark .inspector .range {
  background: #1E293B !important;
}

html.dark .inspector .range::-webkit-slider-thumb {
  background: #F8FAFC !important;
  border-color: #111827 !important;
}

html.dark .inspector .range::-moz-range-thumb {
  background: #F8FAFC !important;
  border-color: #111827 !important;
}

/* Inspector buttons */
html.dark .inspector .btn:not(.btn-primary):not(#btnReplace):not(#btnSlotDelete):not(#btnTextDelete):not(#layoutReset) {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #CBD5E1 !important;
}

html.dark .inspector .btn:not(.btn-primary):not(#btnReplace):not(#btnSlotDelete):not(#btnTextDelete):not(#layoutReset):hover {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

html.dark .inspector #btnReplace {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border: 1px solid #F8FAFC !important;
}

html.dark .inspector #btnReplace:hover {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

html.dark .inspector #btnRevert,
html.dark .inspector #btnTextRevert {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #CBD5E1 !important;
}

html.dark .inspector #btnRevert:hover,
html.dark .inspector #btnTextRevert:hover {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

html.dark .inspector #btnSlotDelete,
html.dark .inspector #btnTextDelete,
html.dark #layoutReset {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #F87171 !important;
}

html.dark .inspector #btnSlotDelete:hover,
html.dark .inspector #btnTextDelete:hover,
html.dark #layoutReset:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

html.dark #layoutApply {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border: 1px solid #F8FAFC !important;
}

html.dark #layoutApply:hover {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

html.dark #btnClearPatch {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #94A3B8 !important;
}

html.dark #btnClearPatch:hover {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

html.dark .slot-row {
  background: #111827 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .slot-row:hover {
  background: #151E2E !important;
  border-color: #334155 !important;
}

html.dark .slot-row.active {
  background: #161F30 !important;
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15) !important;
}

html.dark .switch .slider {
  background-color: #1E293B !important;
}

html.dark .switch input:checked + .slider {
  background-color: #38BDF8 !important;
}

html.dark .switch .slider:before {
  background-color: #FFFFFF !important;
}

html.dark .inspector .hint-box,
html.dark #slotHint {
  background: #111827 !important;
  border: 1px dashed #1E293B !important;
  color: #94A3B8 !important;
}

html.dark .inspector .kv {
  background: #111827 !important;
  border-color: #1E293B !important;
}

html.dark .inspector .kv dt {
  color: #94A3B8 !important;
}

html.dark .inspector .kv dd {
  color: #F8FAFC !important;
}

html.dark .layout-label {
  color: #CBD5E1 !important;
}

html.dark .layout-label:hover {
  color: #FFFFFF !important;
}

html.dark .layout-row select {
  background-color: #111827 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: right 8px center !important;
  background-repeat: no-repeat !important;
  background-size: 10px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 24px !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

/* ─── Modals, Overlays & Dialogs (Dark) ───────────────────────────────────── */
html.dark .overlay {
  background: rgba(0, 0, 0, 0.75) !important;
}

html.dark .dialog {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  color: #F8FAFC !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6) !important;
}

html.dark .dialog h2 {
  color: #F8FAFC !important;
}

html.dark .dialog p.sub {
  color: #94A3B8 !important;
}

html.dark .dialog .field label {
  color: #CBD5E1 !important;
}

html.dark .dialog input[type="text"] {
  background: #0B0F19 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .dialog .btn-ghost {
  color: #94A3B8 !important;
}

html.dark .dialog .btn-ghost:hover {
  background: #1E293B !important;
  color: #F8FAFC !important;
}

/* Leave Confirmation Modal */
html.dark #leaveOverlay .dialog {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  color: #F8FAFC !important;
}

html.dark #leaveOverlay #leaveTitle {
  color: #F8FAFC !important;
}

html.dark #leaveOverlay #leaveSub {
  color: #94A3B8 !important;
}

html.dark .leave-dialog-icon {
  background: #151E2E !important;
  border-color: #243042 !important;
  color: #38BDF8 !important;
}

html.dark #leaveSaveBtn,
html.dark .btn-leave-primary {
  background: #F8FAFC !important;
  border-color: #F8FAFC !important;
  color: #090D16 !important;
}

html.dark #leaveSaveBtn:hover,
html.dark .btn-leave-primary:hover:not(:disabled) {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #000000 !important;
}

html.dark #leaveDiscardBtn,
html.dark .btn-leave-danger {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
}

html.dark #leaveDiscardBtn:hover,
html.dark .btn-leave-danger:hover:not(:disabled) {
  background: #B91C1C !important;
  border-color: #B91C1C !important;
}

html.dark #leaveCancelBtn,
html.dark .btn-leave-ghost {
  background: #151E2E !important;
  border: 1px solid #243042 !important;
  color: #CBD5E1 !important;
}

html.dark #leaveCancelBtn:hover,
html.dark .btn-leave-ghost:hover:not(:disabled) {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

/* Export Modal */
html.dark #expDpiDisplay {
  background: #0B0F19 !important;
  border-color: #1E293B !important;
  color: #CBD5E1 !important;
}

html.dark #expDpiText {
  color: #F8FAFC !important;
}

html.dark #expStart {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border-color: #F8FAFC !important;
}

html.dark #expStart:hover:not(:disabled) {
  background: #E2E8F0 !important;
  color: #000000 !important;
}

/* Bulk Modal */
html.dark .bulk-drop {
  background: #0B0F19 !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

html.dark .bulk-drop b {
  color: #F8FAFC !important;
}

html.dark .bulk-table-wrap {
  border-color: #1E293B !important;
}

html.dark .bulk-table thead th {
  background: #0B0F19 !important;
  border-bottom-color: #1E293B !important;
  color: #94A3B8 !important;
}

html.dark .bulk-table td {
  border-bottom-color: #1E293B !important;
  color: #CBD5E1 !important;
}

html.dark .bulk-table tr.is-set td {
  background: rgba(56, 189, 248, 0.08) !important;
}

html.dark .bulk-name {
  color: #F8FAFC !important;
}

html.dark .bulk-pick select {
  background-color: #111827 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: right 8px center !important;
  background-repeat: no-repeat !important;
  background-size: 10px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 24px !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .bulk-every {
  background: #0B0F19 !important;
  border-color: #1E293B !important;
}

html.dark .bulk-field input {
  background: #111827 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark #bulkLayout {
  background: #151E2E !important;
  border-color: #243042 !important;
  color: #CBD5E1 !important;
}

html.dark #bulkApply {
  background: #F8FAFC !important;
  color: #090D16 !important;
  border-color: #F8FAFC !important;
}

html.dark #bulkApply:hover:not(:disabled) {
  background: #E2E8F0 !important;
  color: #000000 !important;
}

/* ─── SweetAlert2 Custom Theme (Dark) ─────────────────────────────────────── */
html.dark .tc-swal-popup,
html.dark .swal2-popup {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  color: #F8FAFC !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6) !important;
}

html.dark .tc-swal-title,
html.dark .swal2-title {
  color: #F8FAFC !important;
}

html.dark .tc-swal-html,
html.dark .swal2-html-container {
  color: #94A3B8 !important;
}

html.dark .tc-swal-input,
html.dark .swal2-input {
  background: #0B0F19 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .tc-swal-cancel,
html.dark .swal2-cancel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #CBD5E1 !important;
}

html.dark .tc-swal-cancel:hover,
html.dark .swal2-cancel:hover {
  background: #273549 !important;
  color: #FFFFFF !important;
}

html.dark .tc-swal-confirm,
html.dark .swal2-confirm {
  background: #F8FAFC !important;
  color: #0B0F19 !important;
  border: 1px solid #F8FAFC !important;
}

html.dark .tc-swal-confirm:hover,
html.dark .swal2-confirm:hover {
  background: #E2E8F0 !important;
  color: #000000 !important;
}

html.dark .tc-swal-confirm.btn-danger-solid,
html.dark .swal2-confirm.btn-danger-solid {
  background: #EF4444 !important;
  border-color: #EF4444 !important;
  color: #FFFFFF !important;
}

html.dark .tc-swal-confirm.btn-danger-solid:hover,
html.dark .swal2-confirm.btn-danger-solid:hover {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
}

/* ─── Auth / Login & Reset Password (Dark) ────────────────────────────────── */
html.dark body.login-body-reset {
  background-color: #090D16 !important;
}

html.dark .login-card {
  background: #111827 !important;
  border-color: #1E293B !important;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

html.dark .login-right {
  background-color: #111827 !important;
}

html.dark .login-right h1,
html.dark .login-right h2 {
  color: #F8FAFC !important;
}

html.dark .login-right p {
  color: #94A3B8 !important;
}

html.dark .login-right label,
html.dark .login-label {
  color: #CBD5E1 !important;
}

html.dark .login-input {
  background-color: #0B0F19 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

html.dark .login-input:focus {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html.dark .login-right .brand-mark-squares span {
  background-color: #F8FAFC !important;
}

html.dark #toForgotPassword,
html.dark #toLogin,
html.dark a[href*="forgot"] {
  color: #38BDF8 !important;
}

html.dark .reset-card {
  background: #111827 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

html.dark .reset-card h1 {
  color: #F8FAFC !important;
}

html.dark .reset-card p {
  color: #94A3B8 !important;
}

html.dark .reset-card input[readonly] {
  background: #151E2E !important;
  color: #64748B !important;
  border-color: #1E293B !important;
}

html.dark .brand-logo-center .brand-mark-squares span {
  background-color: #F8FAFC !important;
}

.slot .slot-img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  backface-visibility: hidden;
}
