/* Full width inside 75vw interior layout (body.bar-interior-wide from BAR_RR_Layout) */
body.bar-rr-form-page .bar-rr-form-wrap,
.bar-rr-form-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 2rem;
  box-sizing: border-box;
}

body.bar-rr-form-page .entry-content > .bar-rr-form-wrap {
  max-width: 100% !important;
}

.bar-rr-form-intro {
  margin-bottom: 1.5rem;
}

.bar-rr-form-notes {
  margin: 0.5rem 0 0 1.25rem;
}

.bar-rr-fieldset {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem 1.25rem;
  background: #fff;
  overflow: visible;
}

.bar-rr-fieldset legend {
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  padding: 0 0.35rem;
}

.bar-rr-grid {
  display: grid;
  gap: 1rem;
}

.bar-rr-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bar-rr-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bar-rr-field span em {
  color: #c0392b;
  font-style: normal;
}

.bar-rr-field input,
.bar-rr-field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.bar-rr-help {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  opacity: 0.85;
}

.bar-rr-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.bar-rr-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.bar-rr-table th,
.bar-rr-table td {
  border-bottom: 1px solid #e6e6e6;
  padding: 0.55rem 0.45rem;
  vertical-align: middle;
  overflow: visible;
}

.bar-rr-table th {
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 700;
  white-space: normal;
}

/* Desktop column widths — keep selects and menus fully visible */
.bar-rr-table .bar-rr-col-date {
  width: 21%;
}

.bar-rr-table .bar-rr-col-name {
  width: 34%;
}

.bar-rr-table .bar-rr-col-type {
  width: 13%;
}

.bar-rr-table .bar-rr-col-result {
  width: 10%;
}

.bar-rr-table .bar-rr-col-amount {
  width: 12%;
}

.bar-rr-table .bar-rr-col-remove {
  width: 4%;
  text-align: center;
}

.bar-rr-table input,
.bar-rr-table select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.5rem 0.45rem;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.bar-rr-table select {
  appearance: auto;
  padding-right: 1.5rem;
}

.bar-rr-total-label {
  text-align: right;
}

.bar-rr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 2px solid transparent;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

.bar-rr-btn-primary {
  background: var(--go--color--primary, #f26522);
  color: #fff;
  border-color: var(--go--color--primary, #f26522);
}

.bar-rr-btn-primary:hover,
.bar-rr-btn-primary:focus {
  filter: brightness(0.95);
}

.bar-rr-btn-secondary {
  background: #fff;
  color: #0033b5;
  border-color: #0033b5;
}

.bar-rr-btn-remove {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.35rem;
  cursor: pointer;
  min-width: 2rem;
  min-height: 2rem;
}

.bar-rr-btn-remove:hover,
.bar-rr-btn-remove:focus {
  color: #c0392b;
}

.bar-rr-actions {
  margin-top: 0.5rem;
}

.bar-rr-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 6px;
}

.bar-rr-status.is-success {
  background: #edf7ed;
  border: 1px solid #b7dfb9;
  color: #1e4620;
}

.bar-rr-status.is-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #611a15;
}

.bar-rr-file-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

/* Card layout for line items on smaller screens */
@media (max-width: 899px) {
  .bar-rr-grid-2 {
    grid-template-columns: 1fr;
  }

  .bar-rr-table-wrap {
    overflow-x: visible;
  }

  .bar-rr-table,
  .bar-rr-table tbody,
  .bar-rr-table tfoot {
    display: block;
    width: 100%;
  }

  .bar-rr-table thead {
    display: none;
  }

  .bar-rr-table tbody tr {
    display: block;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.85rem;
    background: #fafafa;
  }

  .bar-rr-table tbody td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) 1fr;
    gap: 0.5rem;
    align-items: center;
    border: none;
    padding: 0.4rem 0;
  }

  .bar-rr-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.25;
    color: #333;
  }

  .bar-rr-table td.bar-rr-cell-remove {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
  }

  .bar-rr-table td.bar-rr-cell-remove::before {
    display: none;
  }

  .bar-rr-table tfoot tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #d9d9d9;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
  }

  .bar-rr-table tfoot td {
    display: block;
    border: none;
    padding: 0;
  }

  .bar-rr-total-label {
    text-align: left;
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .bar-rr-table th {
    font-size: 0.78rem;
  }

  .bar-rr-table input,
  .bar-rr-table select {
    font-size: 0.9rem;
    padding: 0.45rem 0.35rem;
  }
}
