:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #eef3f9;
  --primary: #1f4e79;
  --primary-dark: #153a59;
  --secondary: #3b82f6;
  --accent: #10b981;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #dfe7f1;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--primary-dark);
}

p {
  margin: 0 0 12px;
  color: var(--text);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Layout general --- */

.topbar {
  background: var(--primary);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px var(--shadow);
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.topbar nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar nav a, .topbar nav button {
  color: white;
  font-size: 0.95rem;
}

.admin-nav-menu {
  position: relative;
  color: white;
  font-size: 0.95rem;
}

.admin-nav-menu summary {
  cursor: pointer;
  list-style: none;
}

.admin-nav-menu summary::-webkit-details-marker {
  display: none;
}

.admin-nav-menu summary::after {
  content: " v";
  font-size: 0.75rem;
}

.admin-nav-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 8px 20px var(--shadow);
}

.admin-nav-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--text) !important;
  white-space: nowrap;
}

.admin-nav-dropdown a:hover {
  background: var(--panel-soft);
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page-header {
  margin-bottom: 24px;
}

/* --- Cards --- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px var(--shadow);
  padding: 20px;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.graduate-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graduate-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.graduate-card-meta {
  min-width: 0;
}

.graduate-avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.graduate-avatar-placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary);
}

.profile-public-header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-public-avatar {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.profile-public-info {
  flex: 1;
  min-width: 220px;
}

.graduate-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.graduate-card .role {
  color: var(--muted);
  font-size: 0.9rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  background: var(--panel-soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
}

/* --- Textos extensos truncados con 'Ver más' --- */
.expandable-text-wrap {
  margin-top: 4px;
  margin-bottom: 8px;
}

.clamped-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}

.clamped-text.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.btn-toggle-expand {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.btn-toggle-expand:hover {
  text-decoration: underline;
  color: var(--primary);
}

/* --- Formularios --- */

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  color: var(--text);
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 1px;
  border-color: var(--secondary);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.filters-bar .form-group {
  margin-bottom: 0;
  min-width: 160px;
  flex: 1;
}

/* --- Botones --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Badges y mensajes --- */

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-public {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.badge-private {
  background: rgba(107, 114, 128, 0.15);
  color: var(--muted);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #92610a;
}

.alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

/* --- Selecciones (chips seleccionables) --- */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Tabla simple (admin) --- */

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

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-bar .form-group {
    min-width: 0;
  }
}

/* --- Utilidades --- */

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-photo-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 22px;
}

.profile-photo-frame {
  position: relative;
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-soft);
}

.profile-photo-frame img,
.profile-photo-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.profile-photo-frame img {
  display: block;
  object-fit: cover;
}

.profile-photo-frame img[hidden],
.profile-photo-placeholder[hidden],
.photo-remove-button[hidden] {
  display: none;
}

.profile-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.photo-edit-button {
  position: absolute;
  right: 3px;
  bottom: 5px;
  max-width: calc(100% - 12px);
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.photo-edit-button:hover {
  background: var(--primary-dark);
}

.profile-photo-actions {
  min-width: 0;
}

.profile-photo-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.profile-photo-buttons [hidden] {
  display: none;
}

.photo-crop-panel {
  width: min(100%, 420px);
}

.photo-crop-stage {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px;
}

#photoCropCanvas {
  width: 320px;
  height: 320px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#photoCropCanvas:active {
  cursor: grabbing;
}

.photo-crop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.photo-crop-controls label {
  margin: 0;
}

.photo-crop-controls input[type="range"] {
  flex: 1;
  padding: 0;
  border: 0;
}

.photo-remove-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--panel-soft);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  cursor: default;
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 38px;
  color: var(--muted);
  font-weight: 600;
}

.admin-page {
  max-width: 1440px;
}

.admin-table-card {
  padding: 0;
  overflow: hidden;
}

