/* ================================================================
   ICyTA — Scientific Research Platform
   "Laboratory Notebook × Prestigious Journal"
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────── */
:root {
    /* ── Paleta principal: Teal-Pizarra Académico ── */
    --sci-ink:          #0b1c24;   /* casi-negro cálido */
    --sci-navy:         #1a4a5c;   /* teal profundo — estructura */
    --sci-blue:         #226e87;   /* teal medio — acciones */
    --sci-sky:          #00c4b4;   /* teal-cian — acento/hover */
    --sci-sky-light:    #e0f7f5;
    --sci-amber:        #d4860a;   /* ámbar — acento secundario */
    --sci-amber-light:  #fff8e6;
    --sci-paper:        #ffffff;
    --sci-bg:           #f0f5f7;
    --sci-surface:      #f6fafc;
    --sci-border:       #c8d8df;
    --sci-border-light: #e2eef2;
    --sci-text:         #1a2f3a;
    --sci-muted:        #5a7a8a;
    --sci-accepted:     #1a6e45;
    --sci-accepted-bg:  #e6f5ee;
    --sci-review:       #7a5500;
    --sci-review-bg:    #fff8e1;
    --sci-rejected:     #8b1a1a;
    --sci-rejected-bg:  #fdf0f0;
    --sci-revision:     #5a2d82;
    --sci-revision-bg:  #f5eeff;
    --sci-submitted:    #1a4a5c;
    --sci-submitted-bg: #e4f2f7;
    --sci-radius:       4px;
    --sci-radius-lg:    8px;
    --sci-shadow-sm:    0 1px 4px rgba(11,28,36,.08);
    --sci-shadow:       0 2px 12px rgba(11,28,36,.10);
    --sci-shadow-lg:    0 4px 24px rgba(11,28,36,.14);
    --sci-transition:   all .2s ease;

    /* ── Bootstrap primary override ── */
    --bs-primary:            #1a4a5c;
    --bs-primary-rgb:        26, 74, 92;
    --bs-link-color:         #226e87;
    --bs-link-hover-color:   #1a4a5c;
    --bs-link-color-rgb:     34, 110, 135;
}

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    font-size: .9375rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--sci-text);
    background-color: var(--sci-bg);
    background-image:
        radial-gradient(circle, rgba(26,74,92,.08) 1px, transparent 1px);
    background-size: 22px 22px;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.sci-heading {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    color: var(--sci-ink);
    line-height: 1.3;
}

code, kbd, pre, .sci-mono {
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
    font-size: .85em;
}

/* ── Topbar institucional ───────────────────────────────────────── */
.sci-topbar {
    background-color: var(--sci-ink);
    color: rgba(255,255,255,.72);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .3rem 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sci-topbar a {
    color: rgba(255,255,255,.72);
    text-decoration: none;
}
.sci-topbar a:hover { color: var(--sci-sky); }

.sci-topbar-sep {
    margin: 0 .75rem;
    opacity: .35;
}

/* ── Masthead (journal header) ──────────────────────────────────── */
.sci-masthead {
    background: linear-gradient(135deg, var(--sci-ink) 0%, #12323f 60%, var(--sci-navy) 100%);
    padding: .9rem 0;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--sci-sky);
}

/* Decorative spectrum lines */
.sci-masthead::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 120px,
            rgba(0,180,204,.04) 120px,
            rgba(0,180,204,.04) 121px
        ),
        repeating-linear-gradient(
            180deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,.02) 30px,
            rgba(255,255,255,.02) 31px
        );
    pointer-events: none;
}

/* Glow in upper-right corner */
.sci-masthead::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(0,180,204,.18) 0%, transparent 70%);
    pointer-events: none;
}

/* Brand */
.sci-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.sci-brand:hover { text-decoration: none; color: inherit; }

.sci-brand-emblem {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--sci-sky) 0%, #007a8a 100%);
    border-radius: var(--sci-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,180,204,.4);
    transition: var(--sci-transition);
}

.sci-brand:hover .sci-brand-emblem {
    transform: rotate(-4deg) scale(1.05);
    box-shadow: 0 4px 20px rgba(0,180,204,.55);
}

.sci-brand-name {
    font-family: 'Lora', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
    line-height: 1;
}

.sci-brand-tagline {
    font-size: .68rem;
    font-weight: 400;
    color: rgba(255,255,255,.55);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: .18rem;
}

.sci-masthead-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .2rem;
}

