html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ——— App shell (sidebar layout) ——— */

.app-topbar {
  flex-shrink: 0;
  z-index: 1030;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.app-sidebar {
  flex-shrink: 0;
  width: 16.5rem;
  max-width: 88vw;
  border-right: 1px solid var(--bs-border-color);
  background-color: var(--bs-tertiary-bg);
  overflow-y: auto;
  transition: transform 0.2s ease;
}

.app-sidebar .nav-link {
  border-radius: 0.375rem;
  color: var(--bs-body-color);
  padding: 0.45rem 0.65rem;
}

.app-sidebar .nav-link:hover {
  background-color: rgba(var(--bs-emphasis-color-rgb), 0.06);
}

.app-sidebar .nav-link.active {
  background-color: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
  font-weight: 600;
}

.app-sidebar .submenu-link {
  padding: 0.35rem 0.65rem 0.35rem 1.5rem;
  font-size: 0.92rem;
}

.sidebar-submenu-toggle {
  font-weight: 600;
  border: none;
  background: transparent;
  box-shadow: none !important;
}

.sidebar-submenu-toggle .submenu-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.65rem;
  opacity: 0.7;
}

.sidebar-submenu-toggle[aria-expanded="true"] .submenu-chevron {
  transform: rotate(180deg);
}

.sidebar-nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color);
  padding: 0.5rem 0.65rem 0.25rem;
  margin-top: 0.35rem;
}

.sidebar-nested-toggle {
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  background: transparent;
  box-shadow: none !important;
  padding: 0.35rem 0.65rem;
  width: 100%;
  text-align: start;
  color: var(--bs-body-color);
  border-radius: 0.375rem;
}

.sidebar-nested-toggle:hover {
  background-color: rgba(var(--bs-emphasis-color-rgb), 0.06);
}

.sidebar-nested-toggle .submenu-chevron {
  display: inline-block;
  font-size: 0.6rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.sidebar-nested-toggle[aria-expanded="true"] .submenu-chevron {
  transform: rotate(180deg);
}

.sidebar-nested-link {
  padding: 0.3rem 0.65rem 0.3rem 1.75rem !important;
  font-size: 0.875rem;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bs-body-bg);
}

.app-main-inner {
  flex: 1;
  padding: 1.25rem 1.5rem;
}

.app-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--bs-border-color);
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1025;
}

.app-sidebar-backdrop.show {
  display: block;
}

@media (max-width: 767.98px) {
  .app-sidebar {
    position: fixed;
    top: 3.25rem;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transform: translateX(-100%);
    padding-top: 1rem;
    box-shadow: 0.25rem 0 1rem rgba(0, 0, 0, 0.08);
  }

  .app-sidebar.show {
    transform: translateX(0);
  }

  .app-topbar {
    z-index: 1050;
  }
}

/* ——— Standalone login layouts (no app shell) ——— */

.login-body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bs-body-bg);
}

.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(var(--bs-primary-rgb), 0.12), transparent 55%),
    linear-gradient(180deg, var(--bs-tertiary-bg) 0%, var(--bs-body-bg) 45%);
}

.login-backdrop-minimal {
  background: var(--bs-tertiary-bg);
}

.login-main {
  position: relative;
}

.login-card {
  border-radius: 0.75rem;
}

.login-split-brand {
  min-height: 100vh;
}

/* ——— Full-viewport home layout (no app sidebar) ——— */

.layout-home {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.layout-home .home-topbar {
  flex-shrink: 0;
  z-index: 1030;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
}

.layout-home .home-main {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layout-home .home-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
}
