/* P3.6 Global UX & Production Finish layer.
   A final non-invasive polish for legacy/secondary admin and subscriber pages. */
:root {
  --fd-focus-ring: 0 0 0 .22rem rgba(183, 19, 31, .18);
  --fd-table-border: rgba(15, 23, 42, .08);
  --fd-table-head: #f8fafc;
  --fd-surface-2: #ffffff;
}

.fd-app-body,
.fd-public-body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.fd-app-body a.btn,
.fd-public-body a.btn { text-decoration: none; }

.fd-app-body .btn,
.fd-public-body .btn {
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.55rem;
}

.fd-app-body .btn-sm,
.fd-public-body .btn-sm { min-height: 2.1rem; }

.fd-app-body .btn:focus-visible,
.fd-public-body .btn:focus-visible,
.fd-app-body .form-control:focus,
.fd-app-body .form-select:focus,
.fd-public-body .form-control:focus,
.fd-public-body .form-select:focus {
  border-color: var(--fd-primary, #b7131f);
  box-shadow: var(--fd-focus-ring);
}

.fd-app-body .card,
.fd-app-body .fd-card,
.fd-public-body .card,
.fd-public-body .fd-card {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .07);
}

.fd-app-body .table-responsive,
.fd-public-body .table-responsive {
  border: 1px solid var(--fd-table-border);
  border-radius: 22px;
  background: var(--fd-surface-2);
  box-shadow: 0 16px 45px rgba(15, 23, 42, .05);
  overflow: auto;
}

.fd-app-body table.table,
.fd-public-body table.table { margin-bottom: 0; vertical-align: middle; }

.fd-app-body .table > :not(caption) > * > *,
.fd-public-body .table > :not(caption) > * > * {
  padding: .95rem 1rem;
  border-bottom-color: var(--fd-table-border);
}

.fd-app-body .table thead th,
.fd-public-body .table thead th {
  background: var(--fd-table-head);
  color: #334155;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .01em;
  border-bottom: 1px solid rgba(15, 23, 42, .1);
  white-space: nowrap;
}

.fd-app-body .table tbody tr,
.fd-public-body .table tbody tr { transition: background .18s ease, transform .18s ease; }
.fd-app-body .table tbody tr:hover,
.fd-public-body .table tbody tr:hover { background: rgba(183, 19, 31, .035); }

.fd-app-body .alert,
.fd-public-body .alert {
  border: 0;
  border-radius: 20px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .06);
}

.fd-app-body .form-control,
.fd-app-body .form-select,
.fd-public-body .form-control,
.fd-public-body .form-select {
  border-radius: 16px;
  border-color: rgba(15, 23, 42, .12);
  min-height: 2.75rem;
}

.fd-app-body textarea.form-control,
.fd-public-body textarea.form-control { min-height: 7rem; }

.fd-app-body .badge,
.fd-public-body .badge {
  border-radius: 999px;
  padding: .45em .75em;
  font-weight: 800;
}

.fd-empty-state,
.fd-legacy-empty,
.fd-polish-empty {
  padding: clamp(2rem, 4vw, 3.5rem);
  text-align: center;
  border: 1px dashed rgba(100, 116, 139, .35);
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.fd-empty-state i,
.fd-legacy-empty i,
.fd-polish-empty i { font-size: 2.5rem; color: var(--fd-primary, #b7131f); }
.fd-empty-state h2,
.fd-empty-state h3,
.fd-legacy-empty h2,
.fd-legacy-empty h3,
.fd-polish-empty h2,
.fd-polish-empty h3 { font-weight: 900; margin-top: 1rem; }
.fd-empty-state p,
.fd-legacy-empty p,
.fd-polish-empty p { color: #64748b; max-width: 42rem; margin-inline: auto; }

.fd-admin-page .page-title,
.fd-subscriber-page .page-title,
.fd-admin-page h1:first-child,
.fd-subscriber-page h1:first-child {
  font-weight: 900;
  letter-spacing: -.03em;
}

.fd-print-shell {
  min-height: 100vh;
  background: radial-gradient(circle at top right, rgba(183, 19, 31, .09), transparent 32rem), #f8fafc;
  padding: 24px;
}

.fd-print-card {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
  overflow: hidden;
}

.fd-print-toolbar {
  max-width: 860px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fd-print-card__head {
  padding: 28px;
  color: #fff;
  background: linear-gradient(135deg, #991b1b, #b7131f 52%, #ef4444);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fd-print-card__head h1 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 2rem); font-weight: 900; }
.fd-print-card__head p { margin: .35rem 0 0; color: rgba(255,255,255,.82); }
.fd-print-card__body { padding: clamp(22px, 4vw, 36px); }
.fd-print-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fd-print-section { margin-top: 24px; }
.fd-print-section h2 { color: #991b1b; font-size: 1rem; font-weight: 900; margin-bottom: 12px; }
.fd-print-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 18px; border: 1px solid rgba(15,23,42,.09); }
.fd-print-table th,
.fd-print-table td { padding: 11px 14px; border-bottom: 1px solid rgba(15,23,42,.08); text-align: right; }
.fd-print-table th { background: #f8fafc; color: #475569; width: 24%; font-size: .82rem; }
.fd-signature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 30px; }
.fd-signature-box { border: 1px dashed rgba(153,27,27,.45); border-radius: 20px; min-height: 120px; padding: 18px; text-align: center; }
.fd-signature-box strong { color: #991b1b; }
.fd-signature-line { border-top: 1px solid rgba(15,23,42,.35); margin: 38px auto 8px; width: 75%; }

@media (max-width: 767.98px) {
  .fd-app-body .table-responsive { border-radius: 18px; }
  .fd-app-body .table > :not(caption) > * > * { padding: .75rem; }
  .fd-print-shell { padding: 12px; }
  .fd-print-card__head,
  .fd-print-grid,
  .fd-signature-grid { grid-template-columns: 1fr; }
  .fd-print-card__head { flex-direction: column; align-items: flex-start; }
}

@media print {
  .fd-print-shell { background: #fff; padding: 0; }
  .fd-print-toolbar { display: none !important; }
  .fd-print-card { box-shadow: none; border: 0; border-radius: 0; }
  .fd-print-card__head { color: #111827; background: #fff; border-bottom: 2px solid #991b1b; }
  .fd-print-card__head p { color: #334155; }
}