.sci-masthead-meta span {
    font-family: 'JetBrains Mono', monospace;
    font-size: .68rem;
    color: rgba(255,255,255,.4);
    letter-spacing: .08em;
}

.sci-masthead-meta span:first-child {
    color: var(--sci-sky);
    font-weight: 500;
}

/* ── Navbar ─────────────────────────────────────────────────────── */
.sci-navbar {
    background-color: #122c38;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sci-navbar .navbar-nav .nav-link {
    color: rgba(255,255,255,.75);
    font-size: .84rem;
    font-weight: 500;
    letter-spacing: .02em;
    padding: .8rem 1rem;
    border-bottom: 2px solid transparent;
    transition: var(--sci-transition);
    display: flex;
    align-items: center;
    gap: .3rem;
}

.sci-navbar .navbar-nav .nav-link:hover,
.sci-navbar .navbar-nav .nav-link:focus {
    color: #fff;
    border-bottom-color: var(--sci-sky);
    background: rgba(255,255,255,.04);
}

.sci-navbar .navbar-nav .nav-link.active {
    color: var(--sci-sky);
    border-bottom-color: var(--sci-sky);
}

.sci-navbar .dropdown-menu {
    background: var(--sci-ink);
    border: 1px solid rgba(255,255,255,.1);
    border-top: 2px solid var(--sci-sky);
    border-radius: 0 0 var(--sci-radius-lg) var(--sci-radius-lg);
    padding: .5rem 0;
    box-shadow: var(--sci-shadow-lg);
    margin-top: 0;
    min-width: 220px;
}

.sci-navbar .dropdown-item {
    color: rgba(255,255,255,.7);
    font-size: .84rem;
    padding: .5rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .45rem;
    transition: var(--sci-transition);
}

.sci-navbar .dropdown-item:hover,
.sci-navbar .dropdown-item:focus {
    background: rgba(255,255,255,.08);
    color: var(--sci-sky);
}

.sci-navbar .dropdown-divider {
    border-color: rgba(255,255,255,.1);
}

.sci-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.25);
    padding: .3rem .6rem;
}

.sci-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.sci-user-pill {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: rgba(255,255,255,.75) !important;
    font-size: .84rem;
    font-weight: 500;
}

.sci-user-pill:hover { color: #fff !important; }

/* ── Alerts (reemplaza Bootstrap defaults) ──────────────────────── */
.alert {
    border-radius: var(--sci-radius-lg);
    border: 1px solid;
    border-left-width: 4px;
    font-size: .9rem;
    padding: .85rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.alert-success {
    background: var(--sci-accepted-bg);
    border-color: #a8d5be;
    border-left-color: var(--sci-accepted);
    color: #124732;
}

.alert-danger {
    background: var(--sci-rejected-bg);
    border-color: #f0b8b8;
    border-left-color: var(--sci-rejected);
    color: #5c1111;
}

.alert-warning {
    background: var(--sci-amber-light);
    border-color: #f5d78e;
    border-left-color: var(--sci-amber);
    color: #5a3500;
}

.alert-info {
    background: var(--sci-sky-light);
    border-color: #9ce5ef;
    border-left-color: var(--sci-sky);
    color: #00535f;
}

.alert .btn-close {
    margin-left: auto;
    opacity: .5;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
    background: var(--sci-paper);
    border: 1px solid var(--sci-border);
    border-radius: var(--sci-radius-lg);
    box-shadow: var(--sci-shadow-sm);
    transition: var(--sci-transition);
}

.card:hover {
    box-shadow: var(--sci-shadow);
    border-color: #b0c4d8;
}

.card-header {
    background: var(--sci-surface);
    border-bottom: 1px solid var(--sci-border-light);
    border-radius: var(--sci-radius-lg) var(--sci-radius-lg) 0 0 !important;
    padding: .85rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: .84rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--sci-navy);
    text-transform: uppercase;
}

.card-header .h5, .card-header h5,
.card-header .h6, .card-header h6 {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-size: .82rem;
    letter-spacing: .06em;
    margin: 0;
}

/* ── Variantes de color de card-header (normaliza Bootstrap) ─────── */
/* Todas las variantes comparten la misma tipografía, solo cambia el fondo */

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--sci-navy) 0%, var(--sci-blue) 100%) !important;
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.12) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, #0f4a35 0%, var(--sci-accepted) 100%) !important;
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.12) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #9a5e00 0%, var(--sci-amber) 100%) !important;
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.12) !important;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, #6b0f0f 0%, var(--sci-rejected) 100%) !important;
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.12) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #006070 0%, #00acc1 100%) !important;
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.12) !important;
}

