/* ==========================================================================
   BIVA COMPANY FINANCE — WORLD-CLASS COMPACT OVERVIEW
   ========================================================================== */

/* Hide the default admin-layout page heading only on this page. */
.finance-pro-page .admin-page-header,
.finance-pro-page .admin-layout__header,
.finance-pro-page .admin-header,
.finance-pro-page > header:first-child {
  display: none !important;
}

.finance-pro-page {
  min-height: 100vh;
}

.finance-pro-dashboard {
  display: grid;
  gap: 10px;
  padding-top: 2px;
  font-size: 12px;
}


/* ==========================================================================
   TOP TOOLBAR
   ========================================================================== */

.finance-pro-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #dfe6ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(19, 43, 76, 0.045);
}

.finance-pro-toolbar__controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.finance-pro-toolbar label {
  display: grid;
  gap: 5px;
}

.finance-pro-toolbar label > span {
  color: #64758f;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.finance-pro-toolbar select,
.finance-pro-toolbar input {
  height: 35px;
  padding: 0 11px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #ffffff;
  color: #14243d;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  outline: none;
}

.finance-pro-toolbar select {
  min-width: 135px;
}

.finance-pro-toolbar input {
  min-width: 145px;
}

.finance-pro-primary-btn {
  height: 35px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #061a3d;
  color: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(6, 26, 61, 0.18);
}

.finance-pro-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-pro-toolbar__actions > span {
  margin-right: 4px;
  color: #6e7f97;
  font-size: 9px;
  font-weight: 650;
}

.finance-pro-icon-btn,
.finance-pro-export-btn {
  height: 35px;
  border: 1px solid #d8e1ed;
  border-radius: 8px;
  background: #ffffff;
  color: #14243d;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.finance-pro-icon-btn {
  width: 35px;
  padding: 0;
  font-size: 17px;
}

.finance-pro-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
}

.finance-pro-status {
  min-height: 14px;
  color: #61728a;
  font-size: 9px;
  font-weight: 650;
}

.finance-pro-status[data-type="success"] {
  color: #087c55;
}

.finance-pro-status[data-type="error"] {
  color: #c43542;
}


/* ==========================================================================
   KPI CARDS
   ========================================================================== */

.finance-pro-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.finance-pro-kpi {
  position: relative;
  min-width: 0;
  padding: 14px 16px 13px;
  border: 1px solid #dfe6ef;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(17, 40, 73, 0.045);
}

.finance-pro-kpi__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-pro-kpi__top > span {
  color: #5f708a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.finance-pro-kpi__icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid #dce8f7;
  border-radius: 8px;
  background: #f5f9ff;
  color: #1266d7;
}

.finance-pro-kpi__icon svg {
  width: 17px;
  height: 17px;
}

.finance-pro-kpi.is-income
.finance-pro-kpi__icon,
.finance-pro-kpi.is-profit
.finance-pro-kpi__icon {
  border-color: #d7eee5;
  background: #f2fbf7;
  color: #0b9a68;
}

.finance-pro-kpi.is-expense
.finance-pro-kpi__icon {
  border-color: #f4dadd;
  background: #fff6f7;
  color: #db4654;
}

.finance-pro-kpi > strong {
  display: block;
  margin-top: 12px;
  color: #0e213f;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
}

.finance-pro-kpi.is-income > strong,
.finance-pro-kpi.is-profit > strong {
  color: #078357;
}

.finance-pro-kpi.is-expense > strong {
  color: #c93442;
}

.finance-pro-kpi__change {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  color: #718097;
  font-size: 9px;
  font-weight: 700;
}

.finance-pro-kpi__change.is-up {
  color: #0a8b60;
}

.finance-pro-kpi__change.is-down {
  color: #c83b48;
}

.finance-pro-kpi > small {
  display: block;
  margin-top: 9px;
  color: #697a91;
  font-size: 9px;
}


/* ==========================================================================
   FINANCIAL HEALTH
   ========================================================================== */

.finance-pro-health-panel {
  padding: 12px 14px 0;
  border: 1px solid #dfe6ef;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(17, 40, 73, 0.04);
}

.finance-pro-section-title {
  margin-bottom: 9px;
  color: #0b1f43;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.055em;
}

.finance-pro-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-pro-health {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 10px 14px 12px;
  border-top: 1px solid #e7ecf2;
  border-right: 1px solid #e7ecf2;
}

.finance-pro-health:first-child {
  border-left: 1px solid #e7ecf2;
}

.finance-pro-health::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #90a1b8;
}

.finance-pro-health.is-good::after {
  background: #0caf72;
}

.finance-pro-health.is-warning::after {
  background: #eea20f;
}

.finance-pro-health.is-danger::after {
  background: #d84b57;
}

