/* ═══════════════════════════════════════════════════════════════
   BALANCE MODULE STYLES
   Financial reporting UI
   ═══════════════════════════════════════════════════════════════ */

.balance-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px 16px 16px;
}

.balance-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-2);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.balance-card:active {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.balance-card:active::before {
  transform: scaleX(1);
}

.balance-card-icon {
  font-size: 52px;
  margin-bottom: 16px;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.balance-card-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: -0.3px;
}

.balance-card-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.4;
}

.balance-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  cursor: pointer;
  margin-bottom: 24px;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.balance-back:active {
  background: var(--color-surface-2);
  transform: scale(0.97);
}

.balance-back svg {
  flex-shrink: 0;
}

.balance-section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 28px 0;
  letter-spacing: -0.5px;
}

.balance-filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-select {
  width: 100%;
  padding: 16px 20px;
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border-2);
  border-radius: 12px;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 50px;
  transition: all 0.2s ease;
}

.balance-select:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-surface-3);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
}

.balance-select:active {
  transform: scale(0.99);
}

/* Report Styles */
.report-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #334155;
}

.report-header h2 {
  font-size: 24px;
  color: #e2e8f0;
  margin: 0 0 16px 0;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.report-meta-item {
  background: #1e293b;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.report-meta-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 8px;
}

.report-meta-value {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.summary-card.positive {
  background: linear-gradient(135deg, #064e3b 0%, #1e293b 100%);
  border-color: #10b981;
}

.summary-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 28px;
  color: #e2e8f0;
  font-weight: 700;
}

.summary-card.positive .summary-value {
  color: #10b981;
}

.report-breakdown {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.report-breakdown h3 {
  font-size: 18px;
  color: #e2e8f0;
  margin: 0 0 16px 0;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #334155;
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row.total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #334155;
  font-size: 18px;
  font-weight: 700;
}

.breakdown-label {
  color: #cbd5e1;
  font-size: 14px;
}

.breakdown-value {
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
}

.breakdown-value.positive {
  color: #10b981;
}

.report-alert {
  background: #7c2d12;
  border: 1px solid #ea580c;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.alert-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-size: 16px;
  font-weight: 700;
  color: #fed7aa;
  margin-bottom: 4px;
}

.alert-text {
  font-size: 14px;
  color: #fef3c7;
}

.report-payment-methods {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.report-payment-methods h3 {
  font-size: 18px;
  color: #e2e8f0;
  margin: 0 0 16px 0;
}

.report-tech-breakdown {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.report-tech-breakdown h3 {
  font-size: 18px;
  color: #e2e8f0;
  margin: 0 0 16px 0;
}

.tech-item {
  padding: 16px;
  background: #0f172a;
  border-radius: 8px;
  margin-bottom: 12px;
}

.tech-name {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.tech-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #94a3b8;
}

.balance-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
}

@media (max-width: 640px) {
  .balance-actions {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   BIG-NUMBER CARDS (V1 Overall Balance — 4-up summary)
   ═══════════════════════════════════════════════════════════════ */
.bal-big-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 700px) {
  .bal-big-grid { grid-template-columns: repeat(4, 1fr); }
}
.bal-big-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-2);
  border-radius: 16px;
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  min-height: 110px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.bal-big-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
}
.bal-big-sales::before   { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.bal-big-tech::before    { background: linear-gradient(90deg, #ef4444, #f97316); }
.bal-big-parts::before   { background: linear-gradient(90deg, #f59e0b, #f97316); }
.bal-big-company::before { background: linear-gradient(90deg, #22c55e, #10b981); }

.bal-big-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.bal-big-value {
  font-size: 30px;
  font-weight: 900;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.bal-big-company .bal-big-value { color: #16a34a; }
.bal-big-tech    .bal-big-value { color: #dc2626; }
.bal-big-parts   .bal-big-value { color: #d97706; }
.bal-big-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* PDF download button */
.btn-pdf {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-pdf:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.32);
}
.btn-pdf:active {
  transform: scale(0.98);
}

.balance-actions button {
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: #475569;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   REPORTS DASHBOARD — premium aggregates panel above Balance UI
   ═══════════════════════════════════════════════════════════════ */
.reports-dashboard { max-width: 800px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }

.rd-source-filter {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border-2);
  border-radius: 12px;
  padding: 10px 14px;
}
.rd-source-filter label { font-weight: 700; }

.rd-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .rd-tiles { grid-template-columns: repeat(4, 1fr); } }

.rd-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border-2);
  border-radius: 14px;
  padding: 14px 14px 12px;
  position: relative;
  overflow: hidden;
}
.rd-tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
}
.rd-tile-today::before { background: linear-gradient(90deg, #22c55e, #10b981); }
.rd-tile-week::before  { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.rd-tile-month::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.rd-tile-conv::before  { background: linear-gradient(90deg, #ec4899, #d946ef); }
.rd-tile-label { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.rd-tile-value { font-size: 24px; font-weight: 800; color: var(--color-text); margin-top: 4px; line-height: 1.1; }
.rd-tile-sub   { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

.rd-pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-2);
  border-radius: 14px;
  padding: 12px;
}
@media (min-width: 640px) { .rd-pipeline { grid-template-columns: repeat(6, 1fr); } }
.rd-pipeline-cell {
  background: var(--color-surface-raised);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.rd-pipeline-cell:active { transform: scale(0.96); }
.rd-pipeline-cell b { display: block; font-size: 22px; font-weight: 800; color: var(--color-text); }
.rd-pipeline-cell span { display: block; font-size: 10px; color: var(--color-text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.rd-cell-good b { color: #22c55e; }
.rd-cell-bad b  { color: #ef4444; }

.rd-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border-2);
  border-radius: 14px;
  padding: 14px;
}
.rd-list-title { font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 10px; }
.rd-list-row {
  display: grid;
  grid-template-columns: 1fr 90px 70px 30px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-2);
}
.rd-list-row:last-child { border-bottom: none; }
.rd-list-row-name { font-size: 13px; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-list-row-bar { background: var(--color-surface-raised); height: 8px; border-radius: 6px; overflow: hidden; }
.rd-list-row-bar > div { height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); border-radius: 6px; }
.rd-list-row-val { font-size: 13px; font-weight: 700; color: var(--color-text); text-align: right; }
.rd-list-row-count { font-size: 11px; color: var(--color-text-muted); text-align: right; }
@media (max-width: 480px) {
  .rd-list-row { grid-template-columns: 1fr 60px 60px; }
  .rd-list-row-count { display: none; }
}