.card-header.bg-light,
.card-header.bg-white {
    background-color: var(--sci-surface) !important;
    color: var(--sci-navy) !important;
    border-bottom-color: var(--sci-border-light) !important;
}

/* Garantiza que text-white y text-dark no interfieran */
.card-header.bg-primary *,
.card-header.bg-success *,
.card-header.bg-warning *,
.card-header.bg-danger *,
.card-header.bg-info * {
    color: inherit !important;
}

/* Iconos Bootstrap dentro de card-header coloreado */
.card-header[class*="bg-"]:not(.bg-light):not(.bg-white) i[class*="bi-"] {
    opacity: .85;
}

.card-body { padding: 1.35rem; }
.card-footer {
    background: var(--sci-surface);
    border-top: 1px solid var(--sci-border-light);
    border-radius: 0 0 var(--sci-radius-lg) var(--sci-radius-lg) !important;
    padding: .75rem 1.25rem;
    font-size: .84rem;
    color: var(--sci-muted);
}

/* Paper / artículo card */
.sci-paper-card {
    border-left: 3px solid var(--sci-blue);
    border-radius: 0 var(--sci-radius-lg) var(--sci-radius-lg) 0;
}

.sci-paper-card:hover {
    border-left-color: var(--sci-sky);
    transform: translateX(2px);
}

.sci-paper-card .sci-paper-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    color: var(--sci-muted);
    letter-spacing: .05em;
}

.sci-paper-card .sci-paper-title {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sci-ink);
    line-height: 1.4;
    margin: .35rem 0 .5rem;
}

.sci-paper-card .sci-paper-meta {
    font-size: .78rem;
    color: var(--sci-muted);
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* ── Stat Cards (dashboard) ─────────────────────────────────────── */
.stat-card {
    border-left: 3px solid var(--sci-blue);
    background: var(--sci-paper);
    border-radius: var(--sci-radius-lg);
    padding: 1.25rem 1.35rem;
    transition: var(--sci-transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sci-shadow);
    border-left-color: var(--sci-sky);
}

.stat-card .stat-value {
    font-family: 'Lora', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--sci-navy);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--sci-muted);
    margin-top: .3rem;
}

.stat-card .stat-icon {
    font-size: 1.6rem;
    color: var(--sci-border);
}

/* ── Tables ─────────────────────────────────────────────────────── */
.table {
    font-size: .88rem;
    color: var(--sci-text);
    border-color: var(--sci-border-light);
}

.table thead th {
    background: var(--sci-surface);
    color: var(--sci-navy);
    font-weight: 600;
    font-size: .76rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--sci-border);
    padding: .8rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--sci-border-light);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr:hover {
    background-color: #f0f5fc;
}

.table-responsive {
    border-radius: var(--sci-radius-lg);
    border: 1px solid var(--sci-border);
    overflow: hidden;
}

/* ── Badges / etiquetas de estatus ──────────────────────────────── */
.badge {
    font-family: 'Inter', sans-serif;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .3em .65em;
    border-radius: 20px;
}

/* Override Bootstrap badge colors con tema científico */
.badge.bg-success, .badge-accepted {
    background-color: var(--sci-accepted-bg) !important;
    color: var(--sci-accepted) !important;
    border: 1px solid #a8d5be;
}

.badge.bg-warning, .badge-review {
    background-color: var(--sci-review-bg) !important;
    color: var(--sci-review) !important;
    border: 1px solid #f5d78e;
}

.badge.bg-danger, .badge-rejected {
    background-color: var(--sci-rejected-bg) !important;
    color: var(--sci-rejected) !important;
    border: 1px solid #f0b8b8;
}

.badge.bg-primary, .badge-submitted {
    background-color: var(--sci-submitted-bg) !important;
    color: var(--sci-submitted) !important;
    border: 1px solid #b0c8f0;
}

.badge.bg-secondary, .badge-revision {
    background-color: var(--sci-revision-bg) !important;
    color: var(--sci-revision) !important;
    border: 1px solid #c8a8f0;
}

.badge.bg-info {
    background-color: var(--sci-sky-light) !important;
    color: #006070 !important;
    border: 1px solid #9ce5ef;
}

/* ── Botones ─────────────────────────────────────────────────────── */
.btn {
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .02em;
    border-radius: var(--sci-radius);
    transition: var(--sci-transition);
    padding: .45rem 1rem;
}

