:root {
  --mobiler-lime: #c5f36b;
  --mobiler-ink: #11110f;
  --background: #f5f5f2;
  --foreground: var(--mobiler-ink);
  --admin-black: var(--mobiler-ink);
  --admin-gray-50: var(--background);
  --admin-gray-100: #eeeee9;
  --admin-gray-200: #deded8;
  --admin-gray-300: #bdbdb4;
  --admin-gray-500: #70706b;
  --admin-gray-700: #41413b;
  --admin-gray-900: var(--foreground);
  --admin-border: #deded8;
  --admin-link: #253b56;
  --theme-toggle-border: var(--admin-border);
  --theme-toggle-hover: var(--admin-gray-100);
  --theme-focus: #536e24;
}
mobiler-theme-toggle { display: inline-flex; flex: none; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 600 23px/1 system-ui, sans-serif;
}
.theme-toggle:hover { background: var(--theme-toggle-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 3px; }

.admin-sidebar-theme {
  --theme-toggle-border: #3d4338;
  --theme-toggle-hover: #30372b;
  --theme-focus: var(--mobiler-lime);
  align-self: flex-start;
  margin: auto 0 10px;
}
.admin-sidebar.is-collapsed .admin-sidebar-theme { align-self: center; }
.admin-sidebar .admin-nav { min-height: 0; overflow-y: auto; }
.admin-sidebar .admin-logout { flex: none; margin-top: 0; }
.admin-mobile-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) {
  .admin-sidebar-theme { display: none; }
  .admin-sidebar .admin-logout { margin-top: auto; }
  .admin-mobile-header { gap: 8px; }
}

.admin-login { background: var(--admin-gray-50); color: var(--admin-gray-900); padding-block: 24px; }
.admin-login-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.admin-login-card, .admin-login-input { background: var(--admin-white); border-color: var(--admin-border); }
.admin-login-input:focus-visible, .admin-login-submit:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }
.admin-login-muted { color: var(--admin-gray-500); }
.admin-login-error { background: var(--admin-gray-100); border-color: var(--admin-border); }
.admin-login-submit,
.admin-page-content :is(button, a).bg-black.text-white {
  background: var(--mobiler-lime);
  color: var(--mobiler-ink);
}
.admin-login-submit:hover:not(:disabled),
.admin-page-content :is(button, a).bg-black.text-white:hover:not(:disabled) { background: #b7e75d; }
.admin-page-content :is(button, a).bg-black.text-white { border-color: #829b52; }

.admin-sidebar { border-right-color: #3d4338; }
.admin-sidebar .admin-brand-mark {
  background: var(--mobiler-lime);
  border-color: var(--mobiler-lime);
  color: var(--mobiler-ink);
}
.admin-sidebar :is(.admin-nav-label, .admin-brand small) { color: #bec3b6; }
.admin-sidebar :is(.admin-nav-link, .admin-nav-icon) { color: #d3d8cb; }
.admin-sidebar :is(.admin-sidebar-toggle, .admin-logout, .admin-nav-reorder-done) {
  background: #22251e;
  border-color: #3d4338;
  color: #f1f3ea;
}
.admin-sidebar :is(.admin-sidebar-toggle, .admin-logout, .admin-nav-reorder-done, .admin-nav-link):hover {
  background: #30372b;
  color: #f1f3ea;
}
.admin-sidebar .admin-nav-link.is-active {
  background: #2a3621;
  border-color: #52623a;
  color: var(--mobiler-lime);
}
.admin-sidebar .admin-nav-link.is-active .admin-nav-icon { color: var(--mobiler-lime); }
.admin-sidebar :is(a, button):focus-visible,
.admin-page-content :is(a, button, input, select, textarea):focus-visible { outline-color: var(--theme-focus); }
.admin-page-content a.underline:not(.bg-black) { color: var(--admin-link); }
.admin-page-content {
  --color-white: var(--admin-white);
  --color-black: var(--mobiler-ink);
  --color-gray-50: var(--admin-gray-50);
  --color-gray-100: var(--admin-gray-100);
  --color-gray-200: var(--admin-gray-200);
  --color-gray-300: var(--admin-gray-300);
  --color-gray-500: var(--admin-gray-500);
  --color-gray-600: #575751;
  --color-gray-700: var(--admin-gray-700);
  --color-gray-900: var(--admin-gray-900);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #141612;
  --foreground: #f1f3ea;
  --admin-black: #1d211a;
  --admin-gray-50: var(--background);
  --admin-gray-100: #293125;
  --admin-gray-200: #3d4338;
  --admin-gray-300: #697266;
  --admin-gray-500: #bec3b6;
  --admin-gray-700: #d3d8cb;
  --admin-gray-900: var(--foreground);
  --admin-border: #3d4338;
  --admin-link: #b6c8df;
  --admin-shadow: 0 8px 24px rgb(0 0 0 / 16%);
  --theme-focus: var(--mobiler-lime);
}
[data-theme="dark"] .admin-login { --admin-white: #22251e; }
[data-theme="dark"] .admin-page-content {
  /* Tailwind neutral utilities are shared across operations pages. */
  --color-white: #22251e;
  --color-black: var(--foreground);
  --color-gray-50: var(--admin-gray-50);
  --color-gray-100: var(--admin-gray-100);
  --color-gray-200: var(--admin-gray-200);
  --color-gray-300: var(--admin-gray-300);
  --color-gray-400: #969e90;
  --color-gray-500: var(--admin-gray-500);
  --color-gray-600: #c9cebf;
  --color-gray-700: var(--admin-gray-700);
  --color-gray-800: #e0e5d9;
  --color-gray-900: var(--admin-gray-900);
  --color-gray-950: #f7f8f2;
  --color-green-50: #162e25;
  --color-green-900: #a6ecc8;
  --color-red-50: #382326;
  --color-red-800: #ffadb6;
  --color-red-900: #ffd0d4;
}
[data-theme="dark"] .admin-page-content :is(.bg-black\/35, .bg-black\/50, .bg-black\/60, .bg-black\/70) {
  background-color: rgb(0 0 0 / 65%);
}
[data-theme="dark"] .admin-page-content .bg-green-600.text-white { color: #fff; background-color: #16724d; }
[data-theme="dark"] .admin-mobile-header { background: #1d211a; }
[data-theme="dark"] :is(.admin-menu-button, .admin-mobile-logout) { background: #22251e; }
[data-theme="dark"] .admin-shell .leaflet-tile { filter: grayscale(1) invert(.88); }
[data-theme="dark"] .admin-shell .leaflet-container { background: #22251e; }
[data-theme="dark"] .admin-shell :is(.leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-bar a, .leaflet-control-attribution) {
  background: #22251e;
  color: var(--admin-gray-900);
}
[data-theme="dark"] .admin-shell .leaflet-control-attribution a { color: var(--admin-link); }
