*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --border: #c4cdd5;
  --text: #1e272e;
  --muted: #5a6b7a;
  --accent: #0063b0;
  --max-width-desktop: 1300px;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  line-height: 1.45;
}

body {
  width: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.content-container {
  max-width: unset !important;
  margin: 0 auto;
  /* padding: 1rem 1.25rem 2.5rem; */
  padding: 0 !important;

}
.content {
  width: unset !important;
  padding: 0 !important;
  margin: 0 auto;
}

.content-container .content h1 {  
  @media screen and (max-width: 48rem) {
    font-size: 2.75rem;
  }
}

.page-header {
  padding: 1.5rem 1.25rem 0.5rem;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 650;
}

.page-header__lede {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.page-header code {
  font-size: 0.92em;
}

.layout {
  
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  display: grid;
  gap: 1.25rem;
}

.myinvoice-search-form {
  width: 100%
}
/* Icon-only prev/next: center arrow in the box. Overrides `.au-btn` padding (declared later). */
.pagination .pagination-prev.au-btn,
.pagination .pagination-next.au-btn {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  width: 2.4rem;
  min-width: 2.4rem;
  max-width: 2.4rem;
  height: 2.4rem;
  max-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.pagination .au-btn--secondary:hover {
  background-color: lightgray;
  /* color: var(--accent-text) !important; */
  opacity: 0.85;
}

.pagination-prev::before,
.pagination-next::after {
  content: '';
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.15rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pagination-prev::before {
  content: '←';
}

.pagination-next::after {
  content: '→';
}

/* @media screen and (max-width: 48rem) {
  .pagination .pagination-prev__text,
  .pagination .pagination-next__text {
    display: none;
  }
} */

.pagination .pagination-prev__text,
.pagination .pagination-next__text {
  display: none;
}

button#download-csv-btn,
button#download-csv-btn-clone {
  display: none;
}

button#download-csv-btn.is-visible,
button#download-csv-btn-clone.is-visible {
  display: inline-block;

  @media screen and (max-width: 48rem) {
    width: 100%;
  }
  @media screen and (min-width: 48rem) {
    width: 200px;
  }
}

.panel {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.15rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.form-item {
  margin-bottom: 0.85rem;
}

.heading-content {
  padding: 0 2rem;
}

.au-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.required {
  color: #b00020;
  text-decoration: none;
}

.au-text-input,
.au-select {
  width: 100%;
  max-width: 100%;
  padding: 0.45rem 0.55rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: inherit;
}

.au-select {
  cursor: pointer;
}

.au-text-input:focus,
.au-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-actions {
  margin-top: 1rem;
  .au-btn {
    width: 100%;  
    @media screen and (max-width: 48rem) {
      max-width: unset;
    }
    @media screen and (min-width: 48rem) {
      max-width: 250px;
    }
  }
}

.au-btn {
  font: inherit;
  padding: 0.55rem 1.15rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 300ms;
}

.au-btn:hover {
  /* filter: brightness(1.05); */
  opacity: 0.85;
}

.au-btn:active {
  /* filter: brightness(0.95); */
  opacity: 0.85;
}

#clear-filters-btn {
  margin-top: 0.75rem;
}


#download-csv-btn {
  max-width: 350px;
}
  
.au-btn--primary {
  background: var(--secondary-color);
  color: white !important;
}

.au-btn--primary:hover {
  filter: brightness(1.05);
}

.au-btn--primary:active {
  filter: brightness(0.95);
}

.result-count {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.results-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.65rem;
  padding: 0.45rem 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.results-loading[hidden] {
  display: none;
}

.results-loading__text {
  line-height: 1.2;
}

.loading-spinner {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  border: 0.2rem solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: loading-spin 0.7s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
    border-color: var(--accent);
    opacity: 0.9;
  }
}

.table-scroll.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.results-region {
  width: 100%;
}

#load-error {
  position: static;
  margin: 0.75rem 0 0;
  padding: 1rem 1.25rem;
  text-align: center;
  color: #c0392b;
  background: #fef5f5;
  border: 1px solid #c0392b;
  border-radius: 4px;
  display: block;
}

#load-error[hidden] {
  display: none;
}

.table-scroll {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;

  @media (max-width: 56rem) {    

    th {
      display: none;
    }

    td, tr, tbody, thead {
      display: block;
    }

    tr {
      margin-bottom: 1rem;
    }

  td::before {
    content: attr(data-field-heading) ": ";
    width: auto;
    display: inline-block;
    font-weight: 600;
    margin-right: 0.5rem;
    text-align: right;
  }
}
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: unset !important;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.invoice-table th {
  background: #eef2f6;
  font-weight: 600;
  white-space: nowrap;
}

.invoice-table tbody tr:nth-child(even) {
  background: rgb(0 0 0 / 0.02);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.pagination[hidden] {
  display: none;
}

.pagination--top {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 100%;
}

.pagination__page-btn {
  /* background-color: lightgray; */
  /* color: var(--accent-text) !important; */
  min-width: 2.4rem;
  padding: 0.45rem 0.5rem;
  font-variant-numeric: tabular-nums;
}

.pagination__status {
  display: block;
  width: 100%;
  font-size: 0.92rem;
  color: var(--muted);
  min-width: 7rem;
  text-align: center;
}

.pagination .au-btn:disabled {  
  /* display: none; */
  color: var(--muted) !important;
  background-color: lightgray;
  opacity: 0.85;
  cursor: not-allowed;
}


@media (max-width: 81rem) {
  .layout {
    /* display: block; */
    max-width: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .panel {
    max-width: 100%;
    /* width: calc(100% - 2.5rem) !important; */
  }
}

@media (min-width: 81rem) {
  .layout {
    max-width: var(--max-width-desktop);
    grid-template-columns: minmax(16rem, 18rem) 1fr;
    align-items: start;
  }
  .panel {
    width: 100%;
  }
}

.required-indicator {
    color: #b81237 !important;
    font-weight: bold;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
