:root {
  --ch-primary: #0c83ff;
  --ch-page-bg: #f5f7fb;
}

body {
  letter-spacing: 0;
}

.navbar-brand .brand-mark {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0.375rem;
  background: var(--ch-primary);
  color: #fff;
  font-weight: 700;
}

.place-items-center {
  place-items: center;
}

body.sidebar-main-resized .sidebar-main .nav-link[title] {
  position: relative;
}

body.sidebar-main-resized .sidebar-main .nav-link[title]:hover::after,
body.sidebar-main-resized .sidebar-main .nav-link[title]:focus-visible::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 50%;
  z-index: 1070;
  transform: translateY(-50%);
  width: max-content;
  max-width: 16rem;
  padding: 0.35rem 0.625rem;
  border-radius: 0.25rem;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
}

.page-content {
  min-height: calc(100vh - 8.25rem);
  background: var(--ch-page-bg);
}

.content {
  width: 100%;
}

.content-wrapper {
  min-width: 0;
}

.ch-page-title {
  min-width: 0;
}

.ch-page-title small {
  display: block;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.ch-page-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.25rem;
}

.ch-page-actions .hstack {
  flex-wrap: wrap;
}

.ch-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ch-stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0.5rem;
  background: rgba(12, 131, 255, 0.1);
  color: var(--ch-primary);
  font-size: 1.35rem;
}

.ch-dashboard-row {
  --bs-gutter-x: 1rem;
  margin-left: 0;
  margin-right: 0;
}

.ch-dashboard-row > * {
  min-width: 0;
}

.ch-chart {
  width: 100%;
  min-height: 16rem;
}

.ch-chart svg {
  width: 100%;
  min-width: 36rem;
  height: 16rem;
  display: block;
}

.ch-report-chart {
  width: 100%;
  overflow-x: auto;
}

.ch-report-chart svg {
  width: 100%;
  min-width: 42rem;
  height: 15rem;
  display: block;
}

.ch-report-bar {
  fill: rgba(12, 131, 255, 0.72);
}

.ch-report-baseline {
  stroke: #d1d5db;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ch-report-value,
.ch-report-label {
  fill: #6c757d;
  font-size: 11px;
  font-weight: 600;
}

.ch-report-label {
  font-size: 10px;
}

.ch-report-chart-controls {
  max-width: 100%;
}

.ch-table-card {
  overflow: hidden;
}

.ch-table-card .datatable-scroll-wrap {
  overflow-x: clip;
  max-width: 100%;
}

.ch-table-card .datatable-header,
.ch-table-card .datatable-footer {
  padding-inline: 1rem;
}

.ch-table-card .datatable-header {
  border-bottom: 1px solid var(--bs-border-color);
}

.ch-table-card .dataTables_filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ch-report-group-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.ch-report-group-control span {
  white-space: nowrap;
}

.ch-table-card .datatable-footer {
  border-top: 1px solid var(--bs-border-color);
}

.ch-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.ch-column-menu {
  max-height: 18rem;
  overflow-y: auto;
  min-width: 14rem;
}

.ch-column-menu .dropdown-item {
  cursor: pointer;
}

.ch-column-toggle {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-left: 1rem;
}

.ch-column-toggle .form-check-input {
  float: none;
  flex: 0 0 auto;
  margin: 0;
}

.ch-column-menu .form-check-input:disabled + span {
  opacity: 0.65;
}

.ch-excel-table {
  width: 100% !important;
  margin-bottom: 0 !important;
}

.ch-excel-table thead th {
  white-space: nowrap;
}

.ch-excel-table thead th:not(.select-checkbox-cell):not(.responsive-control-cell) {
  cursor: move;
}

.ch-excel-table tbody td {
  vertical-align: middle;
}

.ch-excel-table .select-checkbox-cell {
  width: 2.75rem;
  min-width: 2.75rem;
  text-align: center;
}

.ch-excel-table .responsive-control-cell {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  text-align: center;
}

.ch-excel-table .row-actions-cell {
  width: 1%;
  min-width: 5.75rem;
}

.ch-excel-table .ch-inline-field {
  min-width: 10rem;
  max-width: 16rem;
}

.ch-excel-table td.ch-inline-editable-cell {
  position: relative;
  cursor: cell;
}

.ch-excel-table td.ch-inline-editable-cell::after {
  content: "";
  position: absolute;
  inset: 0.125rem;
  border: 1px solid transparent;
  border-radius: 0.2rem;
  pointer-events: none;
}

.ch-excel-table td.ch-inline-editable-cell:hover::after {
  border-color: rgba(12, 131, 255, 0.6);
}

.ch-excel-table td.responsive-control-cell {
  position: relative;
  cursor: pointer;
  padding-inline: 0 !important;
  text-align: center;
}

.ch-excel-table td.responsive-control-cell::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid rgba(12, 131, 255, 0.35);
  background: rgba(12, 131, 255, 0.08);
  color: var(--ch-primary);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 auto;
}

.ch-excel-table td.responsive-control-cell.dtr-control::before {
  position: static;
  top: auto;
  left: auto;
  margin: 0 auto;
  transform: none;
}

.ch-excel-table tr.parent td.responsive-control-cell::before {
  content: "-";
}

