:root {
    --bg: #0b1221;
    --surface: #111b33;
    --surface-2: #0f172a;
    --line: #253758;
    --text: #e9f1ff;
    --muted: #9db0d3;
    --accent: #3bc7ff;
    --accent-2: #7b66ff;
    --danger: #ff5f6d;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: "Outfit", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 10% -20%, #1c2d52 0, var(--bg) 45%);
}

.container {
    width: min(1060px, calc(100% - 2rem));
    margin: 0 auto;
}

.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(8, 13, 24, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(94, 123, 176, 0.2);
}

.nav {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.links { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.links a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.4rem 0.65rem;
    border-radius: 0.55rem;
}
.links a:hover { background: rgba(151, 175, 219, 0.14); color: var(--text); }

.page { padding: 1.4rem 0 2rem; }

.hero {
    margin-bottom: 1rem;
}
.hero.compact { margin-bottom: 0.7rem; }
.kicker {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    margin: 0;
}

h1 {
    margin: 0.35rem 0;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.hero p { color: var(--muted); margin: 0; }

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.card,
.empty-box,
.post-full,
.panel,
.flash {
    background: linear-gradient(140deg, rgba(19, 32, 59, 0.85), rgba(16, 25, 45, 0.92));
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 1rem;
}

.tutorial-panel {
    border-left: 4px solid var(--accent);
}

.learning-card {
    scroll-margin-top: 90px;
}

.active-step {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59, 199, 255, 0.45), 0 10px 30px rgba(11, 27, 53, 0.45);
}

.result-box {
    margin-top: 0.8rem;
    border: 1px dashed #3f5f94;
    border-radius: 0.75rem;
    background: rgba(10, 22, 44, 0.55);
    color: #d7e6ff;
    padding: 0.75rem;
}

.quiz-list {
    display: grid;
    gap: 0.7rem;
}

.quiz-item {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: rgba(8, 16, 32, 0.55);
    padding: 0.7rem;
}

.quiz-item p {
    margin-top: 0;
}

.quiz-item label {
    display: block;
    margin: 0.25rem 0;
    color: #c8dafb;
}

.quiz-item input[type="radio"] {
    width: auto;
    margin-right: 0.4rem;
}

.kpi-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.kpi-card {
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: rgba(8, 17, 35, 0.65);
    padding: 0.75rem;
}

.kpi-card h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #b8cff7;
}

.kpi-card p {
    margin: 0.45rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.learning-list {
    color: #c9dcff;
    margin: 0.35rem 0 0.75rem 1.1rem;
}

.matrix-panel {
    position: relative;
    overflow: hidden;
}

.matrix-toolbar {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.matrix-toolbar input {
    flex: 1 1 280px;
}

.module-matrix {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.module-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: var(--text);
    border: 1px solid #2e4570;
    border-radius: 0.95rem;
    padding: 0.9rem;
    background: linear-gradient(155deg, rgba(15, 29, 53, 0.95), rgba(11, 21, 40, 0.95));
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    transform-style: preserve-3d;
}

.module-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), rgba(59, 199, 255, 0.18), transparent 65%);
    pointer-events: none;
}

.module-card:hover {
    border-color: #5ca2ff;
    box-shadow: 0 14px 30px rgba(8, 15, 29, 0.5);
}

.module-card h2 {
    margin: 0.2rem 0 0.4rem;
    font-size: 1.25rem;
}

.module-card p {
    margin: 0;
    color: #c8d9f8;
}

.module-chip {
    margin: 0;
    display: inline-block;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8bd7ff;
}

.module-tags {
    margin-top: 0.7rem;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.module-tags span {
    border: 1px solid #35527f;
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    font-size: 0.78rem;
    color: #cde0ff;
    background: rgba(70, 108, 166, 0.2);
}

.timeline-shell {
    background: #ececef;
    color: #3d3f46;
    border-color: #d5d8e2;
}

.timeline-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #d2d6df;
}

