/* RecruiterDocs shared primitives: cards, tables, lists */

/* ─── Design token system ─── */
:root {
  color-scheme: light;

  /* Type scale */
  --rd-text-h1: 28px;
  --rd-text-h2: 20px;
  --rd-text-body: 14px;
  --rd-text-small: 13px;
  --rd-text-meta: 12px;
  --rd-text-label: 11px;

  /* Spacing (8pt grid) */
  --rd-space-0: 4px;
  --rd-space-1: 8px;
  --rd-space-2: 16px;
  --rd-space-3: 24px;
  --rd-space-4: 32px;
  --rd-space-5: 40px;

  /* Control heights — one standard */
  --rd-control-h: 40px;
  --rd-control-h-sm: 32px;

  /* Radii */
  --rd-radius-xs: 8px;   /* badges, chips */
  --rd-radius-sm: 12px;  /* buttons, inputs */
  --rd-radius-md: 18px;  /* cards */
  --rd-radius-lg: 28px;  /* hero cards */

  /* Card */
  --card-radius-xl: 22px;
  --card-shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 38px rgba(15, 23, 42, 0.07);
  --card-shadow-elevated: 0 1px 2px rgba(15, 23, 42, 0.05), 0 24px 56px rgba(15, 23, 42, 0.12);

  /* Surfaces & borders */
  --rd-border-subtle: rgba(15, 23, 42, 0.09);
  --rd-border-faint: rgba(15, 23, 42, 0.06);
  --rd-border-strong: rgba(15, 23, 42, 0.14);
  --rd-surface: rgba(255, 255, 255, 0.94);
  --rd-surface-elevated: rgba(255, 255, 255, 0.98);
  --rd-surface-muted: rgba(246, 248, 251, 0.92);
  --rd-surface-header: rgba(249, 250, 251, 0.92);
  --rd-canvas: #f3f5f7;
  --rd-canvas-tint: #eef2f7;
  --rd-ink: #101828;
  --rd-ink-soft: #475467;
  --rd-ink-muted: #667085;

  /* Accent */
  --rd-accent: #264f76;
  --rd-accent-strong: #16395b;
  --rd-accent-soft: rgba(38, 79, 118, 0.12);
  --rd-accent-border: rgba(38, 79, 118, 0.22);
  --rd-indigo: var(--rd-accent);
  --rd-indigo-soft: var(--rd-accent-soft);
}

/* ─── Cards ─── */
.rd-card,
.rd-dash-card {
  background: var(--rd-surface);
  border-radius: var(--card-radius-xl);
  box-shadow: var(--card-shadow-soft);
  border: 1px solid var(--rd-border-subtle);
  padding: 20px 22px 18px;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.rd-card + .rd-card {
  margin-top: 16px;
}

/* Card micro-interactions */
a.rd-card:hover,
a.rd-dash-card:hover,
.rd-card--interactive:hover {
  box-shadow: var(--card-shadow-elevated);
  border-color: var(--rd-accent-border);
  transform: translateY(-2px);
}

a.rd-card:active,
a.rd-dash-card:active,
.rd-card--interactive:active {
  transform: translateY(0);
  box-shadow: var(--card-shadow-soft);
}

.rd-card-hero {
  border-radius: var(--rd-radius-lg);
}

.rd-card-panel {
  background: var(--rd-surface-elevated);
}

.rd-card-header {
  margin-bottom: 6px;
}

.rd-card-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.rd-card-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--rd-ink-muted);
}

.rd-card-body-tight {
  padding-top: 8px;
}

.rd-card-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.rd-card-compact {
  padding: 14px 14px 12px;
}

/* Alerts */
.rd-alert {
  border-radius: 16px;
  border: 1px solid var(--rd-border-subtle);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  background: var(--rd-surface-muted);
  color: #0f172a;
}

.rd-alert--warn {
  background: #fff7ed;
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

.rd-alert--ok {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.rd-alert--info,
.rd-alert-info {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.32);
  color: #1d4ed8;
}

.rd-alert--clone {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.rd-alert--clone p {
  margin: 0;
}

.rd-alert--clone p + p {
  margin-top: 6px;
}

.rd-alert--clone-dismiss {
  border: none;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.rd-alert--clone-dismiss:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.85);
}

/* Choice cards (radio selector) */
.rd-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.rd-choice {
  border-radius: 18px;
  border: 1px solid var(--rd-border-subtle);
  background: var(--rd-surface-muted);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.rd-choice:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-0.5px);
}

.rd-choice input[type="radio"] {
  margin-top: 3px;
}

.rd-choice-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
  color: #0f172a;
}

.rd-choice-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.rd-choice--active {
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.12);
  background: #ffffff;
}

/* Lists */
.rd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rd-list-lines .rd-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e8f0;
  font-size: 14px;
  flex-wrap: wrap;
}

.rd-list-lines .rd-list-row:last-child {
  border-bottom: none;
}

.rd-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 200px;
}

/* Tables */
.rd-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--rd-border-faint);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 251, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.rd-table {
  width: 100%;
  border-collapse: collapse;
}

.rd-table th,
.rd-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rd-border-faint);
  text-align: left;
  font-size: 13px;
  color: #344054;
  vertical-align: top;
}

.rd-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #667085;
  background: rgba(244, 247, 250, 0.9);
  border-bottom-color: var(--rd-border-subtle);
}

.rd-table tbody tr:nth-child(even) td {
  background: rgba(250, 251, 252, 0.68);
}

.rd-table tbody tr:hover td {
  background: rgba(38, 79, 118, 0.04);
}

.rd-table a:not(.rd-link) {
  color: var(--rd-accent);
  text-decoration: none;
  font-weight: 600;
}

.rd-table a:not(.rd-link):hover {
  text-decoration: underline;
}

.rd-table-tight th,
.rd-table-tight td {
  padding: 10px 12px;
  font-size: 12px;
}

.rd-table-tight thead th {
  font-size: 10px;
}

.rd-table-compact th,
.rd-table-compact td {
  padding: 10px 12px;
  font-size: 12px;
}

.rd-table-compact thead th {
  font-size: 10px;
}

.rd-table-filters th {
  background: transparent;
  text-transform: none;
  letter-spacing: normal;
  border-bottom-color: var(--rd-border-faint);
  padding-top: 8px;
  padding-bottom: 12px;
}
