.welcome-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, #0f4da4, #1769e0 65%, #58a4fa);
  color: #fff;
  border-radius: 16px;
  padding: 25px 28px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 30px #1769e025
}

.welcome-banner:after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 38px solid #ffffff12;
  border-radius: 50%;
  right: -65px;
  top: -75px
}

.welcome-banner>div {
  position: relative;
  z-index: 1
}

.welcome-banner small {
  letter-spacing: 2px;
  opacity: .72
}

.welcome-banner h2 {
  font-size: 27px;
  margin: 7px 0 3px
}

.welcome-banner p {
  margin: 0;
  opacity: .82
}

.quick-actions {
  display: flex;
  gap: 8px
}

.quick-actions button {
  border: 1px solid #ffffff55;
  color: #fff;
  background: #ffffff16;
  border-radius: 9px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer
}

.quick-actions button:hover {
  background: #fff;
  color: var(--blue)
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 20px;
  margin-bottom: 20px
}

.dashboard-grid.lower {
  grid-template-columns: 1.45fr .55fr
}

.finance-bars>div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin: 17px 0
}

.finance-bars span {
  font-size: 13px;
  color: var(--muted)
}

.finance-bars strong {
  font-size: 13px
}

.finance-bars i {
  height: 8px;
  background: #edf1f7;
  border-radius: 8px;
  grid-column: 1/-1;
  overflow: hidden
}

.finance-bars b {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: var(--blue);
  transition: width .4s
}

.finance-bars>div:nth-child(2) b {
  background: #ef9241
}

.finance-bars>div:nth-child(3) b {
  background: #7759d8
}

.project-overview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 10px
}

.project-ring {
  --progress: 0%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--progress), #e9eef7 0);
  display: grid;
  place-content: center;
  text-align: center;
  position: relative
}

.project-ring:after {
  content: "";
  position: absolute;
  inset: 10px;
  background: #fff;
  border-radius: 50%
}

.project-ring strong,
.project-ring small {
  position: relative;
  z-index: 1
}

.project-ring strong {
  font-size: 25px
}

.project-ring small {
  color: var(--muted)
}

.project-counts {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted)
}

.project-counts b {
  color: var(--ink);
  display: inline-block;
  width: 20px
}

.activity-list>div {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0
}

.activity-list>div:last-child {
  border: 0
}

.activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 5px;
  box-shadow: 0 0 0 4px var(--blue2)
}

.activity-list p {
  margin: 0;
  font-size: 12px
}

.activity-list p strong,
.activity-list p small {
  display: block
}

.activity-list p small {
  color: var(--muted);
  margin-top: 4px
}

@media(max-width:1000px) {

  .dashboard-grid,
  .dashboard-grid.lower {
    grid-template-columns: 1fr
  }

  .welcome-banner {
    align-items: flex-start
  }

  .quick-actions {
    flex-wrap: wrap;
    justify-content: flex-end
  }
}

@media(max-width:620px) {
  .welcome-banner {
    display: block
  }

  .quick-actions {
    justify-content: flex-start;
    margin-top: 18px
  }

  .header-actions #current-user {
    display: none
  }
}

.business-alerts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 20px
}

.business-alerts article {
  background: #fff;
  border: 1px solid #e2e8f2;
  border-left: 4px solid #1769e0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 5px 18px #17345c0a
}

.business-alerts small {
  display: block;
  color: #6c768b;
  margin-bottom: 6px
}

.business-alerts strong {
  font-size: 18px
}

.business-alerts article:first-child {
  border-left-color: #df4d55
}

.business-alerts article:nth-child(2) {
  border-left-color: #ef9241
}

.business-alerts article:nth-child(3) {
  border-left-color: #7759d8
}

@media(max-width:800px) {
  .business-alerts {
    grid-template-columns: repeat(2, 1fr)
  }
}

.dashboard-periods .period-btn {
  appearance: none;
  border: 1px solid #d8e2f0 !important;
  background: #f7f9fc !important;
  color: #53627a !important;
  border-radius: 8px !important;
  padding: 9px 14px !important;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none
}

.dashboard-periods .period-btn.active {
  background: #1769e0 !important;
  color: #fff !important;
  border-color: #1769e0 !important;
  box-shadow: 0 5px 12px #1769e02b
}

.dashboard-quick-grid button {
  appearance: none;
  border: 1px solid #d9e5f5 !important;
  background: #f3f7fd !important;
  color: #175bb6 !important;
  border-radius: 9px !important;
  padding: 13px 10px !important;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 9px #174f9b10
}

