/*
 * Taventa Admin — light / dark theme tokens
 * Sneat free ships light-only :root vars; dark mode needs explicit overrides.
 */

/* ------------------------------------------------------------------ toggle */
.theme-toggle-auth {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1050;
}

.theme-toggle {
  color: var(--bs-body-color);
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--bs-heading-color);
}

/* ------------------------------------------------------------------ dark */
[data-bs-theme="dark"] body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .content-wrapper {
  background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --bs-paper-bg: #2b2c40;
  --bs-paper-bg-rgb: 43, 44, 64;
  --bs-base-color: #b2b2c4;
  --bs-base-color-rgb: 178, 178, 196;

  /* Gray scale tuned for dark surfaces */
  --bs-gray-25: #33354a;
  --bs-gray-60: #3e3f57;
  --bs-gray-80: #474866;
  --bs-gray-100: #4e4f68;
  --bs-gray-200: #565771;

  /* Elevation */
  --bs-box-shadow: 0 0.1875rem 0.5rem 0 rgba(0, 0, 0, 0.2);
  --bs-box-shadow-xs: 0 0.0625rem 0.3175rem 0 rgba(0, 0, 0, 0.12);
  --bs-box-shadow-sm: 0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.16);
  --bs-box-shadow-lg: 0 0.25rem 0.75rem 0 rgba(0, 0, 0, 0.24);
  --bs-box-shadow-xl: 0 0.3125rem 1.375rem 0 rgba(0, 0, 0, 0.3);
  --bs-floating-component-shadow: 0 0.1875rem 0.5rem 0 rgba(0, 0, 0, 0.22);

  /* Navbar */
  --bs-navbar-bg: var(--bs-paper-bg);
  --bs-navbar-box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  --bs-navbar-border-color: var(--bs-paper-bg);
  --bs-nav-border-color: var(--bs-paper-bg);

  /* Sidebar / menu */
  --bs-menu-bg: var(--bs-paper-bg);
  --bs-menu-bg-rgb: var(--bs-paper-bg-rgb);
  --bs-menu-color: #b2b2c4;
  --bs-menu-color-rgb: 178, 178, 196;
  --bs-menu-hover-bg: #3e3f57;
  --bs-menu-hover-color: #d5d5e2;
  --bs-menu-active-toggle-bg: #3e3f57;
  --bs-menu-divider-color: #2b2c40;
  --bs-menu-box-shadow: 0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.16);
  --bs-menu-header-color: #d5d5e2;

  /* Labels & cards */
  --bs-bg-label-tint-amount: 76%;
  --bs-card-hover-box-shadow: 0 0.25rem 0.75rem 0 rgba(0, 0, 0, 0.24);

  /* Footer */
  --bs-footer-link-disabled-color: var(--bs-gray-500);
}

/* Layout shells — navbar/menu/footer use paper-bg, not body-bg */
[data-bs-theme="dark"] .layout-navbar,
[data-bs-theme="dark"] .layout-menu,
[data-bs-theme="dark"] .bg-menu-theme,
[data-bs-theme="dark"] .bg-navbar-theme,
[data-bs-theme="dark"] .bg-footer-theme,
[data-bs-theme="dark"] .footer {
  background-color: var(--bs-paper-bg);
}

[data-bs-theme="dark"] .layout-menu.menu-vertical.menu {
  background-color: var(--bs-menu-bg);
}

[data-bs-theme="dark"] .menu .menu-link,
[data-bs-theme="dark"] .menu .menu-header .menu-header-text {
  color: var(--bs-menu-color);
}

[data-bs-theme="dark"] .menu .menu-item.active > .menu-link:not(.menu-toggle),
[data-bs-theme="dark"] .menu .menu-item.open > .menu-toggle {
  color: var(--bs-menu-active-color);
}

[data-bs-theme="dark"] .menu .menu-link:hover,
[data-bs-theme="dark"] .menu .menu-link:focus {
  background-color: var(--bs-menu-hover-bg);
  color: var(--bs-menu-hover-color);
}

/* Auth (login) page */
[data-bs-theme="dark"] .authentication-wrapper {
  background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .authentication-wrapper .card {
  background-color: var(--bs-paper-bg);
}

/* Tables — keep row borders subtle in dark */
[data-bs-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .table thead th {
  color: var(--bs-heading-color);
}

/* Modals & dropdowns inherit paper surface */
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--bs-paper-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: var(--bs-menu-hover-bg);
  color: var(--bs-menu-hover-color);
}

/* Form controls on dark surfaces */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
  background-color: color-mix(in sRGB, var(--bs-base-color) 6%, var(--bs-paper-bg));
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--bs-paper-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] code {
  color: var(--bs-code-color);
}

/* Scrollbar rail (menu) */
[data-bs-theme="dark"] .ps .ps__rail-x:hover,
[data-bs-theme="dark"] .ps .ps__rail-y:hover,
[data-bs-theme="dark"] .ps .ps__rail-x:focus,
[data-bs-theme="dark"] .ps .ps__rail-y:focus,
[data-bs-theme="dark"] .ps .ps__rail-x.ps--clicking,
[data-bs-theme="dark"] .ps .ps__rail-y.ps--clicking {
  background-color: var(--bs-gray-80);
}

[data-bs-theme="dark"] .ps .ps__thumb-x,
[data-bs-theme="dark"] .ps .ps__thumb-y {
  background-color: var(--bs-gray-400);
}

[data-bs-theme="dark"] .ps .ps__rail-x:hover > .ps__thumb-x,
[data-bs-theme="dark"] .ps .ps__rail-y:hover > .ps__thumb-y,
[data-bs-theme="dark"] .ps .ps__rail-x:focus > .ps__thumb-x,
[data-bs-theme="dark"] .ps .ps__rail-y:focus > .ps__thumb-y,
[data-bs-theme="dark"] .ps .ps__rail-x.ps--clicking > .ps__thumb-x,
[data-bs-theme="dark"] .ps .ps__rail-y.ps--clicking > .ps__thumb-y {
  background-color: var(--bs-gray-300);
}
