.premium-brand {
  gap: 10px;
  padding-left: 2px
}

.premium-brand>img {
  width: 55px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff
}

.premium-brand>div {
  font-size: 15px
}

.welcome-brand img {
  width: 230px;
  max-width: 100%;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px #06265a44
}

.panel {
  transition: transform .2s, box-shadow .2s
}

.panel:hover {
  box-shadow: 0 12px 32px rgba(27, 46, 94, .09)
}

.stats article {
  position: relative;
  overflow: hidden
}

.stats article:after {
  content: "";
  position: absolute;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--blue2);
  right: -20px;
  top: -20px
}

.primary {
  box-shadow: 0 7px 17px #1769e02b
}

.sidebar {
  box-shadow: 8px 0 30px rgba(23, 50, 90, .035)
}

@media(max-width:900px) {
  .premium-brand>img {
    width: 48px
  }

  .premium-brand>div {
    display: none
  }
}

@media(max-width:580px) {
  .premium-brand {
    display: none
  }
}

/* Keep every navigation option accessible on laptop screens with limited height. */
.sidebar {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d8ee transparent
}

@media (max-height:850px) and (min-width:581px) {
  .sidebar {
    padding-top: 14px;
    padding-bottom: 14px
  }

  .brand {
    padding-bottom: 12px
  }

  .sidebar nav {
    gap: 2px
  }

  .nav {
    padding: 8px 14px
  }

  .sidebar-note {
    display: none
  }
}

.accounting-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px
}

.account-tab.active {
  background: #1769e0;
  color: #fff
}

.account-type-row td {
  background: #e9f1fc;
  font-weight: 700
}

.amount-positive {
  color: #087f5b
}

.amount-negative {
  color: #c92a2a
}

.accounting-tabs+.panel {
  overflow: hidden
}

#accounting-content {
  overflow: auto;
  max-height: 58vh
}

#accounting-content table {
  min-width: 760px
}

.item-head,
.item-row {
  grid-template-columns: 1.8fr .55fr 1fr .6fr 1fr 32px
}

.item-head.nr-layout,
.item-row.nr-layout {
  grid-template-columns: 1.8fr .55fr 1fr 1fr .6fr 1fr 32px
}

.expense-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.expense-preview {
  display: none;
  background: #f2f7ff;
  border: 1px solid #d8e7fb;
  border-radius: 10px;
  padding: 12px;
  margin: 6px 0 12px
}

.expense-preview.show {
  display: block
}

.expense-preview h3 {
  margin: 0 0 9px;
  color: #174f9b
}

.expense-preview p {
  display: flex;
  justify-content: space-between;
  margin: 6px 0
}

.expense-preview .expense-preview-total {
  border-top: 1px solid #c9d9ee;
  padding-top: 8px;
  font-size: 17px
}

.invoice-form-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.hr-live-breakdown {
  display: block !important;
  background: #f2f7ff;
  border: 1px solid #d8e7fb;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 4px
}

.hr-live-breakdown:empty {
  display: none !important
}

.hr-live-breakdown h4 {
  margin: 0 0 8px;
  color: #174f9b
}

.hr-live-breakdown p {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
  font-size: 12px
}

.invoice-preview-dialog {
  width: min(1050px, 94vw);
  max-width: 1050px
}

.invoice-preview-sheet {
  background: #fff;
  border: 1px solid #dfe6ef;
  padding: 24px
}

.preview-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid #00a94f;
  padding-bottom: 12px
}

.preview-top img {
  width: 160px
}

.preview-meta {
  text-align: right
}

.preview-customer {
  background: #00a94f;
  color: white;
  padding: 8px;
  margin-top: 15px
}

.invoice-preview-sheet table {
  font-size: 12px;
  margin: 0 0 14px
}

.invoice-preview-sheet th,
.invoice-preview-sheet td {
  border: 1px solid #53606f;
  padding: 7px;
  text-align: center
}

.invoice-preview-sheet th {
  background: #f1f5f9;
  color: #172033
}

.preview-total {
  text-align: right;
  font-size: 17px;
  font-weight: 700
}

@media(max-width:700px) {
  .invoice-form-actions {
    grid-template-columns: 1fr
  }

  .hr-live-breakdown {
    font-size: 11px
  }
}

/* Business suite modules */
.module-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between
}

.module-toggle span {
  font-size: 16px;
  transition: transform .2s ease
}

.module-toggle.expanded span {
  transform: rotate(180deg)
}