.dashboard-quick-grid button:hover {
  background: #1769e0 !important;
  color: #fff !important;
  transform: translateY(-1px)
}

.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f2;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 18px
}

.dashboard-periods,
.dashboard-custom {
  display: flex;
  gap: 7px;
  align-items: center
}

.period-btn {
  border: 1px solid #d8e2f0;
  background: #f7f9fc;
  color: #53627a;
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 700
}

.period-btn.active {
  background: #1769e0;
  color: #fff;
  border-color: #1769e0
}

.dashboard-custom input {
  padding: 7px;
  border: 1px solid #d8e2f0;
  border-radius: 7px
}

.net-profit-line {
  display: flex;
  justify-content: space-between;
  background: #f2f7ff;
  border-radius: 9px;
  padding: 11px 13px;
  margin-top: 12px
}

.dashboard-insights {
  grid-template-columns: 1.3fr .7fr
}

.dashboard-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px
}

.dashboard-quick-grid button {
  border: 1px solid #d9e5f5;
  background: #f3f7fd;
  color: #175bb6;
  border-radius: 9px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer
}

.dashboard-chart {
  display: flex;
  align-items: flex-end;
  gap: 13px;
  min-height: 205px;
  padding: 20px 8px 0
}

.chart-month {
  flex: 1;
  text-align: center;
  min-width: 48px
}

.chart-bars {
  height: 155px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid #dce4ee
}

.chart-bar {
  width: 16px;
  min-height: 2px;
  border-radius: 5px 5px 0 0
}

.chart-bar.revenue {
  background: #1769e0
}

.chart-bar.expense {
  background: #ef9241
}

.chart-month small {
  display: block;
  margin-top: 7px;
  color: #68778e
}

.chart-legend {
  display: flex;
  gap: 13px;
  font-size: 11px;
  color: #68778e
}

.outstanding-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #edf1f6
}

.outstanding-row:last-child {
  border: 0
}

.outstanding-row small {
  display: block;
  color: #68778e
}

.outstanding-row.overdue strong {
  color: #cf313b
}

.dashboard-alert-list>div {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e8;
  border-left: 4px solid #ef9241;
  margin-bottom: 8px;
  font-size: 12px
}

.dashboard-alert-list>div.danger {
  background: #fff0f1;
  border-left-color: #df4d55
}

.dashboard-alert-list>div.ok {
  background: #edf9f3;
  border-left-color: #16a36d
}

@media(max-width:900px) {
  .dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column
  }

  .dashboard-periods,
  .dashboard-custom {
    flex-wrap: wrap
  }

  .dashboard-insights {
    grid-template-columns: 1fr
  }

  .dashboard-chart {
    overflow-x: auto
  }

  .outstanding-row {
    grid-template-columns: 1fr auto
  }
}

/* ERP dashboard */
.erp-hero {
  min-height: 120px;
  background: linear-gradient(90deg, #062b55ee, #0c4b82e8), radial-gradient(circle at 66% 30%, #d7a53155, transparent 35%);
  border-radius: 14px;
  color: #fff;
  padding: 25px 28px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 28px #0a315529
}

.erp-hero small {
  letter-spacing: 1.4px;
  color: #d8ad4e
}

.erp-hero h2 {
  font-size: 30px;
  margin: 5px 0
}

.erp-hero p {
  margin: 0;
  color: #d8e5f2
}

.erp-hero>div:last-child {
  font-size: 19px;
  line-height: 1.5;
  text-align: right;
  border-left: 3px solid #d8ad4e;
  padding-left: 24px
}

.erp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 14px 0 18px
}

.erp-kpi-grid button {
  display: grid;
  grid-template-columns: 44px 1fr;
  text-align: left;
  gap: 2px 10px;
  border: 1px solid #dbe5f0;
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  box-shadow: 0 6px 18px #0c31540b
}

.erp-kpi-grid button:hover {
  transform: translateY(-2px)
}

.erp-kpi-grid small,
.erp-kpi-grid strong,
.erp-kpi-grid em {
  grid-column: 2;
  font-style: normal
}

.erp-kpi-grid small {
  color: #405778;
  font-weight: 700
}

.erp-kpi-grid strong {
  font-size: 18px;
  color: #0a2443
}

.erp-kpi-grid em {
  font-size: 10px;
  color: #738298
}

.erp-kpi-icon {
  grid-row: 1/4;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px
}

.erp-kpi-icon.blue {
  background: #1769e0
}

.erp-kpi-icon.cyan {
  background: #118eb4
}

.erp-kpi-icon.green {
  background: #12a47a
}

.erp-kpi-icon.purple {
  background: #713bd7
}