.btn-primary,
.btn-icyta {
    background-color: var(--sci-navy);
    border-color: var(--sci-navy);
    color: #fff;
}

.btn-primary:hover,
.btn-icyta:hover {
    background-color: var(--sci-blue);
    border-color: var(--sci-blue);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(11,61,124,.3);
}

.btn-primary:active, .btn-icyta:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border-color: var(--sci-navy);
    color: var(--sci-navy);
}

.btn-outline-primary:hover {
    background-color: var(--sci-navy);
    border-color: var(--sci-navy);
}

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

.btn-secondary:hover {
    background-color: var(--sci-surface);
    border-color: #b0c4d8;
    color: var(--sci-text);
}

.btn-sm {
    font-size: .78rem;
    padding: .3rem .7rem;
}

.btn-lg {
    font-size: .95rem;
    padding: .65rem 1.5rem;
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-control, .form-select {
    font-family: 'Inter', sans-serif;
    font-size: .9rem;
    border: 1px solid var(--sci-border);
    border-radius: var(--sci-radius);
    padding: .5rem .85rem;
    background-color: var(--sci-paper);
    color: var(--sci-text);
    transition: var(--sci-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--sci-sky);
    box-shadow: 0 0 0 3px rgba(0,180,204,.15);
    background-color: var(--sci-paper);
}

.form-label {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--sci-navy);
    margin-bottom: .35rem;
}

.input-group-text {
    background: var(--sci-surface);
    border-color: var(--sci-border);
    color: var(--sci-muted);
    font-size: .9rem;
}

.form-text {
    font-size: .76rem;
    color: var(--sci-muted);
    margin-top: .3rem;
}

.invalid-feedback {
    font-size: .78rem;
    color: var(--sci-rejected);
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.breadcrumb {
    font-size: .78rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: .02em;
    margin-bottom: 1.5rem;
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--sci-blue);
    text-decoration: none;
}

.breadcrumb-item a:hover { text-decoration: underline; }

.breadcrumb-item.active { color: var(--sci-muted); }

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--sci-border);
    font-size: 1rem;
    line-height: 1;
}

/* ── Progress bars ───────────────────────────────────────────────── */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--sci-border-light);
}

.progress-bar {
    background-color: var(--sci-blue);
    border-radius: 4px;
}

/* ── Login / Auth cards ──────────────────────────────────────────── */
.login-card {
    max-width: 460px;
    margin: 3rem auto;
}

.login-card .card {
    border-top: 3px solid var(--sci-sky);
    box-shadow: var(--sci-shadow-lg);
}

.login-card .sci-auth-header {
    text-align: center;
    padding: 2rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--sci-border-light);
}

.login-card .sci-auth-emblem {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--sci-navy), var(--sci-sky));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 16px rgba(0,180,204,.35);
}

.login-card .sci-auth-title {
    font-family: 'Lora', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sci-ink);
    margin-bottom: .2rem;
}

.login-card .sci-auth-sub {
    font-size: .8rem;
    color: var(--sci-muted);
    letter-spacing: .03em;
}

/* ── Section titles ──────────────────────────────────────────────── */
.sci-section-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--sci-border-light);
}

.sci-section-header h1,
.sci-section-header h2,
.sci-section-header h3 {
    margin: 0;
}

.sci-section-marker {
    width: 4px;
    height: 1.6em;
    background: linear-gradient(180deg, var(--sci-sky), var(--sci-blue));
    border-radius: 2px;
    flex-shrink: 0;
}

.sci-section-sub {
    font-size: .82rem;
    color: var(--sci-muted);
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: .15rem;
}

/* ── Metadata / DOI / ID displays ───────────────────────────────── */
.sci-doi, .sci-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: .78rem;
    color: var(--sci-muted);
    letter-spacing: .04em;
}

.sci-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .8rem;
    color: var(--sci-muted);
}

