/* RESET SIMPLE */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.udb-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f7fb;
    color: #111827;
}

/* LAYOUT GENERAL */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    background: #102552;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
}

.sidebar__logo {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 8px;
}

.sidebar__logo-icon {
    background: #ffcc00;
    color: #102552;
    font-weight: 800;
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.sidebar__logo-text span {
    font-weight: 600;
    font-size: 0.9rem;
}
.sidebar__logo-text small {
    font-size: 0.7rem;
    color: #9ca3af;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar__link--active {
    background: #1b3d8f;
}

.sidebar__icon {
    width: 22px;
    text-align: center;
}

.sidebar__section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin: 12px 4px 6px;
}

/* USER EN SIDEBAR */
.sidebar__user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #1b3d8f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #f9fafb;
    font-size: 0.85rem;
}

.sidebar__user-info {
    display: flex;
    flex-direction: column;
}
.sidebar__user-name {
    font-size: 0.85rem;
    font-weight: 600;
}
.sidebar__user-email {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* MAIN */
.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOPBAR */
.topbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar__search {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 6px 14px;
    width: min(480px, 100%);
}

.topbar__search-icon {
    margin-right: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

.topbar__search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-button {
    border: none;
    background: #f3f4f6;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

.topbar__user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__user-role {
    font-size: 0.85rem;
    color: #4b5563;
}

/* BOTONES */
.btn {
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #ffcc00;
    color: #102552;
}

.btn-outline {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

/* CABECERA PERFIL */
.profile-header {
    background: linear-gradient(135deg, #1b3d8f, #102552);
    color: #f9fafb;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-header__main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-header__avatar img {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.profile-header__name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-header__position {
    font-size: 0.95rem;
    color: #e5e7eb;
}

/* GRID SUPERIOR */
.profile-grid {
    padding: 20px 32px 0;
    display: grid;
    grid-template-columns: 2fr 2fr 1.6fr;
    gap: 20px;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 4px 7px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
}

.card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

/* CONTACTO */
.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #4b5563;
}
.contact-icon {
    margin-right: 8px;
}

/* IDENTIFICADORES */
.id-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
}

.id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
    color: #111827;
}
.id-badge--orcid { background: #e5f7eb; color: #047857; }
.id-badge--scopus { background: #e0f2fe; color: #0369a1; }
.id-badge--gs    { background: #fef3c7; color: #92400e; }

.id-value {
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.id-link {
    color: #1b3d8f;
    text-decoration: none;
    font-size: 0.85rem;
}

/* MÉTRICAS */
.metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff, #e5edff);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #dbe3ff;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1b3d8f;
}

.metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* TABS */
.tabs {
    margin: 24px 32px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 20px;
}

.tab {
    border: none;
    background: transparent;
    padding: 10px 0;
    margin-bottom: -1px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
}

.tab--active {
    color: #1b3d8f;
    border-bottom-color: #ffcc00;
    font-weight: 600;
}

/* CONTENIDO PESTAÑA */
.tab-content {
    padding: 16px 32px 32px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 16px 0 6px;
}

/* CHIPS */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 0.8rem;
}

/* TIMELINE SIMPLE */
.timeline {
    list-style: none;
    margin-top: 8px;
}
.timeline li {
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.timeline h3 {
    font-size: 0.95rem;
    font-weight: 600;
}
.timeline p {
    font-size: 0.85rem;
    color: #6b7280;
}

/* FOOTER */
.footer {
    margin-top: auto;
    padding: 12px 32px 20px;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 72px 1fr;
    }

    .sidebar__logo-text,
    .sidebar__link span:last-child,
    .sidebar__section-title,
    .sidebar__user-info {
        display: none;
    }

    .sidebar__logo-icon {
        margin-right: 0;
    }

    .sidebar__user {
        justify-content: center;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .profile-grid {
        padding-inline: 16px;
    }

    .tabs, .tab-content, .footer {
        padding-inline: 16px;
    }

    .topbar {
        padding-inline: 16px;
    }
}

.id-badge--wos { background: #e0f7fa; color: #00796b; } /* Color para Web of Science */
/* DASHBOARD */

.dashboard {
    padding: 32px;
}

.dashboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.dashboard__subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

.dashboard__metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Reutilizamos metric-card pero con un estilo un poco distinto si queremos */
.metric-card--wide {
    align-items: flex-start;
}

.metric-card__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 4px;
}

.metric-card__value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1b3d8f;
    margin-bottom: 2px;
}

.metric-card__hint {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Paneles inferiores del dashboard */
.dashboard__panels {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
}

.dashboard__panel {
    min-height: 140px;
}

.dashboard__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #4b5563;
}

.dashboard__text {
    font-size: 0.9rem;
    color: #4b5563;
}

.link-primary {
    color: #1b3d8f;
    text-decoration: none;
}
.link-primary:hover {
    text-decoration: underline;
}

/* Responsive para dashboard */
@media (max-width: 1024px) {
    .dashboard__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard__panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding-inline: 16px;
    }
    .dashboard__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.sidebar__logo-img {
    height: 100px;
    width: auto;
    margin-right: 10px;
    border-radius: 8px; /* si tu logo es cuadrado, se ve más suave */
}
.sidebar__user-link {
    text-decoration: none;
    color: inherit;
}
.sidebar__user-link:hover {
    background: rgba(255, 255, 255, 0.08);
}


/* Usuario en sidebar clicable */
.sidebar__user-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    transition: background 0.2s;
}
.sidebar__user-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Botones en header del dashboard */
.dashboard__header-actions {
    display: flex;
    gap: 8px;
}
/* PÁGINA GENÉRICA */
.page-content {
    padding: 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.page-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

/* GRID DE INVESTIGADORES */
.researchers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.researcher-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.researcher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.researcher-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.researcher-card__photo {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.researcher-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.researcher-card__placeholder {
    font-size: 3rem;
    font-weight: 700;
    color: #1b3d8f;
}

.researcher-card__info {
    padding: 16px;
}

.researcher-card__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.researcher-card__position {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.researcher-card__faculty {
    font-size: 0.85rem;
    color: #1b3d8f;
    margin-bottom: 8px;
}

.researcher-card__metric {
    font-size: 0.85rem;
    color: #4b5563;
}

/* ESTADO VACÍO */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

/* ALERTAS */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* FORMULARIO EN TARJETA */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 32px;
}

.form-section__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1b3d8f;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1b3d8f;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .page-content {
        padding: 16px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .researchers-grid {
        grid-template-columns: 1fr;
    }
}
.tab-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.pub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pub-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.pub-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.pub-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

.pub-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 80px;
}

.pub-link {
    font-size: 0.8rem;
    color: #1b3d8f;
    text-decoration: none;
}

.pub-link:hover {
    text-decoration: underline;
}
.pub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

/* Botones compactos tipo “chip” */
.btn-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

/* Variantes */
.btn-chip--doi {
    background: #f3e8ff;
    color: #5b21b6;
    border-color: #e9d5ff;
}

.btn-chip--doi:hover {
    background: #ddd6fe;
}

.btn-chip--view {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.btn-chip--view:hover {
    background: #bfdbfe;
}

.btn-chip--edit {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fef3c7;
}

.btn-chip--edit:hover {
    background: #fef3c7;
}
/* Contenedor de la sección de publicaciones */
.publications-section {
    margin-top: 24px;
}

/* Card de publicación individual */
.publication-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
}

/* Título + metadatos + acciones en columna */
.publication-card__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Título */
.publication-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

/* Línea de tipo · venue · año */
.publication-meta {
    font-size: 0.9rem;
    color: #4b5563;
}

/* Fila de acciones: botones alineados a la izquierda, debajo del meta */
.pub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* Botones tipo chip */
.btn-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

.btn-chip--doi {
    background: #f4f4ff;
    color: #4f46e5;
    border-color: #e0e7ff;
}

.btn-chip--doi:hover {
    background: #e0e7ff;
}

.btn-chip--view {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.btn-chip--view:hover {
    background: #bfdbfe;
}

.btn-chip--edit {
    background: #fef3c7;
    color: #92400e;
    border-color: #fee2a2;
}

.btn-chip--edit:hover {
    background: #fee2a2;
}
/* Forzar layout en columna para cada publicación */
.publication-card__content {
    display: flex;
    flex-direction: column;   /* columna: título -> botones -> meta */
    align-items: flex-start;  /* todo alineado a la izquierda */
    gap: 6px;
}

/* Botones debajo del título, alineados a la izquierda */
.pub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-start;   /* importante: que no se vayan a la derecha */
}

/* Publicación: layout en columna título -> meta -> acciones */
.publication-card__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Fila única de acciones bajo el meta */
.pub-actions--inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 4px;
}

/* Asegurar que los chips no salten de línea salvo que no quepan */
.pub-actions--inline .btn-chip {
    white-space: nowrap;
}