.module-submenu {
  display: none;
  margin: -2px 10px 6px 18px;
  border-left: 2px solid #dbe8fb;
  padding-left: 7px
}

.module-submenu.open {
  display: block
}

.module-submenu .subnav {
  font-size: 12px;
  padding: 9px 12px;
  background: transparent
}

.catalog-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0
}

.catalog-tabs .active {
  background: #e5efff;
  color: #1462cf;
  border-color: #b8d2fc
}

.table-search-row,
.contact-search {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 14px 0
}

.table-search-row .search {
  margin-left: auto;
  max-width: 340px
}

.contact-search {
  padding: 16px;
  border: 1px solid #e2e8f2;
  border-radius: 12px;
  background: #f8fbff
}

.contact-search label {
  flex: 1
}

.contact-search input,
.contact-search select {
  margin-top: 6px
}

.bank-list {
  display: grid;
  gap: 16px;
  margin-top: 16px
}

.bank-card,
.primary-business-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  border: 1px solid #dfe7f2;
  border-radius: 15px;
  background: linear-gradient(135deg, #fbfdff, #f4f8ff)
}

.bank-card h3,
.primary-business-card h3 {
  margin: 5px 0 12px
}

.bank-card p,
.primary-business-card p {
  line-height: 1.8;
  margin: 0
}

.bank-actions {
  display: grid;
  gap: 8px;
  min-width: 210px
}

.danger-button {
  border: 0;
  border-radius: 9px;
  background: #fff0f0;
  color: #c93636;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer
}

.danger-button:hover {
  background: #ffe1e1
}

.settings {
  max-width: 1050px
}

.settings-block {
  padding: 18px 0;
  border-top: 1px solid #e4eaf2
}

.settings-block:first-of-type {
  border-top: 0
}

.settings-block h3 {
  margin: 0 0 14px
}

.settings-switches {
  display: grid;
  gap: 12px
}

.settings-switches label {
  display: flex;
  align-items: center;
  gap: 9px
}

.settings-switches input {
  width: auto;
  margin: 0
}

.empty-state {
  padding: 28px;
  text-align: center;
  border: 1px dashed #cad6e7;
  border-radius: 12px;
  background: #fbfdff
}

@media(max-width:800px) {

  .bank-card,
  .primary-business-card {
    align-items: stretch;
    flex-direction: column
  }

  .bank-actions {
    width: 100%;
    min-width: 0
  }

  .contact-search,
  .table-search-row {
    align-items: stretch;
    flex-direction: column
  }

  .table-search-row .search {
    margin-left: 0;
    max-width: none
  }
}

/* Finance and billing screens */
.module-top-tabs,
.billing-tabs,
.fbr-tabs>div,
.catalog-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #edf1f5;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  padding: 7px;
  margin-bottom: 14px
}

.module-top-tabs button,
.billing-tabs button,
.fbr-tabs button,
.catalog-tabs button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #34455d;
  font-weight: 700;
  padding: 10px 15px;
  cursor: pointer
}

.module-top-tabs button:hover,
.billing-tabs button:hover,
.fbr-tabs button:hover,
.catalog-tabs button:hover,
.module-top-tabs .active,
.billing-tabs .active,
.fbr-tabs .active,
.catalog-tabs .active {
  background: #fff;
  color: #075faf;
  box-shadow: 0 2px 8px #20364d18
}

.search-panel h2 {
  margin-top: 0
}

.search-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(145px, 1fr)) auto;
  gap: 12px;
  align-items: end
}

.search-grid label {
  font-size: 12px;
  color: #52647c
}

.search-grid input,
.search-grid select {
  margin-top: 6px
}

.search-grid button {
  height: 43px
}

.table-summary {
  text-align: right;
  font-size: 13px;
  margin: 0 0 9px
}

.table-scroll {
  overflow: auto
}

.table-scroll table {
  min-width: 850px
}

.table-scroll th {
  white-space: nowrap
}

.table-scroll td {
  vertical-align: middle
}

.table-pager {
  text-align: right;
  padding: 12px;
  color: #6e7b8f;
  font-size: 12px;
  border-top: 1px solid #e5eaf1
}

.empty-cell {
  text-align: center !important;
  color: #7b8797;
  padding: 32px !important
}

.table-action {
  border: 0;
  background: #edf4ff;
  color: #145fbd;
  border-radius: 6px;
  padding: 7px 10px;
  font-weight: 700;
  cursor: pointer
}

.bill-item-grid {
  display: grid;
  grid-template-columns: 2fr .7fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px
}

