/**
 * SENVIQ Design System — Table, DataList, ActivityList, Skeleton,
 * Spinner, EmptyState, ErrorState, PageHeader, SectionHeader.
 * These are the primitives an information-dense administration screen
 * needs (Prompt 43's own "data density" requirement) — a table stays
 * a real, efficient <table>, not a card-per-row reinterpretation.
 */

/* ============ Table ============ */

.senviq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--senviq-fs-table);
}
.senviq-table th {
  text-align: left;
  font-weight: var(--senviq-fw-semibold);
  color: var(--senviq-muted);
  font-size: var(--senviq-fs-small);
  padding: var(--senviq-space-3) var(--senviq-space-4);
  border-bottom: 1px solid var(--senviq-border);
  white-space: nowrap;
}
.senviq-table td {
  padding: var(--senviq-space-3) var(--senviq-space-4);
  border-bottom: 1px solid var(--senviq-border);
  color: var(--senviq-navy);
}
.senviq-table tbody tr:hover {
  background: var(--senviq-bg);
}
.senviq-table td.senviq-table__numeric,
.senviq-table th.senviq-table__numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Deliberately no zebra-striping and no per-row rounded-card wrapper — a plain, dense, real table reads faster for an administrator scanning many rows (see PRODUCT_INFORMATION_ARCHITECTURE.md's data-density note). */

/* ============ DataList (a lighter-weight list for non-tabular, still-structured data) ============ */

.senviq-data-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.senviq-data-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--senviq-space-4);
  padding: var(--senviq-space-3) 0;
  border-bottom: 1px solid var(--senviq-border);
}
.senviq-data-list__row:last-child {
  border-bottom: none;
}

/* ============ ActivityList ============ */

.senviq-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.senviq-activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--senviq-space-3);
  padding: var(--senviq-space-3) 0;
  border-bottom: 1px solid var(--senviq-border);
}
.senviq-activity-item:last-child {
  border-bottom: none;
}
.senviq-activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--senviq-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--senviq-bg);
  color: var(--senviq-muted);
}
/* Status-accent modifiers (Prompt 46 visual-convergence pass) — decorative categorical accents only, same rule as StatCard's own icon tints; the event's own label text is always the real signal, never color alone. */
.senviq-activity-item__icon--mail {
  background: var(--senviq-accent-mail-bg);
  color: var(--senviq-accent-mail);
}
.senviq-activity-item__icon--sign {
  background: var(--senviq-accent-sign-bg);
  color: var(--senviq-accent-sign);
}
.senviq-activity-item__icon--pending {
  background: var(--senviq-warning-bg);
  color: var(--senviq-warning);
}
.senviq-activity-item__icon--attention {
  background: var(--senviq-danger-bg);
  color: var(--senviq-danger);
}
.senviq-activity-item__body {
  flex: 1;
  min-width: 0;
}
.senviq-activity-item__time {
  font-size: var(--senviq-fs-caption);
  color: var(--senviq-muted);
  white-space: nowrap;
}

/* ============ Skeleton ============ */

.senviq-skeleton {
  background: linear-gradient(
    90deg,
    var(--senviq-border) 25%,
    var(--senviq-bg) 37%,
    var(--senviq-border) 63%
  );
  background-size: 400% 100%;
  border-radius: var(--senviq-radius-sm);
  animation: senviq-skeleton-shimmer 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .senviq-skeleton {
    animation: none;
    background: var(--senviq-border);
  }
}
@keyframes senviq-skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ============ Spinner ============ */

.senviq-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--senviq-border);
  border-top-color: var(--senviq-blue);
  border-radius: 50%;
  animation: senviq-spin var(--senviq-duration-slow) linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .senviq-spinner {
    animation-duration: 1.2s; /* keeps a real, slow rotation rather than a jarring instant snap — spinners are an exception to "durations near-zero," since a static spinner communicates nothing */
  }
}

/* ============ EmptyState / ErrorState ============ */

.senviq-empty-state,
.senviq-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--senviq-space-3);
  padding: var(--senviq-space-12) var(--senviq-space-6);
  color: var(--senviq-muted);
}
.senviq-empty-state__icon,
.senviq-error-state__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--senviq-bg);
  color: var(--senviq-muted);
}
.senviq-error-state__icon {
  background: var(--senviq-danger-bg);
  color: var(--senviq-danger);
}
.senviq-empty-state__title,
.senviq-error-state__title {
  font-size: var(--senviq-fs-card-title);
  font-weight: var(--senviq-fw-semibold);
  color: var(--senviq-navy);
}

/* ============ PageHeader / SectionHeader ============ */

.senviq-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--senviq-space-4);
  margin-bottom: var(--senviq-space-6);
}
.senviq-page-header__eyebrow {
  font-size: var(--senviq-fs-caption);
  color: var(--senviq-muted);
  text-transform: uppercase;
  letter-spacing: var(--senviq-ls-caption);
  margin-bottom: var(--senviq-space-1);
}
.senviq-page-header__actions {
  display: flex;
  gap: var(--senviq-space-3);
  flex-shrink: 0;
}

.senviq-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--senviq-space-4);
}

/**
 * ContentGrid — a page-level two-column content layout (a wide primary
 * column, a narrower secondary column), Prompt 46's visual-convergence
 * pass. Generic on purpose (not "DashboardGrid") so any future page
 * with the same "main content + supporting panels" shape can reuse it.
 * Collapses to one column at/under the tablet breakpoint — this is a
 * content-density layout choice, not a component that itself needs a
 * different, narrower "mobile" collapse point.
 */
.senviq-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--senviq-space-6);
  align-items: start;
}
.senviq-content-grid__primary,
.senviq-content-grid__secondary {
  min-width: 0;
}
@media (max-width: 1024px) {
  .senviq-content-grid {
    grid-template-columns: 1fr;
  }
}

/**
 * ResponsiveList — Prompt 47's own "desktop table, mobile cards" pattern
 * (Task D's own instruction: a structured table on desktop, never a
 * horizontally-shrunk version of it on mobile). Renders BOTH
 * representations of the same data and toggles which is visible via CSS
 * only (never JS) — a `display:none` table is correctly excluded from
 * the accessibility tree, so this never doubles up for assistive tech.
 * `.senviq-mail-table`/`.senviq-mail-cards` names are deliberately
 * generic-ish (not literally scoped to Mail) so a later page facing the
 * exact same "dense list, denser than Dashboard's own activity feed"
 * need can reuse this rather than inventing its own toggle.
 */
.senviq-responsive-list__table {
  display: block;
}
.senviq-responsive-list__cards {
  display: none;
}
@media (max-width: 640px) {
  .senviq-responsive-list__table {
    display: none;
  }
  .senviq-responsive-list__cards {
    display: block;
  }
}
