/* ═══════════════════════════════════════════════════════
   App – essential global styles (v2)
   Legacy layout/table/navbar/footer rules removed.
   All visual styling now in design-system/ and components-v2.css
   ═══════════════════════════════════════════════════════ */

/* ── Focus reset ── */
textarea:hover,
input:hover,
textarea:active,
input:active,
textarea:focus,
input:focus,
button:focus,
button:active,
button:hover,
label:focus,
.btn:active,
.btn.active,
.btn:focus {
  outline: 0px !important;
  -webkit-appearance: none;
  box-shadow: none !important;
}

/* ── Form validation error ── */
.error {
  border-color: var(--color-danger);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");
  background-repeat: no-repeat;
  background-position: center right calc(0.375em + 0.1875rem);
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

select.error {
  background-image: none !important;
}

label.error {
  color: var(--color-danger) !important;
  background-image: none !important;
}

/* ── Ajax loading overlay ── */
#loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  background: rgba(0, 0, 0, 0.25);
  align-items: center;
  justify-content: center;
}
#loading.is-active {
  display: flex;
}
.ajax-loader {
  color: var(--color-white);
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* ── Repeatable fields ── */
.repeatable .table > :not(:first-child) {
  border-top: 0px !important;
}

.repeatable td > div {
  margin-bottom: 0px !important;
}

.repeatable .table > :not(caption) > * > * {
  border-right-width: 1px;
}

.repeatable td {
  padding-bottom: 0px !important;
}

.repeatable td div {
  margin-bottom: 3px !important;
}

/* ── Page title ── */
.page-title {
  font-weight: 700;
  color: var(--color-text-primary);
}

.page-title i {
  color: var(--color-primary);
}

/* ── Report view rows ── */
.report-view .group-header td {
  background: var(--color-bg-subtle);
  color: var(--color-text-primary);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  border: none;
  border-bottom: 1px solid var(--color-border-default);
}

.report-view .group-header td i {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-right: 0.35rem;
}

.report-view .subtotal-row td {
  background: var(--color-bg-subtle);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border-default);
}

.report-view .subtotal-family td {
  background: var(--color-bg-subtle);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--color-border-default);
}

.report-view .total-row td {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
  border: none;
}

.report-view .total-secondary td {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
  border: none;
}

.report-view .no-results td {
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  border: none;
}

/* ── Filter bar: bottom-align action buttons column ── */
.d-flex.justify-content-between:has(.filters-container) > .text-end {
  align-self: flex-end;
}

/* ── Utility ── */
.bg-black {
  background-color: var(--color-black);
}

.loading {
  position: absolute;
  top: 50%;
  left: 40%;
}

#tour {
  cursor: pointer;
}

#itemsList .icon {
  margin-left: 0;
}

#itemsList .pagination {
  margin-top: 30px;
}
