/* ============================================================
   Business billing — revenue, settlement, wallet
   ============================================================ */

.bill-main { padding: 28px 0 80px; }

.bill-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.bill-head h1 {
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.0;
  font-family: var(--font);
  font-weight: 600;
}
.bill-head .greet {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.bill-head .period {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.bill-head .period .arrow {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
}

/* ===== TOP KPI ===== */
.bill-kpi {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-big {
  background: var(--dark);
  color: var(--text-on-dark);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.kpi-big::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 300px at 100% 0%, rgba(242, 198, 0, 0.18), transparent 60%);
  pointer-events: none;
}
.kpi-big > * { position: relative; }
.kpi-big .l {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 246, 242, 0.55);
}
.kpi-big .v {
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 10px 0 8px;
  color: var(--signal);
}
.kpi-big .v .unit { font-size: 24px; margin-left: 4px; color: rgba(247, 246, 242, 0.7); }
.kpi-big .delta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.kpi-big .delta-row .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  border-radius: var(--r-pill);
  background: rgba(46, 125, 99, 0.2);
  color: #6fcf97;
  font-weight: 600;
  font-size: 12px;
}
.kpi-big .delta-row .pill .ms { font-size: 14px; }
.kpi-big .delta-row .sub { color: rgba(247, 246, 242, 0.6); }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 18px 20px;
}
.kpi-card .l {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.kpi-card .v {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 8px 0 6px;
  line-height: 1;
}
.kpi-card .v .unit { font-size: 14px; color: var(--text-muted); margin-left: 2px; }
.kpi-card .sub {
  font-size: 12px;
  color: var(--text-muted);
}
.kpi-card .sub strong { color: var(--text); font-weight: 600; }

/* ===== CHART ===== */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.chart-head h2 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
}
.chart-head h2 .mono { color: var(--text-muted); font-size: 14px; margin-left: 6px; font-weight: 400; }
.chart-tabs {
  display: flex;
  gap: 6px;
}
.chart-tab {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.chart-tab.active { background: var(--dark); color: var(--text-on-dark); font-weight: 600; }
.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.chart-legend .item { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .swatch { width: 12px; height: 12px; border-radius: 3px; }

.chart-canvas {
  position: relative;
  height: 240px;
}
.chart-y {
  position: absolute;
  left: 0; top: 0; bottom: 24px;
  width: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  padding-right: 8px;
}
.chart-y span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.chart-bars {
  position: absolute;
  left: 60px;
  right: 0;
  top: 0;
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  align-items: flex-end;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 calc(25% - 1px),
      var(--line-faint) calc(25% - 1px) 25%
    );
}
.chart-bar-group {
  display: flex;
  gap: 3px;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
}
.chart-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  position: relative;
  cursor: pointer;
  transition: filter 120ms ease;
}
.chart-bar:hover { filter: brightness(1.1); }
.chart-bar.this-week {
  background: var(--dark);
}
.chart-bar.commission {
  background: var(--signal);
}
.chart-bar.expenses {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
}
.chart-bar.this-week.now {
  background: linear-gradient(0deg, var(--dark) 60%, rgba(15, 17, 21, 0.3) 60%);
}
.chart-x {
  position: absolute;
  left: 60px; right: 0; bottom: 0;
  height: 24px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  padding-left: 14px;
  align-items: center;
}
.chart-x span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.chart-x span.today { color: var(--text); font-weight: 600; }

/* ===== TWO COL ===== */
.bill-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
}
.panel-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-card-head h2 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
}
.panel-card-head h2 .mono { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 6px; }

/* settlement table */
.settle-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.settle-row {
  display: grid;
  grid-template-columns: 110px 1fr 120px 100px 30px;
  gap: 14px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 100ms ease;
}
.settle-row:hover { background: var(--surface-2); cursor: pointer; }
.settle-row .when { font-family: var(--font-mono); color: var(--text-2); }
.settle-row .what { display: flex; flex-direction: column; gap: 2px; }
.settle-row .what .n { font-weight: 500; }
.settle-row .what .d { font-size: 12px; color: var(--text-muted); }
.settle-row .amount {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}
.settle-row .amount.in { color: var(--go); }
.settle-row .amount.out { color: var(--text-2); }
.settle-row .nav { color: var(--text-muted); }

/* WALLET card */
.wallet-card {
  background: var(--dark);
  color: var(--text-on-dark);
  border-radius: var(--r-xl);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.wallet-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(400px 300px at 100% 100%, rgba(242, 198, 0, 0.18), transparent 60%);
  pointer-events: none;
}
.wallet-card > * { position: relative; }
.wallet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.wallet-head .label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(247, 246, 242, 0.55);
}
.wallet-head .iban {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(247, 246, 242, 0.5);
}
.wallet-balance {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--signal);
  line-height: 1;
}
.wallet-balance .unit { font-size: 20px; color: rgba(247, 246, 242, 0.7); margin-left: 4px; }
.wallet-rows {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(247, 246, 242, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.wallet-rows .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wallet-rows .l { color: rgba(247, 246, 242, 0.7); }
.wallet-rows .v { font-family: var(--font-mono); font-weight: 500; }
.wallet-cta {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.wallet-cta button {
  flex: 1;
  padding: 12px;
  border-radius: var(--r-pill);
  background: var(--signal);
  color: var(--signal-on);
  border: 0;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.wallet-cta button.ghost {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid rgba(247, 246, 242, 0.18);
}

/* commission breakdown */
.comm-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.comm-card .row:last-child { border-bottom: 0; padding-bottom: 0; }
.comm-card .row .l { color: var(--text-muted); }
.comm-card .row .v {
  font-family: var(--font-mono);
  font-weight: 500;
}
.comm-card .row .v.muted { color: var(--text-muted); }
.comm-card .row.total {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.comm-card .row.total .l {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.comm-card .row.total .v {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
