.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.dashboard-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.dashboard-summary {
  flex-shrink: 0;
  padding-bottom: 28px;
}

.dashboard-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
}

.summary-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.summary-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.summary-card-value.danger {
  color: var(--color-danger);
}

.summary-card-sub {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.grid-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.grid-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  max-height: 320px;
}

.table-scroll {
  overflow-x: auto;
}

.table-scroll table th:last-child,
.table-scroll table td:last-child {
  position: sticky;
  right: 0;
  background: var(--color-surface);
  z-index: 1;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-surface);
}

.table-scroll thead th:last-child {
  z-index: 3;
}

.table-scroll table tbody tr:nth-child(even) td:last-child {
  background: var(--color-row-alt);
}

.table-scroll table tbody tr:hover td:last-child {
  background: var(--color-row-hover);
}

.table-scroll table tbody tr.selected td:last-child {
  background: var(--color-primary-light);
}

.table-scroll table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.table-scroll table td {
  padding: 10px 12px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table-scroll table tbody tr:nth-child(even) {
  background: var(--color-row-alt);
}

.table-scroll table tbody tr:hover {
  background: var(--color-row-hover);
}

.table-scroll table tbody tr.selected {
  background: var(--color-primary-light);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.table-scroll table tbody tr.selected:hover {
  background: var(--color-primary-light);
}

.table-scroll table tbody tr.selected td {
  font-weight: 500;
}

.amount {
  font-family: var(--font-mono);
  font-weight: 500;
}

.client-name {
  font-weight: 500;
}

.invoice-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.invoice-link:hover {
  text-decoration: underline;
}

.reports-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.reports-header {
  flex-shrink: 0;
  padding-bottom: 20px;
}

.reports-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

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

  .grid-charts {
    grid-template-columns: 1fr;
  }

  .grid-tables {
    grid-template-columns: 1fr;
  }
}

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