/*
 * Okumkom dark theme.
 *
 * The front-ends are pre-built bundles, so these overrides target the exact
 * Tailwind tokens used by the apps. `[class~="..."]` matches a complete class
 * name, which keeps hover variants such as `hover:bg-slate-50` separate.
 */

html[data-theme="dark"] {
  color-scheme: dark;
  background-color: #0c0a09;
}

html[data-theme="dark"] body {
  background-color: #0c0a09 !important;
  color: #e7e5e4 !important;
}

/* ---------- Base surfaces ---------- */

html[data-theme="dark"] [class~="bg-white"] { background-color: #1c1917 !important; }

html[data-theme="dark"] [class~="bg-[#F9FAFB]"],
html[data-theme="dark"] [class~="bg-[#F7F8FA]"],
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-gray-50 { background-color: #12100e !important; }

html[data-theme="dark"] [class~="bg-[#FAFAFA]"],
html[data-theme="dark"] .bg-gray-100 { background-color: #181513 !important; }

html[data-theme="dark"] [class~="bg-[#F4F4F5]"],
html[data-theme="dark"] [class~="bg-[#F3F4F6]"],
html[data-theme="dark"] .bg-gray-200 { background-color: #292524 !important; }

html[data-theme="dark"] [class~="bg-[#E4E4E7]"],
html[data-theme="dark"] [class~="bg-[#D4D4D8]"],
html[data-theme="dark"] .bg-gray-300 { background-color: #3f3f46 !important; }

html[data-theme="dark"] .bg-gray-400 { background-color: #52525b !important; }

/* Pale amber highlights and selected states */
html[data-theme="dark"] [class~="bg-[#FEFCE8]"] { background-color: #2c2410 !important; }

html[data-theme="dark"] [class~="bg-[#FEF9C3]"],
html[data-theme="dark"] [class~="bg-[#FEF3C7]"],
html[data-theme="dark"] [class~="bg-[#f5e7c3]"] { background-color: #3a2f10 !important; }

html[data-theme="dark"] [class~="bg-[#FFFBEB]"] { background-color: #2a2310 !important; }
html[data-theme="dark"] [class~="bg-[#FFF7ED]"] { background-color: #2c2118 !important; }

/* Status and tag surfaces */
html[data-theme="dark"] [class~="bg-[#FEE2E2]"] { background-color: #3b1a1a !important; }
html[data-theme="dark"] [class~="bg-[#DCFCE7]"] { background-color: #12291a !important; }
html[data-theme="dark"] [class~="bg-[#FFEDD5]"] { background-color: #36220f !important; }
html[data-theme="dark"] [class~="bg-[#ECFCCB]"] { background-color: #1f2a10 !important; }
html[data-theme="dark"] [class~="bg-[#CCFBF1]"] { background-color: #0f2a27 !important; }
html[data-theme="dark"] [class~="bg-[#ECFDF5]"] { background-color: #10261f !important; }
html[data-theme="dark"] [class~="bg-[#EDE9FE]"] { background-color: #221a3a !important; }
html[data-theme="dark"] [class~="bg-[#FCE7F3]"] { background-color: #351626 !important; }
html[data-theme="dark"] [class~="bg-[#DBEAFE]"] { background-color: #152238 !important; }
html[data-theme="dark"] [class~="bg-[#EEF2FF]"] { background-color: #1a1d35 !important; }
html[data-theme="dark"] [class~="bg-[#ECFEFF]"] { background-color: #10262a !important; }
html[data-theme="dark"] [class~="bg-[#E0F2FE]"] { background-color: #102635 !important; }
html[data-theme="dark"] [class~="bg-[#D1FAE5]"] { background-color: #10291f !important; }

/* Hover surfaces */
html[data-theme="dark"] [class~="hover:bg-slate-50"]:hover,
html[data-theme="dark"] [class~="hover:bg-gray-50"]:hover,
html[data-theme="dark"] [class~="hover:bg-gray-100"]:hover { background-color: #292524 !important; }

html[data-theme="dark"] [class~="hover:bg-[#FFF7ED]"]:hover { background-color: #3a2b1c !important; }
html[data-theme="dark"] [class~="hover:bg-[#f5e7c3]"]:hover { background-color: #4a3a12 !important; }
html[data-theme="dark"] [class~="hover:bg-[#CA8A04]"]:hover { background-color: #a16207 !important; }

/* ---------- Text ---------- */

html[data-theme="dark"] [class~="text-[#18181B]"],
html[data-theme="dark"] [class~="text-[#1c1b1b]"],
html[data-theme="dark"] [class~="text-[#000000]"],
html[data-theme="dark"] .text-black { color: #f4f4f5 !important; }

html[data-theme="dark"] [class~="text-[#27272A]"],
html[data-theme="dark"] [class~="text-[#3F3F46]"],
html[data-theme="dark"] [class~="text-[#334154]"],
html[data-theme="dark"] [class~="text-[#172B4D]"],
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900 { color: #e4e4e7 !important; }

html[data-theme="dark"] [class~="text-[#71717A]"],
html[data-theme="dark"] [class~="text-[#79747E]"],
html[data-theme="dark"] [class~="text-[#6B7280]"],
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-secondary { color: #a1a1aa !important; }

html[data-theme="dark"] [class~="text-[#A1A1AA]"],
html[data-theme="dark"] .text-gray-400 { color: #b4b4bb !important; }

html[data-theme="dark"] .text-gray-300 { color: #d4d4d8 !important; }

/* Brand accents */
html[data-theme="dark"] [class~="text-[#CA8A04]"],
html[data-theme="dark"] [class~="text-[#A16207]"],
html[data-theme="dark"] .text-main { color: #facc15 !important; }

/* Status accents */
html[data-theme="dark"] [class~="text-[#EF4444]"],
html[data-theme="dark"] [class~="text-[#DC2626]"] { color: #f87171 !important; }

html[data-theme="dark"] [class~="text-[#16A34A]"],
html[data-theme="dark"] [class~="text-[#059669]"],
html[data-theme="dark"] [class~="text-[#10B981]"],
html[data-theme="dark"] [class~="text-[#22C55E]"] { color: #4ade80 !important; }

html[data-theme="dark"] [class~="text-[#166534]"],
html[data-theme="dark"] [class~="text-[#4D7C0F]"] { color: #bef264 !important; }

html[data-theme="dark"] [class~="text-[#84CC16]"] { color: #a3e635 !important; }
html[data-theme="dark"] [class~="text-[#F97316]"],
html[data-theme="dark"] [class~="text-[#F59E0B]"] { color: #fbbf24 !important; }
html[data-theme="dark"] [class~="text-[#3B82F6]"] { color: #60a5fa !important; }
html[data-theme="dark"] [class~="text-[#8B5CF6]"] { color: #a78bfa !important; }
html[data-theme="dark"] [class~="text-[#6366F1]"] { color: #818cf8 !important; }
html[data-theme="dark"] [class~="text-[#EC4899]"] { color: #f472b6 !important; }
html[data-theme="dark"] [class~="text-[#14B8A6]"] { color: #2dd4bf !important; }
html[data-theme="dark"] [class~="text-[#06B6D4]"] { color: #22d3ee !important; }
html[data-theme="dark"] [class~="text-[#C026D3]"] { color: #e879f9 !important; }

html[data-theme="dark"] [class~="hover:text-main"]:hover { color: #facc15 !important; }
html[data-theme="dark"] [class~="hover:text-gray-700"]:hover { color: #e4e4e7 !important; }
html[data-theme="dark"] [class~="hover:text-indigo-800"]:hover { color: #c7d2fe !important; }

/* ---------- Borders ---------- */

html[data-theme="dark"] [class~="border-[#F4F4F5]"],
html[data-theme="dark"] [class~="border-[#E4E4E7]"],
html[data-theme="dark"] [class~="border-[#E4E7EC]"],
html[data-theme="dark"] [class~="border-[#D4D4D8]"],
html[data-theme="dark"] [class~="border-[#f1f5f9]"],
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300 { border-color: #33302c !important; }

html[data-theme="dark"] [class~="border-[#A1A1AA]"] { border-color: #52525b !important; }
html[data-theme="dark"] [class~="border-[#FAAFAF5]"] { border-color: #7f1d1d !important; }
html[data-theme="dark"] [class~="border-[#F97316]"] { border-color: #fb923c !important; }

html[data-theme="dark"] [class~="hover:border-[#A1A1AA]"]:hover { border-color: #71717a !important; }

/* ---------- Form controls ---------- */

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  color: #f4f4f5;
  background-color: #12100e;
  border-color: #3f3f46;
  caret-color: #facc15;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] [class~="placeholder:text-[#A1A1AA]"]::placeholder {
  color: #71717a !important;
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #12100e inset !important;
  -webkit-text-fill-color: #f4f4f5 !important;
  caret-color: #f4f4f5;
}

html[data-theme="dark"] ::selection {
  background: rgba(234, 179, 8, 0.35);
  color: #ffffff;
}

/* ---------- Toasts ---------- */

html[data-theme="dark"] .Toastify__toast-theme--light {
  background: #1c1917 !important;
  color: #fafaf9 !important;
}

html[data-theme="dark"] .Toastify__toast-theme--light .Toastify__toast-body {
  color: #fafaf9 !important;
}

html[data-theme="dark"] .Toastify__close-button--light {
  color: #a1a1aa !important;
}

/* ---------- Theme toggle ---------- */

.okumkom-theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  color: #44403c;
  box-shadow: 0 10px 30px -12px rgba(28, 25, 23, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.okumkom-theme-toggle:hover { transform: translateY(-2px); }
.okumkom-theme-toggle:focus-visible { outline: 2px solid #ca8a04; outline-offset: 2px; }
.okumkom-theme-toggle svg { width: 20px; height: 20px; display: block; }

html[data-theme="dark"] .okumkom-theme-toggle {
  background: #1c1917;
  color: #fafaf9;
  border-color: #3f3f46;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
}

.okumkom-settings-link {
  position: fixed;
  right: 20px;
  bottom: 76px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  color: #44403c;
  box-shadow: 0 10px 30px -12px rgba(28, 25, 23, 0.35);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.okumkom-settings-link:hover { transform: translateY(-2px); }
.okumkom-settings-link:focus-visible { outline: 2px solid #ca8a04; outline-offset: 2px; }
.okumkom-settings-link svg { width: 20px; height: 20px; display: block; }

html[data-theme="dark"] .okumkom-settings-link {
  background: #1c1917;
  color: #fafaf9;
  border-color: #3f3f46;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
}

@media print {
  .okumkom-theme-toggle,
  .okumkom-settings-link { display: none !important; }
}
