:host {
  display: block;
}

.filter-bar {
  background: var(--p-surface-card);
  border: 1px solid var(--p-surface-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;

  label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--p-text-muted-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
}

.supplier-field {
  flex: 1;
  min-width: 220px;
}

.date-field {
  min-width: 160px;
}

.filter-presets {
  display: flex;
  gap: 0.25rem;
  align-items: flex-end;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

// Loading
.loading-container {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

// Summary Cards
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;

  &:hover {
    transform: translateY(-2px);
  }
}

.card-opening {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
}

.card-debit {
  background: linear-gradient(135deg, #ef5350, #c62828);
}

.card-credit {
  background: linear-gradient(135deg, #66bb6a, #2e7d32);
}

.card-closing {
  background: linear-gradient(135deg, #ffa726, #e65100);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 1.3rem;
}

.card-content {
  display: flex;
  flex-direction: column;
}

.card-label {
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: 500;
}

.card-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: -0.5px;
}

// Table
.statement-table-wrapper {
  background: var(--p-surface-card);
  border: 1px solid var(--p-surface-border);
  border-radius: 12px;
  overflow: hidden;
}

.text-end {
  text-align: end !important;
}

.mono-cell {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
}

.debit-cell {
  color: #ef5350;
}

.credit-cell {
  color: #4caf50;
}

.balance-cell {
  font-weight: 600;
}

.positive-balance {
  color: #ef5350;
}

.negative-balance {
  color: #4caf50;
}

.opening-balance-row {
  background: var(--p-surface-hover) !important;

  .opening-label {
    font-size: 0.9rem;
  }
}

.totals-row {
  background: var(--p-surface-hover) !important;
  font-size: 1rem;

  .totals-label {
    font-size: 0.95rem;
  }
}

.doc-link {
  color: var(--p-primary-color);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;

  &:hover {
    color: var(--p-primary-hover-color);
  }
}

// Empty state
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  text-align: center;
  color: var(--p-text-muted-color);

  i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
  }

  p {
    font-size: 1.1rem;
    max-width: 400px;
  }
}

// Print styles
@media print {
  .filter-bar,
  .filter-actions,
  .filter-presets {
    display: none !important;
  }

  .summary-cards {
    break-inside: avoid;
  }

  .summary-card {
    box-shadow: none;
    border: 1px solid #ddd;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

// Responsive
@media (max-width: 768px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-row {
    flex-direction: column;
  }

  .supplier-field,
  .date-field {
    width: 100%;
  }
}