.finance-pro-health > span {
  color: #62738c;
  font-size: 9px;
  font-weight: 750;
}

.finance-pro-health > strong {
  color: #10213d;
  font-size: 15px;
  font-weight: 900;
}

.finance-pro-health > small {
  color: #718198;
  font-size: 8.5px;
}


/* ==========================================================================
   GRID PANELS
   ========================================================================== */

.finance-pro-top-grid,
.finance-pro-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.08fr;
  gap: 9px;
}

.finance-pro-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe6ef;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(17, 40, 73, 0.04);
}

.finance-pro-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: 0 14px;
  border-bottom: 1px solid #edf1f5;
}

.finance-pro-panel > header strong {
  color: #0c1f43;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.finance-pro-panel__split {
  gap: 12px;
}

.finance-pro-view-all,
.finance-pro-panel-link {
  border: 0;
  background: transparent;
  color: #0b62d0;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.finance-pro-panel-link {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  padding: 0 14px;
  border-top: 1px solid #edf1f5;
  text-align: left;
}


/* ==========================================================================
   BREAKDOWNS
   ========================================================================== */

.finance-pro-breakdown {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 175px;
  padding: 13px 14px;
}

.finance-pro-donut {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 0 auto;
  border-radius: 50%;
}

.finance-pro-donut > div {
  position: absolute;
  inset: 23px;
  border-radius: 50%;
  background: #ffffff;
}

.finance-pro-breakdown-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.finance-pro-breakdown-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.finance-pro-breakdown-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12a66f;
}

.finance-pro-breakdown-row:nth-child(2)
.finance-pro-breakdown-dot {
  background: #2e74e6;
}

.finance-pro-breakdown-row:nth-child(3)
.finance-pro-breakdown-dot {
  background: #f4b51f;
}

.finance-pro-breakdown-row:nth-child(4)
.finance-pro-breakdown-dot {
  background: #9a7be6;
}

.finance-pro-breakdown-row:nth-child(5)
.finance-pro-breakdown-dot {
  background: #20a4c7;
}

.finance-pro-breakdown-row strong {
  overflow: hidden;
  color: #23334d;
  font-size: 8.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-pro-breakdown-row small {
  color: #394a64;
  font-size: 8.2px;
  font-weight: 700;
  white-space: nowrap;
}


/* ==========================================================================
   CASH TABLE
   ========================================================================== */

.finance-pro-table-wrap {
  overflow-x: auto;
}

.finance-pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.6px;
}

.finance-pro-table th {
  padding: 6px 10px;
  background: #eef2f7;
  color: #5f7087;
  font-size: 7.5px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.finance-pro-table td {
  padding: 6px 10px;
  border-top: 1px solid #eef2f6;
  color: #26364e;
}

.finance-pro-table td:nth-child(2),
.finance-pro-table td:nth-child(3),
.finance-pro-table th:nth-child(2),
.finance-pro-table th:nth-child(3) {
  text-align: right;
}

.finance-pro-table td strong {
  color: #1e2f49;
  font-weight: 800;
}

.finance-pro-table td.is-negative {
  color: #ca3442;
}

.finance-pro-table__total td {
  background: #f1f4f8;
  color: #0d1f40;
  font-weight: 900;
}


/* ==========================================================================
   TREND CHART
   ========================================================================== */

#companyFinanceTrendChart {
  min-height: 240px;
  padding: 10px 12px 6px;
}

.finance-pro-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

.finance-pro-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #61728a;
  font-size: 8.5px;
  font-weight: 700;
}

.finance-pro-chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12a66f;
}

.finance-pro-chart-legend .is-expense i {
  background: #df4e59;
}

.finance-pro-chart-legend .is-result i {
  background: #2e74e6;
}

.finance-pro-chart {
  width: 100%;
  height: 190px;
}

.finance-pro-chart-grid {
  stroke: #e7ecf2;
  stroke-width: 1;
}

.finance-pro-chart-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-pro-chart-line.is-income {
  stroke: #12a66f;
}

.finance-pro-chart-line.is-expense {
  stroke: #df4e59;
}

.finance-pro-chart-line.is-result {
  stroke: #2e74e6;
}

.finance-pro-chart-label {
  fill: #7d8ca1;
  font-size: 8px;
  font-weight: 650;
}


/* ==========================================================================
   OWNER FUNDING
   ========================================================================== */

.finance-pro-owner-list {
  display: grid;
}

.finance-pro-owner-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #edf1f5;
}

.finance-pro-owner-row:last-child {
  border-bottom: 0;
}

.finance-pro-owner-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  color: #0b62d0;
  background: #edf4ff;
  font-size: 11px;
  font-weight: 900;
}