.sci-meta-row .sci-meta-item {
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* ── Abstract / descripción larga ───────────────────────────────── */
.sci-abstract {
    font-family: 'Lora', serif;
    font-size: .95rem;
    color: var(--sci-text);
    line-height: 1.75;
    border-left: 3px solid var(--sci-border);
    padding-left: 1.25rem;
    font-style: italic;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination .page-link {
    font-size: .84rem;
    color: var(--sci-navy);
    border-color: var(--sci-border);
    padding: .4rem .85rem;
    transition: var(--sci-transition);
}

.pagination .page-link:hover {
    background: var(--sci-sky-light);
    border-color: var(--sci-sky);
    color: #006070;
}

.pagination .page-item.active .page-link {
    background: var(--sci-navy);
    border-color: var(--sci-navy);
}

/* ── Dropdowns generales ─────────────────────────────────────────── */
.dropdown-menu {
    font-size: .88rem;
    border-radius: var(--sci-radius-lg);
    border-color: var(--sci-border);
    box-shadow: var(--sci-shadow);
    padding: .4rem 0;
}

.dropdown-item {
    padding: .45rem 1rem;
    transition: var(--sci-transition);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f0f5fc;
    color: var(--sci-navy);
}

/* ── Nav tabs / pills en vistas internas ─────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--sci-border);
    gap: .25rem;
}

.nav-tabs .nav-link {
    font-size: .84rem;
    font-weight: 500;
    color: var(--sci-muted);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: .6rem 1.1rem;
    transition: var(--sci-transition);
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--sci-navy);
    border-bottom-color: var(--sci-border);
}

.nav-tabs .nav-link.active {
    color: var(--sci-blue);
    border-bottom-color: var(--sci-blue);
    background: none;
    font-weight: 600;
}

/* ── Modales ─────────────────────────────────────────────────────── */
.modal-header {
    background: var(--sci-surface);
    border-bottom-color: var(--sci-border-light);
    padding: 1rem 1.5rem;
}

.modal-title {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sci-ink);
}

.modal-footer {
    background: var(--sci-surface);
    border-top-color: var(--sci-border-light);
    padding: .75rem 1.5rem;
}

/* ── Main content ────────────────────────────────────────────────── */
main {
    padding: 2rem 0 3rem;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.sci-footer {
    background: var(--sci-ink);
    color: rgba(255,255,255,.65);
    font-size: .84rem;
    padding: 2.5rem 0 0;
    margin-top: auto;
    border-top: 3px solid var(--sci-sky);
    position: relative;
}

.sci-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sci-sky), transparent);
    opacity: .5;
}

.sci-footer h6 {
    font-family: 'Inter', sans-serif;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.9);
    margin-bottom: .85rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sci-footer p,
.sci-footer address {
    font-size: .82rem;
    line-height: 1.7;
    color: rgba(255,255,255,.5);
    font-style: normal;
    margin: 0;
}

.sci-footer a {
    color: rgba(255,255,255,.55);
    text-decoration: none;
    transition: var(--sci-transition);
}

.sci-footer a:hover { color: var(--sci-sky); }

.sci-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .9rem 0;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .75rem;
    color: rgba(255,255,255,.35);
    letter-spacing: .03em;
}

.sci-footer-issn {
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    color: var(--sci-sky);
    opacity: .75;
    letter-spacing: .05em;
}

/* ── Utilities científicas ───────────────────────────────────────── */
.text-muted { color: var(--sci-muted) !important; }

.sci-label {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sci-muted);
}

.sci-divider {
    border: none;
    border-top: 1px solid var(--sci-border-light);
    margin: 1.5rem 0;
}

.sci-highlight {
    background: linear-gradient(135deg, rgba(0,180,204,.08), rgba(18,96,176,.06));
    border: 1px solid rgba(0,180,204,.2);
    border-radius: var(--sci-radius-lg);
    padding: 1rem 1.25rem;
}

/* ── Animaciones de entrada ──────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sci-fade-in {
    animation: fadeInUp .35s ease both;
}

main > .container > *:not(.alert) {
    animation: fadeInUp .3s ease both;
}

main > .container > *:nth-child(2) { animation-delay: .05s; }
main > .container > *:nth-child(3) { animation-delay: .10s; }
main > .container > *:nth-child(4) { animation-delay: .15s; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sci-masthead-meta { display: none !important; }

    .sci-navbar .navbar-collapse {
        background: #122c38;
        border-top: 1px solid rgba(255,255,255,.08);
        padding: .5rem 0 1rem;
    }

    .sci-navbar .nav-link {
        border-bottom: none !important;
        border-left: 2px solid transparent;
        padding: .6rem 1.25rem !important;
    }

    .sci-navbar .nav-link:hover {
        border-left-color: var(--sci-sky) !important;
        background: rgba(255,255,255,.04) !important;
    }
}

@media (max-width: 767.98px) {
    .sci-brand-name { font-size: 1.4rem; }
    .sci-brand-emblem { width: 40px; height: 40px; font-size: 1.2rem; }
    main { padding: 1.25rem 0 2rem; }
    .stat-card .stat-value { font-size: 1.6rem; }
}

/* ── Catálogo: layout dos paneles ────────────────────────────────── */
.cat-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 240px);
    border: 1px solid var(--sci-border);
    border-radius: var(--sci-radius-lg);
    overflow: hidden;
    background: var(--sci-paper);
    box-shadow: var(--sci-shadow);
}

