/**
 * @file
 * Homologación visual FASE 7.24–7.26: clients, translators, V2, errores, logout.
 */

/* ---------- Shell común (listados y fichas V2) ---------- */
html.certlink-portal-route .certlink-portal-list-page .shell,
html.certlink-portal-route .certlink-portal-v2-page .shell,
html.certlink-portal-route .certlink-linguist-profile-page .shell,
html.certlink-portal-route .certlink-linguist-cv-page .shell {
  max-width: 100%;
  margin: 0;
  width: 100%;
  padding: var(--space-4, 16px) var(--certlink-portal-shell-pad-x, 28px) var(--space-6, 24px)
    var(--certlink-portal-shell-pad-x, 28px);
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

html.certlink-portal-route .certlink-page-head {
  margin: var(--space-2, 8px) 0 var(--space-6, 24px);
}

html.certlink-portal-route .certlink-page-head h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-4xl, 2rem);
  color: #fff;
  margin: 0 0 6px;
}

html.certlink-portal-route .certlink-page-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--fs-md, 1rem);
  line-height: 1.5;
}

/* Linguist Profile: cabecera según maqueta (solo título, fs-5xl). */
html.certlink-portal-route .certlink-linguist-profile-page .certlink-page-head {
  margin: var(--space-2, 8px) 0 var(--space-6, 24px);
  text-align: left;
}

html.certlink-portal-route .certlink-linguist-profile-page .certlink-page-head h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-5xl, 48px);
  letter-spacing: var(--tracking-tight, -0.01em);
  color: var(--al-white, #fff);
  margin: 0 0 8px;
}

/* Panel listados: mismo gradiente que table-card / settings */
html.certlink-portal-route .certlink-portal-list-page .certlink-portal-list-panel,
html.certlink-portal-route .certlink-portal-v2-page .certlink-portal-v2-panel,
html.certlink-portal-route .certlink-linguist-profile-page .certlink-portal-v2-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-2xl, 20px);
  padding: var(--space-8, 32px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.2));
}

html.certlink-portal-route .certlink-linguist-profile-page .shell {
  width: 100% !important;
  max-width: 100% !important;
}

html.certlink-portal-route .certlink-project-details-page.certlink-portal-v2-page .shell {
  width: 100% !important;
  max-width: 100% !important;
}

html.certlink-portal-route .certlink-portal-list-page .table-card {
  background: linear-gradient(180deg, rgba(0, 31, 54, 0.45), rgba(0, 48, 80, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
}

/* Thead navy en tablas portal (clients, translators, V2) */
html.certlink-portal-route .certlink-portal-list-page .table-card table thead th,
html.certlink-portal-route .certlink-portal-v2-page .certlink-portal-grid-wrap table thead th,
html.certlink-portal-route .certlink-linguist-profile-page .certlink-portal-grid-wrap table thead th {
  background: var(--al-navy-900, #001f36) !important;
  color: #fff !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm, 0.875rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

html.certlink-portal-route .certlink-portal-list-page .table-card tbody td,
html.certlink-portal-route .certlink-portal-v2-page .certlink-portal-grid-wrap tbody td,
html.certlink-portal-route .certlink-linguist-profile-page .certlink-portal-grid-wrap tbody td {
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
  line-height: 1.35;
}

html.certlink-portal-route .certlink-portal-list-page .table-card tbody tr:hover td,
html.certlink-portal-route .certlink-portal-v2-page .certlink-portal-grid-wrap tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

html.certlink-portal-route .certlink-portal-list-page a.certlink-portal-row-link,
html.certlink-portal-route .certlink-portal-v2-page a.certlink-v2-col-link {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 101, 34, 0.45);
}

html.certlink-portal-route .certlink-portal-v2-page a.certlink-linguist-name-link {
  color: var(--al-orange, #e09030) !important;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(224, 144, 48, 0.45);
}

html.certlink-portal-route .certlink-portal-list-page a.certlink-portal-row-link:hover,
html.certlink-portal-route .certlink-portal-v2-page a.certlink-linguist-name-link:hover {
  color: #fff !important;
  border-bottom-color: #fff !important;
}

/* Filtros expuestos Views: alinear a controles /projects */
html.certlink-portal-route .certlink-portal-list-page .view-filters {
  margin-bottom: var(--space-6, 24px);
}

html.certlink-portal-route .certlink-translators-page .certlink-translators-view-wrap .view-filters {
  margin-bottom: var(--space-6, 24px);
}

html.certlink-portal-route .certlink-translators-page .certlink-translators-view-wrap .view-filters form,
html.certlink-portal-route .certlink-translators-page .certlink-translators-controls.view-filters form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4, 16px);
}

html.certlink-portal-route .certlink-translators-page .certlink-translators-view-wrap .certlink-portal-grid-wrap,
html.certlink-portal-route .certlink-translators-page .certlink-translators-view-wrap .table-wrap {
  background: linear-gradient(180deg, rgba(0, 31, 54, 0.45), rgba(0, 48, 80, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
}

/* Toolbar V2 (Back + título) */
html.certlink-portal-route .certlink-v2-spec-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 16px);
  flex-wrap: wrap;
  margin-bottom: var(--space-6, 24px);
}

html.certlink-portal-route .certlink-v2-spec-toolbar .certlink-section-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-2xl, 1.5rem);
  color: #fff;
}