.erp-kpi-icon.gold {
  background: #ee961f
}

.erp-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr .82fr;
  gap: 14px;
  margin-bottom: 18px
}

.erp-detail-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 14px;
  margin-bottom: 18px
}

.erp-category-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 190px
}

.erp-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto
}

.erp-donut:after {
  content: "";
  position: absolute;
  inset: 28px;
  background: #fff;
  border-radius: 50%
}

.erp-donut span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 12px;
  text-align: center
}

.erp-donut small {
  display: block;
  color: #77859a
}

.erp-category-legend {
  flex: 1
}

.erp-category-legend>div {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 5px 0;
  font-size: 11px
}

.erp-category-legend i {
  height: 9px;
  border-radius: 50%
}

.erp-dept-row {
  display: grid;
  grid-template-columns: 130px 1fr 85px;
  gap: 9px;
  align-items: center;
  margin: 13px 0;
  font-size: 11px
}

.erp-dept-row>span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.erp-dept-row i {
  height: 7px;
  background: #e9eef4;
  border-radius: 8px;
  overflow: hidden
}

.erp-dept-row b {
  display: block;
  height: 100%;
  background: #2182d8;
  border-radius: 8px
}

.erp-dept-row strong {
  text-align: right;
  font-size: 10px
}

.erp-quick-insights>div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid #edf1f6
}

.erp-quick-insights b {
  width: 30px;
  height: 30px;
  background: #eef5ff;
  color: #1769e0;
  border-radius: 50%;
  display: grid;
  place-items: center
}

.erp-quick-insights strong,
.erp-quick-insights small {
  display: block
}

.erp-quick-insights strong {
  font-size: 11px
}

.erp-quick-insights small {
  font-size: 10px;
  color: #738298
}

.erp-finance-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.erp-finance-cards article {
  background: #f8fafc;
  border: 1px solid #e2e9f2;
  border-radius: 10px;
  padding: 17px
}

.erp-finance-cards small,
.erp-finance-cards strong {
  display: block
}

.erp-finance-cards small {
  color: #687990;
  margin-bottom: 8px
}

.erp-finance-cards strong {
  font-size: 16px;
  color: #0b3157
}

.project-report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(110deg, #082d57, #1769e0);
  color: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 18px 0
}

.project-report-head h3 {
  font-size: 24px;
  margin: 4px 0
}

.project-report-head p {
  margin: 0;
  color: #dbeaff
}

.business-alerts {
  display: none
}

@media(max-width:1200px) {
  .erp-kpi-grid {
    grid-template-columns: repeat(3, 1fr)
  }

  .erp-insight-grid {
    grid-template-columns: 1fr 1fr
  }

  .erp-insight-grid>.panel:last-child {
    grid-column: 1/-1
  }
}

@media(max-width:850px) {

  .erp-kpi-grid,
  .erp-insight-grid,
  .erp-detail-grid {
    grid-template-columns: 1fr 1fr
  }

  .erp-detail-grid>.panel {
    grid-column: 1/-1
  }

  .erp-hero>div:last-child {
    display: none
  }
}

@media(max-width:600px) {

  .erp-kpi-grid,
  .erp-insight-grid {
    grid-template-columns: 1fr
  }

  .erp-category-layout {
    align-items: flex-start;
    flex-direction: column
  }

  .erp-dept-row {
    grid-template-columns: 90px 1fr 70px
  }

  .erp-finance-cards {
    grid-template-columns: 1fr
  }
}

/* Hide duplicate legacy summary rows retained only for data bindings. */
#dashboard>.dashboard-toolbar,
#dashboard>.stats,
#dashboard>.business-alerts {
  display: none !important
}

.erp-pending-panel {
  margin-bottom: 18px
}

.erp-pending-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #dfe7f0;
  margin: 0 0 12px;
  overflow-x: auto
}

.erp-pending-tabs button {
  border: 0;
  background: transparent;
  color: #5c6d83;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent
}

.erp-pending-tabs button.active {
  color: #0d4e8c;
  border-bottom-color: #d6a328
}

.erp-pending-tabs span {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  margin-left: 4px;
  background: #f1f4f8;
  color: #5c6d83;
  border-radius: 10px;
  font-size: 10px
}

.erp-pending-tabs button.active span {
  background: #fff1cc;
  color: #936700
}

.erp-pending-status {
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 12px;
  background: #fff2df;
  color: #bd6812
}

.erp-pending-status.overdue {
  background: #ffe9eb;
  color: #d23b48
}

.erp-pending-empty {
  text-align: center;
  color: #748398;
  padding: 28px
}
