/* Canopy ERP — extra view styles for Dashboard, Clients, Expenses, Reports */

/* Grid that hosts most of the secondary cards */
.dash-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
}
.dash-chart { grid-column: 1; grid-row: 1; }
.dash-side { grid-column: 2; grid-row: 1; padding: 18px 18px 14px; }
.dash-activity { grid-column: 1; grid-row: 2; }
.dash-upcoming { grid-column: 2; grid-row: 2; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-chart, .dash-side, .dash-activity, .dash-upcoming {
    grid-column: 1 / -1; grid-row: auto;
  }
}

/* Legend pills used inside card toolbars */
.chart-legend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.chart-legend .dot { width: 8px; height: 8px; border-radius: 999px; }

/* Bar chart (Dashboard — Billed vs collected) */
.bar-chart {
  display: flex; align-items: flex-end; gap: 18px;
  padding: 24px 20px 12px;
  height: 220px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bars { display: flex; align-items: flex-end; gap: 6px; flex: 1; width: 100%; justify-content: center; }
.bar {
  width: 18px; border-radius: 4px 4px 0 0;
  transition: transform 120ms ease;
  min-height: 4px;
}
.bar.billed   { background: #0f172a; }
.bar.collected{ background: #10b981; }
.bar:hover    { transform: translateY(-2px); }
.bar-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.bar-foot {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line-soft);
}
.bar-foot-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.bar-foot-v { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Quick actions */
.dash-side-head { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.dash-actions { display: flex; flex-direction: column; gap: 8px; }
.dash-action {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer;
  font: inherit; color: var(--ink); text-align: left;
  transition: background 100ms;
}
.dash-action:hover { background: var(--line-soft); }
.dash-action i { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.75; }
.dash-action b { font-size: 13px; font-weight: 600; display: block; }
.dash-action span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 1px; }

/* Activity list */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 20px; border-bottom: 1px solid var(--line-soft);
}
.activity-item:last-child { border-bottom: 0; }
.activity-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--line-soft); color: var(--muted);
}
.activity-icon i { width: 14px; height: 14px; stroke-width: 2; }
.activity-item.tone-pos  .activity-icon { background: var(--pos-bg);  color: var(--pos); }
.activity-item.tone-warn .activity-icon { background: var(--warn-bg); color: var(--warn); }
.activity-item.tone-neg  .activity-icon { background: var(--neg-bg);  color: var(--neg); }
.activity-body { flex: 1; min-width: 0; font-size: 13px; color: var(--text); line-height: 1.5; }
.activity-body b { color: var(--ink); font-weight: 600; }
.activity-when { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

/* Upcoming */
.upcoming-list { padding: 4px 0 4px; }
.upcoming-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--line-soft);
}
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-buyer { font-size: 13px; font-weight: 500; color: var(--ink); }
.upcoming-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.upcoming-amt { font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* --------- Clients --------- */
.client-cell { display: flex; align-items: center; gap: 11px; }
.client-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: #0f172a;
  flex-shrink: 0;
}

/* --------- Expenses --------- */
.expense-grid {
  grid-template-columns: 2fr 1fr;
}
.expense-breakdown { grid-column: 1; grid-row: 1; padding: 0 0 16px; }
.expense-cards { grid-column: 2; grid-row: 1; padding: 0; }

.stacked-bar {
  display: flex; height: 10px;
  margin: 20px 20px 18px; border-radius: 999px; overflow: hidden;
}
.stacked-seg { height: 100%; }
.stacked-seg:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.stacked-seg:last-child  { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }

.cat-list { list-style: none; margin: 0; padding: 0 20px 4px; }
.cat-row {
  display: grid;
  grid-template-columns: 10px 1fr 140px 72px 44px;
  align-items: center; gap: 10px;
  padding: 8px 0; font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.cat-row:last-child { border-bottom: 0; }
.cat-dot { width: 10px; height: 10px; border-radius: 999px; }
.cat-name { color: var(--ink); font-weight: 500; }
.cat-bar {
  height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden;
}
.cat-bar > span { display: block; height: 100%; border-radius: 999px; }
.cat-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.cat-pct { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Virtual cards */
.expense-cards { padding-bottom: 14px; }
.expense-cards .card-toolbar { padding-top: 10px !important; }
.link-sm { font-size: 12px; color: var(--accent); font-weight: 500; cursor: pointer; }
.link-sm:hover { text-decoration: underline; }
.vcard {
  margin: 14px 18px 0;
  padding: 14px 16px 14px;
  border-radius: 10px;
  color: #fff;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.vcard.ink    { background: linear-gradient(135deg, #0f172a, #1e293b); }
.vcard.green  { background: linear-gradient(135deg, #065f46, #047857); }
.vcard::after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
}
.vcard-head { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 0.04em; opacity: 0.8; }
.vcard-brand { font-weight: 700; letter-spacing: 0.08em; font-size: 11.5px; }
.vcard-num { font-family: "JetBrains Mono", Menlo, monospace; font-size: 15px; letter-spacing: 0.08em; font-weight: 500; }
.vcard-foot { display: flex; justify-content: space-between; font-size: 11.5px; opacity: 0.85; margin-top: auto; }
.vcard-foot b { font-weight: 600; }
.vcard-add {
  margin: 12px 18px 0; padding: 12px;
  border: 1px dashed var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.vcard-add:hover { color: var(--ink); border-color: var(--dim); }
.vcard-add i { width: 14px; height: 14px; }

/* Expense row icon */
.expense-cell { display: flex; align-items: center; gap: 11px; }
.expense-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--line-soft); color: var(--muted);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.expense-icon i { width: 15px; height: 15px; stroke-width: 1.75; }

/* --------- Reports --------- */
.report-cashflow { grid-column: 1; grid-row: 1; padding: 0 0 16px; }
.report-aging    { grid-column: 2; grid-row: 1; padding: 0 0 12px; }
.report-top      { grid-column: 1; grid-row: 2; }
.report-docs     { grid-column: 2; grid-row: 2; padding: 0 0 8px; }

.lines-chart { padding: 16px 8px 8px; }
.lines-svg { width: 100%; height: 200px; display: block; }
.lines-x {
  display: flex; justify-content: space-between;
  padding: 4px 16px 0;
  font-size: 11.5px; color: var(--muted);
}

.aging-list { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.aging-head { display: flex; justify-content: space-between; align-items: baseline; }
.aging-bucket { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.aging-amt { font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.aging-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin-top: 6px; }
.aging-bar > span { display: block; height: 100%; border-radius: 999px; }
.aging-pct { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.rank {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--line-soft); color: var(--muted);
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

.share-cell { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.share-bar { width: 80px; height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.share-bar > span { display: block; height: 100%; background: #4f46e5; border-radius: 999px; }

.reports-list { display: flex; flex-direction: column; padding: 8px 0; }
.report-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.report-item:last-child { border-bottom: 0; }
.report-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-bg); color: var(--accent-ink);
  display: grid; place-items: center; flex-shrink: 0;
}
.report-icon i { width: 15px; height: 15px; stroke-width: 1.75; }

.btn-ghost-sm {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 6px; background: transparent; border: 0; cursor: pointer;
  color: var(--muted);
}
.btn-ghost-sm:hover { background: var(--line-soft); color: var(--ink); }
.btn-ghost-sm i { width: 14px; height: 14px; }
