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-bottom: 60px;
}

.badge {
  min-width: 70px; /* Adjust as needed for visual consistency */
  text-align: center; /* Ensures text is centered within the min-width */
}

.is-invalid {
  background-image: none !important;
}


.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;
}

/* Tabler Icon Alignment Fixes */
.btn-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 2.25rem;
  height: 2.25rem;
  line-height: 1 !important;
}

.btn-icon .icon {
  width: 1.25rem !important;
  height: 1.25rem !important;
  margin: 0 !important;
}

.icon {
  vertical-align: middle;
  flex-shrink: 0;
  display: inline-block;
}

.btn .icon {
  margin: 0;
}

.btn-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-list .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Navbar-vertical: right-align dropdown chevron (Tabler SCSS has this but CDN CSS omits it) */
.navbar-vertical .navbar-collapse .dropdown-toggle::after {
  margin-inline-start: auto;
}

/* Chevron rotates to point up when dropdown is open */
.navbar-vertical .nav-link.dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(135deg);
}

/* Full-height list pages: stretch card to bottom of viewport */
.page-body:has(.card-page-fill) {
  display: flex;
  flex-direction: column;
}

.page-body:has(.card-page-fill) > .container-xl {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card-page-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Prevent filter and footer from growing — only the table area should expand */
.card-page-fill > .card-body,
.card-page-fill > .card-footer {
  flex: 0 0 auto;
}

.card-page-fill > .table-responsive-fixed {
  flex: 1;
  min-height: 0;
  overflow-x: clip; /* clip instead of auto so position:sticky works */
}

/* Light/dark logo switching */
.logo-dark { display: none; }
[data-bs-theme="dark"] .logo-light { display: none; }
[data-bs-theme="dark"] .logo-dark { display: inline; }

/* Sticky table header */
.card-page-fill .table-responsive-fixed thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--tblr-card-bg, #fff);
  box-shadow: inset 0 -1px 0 var(--tblr-border-color, #e6e7e9);
}

/* Claims expense table (Claims/Create + Claims/Edit share this markup).

   The ten-column grid sits in .table-responsive, which scrolls horizontally — but
   auto-layout will compress columns indefinitely to AVOID that scroll, so widening one
   column starves another. Giving the table a min-width lets it overflow and scroll
   instead, after which auto-layout sizes every column to its own content again.

   So: content-width by default, with a floor on the amount inputs and a ceiling on the
   selects. Amount floors are in `ch` (width of "0"), which tracks the font — 10ch fits
   123,456.78 and keeps working if the type size changes. */
#detailsTable {
  min-width: 1100px;
}

#detailsTable .row-total,
#detailsTable .row-chargeable,
#detailsTable .row-non-chargeable,
#detailsTable .row-qty {
  min-width: 10ch;
}

/* Selects would otherwise grow to their longest option (names allow 256 chars) and
   crowd out everything else. */
#detailsTable .form-select-sm {
  min-width: 12ch;
  max-width: 14rem;
}

/* The up/down spinner is useless for currency and steals visible digits. */
#detailsTable input[type="number"]::-webkit-outer-spin-button,
#detailsTable input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#detailsTable input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
