/* Billing app tweaks on Maxton theme */
.main-content .card {
  border-radius: 0.75rem;
}
.stat-card h3, .stat-card h4 {
  font-size: 1.35rem;
  margin-bottom: 0;
}
.bg-light-warning {
  background-color: rgba(255, 193, 7, 0.12);
}
.bg-light-danger {
  background-color: rgba(220, 53, 69, 0.1);
}
.table > :not(caption) > * > * {
  vertical-align: middle;
}
#loginMsg .alert {
  border-radius: 0.5rem;
}
.z-999 {
  z-index: 999;
}

/* Add Product modal — sectioned layout */
#addProductModal .modal-title {
  font-size: 1.4rem;
  font-weight: 600;
}
#addProductModal .modal-subtitle {
  font-size: 0.95rem;
  color: var(--bs-secondary-color);
}
#addProductModal .modal-body {
  font-size: 1rem;
  background: var(--bs-body-bg);
}
#addProductModal .product-form-section {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
#addProductModal .product-form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: rgba(var(--bs-primary-rgb), 0.06);
  border-bottom: 1px solid var(--bs-border-color);
}
#addProductModal .section-badge {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--bs-primary);
}
#addProductModal .section-title {
  font-size: 1.1rem;
  font-weight: 600;
}
#addProductModal .section-desc {
  font-size: 0.92rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
}
#addProductModal .product-form-section-body {
  padding: 1.25rem;
}
#addProductModal .form-label {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}
#addProductModal .form-control,
#addProductModal .form-select,
#addProductModal textarea.form-control,
#addProductModal .input-group-text {
  font-size: 1.02rem;
  padding: 0.62rem 0.9rem;
}
#addProductModal .input-group .form-control {
  min-height: calc(2.5rem + 2px);
}
#addProductModal .profit-preview-box {
  min-height: calc(2.5rem + 2px);
  padding: 0.62rem 0.9rem;
  border-radius: 0.375rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}
#addProductModal .profit-preview-box.is-profit {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(25, 135, 84, 0.35);
  color: #198754;
}
#addProductModal .profit-preview-box.is-loss {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.35);
  color: #dc3545;
}
#addProductModal .profit-preview-box.is-neutral {
  color: var(--bs-secondary-color);
  font-weight: 500;
}
#addProductModal .modal-footer .btn {
  font-size: 1rem;
  min-width: 7rem;
}
#addProductModal .form-control.is-invalid,
#addProductModal .form-select.is-invalid {
  border-color: var(--bs-form-invalid-border-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-danger-rgb), 0.15);
}

/* Invalid fields — all forms/modals */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--bs-form-invalid-border-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-danger-rgb), 0.15);
}

/* Lobibox toasts above Bootstrap modals */
.lobibox-notify-wrapper,
.lobibox-notify-wrapper-large {
  z-index: 20000 !important;
}

/* Global fixed site footer — centered bar at viewport bottom */
:root {
  --billing-footer-height: 42px;
}

.billing-site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8;
  height: var(--billing-footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  background-color: #ffffff;
  border-top: 1px solid var(--bs-border-color);
}

.billing-site-footer__text {
  font-size: 13px;
  color: #6c757d;
  text-align: center;
  line-height: 1.3;
}

body:not(.billing-auth-page) .billing-site-footer {
  left: 260px;
}

body.toggled:not(.billing-auth-page) .billing-site-footer {
  left: 70px;
}

@media (max-width: 1199px) {
  body:not(.billing-auth-page) .billing-site-footer {
    left: 0;
  }
}

body:not(.billing-auth-page) .main-wrapper {
  padding-bottom: var(--billing-footer-height) !important;
}

body.billing-auth-page {
  min-height: 100vh;
  padding-bottom: var(--billing-footer-height);
  background-color: #0f1535;
  background-image: url('../images/bg-themes/body-background-1.webp');
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

body.billing-auth-page .auth-shell-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-login-logo {
  max-width: 180px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}

body.billing-auth-page .btn-grd-primary {
  color: #fff !important;
  border: none;
  font-weight: 600;
}

body.billing-auth-page .btn-grd-primary:disabled {
  opacity: 0.75;
  color: #fff !important;
}

[data-bs-theme=dark] .billing-site-footer,
[data-bs-theme=semi-dark] .billing-site-footer {
  background-color: var(--bs-body-bg, #1a1a1a);
}

.billing-header-key {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111827;
  background: #e5e7eb;
  border: 1px solid #9ca3af;
  border-radius: 0.25rem;
  vertical-align: middle;
}

/* Select2 — searchable dropdowns (Accounting ledgers, etc.) */
.select-search-billing + .select2-container--bootstrap4 .select2-selection--single {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.125rem 0.5rem;
  font-size: 0.875rem;
}
.select-search-billing + .select2-container--bootstrap4 .select2-selection__rendered {
  line-height: calc(1.5em + 0.25rem);
  padding-left: 0;
}
.select2-container--bootstrap4 .select2-dropdown {
  z-index: 1060;
}
