/**
 * Grid card shell (Phase 1, new). Wraps any AG Grid / CIGrid instance in a
 * consistent header-bar + grid + footer chrome. The grid engine itself
 * (AG Grid Community, CIGrid) is untouched — this is presentation chrome
 * only. Adopted per-surface as list pages are touched (Phase 2/4).
 */

.grid-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.grid-card__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--card-header-py) var(--card-header-px);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--card-header-bg);
}

.grid-card__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
  margin: 0;
  flex: 1;
  min-width: 0;
}

.grid-card__search {
  flex: 0 1 240px;
  min-width: 140px;
}

.grid-card__actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  margin-left: auto;
}

.grid-card__body {
  /* AG Grid / CIGrid instance mounts here. No padding — the grid manages
     its own internal spacing and needs to run edge-to-edge. */
}

.grid-card__body .ag-root-wrapper,
.grid-card__body .ci-grid {
  border: none;
  border-radius: 0;
}

.grid-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-2-5) var(--card-header-px);
  border-top: 1px solid var(--border-subtle);
  background: var(--card-header-bg);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Numeric columns: right-aligned, tabular-nums, monospace — applied by the
   grid engine's column def class, this just defines the shared utility. */
.grid-card .col-numeric {
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.grid-card .col-actions {
  width: 120px;
  display: flex;
  gap: var(--spacing-1);
  justify-content: flex-end;
}

@media (max-width: 1279.98px) {
  .grid-card__search { flex: 0 1 180px; min-width: 100px; }
}

@media (max-width: 1023.98px) {
  .grid-card__header { flex-wrap: wrap; }
  .grid-card__search { flex: 1 1 100%; order: 3; }
}

@media (max-width: 640px) {
  .grid-card__header { flex-wrap: wrap; }
  .grid-card__search { flex: 1 1 100%; order: 3; }
}
