.page-bills .wrap {
  max-width: 1440px;
}

.bills-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.bills-page-head h1,
.bills-page-head p,
.bills-list-head h2,
.bills-list-head p {
  margin: 0;
}

.bills-page-head h1 {
  color: #123c2a;
  font-size: 29px;
}

.bills-page-head p {
  margin-top: 5px;
  color: #64756d;
  font-size: 14px;
}

.bills-kicker {
  display: block;
  margin-bottom: 4px;
  color: #1b7a4d;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1.35px;
}

.bills-new {
  min-height: 43px;
  padding: 10px 17px;
}

.bills-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 14px;
}

.bills-stat {
  min-height: 82px;
  margin: 0;
  padding: 14px 17px;
  background: linear-gradient(135deg, #fff, #f5faf7);
}

.bills-stat small,
.bills-stat b {
  display: block;
}

.bills-stat small {
  color: #687971;
  font-size: 12px;
  font-weight: 750;
}

.bills-stat b {
  margin-top: 5px;
  color: #155f3b;
  font-size: 22px;
  line-height: 1.1;
}

.bills-stat:nth-child(2) b {
  color: #255f8d;
}

.bills-stat:nth-child(3) b {
  color: #8a6010;
}

.bills-workspace {
  padding: 0;
  overflow: hidden;
}

.bills-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) repeat(2, minmax(155px, .75fr)) auto auto;
  gap: 9px;
  align-items: end;
  padding: 17px 18px;
  border-bottom: 1px solid #e1ebe5;
  background: #fbfdfc;
}

.bills-filters p {
  min-width: 0;
  margin: 0;
}

.bills-filters label {
  margin-bottom: 5px;
  font-size: 12px;
}

.bills-filters input,
.bills-filters button,
.bills-filters .btn {
  min-height: 43px;
}

.bills-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
}

.bills-list-head h2 {
  color: #183d2d;
  font-size: 18px;
}

.bills-list-head p {
  margin-top: 4px;
  color: #6b7c73;
  font-size: 12px;
}

.bills-table-wrap {
  overflow-x: auto;
  border-top: 1px solid #e4ece7;
}

.bills-table {
  min-width: 1050px;
  margin: 0;
}

.bills-table th {
  padding: 10px 12px;
  font-size: 11px;
  white-space: nowrap;
}

.bills-table td {
  padding: 11px 12px;
  font-size: 14px;
}

.bills-sno {
  color: #6b7c73;
  font-weight: 800;
}

.bills-number {
  color: #16623d;
  font-weight: 850;
}

.bills-customer b,
.bills-customer small {
  display: block;
}

.bills-customer small {
  margin-top: 3px;
  color: #75847c;
  font-size: 12px;
}

.bills-received,
.bills-clear {
  color: #177048;
  font-weight: 750;
}

.bills-due {
  color: #b13e35;
  font-weight: 850;
}

.bills-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.bills-row-actions .btn {
  min-height: 35px;
  padding: 7px 11px;
  font-size: 12px;
  box-shadow: none;
}

.bills-empty {
  padding: 38px !important;
  color: #6d7d75;
  text-align: center;
}

.page-bills nav.bills-pagination {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  display: flex !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 14px 18px !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  overflow: visible !important;
  transform: none !important;
  border: 0 !important;
  border-top: 1px solid #e1eae5 !important;
  border-radius: 0 !important;
  background: #fbfdfc !important;
  box-shadow: none !important;
  color: inherit !important;
}

.bills-pagination > span {
  color: #607269;
  font-size: 13px;
  font-weight: 750;
}

.bills-pagination > div {
  display: flex;
  gap: 8px;
}

.page-bills nav.bills-pagination .btn {
  display: inline-flex !important;
  width: auto !important;
  min-height: 39px !important;
  margin: 0 !important;
  padding: 8px 13px !important;
  flex: none !important;
  gap: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #17794b, #0e5c38) !important;
  color: #fff !important;
  font-size: 14px !important;
  text-align: center !important;
  box-shadow: none !important;
}

.page-bills nav.bills-pagination .btn.secondary {
  background: #edf3ef !important;
  color: #34483d !important;
}

.page-bills nav.bills-pagination .btn::before {
  display: none !important;
  content: none !important;
}