.timeline-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.timeline-tab {
    border: 0;
    background: transparent;
    color: #5e616b;
    font: inherit;
    font-weight: 500;
    padding: 0.45rem 0.55rem;
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.timeline-tab.is-active {
    color: #3b3f49;
    border-bottom-color: #6124ff;
}

.timeline-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.timeline-select {
    min-width: 160px;
    background: #fff;
    color: #424651;
    border: 1px solid #cbd1de;
    border-radius: 0.6rem;
    padding: 0.45rem 0.6rem;
}

.timeline-mount {
    min-height: 520px;
    padding-top: 0.9rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.timeline-mount.is-mounted {
    opacity: 1;
    transform: translateY(0);
}

.timeline-empty {
    border: 1px dashed #b7becc;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #f4f5f9;
}

.timeline-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 2rem;
    padding: 0.5rem 0;
}

.timeline-grid::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #b9becb;
}

.timeline-card {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 8px 18px rgba(40, 44, 54, 0.12);
}

.timeline-card.left {
    grid-column: 1;
}

.timeline-card.right {
    grid-column: 2;
}

.timeline-card h3 {
    margin: 0.2rem 0 0.45rem;
    color: #3f424b;
    font-size: 1.95rem;
}

.timeline-card p {
    margin: 0;
    color: #525764;
}

.timeline-date {
    margin: 0;
    color: #5c616c;
    font-style: italic;
    font-size: 1.55rem;
}

.timeline-dot {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    background: #5f20ff;
    box-shadow: 0 0 0 4px rgba(95, 32, 255, 0.15);
}

.timeline-card.left .timeline-dot {
    right: -44px;
}

.timeline-card.right .timeline-dot {
    left: -44px;
}

.timeline-horizontal {
    min-height: 520px;
}

.h-axis {
    position: relative;
    height: 56px;
    border-bottom: 1px solid #cfd4df;
}

.h-month {
    position: absolute;
    top: 20px;
    transform: translateX(-50%);
    color: #8a8f99;
    font-size: 0.86rem;
    text-transform: capitalize;
}

.h-tracks {
    position: relative;
    margin-top: 34px;
    display: grid;
    gap: 1rem;
}

.h-track {
    position: relative;
    height: 54px;
    border-radius: 0.8rem;
    background: rgba(127, 136, 154, 0.12);
    overflow: hidden;
}

.h-label {
    position: absolute;
    left: 0.7rem;
    top: 0.5rem;
    z-index: 2;
    font-weight: 600;
    color: #4b4f58;
}

.h-bar {
    position: absolute;
    top: 28px;
    height: 20px;
    border-radius: 0.4rem;
    background: linear-gradient(90deg, #5f20ff, #6e2bff, #5f20ff);
    box-shadow: 0 8px 16px rgba(95, 32, 255, 0.32);
}

.timeline-vertical {
    position: relative;
    display: grid;
    gap: 0.9rem;
    padding-left: 1.5rem;
}

.timeline-vertical::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 11px;
    width: 2px;
    background: #bcc2cf;
}

.timeline-v-item {
    position: relative;
}

.timeline-v-dot {
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #5f20ff;
}

.timeline-v-card {
    background: #fff;
    border-radius: 0.9rem;
    padding: 1rem;
    box-shadow: 0 7px 15px rgba(45, 48, 58, 0.1);
}

.timeline-v-card h3 {
    margin: 0.2rem 0 0.45rem;
    color: #3f424b;
}

.timeline-v-card p {
    margin: 0;
    color: #555b67;
}

.timeline-editor {
    margin-top: 0.9rem;
}

.timeline-editor h2 {
    margin-top: 0;
}

