:root.dark {
  color-scheme: dark;
}

:root.dark #global-theme-toggle [data-theme-icon="dark"] {
  display: none !important;
}

:root.dark #global-theme-toggle [data-theme-icon="light"] {
  display: inline-block !important;
}

body.dark-mode {
  background-color: #0b1220;
  color: #e2e8f0;
}

body.dark-mode .bg-white {
  background-color: #0f172a !important;
}

body.dark-mode .bg-gray-50 {
  background-color: #0b1220 !important;
}

body.dark-mode .bg-gray-100 {
  background-color: #111827 !important;
}

body.dark-mode .bg-gray-200 {
  background-color: #1f2937 !important;
}

body.dark-mode .bg-blue-50 {
  background-color: #0b1f2e !important;
}

body.dark-mode .bg-blue-100 {
  background-color: #0b2a3f !important;
}

body.dark-mode .text-gray-900 {
  color: #f8fafc !important;
}

body.dark-mode .text-gray-800 {
  color: #e2e8f0 !important;
}

body.dark-mode .text-gray-700 {
  color: #cbd5e1 !important;
}

body.dark-mode .text-gray-600 {
  color: #94a3b8 !important;
}

body.dark-mode .text-gray-500,
body.dark-mode .text-gray-400 {
  color: #94a3b8 !important;
}

body.dark-mode .text-blue-700,
body.dark-mode .text-blue-600,
body.dark-mode .text-blue-500 {
  color: #93c5fd !important;
}

body.dark-mode .text-green-600,
body.dark-mode .text-green-500 {
  color: #6ee7b7 !important;
}

body.dark-mode .text-red-600,
body.dark-mode .text-red-500 {
  color: #fca5a5 !important;
}

body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300 {
  border-color: #1f2937 !important;
}

body.dark-mode .border-blue-100 {
  border-color: #1e3a8a !important;
}

body.dark-mode .shadow-sm,
body.dark-mode .shadow,
body.dark-mode .shadow-lg,
body.dark-mode .shadow-xl {
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.55) !important;
}

body.dark-mode a {
  color: inherit;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background-color: #0b1220 !important;
  border-color: #1f2937 !important;
  color: #e2e8f0 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748b;
}

body.dark-mode table thead,
body.dark-mode table tfoot {
  background-color: #0f172a;
}

body.dark-mode table tr {
  border-color: #1f2937;
}

body.dark-mode .hover\:bg-gray-100:hover {
  background-color: #111827 !important;
}

body.dark-mode .hover\:bg-gray-50:hover {
  background-color: #0f172a !important;
}

body.dark-mode .hover\:bg-blue-100:hover {
  background-color: #1e3a8a !important;
}

body.dark-mode .hover\:bg-blue-50:hover {
  background-color: #0b1f2e !important;
}

body.dark-mode .sidebar-link:hover,
body.dark-mode .sidebar-action:hover {
  background-color: #111827 !important;
}

body.dark-mode .action-menu__panel,
body.dark-mode .action-menu__item {
  background-color: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .action-menu__item:hover {
  background-color: #111827;
}

body.dark-mode .flash-toast {
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.6);
}

body.dark-mode .bg-white\/95,
body.dark-mode .bg-white\/90,
body.dark-mode .bg-white\/85,
body.dark-mode .bg-white\/80 {
  background-color: #0f172a !important;
}

body.dark-mode .bg-white\/70 {
  background-color: #0b1220 !important;
}

body.dark-mode .bg-slate-50,
body.dark-mode .bg-slate-50\/60,
body.dark-mode .bg-slate-50\/70,
body.dark-mode .bg-slate-50\/80 {
  background-color: #0b1220 !important;
}

body.dark-mode .bg-slate-100,
body.dark-mode .bg-slate-100\/70 {
  background-color: #111827 !important;
}

body.dark-mode .bg-slate-200 {
  background-color: #1f2937 !important;
}

body.dark-mode .bg-slate-300 {
  background-color: #334155 !important;
}

body.dark-mode .text-slate-900 {
  color: #f8fafc !important;
}

body.dark-mode .text-slate-800 {
  color: #e2e8f0 !important;
}

body.dark-mode .text-slate-700 {
  color: #cbd5e1 !important;
}

body.dark-mode .text-slate-600 {
  color: #94a3b8 !important;
}

body.dark-mode .text-slate-500 {
  color: #94a3b8 !important;
}

body.dark-mode .text-slate-400 {
  color: #64748b !important;
}

body.dark-mode .border-slate-100,
body.dark-mode .border-slate-200 {
  border-color: #1f2937 !important;
}

body.dark-mode .border-slate-300 {
  border-color: #334155 !important;
}

body.dark-mode .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
body.dark-mode .divide-gray-200 > :not([hidden]) ~ :not([hidden]),
body.dark-mode .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
body.dark-mode .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #1f2937 !important;
}

