/* Sthapana additions to Tabler. Our templates never use style="" (CSP style-src 'self', seed-D99). */

/* Theme switch: mark the current choice (set on <html> by theme.js) */
html[data-sthapana-theme-choice="light"] [data-sthapana-theme="light"],
html[data-sthapana-theme-choice="dark"] [data-sthapana-theme="dark"],
html[data-sthapana-theme-choice="auto"] [data-sthapana-theme="auto"] {
  font-weight: var(--tblr-font-weight-bold);
  color: var(--tblr-primary);
}

/* Django form errors (allauth pages) */
.errorlist {
  list-style: none;
  padding-left: 0;
  margin: 0.25rem 0 0;
  color: var(--tblr-danger);
  font-size: 0.875em;
}

/* 2FA QR code: centred, readable on dark backgrounds too */
.sthapana-qr {
  display: block;
  margin: 0 auto 1rem;
  max-width: 220px;
  background: #fff;
  padding: 0.5rem;
  border-radius: var(--tblr-border-radius);
}

/* Recovery codes / secrets: keep long values inside the card */
.card textarea,
.card input[readonly],
.card input[disabled] {
  word-break: break-all;
}

/* Brand: PWA icon + "Sthapana" (sidebar head on lg+, top row below lg - seed-D117) */
.sthapana-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.sthapana-brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--tblr-border-radius);
}

/* Phone bottom navigation (below md, seed-D117): fixed, above the iPhone home bar */
.sthapana-bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.25rem 0.5rem calc(0.25rem + env(safe-area-inset-bottom));
  background: var(--tblr-bg-surface);
  border-top: var(--tblr-border-width) solid var(--tblr-border-color);
}
.sthapana-bottom-link {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-height: 2.75rem;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--tblr-secondary);
  text-decoration: none;
}
.sthapana-bottom-link.active {
  color: var(--tblr-primary);
  font-weight: var(--tblr-font-weight-medium);
}
.sthapana-bottom-icon {
  position: relative;
  display: inline-flex;
}
.sthapana-bottom-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.75rem;
  font-size: 0.625rem;
}
.sthapana-bottom-primary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 0.5rem;
  border-radius: 50%;
  background: var(--tblr-primary);
  color: #fff;
  box-shadow: var(--tblr-box-shadow);
}
.sthapana-bottom-primary:hover,
.sthapana-bottom-primary:focus-visible {
  color: #fff;
  background: var(--tblr-primary-darken, var(--tblr-primary));
}
.sthapana-bottom-primary .icon {
  width: 1.5rem;
  height: 1.5rem;
}
@media (max-width: 767.98px) {
  /* Room for the bottom navigation, so nothing is hidden behind it */
  .sthapana-shell .page-wrapper {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
}

/* Breadcrumbs above the page title */
.page-header .breadcrumb {
  margin-bottom: 0.25rem;
}
.page-pretitle:empty {
  display: none;
}

/* Sidebar badge: keep it right-aligned in the menu */
.navbar-vertical .nav-link .badge {
  margin-left: auto;
}

/* Notification bell (C8, seed-D126): the count sits on the bell's top right corner */
.sthapana-bell {
  position: relative;
}
.sthapana-bell-badge {
  position: absolute;
  top: -0.125rem;
  right: -0.625rem;
  font-size: 0.625rem;
}
.sthapana-notification.is-unread .sthapana-notification-title {
  font-weight: var(--tblr-font-weight-bold);
}
.sthapana-notification-title,
.sthapana-notification-body {
  overflow-wrap: anywhere;
  white-space: normal;
}
.sthapana-notification .badge:empty {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border-radius: 50%;
  vertical-align: middle;
}