/* page-head ya muestra el título; la toolbar conserva solo Back */
html.certlink-portal-route .certlink-portal-v2-page .certlink-page-head + * .certlink-v2-spec-toolbar .certlink-section-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.certlink-portal-route .certlink-portal-v2-page .certlink-page-head + * .certlink-v2-spec-toolbar {
  justify-content: flex-end;
}

html.certlink-portal-route .certlink-v2-spec-back-btn.setup-btn {
  flex: none;
  text-decoration: none !important;
  font-weight: 700;
  border-radius: var(--radius-md, 8px);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff !important;
}

html.certlink-portal-route .certlink-v2-spec-back-btn.setup-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff !important;
}

/* Meta legacy (.meta .chip) → pills como /projects */
html.certlink-portal-route .certlink-portal-list-page .meta {
  display: none;
}

html.certlink-portal-route .certlink-panel-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
  margin-top: var(--space-6, 24px);
}

html.certlink-portal-route .certlink-panel-foot .pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 600;
}

html.certlink-portal-route .certlink-panel-foot .pill--muted {
  opacity: 0.85;
}

/* ---------- Errores 403/404 y confirmación logout ---------- */
html.certlink-portal-route .certlink-portal-error-page .shell,
html.certlink-portal-route .certlink-signout-confirm-page .shell {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--space-8, 32px) var(--space-6, 24px) var(--space-10, 40px);
}

html.certlink-portal-route .certlink-portal-error-page .certlink-portal-error-panel,
html.certlink-portal-route .certlink-signout-confirm-page .certlink-portal-error-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-2xl, 20px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.2));
  padding: var(--space-8, 32px) var(--space-6, 24px);
  text-align: center;
}

html.certlink-portal-route .certlink-portal-error-page .certlink-portal-error-code {
  color: rgba(255, 255, 255, 0.22);
}

html.certlink-portal-route .certlink-portal-error-page .certlink-portal-error-title,
html.certlink-portal-route .certlink-signout-confirm-page .certlink-portal-error-title {
  color: #fff;
  font-family: var(--font-display);
}

html.certlink-portal-route .certlink-portal-error-page .certlink-portal-error-text,
html.certlink-portal-route .certlink-signout-confirm-page .certlink-portal-error-text {
  color: rgba(255, 255, 255, 0.72);
}

html.certlink-portal-route .certlink-signout-confirm-page .certlink-portal-error-actions a.btn-primary.certlink-portal-error-btn {
  background: var(--al-orange, #e8722e) !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(232, 114, 46, 0.35);
}

html.certlink-portal-route .certlink-signout-confirm-page .certlink-portal-error-actions a.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
}

/* Plantillas: shell alineado a settings */
html.certlink-portal-route body.path-settings-general .certlink-template-manage-portal .shell,
html.certlink-portal-route body.path-settings-general .certlink-template-form-portal .shell {
  max-width: var(--container-xl);
  margin: 0 auto;
}

@media (max-width: 720px) {
  html.certlink-portal-route .certlink-portal-list-page .shell,
  html.certlink-portal-route .certlink-portal-v2-page .shell,
  html.certlink-portal-route .certlink-linguist-profile-page .shell {
    padding-left: var(--space-5, 20px);
    padding-right: var(--space-5, 20px);
  }

  html.certlink-portal-route .certlink-portal-list-page .certlink-portal-list-panel,
  html.certlink-portal-route .certlink-portal-v2-page .certlink-portal-v2-panel {
    padding: var(--space-5, 20px);
  }

  html.certlink-portal-route .certlink-v2-spec-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  html.certlink-portal-route .certlink-signout-confirm-actions {
    flex-direction: column !important;
    width: 100%;
  }

  html.certlink-portal-route .certlink-signout-confirm-actions .btn {
    width: 100%;
    max-width: 100%;
  }
}

/* ========== Escalado responsivo y legible para tablas del portal (proyectos, clientes, traductores, etc.) ========== */

/* 1. Pantallas medianas (Laptops compactas y tablets, p. ej. >=769px) */
@media (min-width: 769px) {
  html.certlink-portal-route .table-card table thead th,
  html.certlink-portal-route .certlink-portal-grid-wrap table thead th,
  html.certlink-portal-route .certlink-custom-page table thead th {
    font-size: 19px !important;
    padding: 16px 20px !important;
  }

  html.certlink-portal-route .table-card table tbody td,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td,
  html.certlink-portal-route .certlink-custom-page table tbody td {
    font-size: 19px !important;
    padding: 16px 20px !important;
  }

  /* Ajustar botones de acción y engranajes del listado para guardar proporción */
  html.certlink-portal-route .table-card table tbody td a.certlink-portal-row-link,
  html.certlink-portal-route .table-card table tbody td a.certlink-v2-col-link,
  html.certlink-portal-route .table-card table tbody td .btn {
    font-size: 19px !important;
  }

  /* Redimensionar el botón de configuración (engranaje) - Más compacto, 100% redondo */
  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td a.setup-btn.setup-btn--icon,
  html.certlink-portal-route .certlink-custom-page table tbody td a.setup-btn.setup-btn--icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    border-radius: 50% !important;
  }

  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon svg,
  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon img,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td a.setup-btn.setup-btn--icon svg,
  html.certlink-portal-route .certlink-custom-page table tbody td a.setup-btn.setup-btn--icon svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* 2. Pantallas de escritorio grandes (≥1200px) */