body.dark-mode .odd\:bg-white:nth-child(odd) {
  background-color: #0f172a !important;
}

body.dark-mode .even\:bg-gray-50:nth-child(even) {
  background-color: #0b1220 !important;
}

body.dark-mode .hover\:bg-slate-50:hover,
body.dark-mode .hover\:bg-slate-50\/80:hover {
  background-color: #111827 !important;
}

body.dark-mode .hover\:bg-gray-100\/40:hover,
body.dark-mode .hover\:bg-blue-100\/40:hover {
  background-color: #1f2937 !important;
}

body.dark-mode .prose {
  --tw-prose-body: var(--tw-prose-invert-body);
  --tw-prose-headings: var(--tw-prose-invert-headings);
  --tw-prose-lead: var(--tw-prose-invert-lead);
  --tw-prose-links: var(--tw-prose-invert-links);
  --tw-prose-bold: var(--tw-prose-invert-bold);
  --tw-prose-counters: var(--tw-prose-invert-counters);
  --tw-prose-bullets: var(--tw-prose-invert-bullets);
  --tw-prose-hr: var(--tw-prose-invert-hr);
  --tw-prose-quotes: var(--tw-prose-invert-quotes);
  --tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);
  --tw-prose-captions: var(--tw-prose-invert-captions);
  --tw-prose-kbd: var(--tw-prose-invert-kbd);
  --tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);
  --tw-prose-code: var(--tw-prose-invert-code);
  --tw-prose-pre-code: var(--tw-prose-invert-pre-code);
  --tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);
  --tw-prose-th-borders: var(--tw-prose-invert-th-borders);
  --tw-prose-td-borders: var(--tw-prose-invert-td-borders);
}

body.dark-mode #ai-summary-fade {
  background: linear-gradient(to top, #0b1220, rgba(11, 18, 32, 0.85), rgba(11, 18, 32, 0));
}

body.dark-mode #today-plan-widget {
  background: linear-gradient(135deg, #0f172a, #0b1220);
  border-color: #1f2937;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.5);
}

body.dark-mode .notes-panel-card,
body.dark-mode .notes-panel-item,
body.dark-mode .notes-panel-link,
body.dark-mode .notes-template-card,
body.dark-mode .notes-shortcut-row,
body.dark-mode .notes-insight-card,
body.dark-mode .notes-insight-row {
  background: #0f172a;
  border-color: #1f2937;
  color: #e2e8f0;
}

body.dark-mode .notes-panel-button,
body.dark-mode .notes-template-btn {
  background: #0b1220;
  border-color: #1f2937;
  color: #e2e8f0;
}

body.dark-mode .notes-panel-button:hover,
body.dark-mode .notes-panel-item:hover,
body.dark-mode .notes-panel-link:hover,
body.dark-mode .notes-template-btn:hover,
body.dark-mode .notes-action-item:hover {
  background: #111827;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-mode .notes-panel-option {
  color: #cbd5e1;
}

body.dark-mode .notes-panel-option:hover {
  background: #111827;
}

body.dark-mode .notes-panel-option-active {
  background: #e2e8f0;
  color: #0f172a;
}

body.dark-mode .notes-panel-option-active:hover {
  background: #f8fafc;
}

body.dark-mode .notes-panel-kicker,
body.dark-mode .notes-panel-count,
body.dark-mode .notes-panel-link-meta,
body.dark-mode .notes-template-desc,
body.dark-mode .notes-panel-muted {
  color: #94a3b8;
}

body.dark-mode .notes-template-title,
body.dark-mode .notes-insight-value {
  color: #f8fafc;
}

body.dark-mode .notes-action-item {
  color: #cbd5e1;
}

body.dark-mode .notes-template-primary {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.dark-mode .notes-template-primary:hover {
  background: #f8fafc;
  border-color: #f8fafc;
  color: #0f172a;
}

body.dark-mode .cases-filter-toggle {
  border-color: #1e3a8a;
  background-color: #0f172a;
  color: #bfdbfe;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45);
}

body.dark-mode .cases-filter-count {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

body.dark-mode .cases-filter-panel {
  background-color: #0f172a;
  border-color: #1f2937;
  border-top-color: #2563eb;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.5);
}

body.dark-mode .cases-filter-field label {
  color: #94a3b8;
}

body.dark-mode .cases-filter-input {
  background-color: #0b1220;
  border-color: #1f2937;
  color: #e2e8f0;
}

body.dark-mode .cases-filter-input::placeholder {
  color: #64748b;
}

body.dark-mode .cases-filter-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

body.dark-mode .cases-filter-actions a {
  color: #93c5fd;
}

body.dark-mode .cases-filter-actions a:hover,
body.dark-mode .cases-filter-actions a:focus-visible {
  color: #bfdbfe;
  text-decoration: underline;
}

body.dark-mode .mobile-card-select {
  color: #e2e8f0;
}