.finance-pro-owner-icon.is-good {
  color: #079361;
  background: #ecf9f3;
}

.finance-pro-owner-icon.is-danger {
  color: #d53e4a;
  background: #fff1f2;
}

.finance-pro-owner-icon.is-warning {
  color: #d78b00;
  background: #fff7e7;
}

.finance-pro-owner-row strong {
  color: #25354d;
  font-size: 8.8px;
  font-weight: 750;
}

.finance-pro-owner-row > span {
  color: #1d2e47;
  font-size: 8.8px;
  font-weight: 800;
}


/* ==========================================================================
   RECENT ACTIVITY
   ========================================================================== */

.finance-pro-activity-list {
  display: grid;
}

.finance-pro-activity-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 5px 12px;
  border-bottom: 1px solid #edf1f5;
}

.finance-pro-activity-row:last-child {
  border-bottom: 0;
}

.finance-pro-date-box {
  display: grid;
  place-items: center;
  width: 29px;
  height: 32px;
  border: 1px solid #dce4ef;
  border-radius: 6px;
  background: #fbfcfe;
}

.finance-pro-date-box small {
  color: #708099;
  font-size: 6px;
  line-height: 1;
}

.finance-pro-date-box strong {
  color: #1b2b43;
  font-size: 10px;
  line-height: 1;
}

.finance-pro-activity-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.finance-pro-activity-copy strong {
  overflow: hidden;
  color: #26364e;
  font-size: 8.7px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-pro-activity-copy small {
  overflow: hidden;
  color: #74839a;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-pro-activity-amount {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.finance-pro-activity-amount strong {
  color: #cc3543;
  font-size: 8.7px;
  font-weight: 850;
}

.finance-pro-activity-amount.is-income strong {
  color: #078357;
}

.finance-pro-activity-amount small {
  color: #74839a;
  font-size: 7px;
}


/* ==========================================================================
   ATTENTION
   ========================================================================== */

.finance-pro-attention {
  display: grid;
  grid-template-columns: 42px 210px 150px 185px minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 14px;
  border: 1px solid #dfe6ef;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(17, 40, 73, 0.04);
}

.finance-pro-attention__icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: #fff1df;
  color: #e48000;
  font-size: 19px;
  font-weight: 900;
}

.finance-pro-attention__lead {
  display: grid;
  gap: 2px;
}

.finance-pro-attention__lead strong,
.finance-pro-attention__detail > span {
  color: #1b2b45;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.finance-pro-attention__lead > span {
  color: #32425a;
  font-size: 8.5px;
  font-weight: 800;
}

.finance-pro-attention__lead small {
  color: #738199;
  font-size: 7px;
}

.finance-pro-attention__detail {
  display: grid;
  gap: 5px;
}

.finance-pro-attention__detail strong {
  color: #2a3a52;
  font-size: 8.5px;
  font-weight: 750;
}

.finance-pro-attention__detail .is-warning-text {
  color: #e38600;
}

.finance-pro-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #0b62d0;
  font: inherit;
  font-size: 8.5px;
  font-weight: 800;
  cursor: pointer;
}

.finance-pro-attention.is-good {
  grid-template-columns: 42px minmax(0, 1fr);
}


/* ==========================================================================
   EMPTY
   ========================================================================== */

.finance-pro-empty {
  padding: 24px 12px;
  color: #7b8ba0;
  font-size: 9px;
  text-align: center;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1180px) {
  .finance-pro-top-grid,
  .finance-pro-bottom-grid {
    grid-template-columns: 1fr 1fr;
  }

  .finance-pro-attention {
    grid-template-columns: 42px 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .finance-pro-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-pro-toolbar__controls,
  .finance-pro-toolbar__actions {
    flex-wrap: wrap;
  }

  .finance-pro-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .finance-pro-health-grid {
    grid-template-columns: 1fr 1fr;
  }

  .finance-pro-top-grid,
  .finance-pro-bottom-grid {
    grid-template-columns: 1fr;
  }

  .finance-pro-attention {
    grid-template-columns: 42px 1fr;
  }
}

@media (max-width: 620px) {
  .finance-pro-dashboard {
    gap: 8px;
  }

  .finance-pro-toolbar__controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .finance-pro-toolbar__controls label:first-child {
    grid-column: 1 / -1;
  }

  .finance-pro-toolbar select,
  .finance-pro-toolbar input,
  .finance-pro-primary-btn {
    width: 100%;
    min-width: 0;
  }

  .finance-pro-kpis,
  .finance-pro-health-grid {
    grid-template-columns: 1fr;
  }

  .finance-pro-breakdown {
    grid-template-columns: 1fr;
  }

  .finance-pro-attention {
    grid-template-columns: 1fr;
  }
}