@media (min-width: 1200px) {
  html.certlink-portal-route .table-card table thead th,
  html.certlink-portal-route .certlink-portal-grid-wrap table thead th,
  html.certlink-portal-route .certlink-custom-page table thead th {
    font-size: 24px !important;
    padding: 20px 24px !important;
  }

  html.certlink-portal-route .table-card table tbody td,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td,
  html.certlink-portal-route .certlink-custom-page table tbody td {
    font-size: 24px !important;
    padding: 20px 24px !important;
  }

  /* Ajustar botones de acción y engranajes del listado para guardar proporción */
  html.certlink-portal-route .table-card table tbody td a.certlink-portal-row-link,
  html.certlink-portal-route .table-card table tbody td a.certlink-v2-col-link,
  html.certlink-portal-route .table-card table tbody td .btn {
    font-size: 24px !important;
  }

  /* Redimensionar el botón de configuración (engranaje) - Más compacto, 100% redondo */
  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td a.setup-btn.setup-btn--icon,
  html.certlink-portal-route .certlink-custom-page table tbody td a.setup-btn.setup-btn--icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    min-height: 26px !important;
    border-radius: 50% !important;
  }

  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon svg,
  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon img,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td a.setup-btn.setup-btn--icon svg,
  html.certlink-portal-route .certlink-custom-page table tbody td a.setup-btn.setup-btn--icon svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* 3. Pantallas Ultra-Wide y monitores grandes (≥1500px) */
@media (min-width: 1500px) {
  html.certlink-portal-route .table-card table thead th,
  html.certlink-portal-route .certlink-portal-grid-wrap table thead th,
  html.certlink-portal-route .certlink-custom-page table thead th {
    font-size: 28px !important;
    padding: 24px 30px !important;
  }

  html.certlink-portal-route .table-card table tbody td,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td,
  html.certlink-portal-route .certlink-custom-page table tbody td {
    font-size: 28px !important;
    padding: 24px 30px !important;
  }

  /* Ajustar botones de acción y engranajes del listado para guardar proporción */
  html.certlink-portal-route .table-card table tbody td a.certlink-portal-row-link,
  html.certlink-portal-route .table-card table tbody td a.certlink-v2-col-link,
  html.certlink-portal-route .table-card table tbody td .btn {
    font-size: 28px !important;
  }

  /* Redimensionar el botón de configuración (engranaje) - Más compacto, 100% redondo */
  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td a.setup-btn.setup-btn--icon,
  html.certlink-portal-route .certlink-custom-page table tbody td a.setup-btn.setup-btn--icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
  }

  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon svg,
  html.certlink-portal-route .table-card table tbody td a.setup-btn.setup-btn--icon img,
  html.certlink-portal-route .certlink-portal-grid-wrap table tbody td a.setup-btn.setup-btn--icon svg,
  html.certlink-portal-route .certlink-custom-page table tbody td a.setup-btn.setup-btn--icon svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* ---------- Vista CV del lingüista (portal header + PDF) ---------- */
html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-panel-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 16px);
  margin-bottom: var(--space-4, 16px);
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--fs-xl, 1.25rem);
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-panel-top .certlink-v2-back-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-viewer {
  background: #fff;
  border-radius: 12px;
  overflow: auto;
  min-height: 70vh;
  max-height: calc(100vh - 220px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-canvas-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #e8ecf0;
  min-height: 70vh;
  user-select: none;
  -webkit-user-select: none;
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-page-canvas {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-loading {
  margin: 48px auto;
  color: #334155;
  font-family: var(--font-sans);
}

@media print {
  /* El CV no debe salir en ninguna impresión de esta vista. */
  html.certlink-portal-route.certlink-linguist-cv-print-block .certlink-linguist-cv-viewer,
  html.certlink-portal-route.certlink-linguist-cv-print-block .certlink-linguist-cv-canvas-host,
  html.certlink-portal-route.certlink-linguist-cv-print-block .certlink-linguist-cv-page-canvas,
  html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-viewer,
  html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-canvas-host,
  html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-page-canvas,
  html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-loading {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -99999px !important;
    opacity: 0 !important;
  }

  html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-print-placeholder {
    display: block !important;
    visibility: visible !important;
    color: #000;
    font-family: sans-serif;
    font-size: 14px;
    margin: 24px 0;
  }
}

html.certlink-portal-route .certlink-linguist-cv-page .certlink-linguist-cv-print-placeholder {
  display: none;
}