.admin-table-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-toolbar-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-table-toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-search-label {
  width: min(100%, 360px);
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-search-label input {
  margin-top: 4px;
}

.admin-table-scroll {
  max-width: 100%;
  overflow: auto;
}

.admin-table {
  min-width: 900px;
}

.admin-table th {
  background: var(--panel-soft);
  white-space: nowrap;
}

.admin-table td {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.admin-table .admin-actions-heading,
.admin-table .admin-actions-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
}

.admin-table .admin-actions-heading {
  background: var(--panel-soft);
}

.admin-inactive-row td {
  color: var(--muted);
  background: #f7f8fa;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.admin-status-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #929aa5;
  cursor: pointer;
  transition: background 0.16s ease;
}

.admin-status-switch[aria-checked="true"] {
  background: #178052;
}

.admin-status-switch:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.admin-status-switch:disabled {
  opacity: 0.55;
  cursor: wait;
}

.admin-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 0.16s ease;
}

.admin-status-switch[aria-checked="true"] .admin-switch-thumb {
  transform: translateX(18px);
}

.admin-edit-button {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.admin-dialog[hidden] {
  display: none;
}

.admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
}

.admin-dialog-panel {
  width: min(100%, 640px);
  max-height: min(90vh, 820px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px var(--shadow);
}

.admin-dialog-heading {
  margin-bottom: 14px;
}

.admin-dialog-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.admin-form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-field {
  min-width: 0;
  margin: 0;
}

.admin-form-field:has(textarea),
.admin-form-field:has(select[name="professional_summary"]) {
  grid-column: 1 / -1;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 680px) {
  .admin-table-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .admin-search-label {
    width: 100%;
  }

  .admin-form-fields {
    grid-template-columns: 1fr;
  }

  .admin-form-field:has(textarea),
  .admin-form-field:has(select[name="professional_summary"]) {
    grid-column: auto;
  }
}

.certificate-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.certificate-upload-box {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.certificate-upload-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.certificate-file-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.certificate-file-link {
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
}

.certificate-row-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.certificates-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.month-year-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.month-year-picker[hidden] {
  display: none;
}

@media (max-width: 680px) {
  .certificate-row-grid {
    grid-template-columns: 1fr;
  }

  .month-year-picker {
    grid-template-columns: 1fr;
  }
}

/* --- Botones y Canales de Contacto Profesional --- */
.contact-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-contact:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.btn-contact svg {
  flex-shrink: 0;
}

.btn-brand-whatsapp {
  background-color: #25D366;
  color: #ffffff;
}

.btn-brand-gmail {
  background-color: #EA4335;
  color: #ffffff;
}

.btn-brand-institutional {
  background-color: #1E3A8A;
  color: #ffffff;
}

.btn-brand-linkedin {
  background-color: #0A66C2;
  color: #ffffff;
}

.btn-brand-github {
  background-color: #24292F;
  color: #ffffff;
}

.btn-brand-portfolio {
  background-color: #4F46E5;
  color: #ffffff;
}

.btn-brand-gitlab {
  background-color: #FC6D26;
  color: #ffffff;
}

.btn-brand-kaggle {
  background-color: #20BEFF;
  color: #0F172A;
}

.btn-brand-leetcode {
  background-color: #FFA116;
  color: #1F2937;
}

.btn-brand-behance {
  background-color: #053EFF;
  color: #ffffff;
}

.btn-brand-other {
  background-color: #4B5563;
  color: #ffffff;
}

@media (max-width: 600px) {
  .contact-buttons-grid {
    flex-direction: column;
  }
  .btn-contact {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   CV Formal y Modal de Exportación / Impresión
   ========================================================================== */

.cv-dialog[hidden] {
  display: none;
}

.cv-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

.cv-preview-panel {
  width: min(100%, 880px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.cv-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border);
}

.cv-preview-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.cv-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.cv-preview-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #e2e8f0;
  display: flex;
  justify-content: center;
}

/* Hoja de vida formal moderna (Estilo 2 columnas) */
.cv-formal-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 820px;
  min-height: 1060px;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.cv-modern-layout {
  display: flex;
  align-items: stretch;
}

/* Acentos geométricos de las esquinas */
.cv-corner-accent-top {
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 24px;
  background: #0f2744;
  clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.cv-corner-accent-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 45px;
  height: 100%;
  background: #94a3b8;
  clip-path: polygon(0 0, 100% 0, 45% 100%, 0 100%);
}

.cv-corner-accent-bottom {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 160px;
  height: 22px;
  background: #0f2744;
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

/* Columna lateral izquierda */
.cv-sidebar-col {
  width: 32%;
  min-width: 230px;
  max-width: 260px;
  background: #ffffff;
  border-right: 1.5px solid #e2e8f0;
  padding: 32px 18px 36px 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Foto o avatar */
.cv-photo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.cv-photo-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  background: #cbd5e1;
  border: 4px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cv-photo-placeholder {
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Secciones del sidebar */
.cv-sidebar-section {
  margin-bottom: 22px;
}

.cv-sidebar-banner {
  background: #0f2744;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  margin-left: -28px; /* Extiende el banner hasta el borde izquierdo */
  padding-left: 28px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
  display: inline-block;
  min-width: 160px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.cv-sidebar-content {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.45;
}

.cv-contact-row {
  margin-bottom: 8px;
  word-break: break-word;
}
.cv-contact-label {
  display: block;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.82rem;
  margin-bottom: 1px;
}
.cv-contact-val {
  color: #475569;
}
.cv-contact-val a {
  color: #1e3a8a;
  text-decoration: none;
}
.cv-contact-val a:hover {
  text-decoration: underline;
}

/* Notificaciones Bell & Dropdown */
.notif-bell-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.notif-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 9999px;
  line-height: 1;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #0f2744;
  pointer-events: none;
  z-index: 10;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 420px;
  background: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  z-index: 250;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notif-dropdown[hidden] {
  display: none !important;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.btn-link-action {
  background: none;
  border: none;
  color: #1e40af;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.notif-list {
  overflow-y: auto;
  max-height: 350px;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-item.unread {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
}

.notif-item-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
  margin-bottom: 2px;
}

.notif-item-msg {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
  white-space: pre-line;
}

.notif-item-date {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 4px;
}

.notif-empty, .notif-loading {
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* Toasts Superiores */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 480px);
  width: 100%;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  color: #1f2937;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #3b82f6;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
  width: 100%;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.toast-fadeout {
  opacity: 0;
  transform: translateY(-12px);
}

.toast-success {
  border-left-color: #10b981;
  background: #f0fdf4;
  color: #065f46;
  border-color: #bbf7d0;
}
.toast-info { border-left-color: #3b82f6; }
.toast-warning { border-left-color: #f59e0b; }
.toast-error { border-left-color: #ef4444; }

.toast-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
  padding: 2px 4px;
}
.toast-close:hover {
  color: #475569;
}

/* Modal de Términos y Condiciones adaptativo a la pantalla */
.terms-panel {
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.terms-panel .cv-preview-header {
  flex-shrink: 0;
}

.terms-body {
  padding: 20px 24px;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.terms-body::-webkit-scrollbar {
  width: 8px;
}
.terms-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.terms-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.terms-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.terms-list {
  margin: 14px 0 0 0;
  padding-left: 20px;
}

.terms-list li {
  margin-bottom: 12px;
}

.terms-footer {
  padding: 14px 24px;
  text-align: right;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

/* Badges de moderación */
.badge-pending {
  background: #fef3c7;
  color: #b45309;
}
.badge-observed {
  background: #fee2e2;
  color: #b91c1c;
}

/* Especialidades técnicas */
.tech-specialty-title {
  font-size: 0.92rem;
  color: #1e3a8a;
  margin: 0 0 8px 0;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
  cursor: help;
}

.verified-icon {
  width: 17px;
  height: 17px;
  display: block;
}

.graduate-name-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.profile-name-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.email-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.cv-bullets-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cv-bullets-list li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 5px;
  color: #334155;
  font-size: 0.82rem;
}
.cv-bullets-list li::before {
  content: "■";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.55rem;
  color: #0f2744;
  line-height: 1.5;
}

/* Idiomas */
.cv-lang-row {
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: #334155;
}
.cv-lang-row strong {
  color: #0f172a;
}

/* Columna principal derecha */
.cv-main-col {
  flex: 1;
  padding: 32px 36px 36px 28px;
  box-sizing: border-box;
}

/* Cabecera principal */
.cv-main-hero {
  margin-bottom: 24px;
}
.cv-hero-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0b1e36;
  margin: 0 0 2px 0;
  letter-spacing: 0.5px;
  line-height: 1.15;
}
.cv-hero-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 2.5px;
  margin-bottom: 4px;
}
.cv-hero-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 6px;
}
.cv-hero-line {
  width: 90px;
  height: 2.5px;
  background: #0f2744;
  margin: 8px 0 12px 0;
}
.cv-hero-summary {
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.55;
  text-align: justify;
  margin: 0;
  white-space: pre-line;
}

/* Secciones de la columna principal */
.cv-main-section {
  margin-bottom: 22px;
}

.cv-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.cv-section-banner {
  background: #0f2744;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 18px 6px 14px;
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 100%, 0 100%);
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-section-line {
  flex: 1;
  height: 1.5px;
  background: #cbd5e1;
  margin-left: 2px;
}

/* Bloques de items (experiencia, educación, proyectos) */
.cv-entry-block {
  margin-bottom: 14px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.cv-entry-title-line {
  margin-bottom: 1px;
}
.cv-entry-position {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.cv-entry-subline {
  font-size: 0.82rem;
  color: #475569;
  margin-bottom: 4px;
}
.cv-entry-org {
  font-weight: 600;
  color: #334155;
}
.cv-entry-sep {
  margin: 0 6px;
  color: #94a3b8;
}
.cv-entry-period {
  color: #64748b;
  font-style: italic;
}

.cv-entry-link {
  color: #1e3a8a;
  text-decoration: none;
}
.cv-entry-link:hover {
  text-decoration: underline;
}

.cv-entry-text {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.5;
  margin: 3px 0 0 0;
  white-space: pre-line;
}

.cv-entry-bullets {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
}
.cv-entry-bullets li {
  position: relative;
  padding-left: 14px;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.45;
  margin-bottom: 3px;
}
.cv-entry-bullets li::before {
  content: "■";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.5rem;
  color: #0f2744;
  line-height: 1.5;
}

/* Reglas de impresión directas para ventana y descarga PDF */
@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar elementos web globales que nunca deben imprimirse */
  .topbar,
  footer,
  .cv-preview-header,
  .cv-preview-toolbar {
    display: none !important;
  }

  /* Si el modal del CV está oculto, que no ocupe espacio ni imprima nada */
  #cvPreviewModal[hidden] {
    display: none !important;
  }

  /* Ocultar main ÚNICAMENTE cuando el modal de CV está abierto/activo para imprimir */
  body.cv-printing main,
  body:has(#cvPreviewModal:not([hidden])) main {
    display: none !important;
  }

  /* Activar modal del CV solo cuando está abierto */
  #cvPreviewModal:not([hidden]) {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .cv-preview-panel {
    position: static !important;
    max-height: none !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  .cv-preview-scroll-area {
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
    overflow: visible !important;
  }

  .cv-formal-sheet {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cv-entry-block,
  .cv-main-section,
  .cv-sidebar-section {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cv-sidebar-banner,
  .cv-section-banner,
  .cv-corner-accent-top,
  .cv-corner-accent-bottom {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