@media (max-width: 1100px) {
  .bills-filters {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .bills-filters button,
  .bills-filters .btn {
    min-width: 120px;
  }
}

@media (max-width: 700px) {
  .page-bills .wrap {
    padding: 78px 12px 28px !important;
  }

  .bills-page-head {
    align-items: flex-end;
    margin-bottom: 12px;
  }

  .bills-page-head h1 {
    font-size: 26px;
  }

  .bills-page-head p,
  .bills-kicker {
    display: none;
  }

  .bills-new {
    min-height: 42px;
    padding: 9px 13px;
  }

  .bills-stats {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .bills-stat {
    min-height: 76px;
    padding: 12px 13px;
  }

  .bills-stat:nth-child(3) {
    grid-column: 1 / -1;
  }

  .bills-stat b {
    font-size: 19px;
  }

  .bills-filters {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
  }

  .bills-search {
    grid-column: 1 / -1;
  }

  .bills-filters button,
  .bills-filters .btn {
    min-width: 0;
  }

  .bills-list-head {
    padding: 15px 14px 11px;
  }

  .bills-list-head {
    padding: 13px 12px 9px;
  }

  .bills-list-head h2 {
    font-size: 18px;
  }

  .bills-list-head p {
    margin-top: 3px;
    font-size: 11px;
  }

  .bills-table-wrap {
    overflow: visible;
    padding: 0 10px 12px;
    border-top: 0;
  }

  .bills-table,
  .bills-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .bills-table thead {
    display: none;
  }

  .bills-table tbody {
    display: grid;
    gap: 9px;
  }

  .bills-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "bill bill date"
      "customer customer customer"
      "total received balance"
      "actions actions actions";
    gap: 9px 8px;
    padding: 12px;
    border: 1px solid #dce8e1;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 65, 42, .045);
  }

  .bills-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left !important;
    white-space: normal;
  }

  .bills-table td::before {
    display: none;
  }

  .bills-table td:nth-child(1) {
    display: none;
  }

  .bills-table td:nth-child(2) {
    grid-area: bill;
    align-self: center;
  }

  .bills-table td:nth-child(2)::before {
    content: "Bill No.";
    display: block;
    margin-bottom: 2px;
    color: #7b8982;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
  }

  .bills-number {
    font-size: 15px;
  }

  .bills-table td:nth-child(3) {
    grid-area: date;
    align-self: center;
    color: #53675d;
    font-size: 11px;
    text-align: right !important;
    white-space: nowrap;
  }

  .bills-table td:nth-child(3)::before {
    content: "Date";
    display: block;
    margin-bottom: 2px;
    color: #7b8982;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
  }

  .bills-table td:nth-child(4) {
    grid-area: customer;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2ef;
  }

  .bills-customer b {
    color: #243a2f;
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .bills-customer small {
    margin-top: 2px;
    color: #7b8982;
    font-size: 10px;
  }

  .bills-table td:nth-child(5),
  .bills-table td:nth-child(6),
  .bills-table td:nth-child(7) {
    min-width: 0;
    padding: 7px 6px;
    border-radius: 8px;
    background: #f7faf8;
    font-size: 11px;
    font-weight: 800;
    text-align: left !important;
    overflow-wrap: anywhere;
  }

  .bills-table td:nth-child(5) { grid-area: total; }
  .bills-table td:nth-child(6) { grid-area: received; }
  .bills-table td:nth-child(7) { grid-area: balance; }

  .bills-table td:nth-child(5)::before,
  .bills-table td:nth-child(6)::before,
  .bills-table td:nth-child(7)::before {
    display: block;
    margin-bottom: 3px;
    color: #78877f;
    font-size: 7.5px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .bills-table td:nth-child(5)::before { content: "Total"; }
  .bills-table td:nth-child(6)::before { content: "Received"; }
  .bills-table td:nth-child(7)::before { content: "Balance"; }

  .bills-table td:nth-child(8) {
    grid-area: actions;
    padding-top: 1px;
  }

  .bills-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
  }

  .bills-row-actions .btn {
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 10px;
    text-align: center;
  }

  .bills-table td[colspan] {
    display: block;
    grid-column: 1 / -1;
  }

  .bills-empty {
    padding: 20px 8px !important;
    font-size: 11px;
  }

  .page-bills nav.bills-pagination {
    align-items: center !important;
    flex-direction: row !important;
    padding: 11px 12px !important;
  }

  .page-bills nav.bills-pagination > span {
    flex: 0 0 auto;
    font-size: 10px !important;
  }

  .page-bills nav.bills-pagination > div {
    display: flex !important;
    width: auto !important;
    margin-left: auto;
    gap: 6px;
  }

  .page-bills nav.bills-pagination .btn {
    width: auto !important;
    min-height: 32px !important;
    padding: 6px 9px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
  }
}

@media print {
  .page-bills .bills-page-head,
  .page-bills .bills-stats,
  .page-bills .bills-workspace {
    display: none !important;
  }
}

/* Photo to Bill entry: navy ink with a jute scan chip, so it reads as a different action from the green New Bill. */
.bills-page-head {
  flex-wrap: wrap;
}

.bills-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bills-page-head .bills-photo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  padding: 7px 16px 7px 8px;
  border: 1px solid #2c3f66;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d2e50, #16233f);
  box-shadow: 0 8px 18px rgba(22, 35, 63, .22), inset 0 -3px 0 #c9a767;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}

.bills-page-head .bills-photo:hover {
  background: linear-gradient(135deg, #263a63, #1b2b4b);
  box-shadow: 0 11px 22px rgba(22, 35, 63, .28), inset 0 -3px 0 #d8b97c;
  color: #fff;
  transform: translateY(-1px);
}

.bills-page-head .bills-photo:focus-visible {
  outline: 3px solid #c9a767;
  outline-offset: 3px;
}

.bills-photo-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #c9a767;
  color: #16233f;
}

@media (max-width: 700px) {
  .bills-head-actions {
    gap: 8px;
  }

  .bills-page-head .bills-photo {
    min-height: 42px;
    padding: 6px 11px 6px 6px;
    gap: 7px;
    font-size: 13px;
  }

  .bills-photo-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bills-page-head .bills-photo {
    transition: none;
  }

  .bills-page-head .bills-photo:hover {
    transform: none;
  }
}