.cat-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--sci-border);
    display: flex;
    flex-direction: column;
    background: var(--sci-surface);
}

.cat-sidebar-head {
    padding: .85rem 1rem;
    border-bottom: 2px solid var(--sci-blue);
    background: var(--sci-paper);
}

.cat-sidebar-head h6 {
    font-family: 'Inter', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sci-navy);
    margin: 0;
}

.cat-edition-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
}

.cat-edition-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: var(--sci-transition);
    border-bottom: 1px solid var(--sci-border-light);
}

.cat-edition-item:hover {
    background: rgba(18,96,176,.05);
    border-left-color: var(--sci-border);
}

.cat-edition-item.active {
    background: rgba(18,96,176,.08);
    border-left-color: var(--sci-blue);
}

.cat-edition-item img {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid var(--sci-border);
    flex-shrink: 0;
}

.cat-edition-info { flex: 1; min-width: 0; }

.cat-edition-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--sci-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.cat-edition-meta {
    font-size: .72rem;
    color: var(--sci-muted);
    margin-top: .1rem;
    font-family: 'JetBrains Mono', monospace;
}

.cat-edition-count {
    display: inline-block;
    margin-top: .25rem;
    font-size: .68rem;
    font-weight: 600;
    background: var(--sci-submitted-bg);
    color: var(--sci-submitted);
    border: 1px solid #b0c8f0;
    padding: .1em .5em;
    border-radius: 10px;
}

/* Panel principal de artículos */
.cat-panel {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.cat-panel.active { display: block; }

.cat-panel-head {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--sci-border-light);
    background: var(--sci-paper);
    position: sticky;
    top: 0;
    z-index: 1;
}

.cat-panel-head h4 {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sci-ink);
    margin: 0 0 .35rem;
}

.cat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: var(--sci-muted);
    text-align: center;
}

/* Artículo individual en catálogo */
.cat-article {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--sci-border-light);
    transition: background .15s;
}

.cat-article:hover { background: rgba(18,96,176,.03); }
.cat-article:last-child { border-bottom: none; }

.cat-article-title {
    font-family: 'Lora', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--sci-ink);
    line-height: 1.4;
    margin-bottom: .4rem;
}

.cat-article-meta {
    font-size: .78rem;
    color: #3a5270;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: .5rem;
}

.cat-article-abstract {
    font-size: .84rem;
    color: var(--sci-text);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: .5rem;
}

/* Responsive */
@media (max-width: 767.98px) {
    .cat-layout { flex-direction: column; min-height: auto; }
    .cat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--sci-border); max-height: 220px; }
    .cat-edition-list { display: flex; overflow-x: auto; overflow-y: hidden; padding: .5rem; gap: .4rem; }
    .cat-edition-item { flex-direction: column; align-items: center; text-align: center; min-width: 90px; padding: .5rem; border-left: none; border-bottom: 2px solid transparent; border-radius: var(--sci-radius); }
    .cat-edition-item.active { border-bottom-color: var(--sci-blue); }
    .cat-edition-info { min-width: 0; width: 100%; }
    .cat-edition-name { font-size: .7rem; white-space: normal; }
    .cat-panel-head { position: static; }
}

/* ── Contenido enriquecido (Quill / dictámenes) ──────────────────── */
.rich-content { font-family: 'Lora', Georgia, serif; }
.rich-content p { margin: 0 0 .6rem; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 .6rem 1.25rem; padding: 0; }
.rich-content li { margin-bottom: .25rem; }
.rich-content strong { font-weight: 700; color: var(--sci-ink); }
.rich-content h2, .rich-content h3 {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    color: var(--sci-navy);
    margin: .4rem 0 .5rem;
}

/* ── Portadas: miniatura ampliable ──────────────────────────────── */
.sci-img-zoom {
    cursor: zoom-in;
    transition: var(--sci-transition);
}

.sci-img-zoom:hover {
    opacity: .85;
    transform: scale(1.03);
}

/* ── Print ───────────────────────────────────────────────────────── */
@media print {
    .sci-topbar, .sci-masthead, .sci-navbar, .sci-footer,
    .btn, .alert .btn-close { display: none !important; }

    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }

    h1, h2, h3, h4 { font-family: Georgia, serif; }
    main { padding: 0; }
}