.timeline-manager {
    background: linear-gradient(145deg, #f7f8fc, #edf0f8);
    border: 1px solid #d5dbea;
    border-radius: 0.9rem;
    padding: 0.8rem;
    margin-bottom: 0.85rem;
}

.timeline-manager-head {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
}

.timeline-manager-head label {
    color: #4c5260;
    font-weight: 600;
}

.timeline-shell .hint {
    color: #626877;
}

.timeline-grid-list table {
    min-width: 860px;
    background: #ffffff;
    border-radius: 0.8rem;
    overflow: hidden;
}

.timeline-grid-list th {
    background: #f0f2f8;
    color: #545a67;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

.timeline-grid-list td {
    color: #3e4350;
    vertical-align: top;
}

.timeline-grid-list tr:hover td {
    background: #fafbfe;
}

.timeline-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.timeline-pill.is-operacion {
    background: rgba(42, 148, 255, 0.14);
    color: #2f72ce;
}

.timeline-pill.is-academico {
    background: rgba(142, 91, 255, 0.16);
    color: #6f33d4;
}

.timeline-pill.is-proyecto {
    background: rgba(11, 175, 125, 0.16);
    color: #0d8562;
}

.timeline-date {
    margin: 0;
    color: #5c616c;
    font-style: italic;
    font-size: 0.95rem;
}

.timeline-card h3 {
    margin: 0.2rem 0 0.45rem;
    color: #353845;
    font-size: 1.3rem;
}

.timeline-horizontal {
    min-height: 500px;
    border-radius: 0.9rem;
    background: linear-gradient(160deg, #f8f9fd 0%, #eef1f8 100%);
    padding: 0.65rem 0.7rem;
}

.h-track {
    position: relative;
    height: 62px;
    border-radius: 0.8rem;
    background: rgba(127, 136, 154, 0.12);
    overflow: hidden;
    border: 1px solid #d8dce8;
}

.h-meta {
    position: absolute;
    right: 0.65rem;
    top: 0.5rem;
    color: #697081;
    font-size: 0.8rem;
    z-index: 2;
}

.h-track.is-operacion .h-bar {
    background: linear-gradient(90deg, #2f7ef0, #3e90ff);
    box-shadow: 0 8px 16px rgba(47, 126, 240, 0.28);
}

.h-track.is-academico .h-bar {
    background: linear-gradient(90deg, #6a2bff, #8b46ff);
    box-shadow: 0 8px 16px rgba(106, 43, 255, 0.3);
}

.h-track.is-proyecto .h-bar {
    background: linear-gradient(90deg, #0aa470, #13c18a);
    box-shadow: 0 8px 16px rgba(10, 164, 112, 0.28);
}

.timeline-v-item.is-operacion .timeline-v-dot {
    background: #2f7ef0;
}

.timeline-v-item.is-academico .timeline-v-dot {
    background: #6a2bff;
}

.timeline-v-item.is-proyecto .timeline-v-dot {
    background: #0aa470;
}

.timeline-v-category {
    margin-top: 0.55rem;
    color: #6a7385;
    font-size: 0.82rem;
    font-weight: 600;
}

.card h2 { margin: 0.35rem 0 0.45rem; font-size: 1.2rem; }
.card p { color: var(--muted); }

.meta {
    margin: 0;
    color: #9eb7e8;
    font-size: 0.86rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    color: #fff;
}

.btn.ghost {
    background: rgba(129, 153, 198, 0.15);
    border-color: var(--line);
}

.btn.small { font-size: 0.82rem; padding: 0.38rem 0.6rem; }
.btn.danger { background: linear-gradient(90deg, #ff3f68, var(--danger)); }

.post-full h1 { margin-top: 0.2rem; }
.excerpt { color: #bed3f9; font-size: 1.02rem; margin-top: 0; }
.content {
    color: var(--text);
    margin-top: 1rem;
    line-height: 1.75;
}

.rich-content h2,
.rich-content h3,
.rich-content h4 {
    margin: 1.5rem 0 0.7rem;
}

.rich-content p {
    margin: 0 0 1rem;
}

.rich-content ul,
.rich-content ol {
    padding-left: 1.3rem;
    margin: 0 0 1rem;
}

.rich-content blockquote {
    margin: 1.1rem 0;
    padding: 0.9rem 1rem;
    border-left: 4px solid var(--accent);
    border-radius: 0.8rem;
    background: rgba(18, 30, 56, 0.8);
    color: #d8e8ff;
}

.rich-content pre {
    overflow-x: auto;
    padding: 0.9rem;
    border-radius: 0.8rem;
    background: #081221;
    border: 1px solid #1f365e;
}

.rich-content code {
    font-family: "SFMono-Regular", Consolas, monospace;
}

.rich-content a {
    color: #8bd7ff;
}

.rich-content figure {
    margin: 1.3rem 0;
}

.rich-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.9rem;
    border: 1px solid var(--line);
}

.rich-content figcaption {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.92rem;
    text-align: center;
}

.share-box {
    margin-top: 1.3rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}
.share-box h3 { margin: 0 0 0.6rem; }
.share-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.flash {
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--accent);
}

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.form-grid.large { grid-template-columns: 1fr 1fr; }
.form-grid label { display: flex; flex-direction: column; gap: 0.33rem; color: #cfe0ff; }
.form-grid .full { grid-column: 1 / -1; }
.row-gap { display: flex; gap: 0.6rem; flex-wrap: wrap; }

input, textarea, select {
    width: 100%;
    background: #0b1426;
    border: 1px solid #2a3f67;
    border-radius: 0.6rem;
    color: var(--text);
    padding: 0.58rem 0.65rem;
    font: inherit;
}

.editor-shell {
    border: 1px solid #2a3f67;
    border-radius: 0.8rem;
    overflow: hidden;
    background: #081221;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.7rem;
    border-bottom: 1px solid #203455;
    background: rgba(16, 26, 47, 0.92);
}

.editor-btn {
    border: 1px solid #315080;
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    background: #11203b;
    color: #dce9ff;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.editor-btn:hover {
    background: #16315b;
    border-color: #4f88d2;
    transform: translateY(-1px);
}

.editor-canvas {
    min-height: 320px;
    padding: 0.9rem;
    outline: none;
    color: var(--text);
    line-height: 1.7;
}

.editor-canvas:empty::before {
    content: "Escribe aqui tu entrada...";
    color: #6f87b4;
}

.editor-canvas img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.8rem;
    margin: 1rem 0;
}

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
th, td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.56rem;
}
th { color: #ccddff; }

.actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.inline { display: inline-flex; }
.inline-form { display: inline-flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.status {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
}
.status.published { background: rgba(59, 227, 137, 0.18); color: #72f1b0; }
.status.approved { background: rgba(59, 227, 137, 0.18); color: #72f1b0; }
.status.draft { background: rgba(255, 196, 68, 0.18); color: #ffd67c; }
.status.pending { background: rgba(255, 196, 68, 0.18); color: #ffd67c; }
.status.rejected { background: rgba(255, 95, 109, 0.2); color: #ff9da6; }
.status.none { background: rgba(126, 147, 182, 0.2); color: #c6d4ef; }

.comment-list { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.comment-item {
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: rgba(7, 14, 30, 0.5);
    padding: 0.75rem;
}
.comment-item p {
    margin: 0.25rem 0 0;
}

.comment-children {
    margin-top: 0.6rem;
    margin-left: 1rem;
    border-left: 2px solid rgba(123, 102, 255, 0.35);
    padding-left: 0.7rem;
}

.reply-box {
    margin-top: 0.5rem;
}

.reply-box summary {
    cursor: pointer;
    color: #b7cbef;
    font-size: 0.9rem;
}

.auth-tabs .tab-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.top-gap {
    margin-top: 0.7rem;
}

.actions-row {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 50;
}

.modal.show {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.72);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100% - 2rem));
    margin: 4rem auto;
    background: linear-gradient(140deg, rgba(19, 32, 59, 0.98), rgba(16, 25, 45, 0.98));
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 1rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
}

.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    background: #142548;
    border: 1px solid #34528d;
    color: #fff;
    border-radius: 0.7rem;
    padding: 0.45rem 0.7rem;
    opacity: 0;
    transform: translateY(8px);
    transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 940px) {
    .cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .cards { grid-template-columns: 1fr; }
    .form-grid,
    .form-grid.large { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
    .module-matrix { grid-template-columns: 1fr; }
    .timeline-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .timeline-grid::before {
        left: 11px;
        margin-left: 0;
    }
    .timeline-card.left,
    .timeline-card.right {
        grid-column: 1;
        margin-left: 1.4rem;
    }
    .timeline-card.left .timeline-dot,
    .timeline-card.right .timeline-dot {
        left: -33px;
        right: auto;
    }
    .timeline-date {
        font-size: 1.05rem;
    }
    .timeline-card h3 {
        font-size: 1.5rem;
    }
    .timeline-manager-head {
        grid-template-columns: 1fr;
    }
}