.form-footer-actions,
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px
}

.fields.three {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.product-dialog {
  width: min(1000px, 94vw)
}

.product-dialog form {
  max-width: none
}

.product-dialog h3 {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-top: 22px
}

.product-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px
}

.product-options>label:last-child {
  grid-column: 1/-1
}

.product-options input[type=checkbox] {
  width: auto;
  margin-right: 7px
}

@media(max-width:1000px) {
  .search-grid {
    grid-template-columns: 1fr 1fr
  }

  .fields.three {
    grid-template-columns: 1fr 1fr
  }

  .bill-item-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:650px) {

  .search-grid,
  .fields.three,
  .bill-item-grid,
  .product-options {
    grid-template-columns: 1fr
  }

  .product-options>label:last-child {
    grid-column: auto
  }

  .module-top-tabs,
  .billing-tabs,
  .catalog-tabs {
    overflow-x: auto;
    flex-wrap: nowrap
  }

  .module-top-tabs button,
  .billing-tabs button,
  .catalog-tabs button {
    white-space: nowrap
  }
}

/* New bill screen */
.bill-form-panel {
  padding: 14px 18px 20px
}

.bill-form-panel>h2 {
  margin: 0 0 16px
}

.bill-header-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 58px;
  max-width: 980px;
  background: #f6f7f9;
  border-radius: 10px;
  padding: 16px
}

.bill-header-card>div {
  display: grid;
  gap: 10px
}

.bill-header-card label {
  font-size: 12px;
  color: #4f6077
}

.bill-header-card input,
.bill-header-card select {
  margin-top: 5px;
  height: 39px
}

.bill-add-contact {
  margin-top: -10px;
  border: 1px solid #dce2e9;
  background: #fff;
  color: #33445b;
  border-radius: 0 0 7px 7px;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer
}

.bill-items-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #cfd6df;
  margin-top: 8px;
  padding-top: 10px
}

.bill-items-heading h2 {
  margin: 0
}

.bill-items-heading label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px
}

.bill-items-heading input {
  width: auto
}

.bill-table-wrap {
  overflow: auto;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px
}

.bill-items-table {
  min-width: 970px;
  margin: 0
}

.bill-items-table th,
.bill-items-table td {
  padding: 0;
  border: 1px solid #cfd5dd;
  background: #fff
}

.bill-items-table th {
  padding: 8px 6px;
  font-size: 11px;
  color: #27384c
}

.bill-items-table input,
.bill-items-table select {
  border: 0;
  border-radius: 0;
  min-height: 36px;
  padding: 7px;
  width: 100%;
  box-shadow: none
}

.bill-items-table th:nth-child(1) {
  width: 21%
}

.bill-items-table th:nth-child(2) {
  width: 9%
}

.bill-items-table th:nth-child(3) {
  width: 12%
}

.bill-items-table th:nth-child(4) {
  width: 17%
}

.bill-items-table th:nth-child(5) {
  width: 15%
}

.bill-items-table th:nth-child(6) {
  width: 8%
}

.bill-items-table th:nth-child(7) {
  width: 10%
}

.bill-items-table td:nth-child(6),
.bill-items-table td:nth-child(7) {
  text-align: right;
  padding: 8px
}

.bill-items-table td:last-child {
  text-align: center;
  white-space: nowrap
}

.bill-row-add,
.bill-row-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  margin: 0 3px;
  background: #0875b9;
  color: #fff;
  font-size: 17px;
  line-height: 20px;
  cursor: pointer
}

.bill-row-remove {
  background: #0b6096
}

.bill-bottom {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 410px;
  gap: 80px;
  margin-top: 14px
}

.bill-bottom textarea {
  margin-top: 7px
}

.bill-totals>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cfd5dd;
  padding: 11px 0
}

.bill-totals span {
  color: #66758a
}

.bill-totals .gross {
  font-size: 16px
}

.bill-totals strong {
  color: #1d3149
}

.bill-draft-button,
.bill-approve-button {
  border: 0;
  border-radius: 5px;
  color: #fff;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer
}

.bill-draft-button {
  background: #053d63
}

.bill-approve-button {
  background: #45a148
}

@media(max-width:850px) {

  .bill-header-card,
  .bill-bottom {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: none
  }
}

.invoice-preview-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px
}

.invoice-preview-actions .full {
  width: auto
}

.invoice-detail-status {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 12px 0;
  background: #f3f7ff;
  border: 1px solid #dbe7fb;
  border-radius: 8px
}
