/* ============== Layout (consumed by home/layout.js as styles.main) ============== */
.main {
  position: relative;
  padding: 88px 24px 48px;
  width: 100%;
  height: 100vh;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--background);
}

/* ============== Welcome card (above 4 KPIs in col-xl-8) ============== */
.welcome {
  /* background: linear-gradient(
    135deg,
    var(--surface) 0%,
    var(--primary-faint) 100%
  ); */
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  min-height: 168px;
  overflow: visible;
  position: relative;
}

.welcomeEyebrow {
  font-size: 11.6px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.welcomeText {
  min-width: 0;
  flex: 1 1 280px;
  color: var(--primary);
}

.welcomeText h4 {
  color: var(--primary);
  font-weight: 800;
  font-size: 24.2px;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}
.welcomeText h4 span {
  color: var(--primary-tint);
}

.welcomeText p {
  color: var(--text-muted);
  font-size: 14.3px;
  margin: 0 0 14px;
  max-width: 440px;
  line-height: 1.5;
  margin-top: 20px;
}

.welcomeBtn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 14.3px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    color 0.15s ease;
}
.welcomeBtn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.welcomeArt {
  flex-shrink: 0;
  width: auto;
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: flex-end;
  margin-top: -40px;
  margin-bottom: -18px;
  margin-right: 40px;
  position: relative;
  z-index: 2;
}
.welcomeArt img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.welcomeStats {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 4px 6px;
}

.welcomeStat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}

.welcomeStatLabel {
  font-size: 11.6px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.welcomeStatValue {
  font-size: 19.8px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.welcomeStatDiv {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ============== KPI cards ============== */
.kpi {
  border-radius: var(--radius-md);
  padding: 26px 20px;
  color: var(--primary);
  position: relative;
  overflow: hidden;
  min-height: 156px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--primary-light);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(0, 73, 202, 0.35);
}
/* Three primary shades so each card in the row differs. */
.kpiShade1 {
  background: var(--primary-tint);
}
.kpiShade2 {
  background: var(--primary-light);
}
.kpiShade3 {
  background: var(--primary-faint);
}
.kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  pointer-events: none;
}

.kpiTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.kpiValue {
  font-size: 24.2px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--text-main);
}

.kpiBadge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11.6px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.kpiBadgeUp {
  color: #16a34a;
}
.kpiBadgeDown {
  color: #dc2626;
}

.kpiBottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.kpiLabel {
  font-size: 12.7px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 1;
  color: var(--primary);
}

.kpiViz {
  width: 90px;
  height: 36px;
  flex-shrink: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.kpiVizIcon {
  font-size: 28.6px;
  color: var(--primary);
  opacity: 0.22;
}

/* ============== Growth speedometer card ============== */
.growth {
  height: 100%;
  border-radius: var(--radius-lg);
  padding: 16px 14px 18px;
  background: var(--primary-tint);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.growth::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  pointer-events: none;
}

.growthGauge {
  width: 100%;
  max-width: 160px;
  position: relative;
  z-index: 1;
}

.growthCaption {
  font-size: 13.2px;
  font-weight: 700;
  margin-top: 2px;
  text-align: center;
  position: relative;
  z-index: 1;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.growthCompare {
  margin-top: 6px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  gap: 8px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  position: relative;
  z-index: 1;
  text-align: center;
}
.growthYear {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.growthAmount {
  font-size: 13.8px;
  font-weight: 800;
  margin-top: 1px;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ============== Section card (chart panels) ============== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  height: 100%;
}

.cardHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cardTitle {
  font-size: 15.4px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.005em;
}

.cardSub {
  font-size: 12.7px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.chartArea {
  width: 100%;
  height: 300px;
}

.emptyHint {
  text-align: center;
  font-size: 14.3px;
  color: var(--text-muted);
  padding: 30px 12px;
}

/* ============== Financial health rows ============== */
.healthList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.healthRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.healthRow:hover {
  border-color: var(--border-strong);
}

.healthLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.healthIcon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16.5px;
  flex-shrink: 0;
}
.healthIcon_neutral {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
}
.healthIcon_primary {
  background: var(--primary-light);
  color: var(--primary);
}
.healthIcon_success {
  background: var(--success-light);
  color: var(--success);
}
.healthIcon_danger {
  background: var(--error-light);
  color: var(--error);
}
.healthIcon_amber {
  background: var(--warning-light);
  color: var(--warning);
}

.healthLabel {
  font-size: 14.3px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.005em;
}

.healthHint {
  font-size: 12.1px;
  color: var(--text-muted);
  margin-top: 1px;
}

.healthValue {
  font-size: 15.4px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}
.healthValue_primary {
  color: var(--primary);
}
.healthValue_success {
  color: var(--success);
}
.healthValue_danger {
  color: var(--error);
}
.healthValue_amber {
  color: var(--warning);
}

/* ============== Invoices table ============== */
.tableWrap {
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl thead th {
  text-align: left;
  font-size: 11.6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.tbl tbody td {
  padding: 12px 16px;
  font-size: 14.3px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr:last-child td {
  border-bottom: none;
}

.tblStrong {
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.tblSub {
  font-size: 12.1px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============== Misc ============== */
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 14px;
  font-size: 13.2px;
}