.ch-excel-table td.select-checkbox-cell::before,
.ch-excel-table th.select-checkbox-cell::before {
  content: none !important;
}

.ch-excel-table tbody td.active {
  background: rgba(12, 131, 255, 0.08);
}

.ch-excel-table tbody tr:hover td,
.ch-excel-table tbody tr:hover td.active {
  background: rgba(12, 131, 255, 0.12);
}

.ch-excel-table .table-danger-subtle td {
  background: rgba(220, 53, 69, 0.05);
}

.ch-excel-table .table-warning-subtle td {
  background: rgba(255, 193, 7, 0.05);
}

.ch-excel-table .ch-report-group-row td,
.ch-excel-table .ch-report-total-row td {
  background: #f8fafc;
  border-top: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
}

.ch-excel-table .ch-report-group-row td {
  font-weight: 500;
}

.ch-excel-table .ch-report-total-row td {
  background: #eef4ff;
  font-weight: 700;
}

.ch-excel-table .ch-report-group-cell {
  white-space: normal;
  min-width: 0;
}

.ch-excel-table .ch-report-subtotal-cell {
  white-space: nowrap;
}

.ch-excel-table tr.child ul.dtr-details {
  width: 100%;
  margin: 0;
}

.ch-excel-table tr.child ul.dtr-details > li {
  display: grid;
  grid-template-columns: minmax(7rem, 0.32fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  line-height: 1.25;
}

.ch-excel-table tr.child ul.dtr-details > li .dtr-title {
  display: inline-block;
  color: var(--bs-secondary-color);
  font-weight: 600;
  text-align: left;
  line-height: 1.25;
  padding: 0;
  margin: 0;
}

.ch-excel-table tr.child ul.dtr-details > li .dtr-data {
  display: inline-block;
  min-width: 0;
  line-height: 1.25;
  padding: 0;
  margin: 0;
  vertical-align: baseline;
}

.chart-grid {
  stroke: #e6ebf2;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.expected-line {
  stroke: var(--ch-primary);
}

.paid-line {
  stroke: var(--bs-success);
}

.chart-dot {
  stroke: #fff;
  stroke-width: 2;
}

.expected-dot {
  fill: var(--ch-primary);
}

.paid-dot {
  fill: var(--bs-success);
}

.chart-label,
.chart-empty {
  fill: #6c757d;
  font-size: 12px;
  font-weight: 600;
}

.micro-bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 1060;
  border-top: 1px solid var(--bs-border-color);
  background: #fff;
}

.micro-bottom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  background: rgba(15, 23, 42, 0.54);
}

.micro-bottom-backdrop.show {
  display: block;
}

.micro-bottom-menu {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.micro-bottom-group {
  position: relative;
  min-width: 0;
}

.micro-bottom-bar .nav-link {
  width: 100%;
  min-height: 3.25rem;
  display: grid;
  align-content: center;
  justify-content: center;
  gap: 0.125rem;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  text-align: center;
}

.micro-bottom-bar .nav-link.active {
  color: var(--ch-primary);
}

.micro-bottom-bar .nav-link[aria-expanded="true"] {
  color: var(--ch-primary);
  background: rgba(12, 131, 255, 0.08);
}

.micro-bottom-bar .nav-link span {
  overflow: hidden;
  max-width: 5.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.micro-bottom-submenu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.75rem);
  display: none;
  transform: translateX(-50%);
  z-index: 1050;
}

.micro-bottom-submenu.show {
  display: block;
}

.micro-bottom-group:first-child .micro-bottom-submenu {
  left: 0.75rem;
  transform: none;
}

.micro-bottom-group:last-child .micro-bottom-submenu {
  right: 0.75rem;
  left: auto;
  transform: none;
}

.micro-bottom-submenu ul {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.micro-bottom-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  color: var(--body-color);
  text-decoration: none;
  white-space: nowrap;
}

.micro-bottom-action-icon {
  order: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--bs-border-color);
  border-radius: 50%;
  background: #fff;
  color: var(--ch-primary);
  box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.12);
  font-size: 1.1rem;
}

.micro-bottom-action-label {
  order: 1;
  max-width: min(14rem, calc(100vw - 5rem));
  padding: 0.35rem 0.625rem;
  border-radius: 999px;
  background: #fff;
  color: var(--body-color);
  box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.12);
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.micro-bottom-action.active .micro-bottom-action-icon,
.micro-bottom-action:hover .micro-bottom-action-icon {
  background: var(--ch-primary);
  border-color: var(--ch-primary);
  color: #fff;
}

@media (min-width: 992px) {
  .micro-bottom-bar {
    display: none;
  }

  .ch-page-actions {
    justify-content: flex-end;
    padding-top: 0;
  }
}

@media (max-width: 991.98px) {
  .page-content {
    padding-bottom: 3.25rem;
  }

  .sidebar-main {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1040;
  }

  .ch-page-actions {
    width: 100%;
    margin-top: 1rem !important;
  }

  .ch-list-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .ch-table-card .dataTables_filter,
  .ch-table-card .dataTables_length,
  .ch-table-card .dataTables_info,
  .ch-table-card .dataTables_paginate {
    width: 100%;
  }

  .ch-table-card .dataTables_filter > label,
  .ch-table-card .dataTables_length > label {
    width: 100%;
  }
}
