/* ============================================================
   MINELYSISS — TIMELINE (VERSIÓN MEJORADA)
   ============================================================ */

:root {
    --blue-950: #071523;
    --blue-900: #0b2035;
    --blue-800: #123049;
    --blue-700: #1a4162;
    --grid-line: rgba(94, 200, 234, .06);
    --cyan: #5ec8ea;
    --cyan-dim: rgba(94, 200, 234, .25);
    --cyan-glow: rgba(94, 200, 234, .08);
    --amber: #e3a13e;
    --red: #e0604f;
    --green: #55c98a;
    --paper: #eef3f6;
    --paper-dim: #8a9fb5;
    --mono: 'JetBrains Mono', 'Courier New', monospace;
    --sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(94, 200, 234, .03) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(94, 200, 234, .03) 0%, transparent 60%),
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
        var(--blue-950);
    color: var(--paper);
    font-family: var(--sans);
}

/* ============================================================
   CABECERA
   ============================================================ */

.titleblock {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    padding: 24px clamp(20px, 4vw, 56px) 20px;
    border-bottom: 1px solid var(--blue-700);
    background: linear-gradient(180deg, rgba(94, 200, 234, .04), rgba(7, 21, 35, .88));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.titleblock .eyebrow {
    margin: 0 0 6px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    opacity: .8;
}

.titleblock h1 {
    margin: 0;
    color: var(--paper);
    font-size: clamp(20px, 2.8vw, 32px);
    font-weight: 600;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, #fff 30%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(94, 200, 234, 0.15));
}

.titleblock .sub {
    margin-top: 4px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 12px;
    opacity: .7;
}

.stamp {
    min-width: 180px;
    padding: 10px 16px;
    border: 1px solid var(--blue-700);
    border-radius: 6px;
    background: rgba(7, 21, 35, .5);
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.8;
    text-align: right;
}

.stamp b {
    color: var(--cyan);
}

/* ============================================================
   ACCIONES
   ============================================================ */

.admin-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px clamp(20px, 4vw, 56px) 0;
}

.admin-toggle {
    padding: 8px 16px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(18, 48, 73, .8);
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    transition: .25s ease;
    backdrop-filter: blur(10px);
}

.admin-toggle:hover {
    border-color: var(--cyan-dim);
    color: var(--paper);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(94, 200, 234, .1);
}

.admin-toggle.active {
    border-color: var(--cyan);
    background: rgba(94, 200, 234, .1);
    color: var(--cyan);
}

.admin-toggle.export-btn {
    border-color: var(--cyan);
    color: var(--cyan);
}

.admin-toggle.export-btn:hover {
    background: var(--cyan);
    color: var(--blue-950);
}

.admin-toggle.import-btn {
    border-color: var(--amber);
    color: var(--amber);
}

.admin-toggle.import-btn:hover {
    background: var(--amber);
    color: var(--blue-950);
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */

.admin-panel {
    display: none;
    max-height: 80vh;
    overflow-y: auto;
    margin: 16px clamp(20px, 4vw, 56px);
    padding: 24px 28px;
    border: 1px solid var(--blue-700);
    border-radius: 12px;
    background: rgba(11, 32, 53, .95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeSlide .3s ease;
}

.admin-panel.open {
    display: block;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-10px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.admin-panel h3 {
    margin: 0 0 16px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px 18px;
}

.admin-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--paper-dim);
    font-size: 11px;
    letter-spacing: .05em;
}

.admin-grid input,
.admin-grid select,
.admin-grid textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    outline: none;
    background: rgba(7, 21, 35, .8);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 13px;
    transition: .2s ease;
}

.admin-grid input:focus,
.admin-grid select:focus,
.admin-grid textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(94, 200, 234, .1);
}

.admin-grid textarea {
    min-height: 60px;
    resize: vertical;
}

.admin-grid select option {
    background: var(--blue-900);
}

.file-upload-wrapper {
    grid-column: 1 / -1;
}

.file-upload-wrapper label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--paper-dim);
    font-size: 11px;
}

.file-upload-wrapper input[type=file] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(7, 21, 35, .8);
    color: var(--paper);
    font-size: 12px;
    cursor: pointer;
}

.file-upload-wrapper .file-info {
    margin-top: 4px;
    color: var(--paper-dim);
    font-size: 11px;
    opacity: .7;
}

.file-upload-wrapper .file-info .file-name {
    color: var(--cyan);
    font-weight: 600;
}

.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.admin-actions button {
    padding: 10px 20px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(18, 48, 73, .5);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: .25s ease;
}

.admin-actions button:hover {
    border-color: var(--cyan-dim);
    background: var(--blue-700);
    transform: translateY(-1px);
}

.admin-actions .btn-primary {
    border-color: var(--cyan);
    background: var(--cyan);
    color: var(--blue-950);
}

.admin-actions .btn-danger {
    border-color: var(--red);
    color: var(--red);
}

.admin-actions .btn-warning {
    border-color: var(--amber);
    color: var(--amber);
}

/* ============================================================
   LISTA ADMIN
   ============================================================ */

.admin-event-list {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--blue-700);
}

.admin-event-list h4 {
    margin: 0 0 12px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    padding: 10px 14px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(7, 21, 35, .6);
    transition: .2s ease;
}

.admin-event-item:hover {
    border-color: var(--cyan-dim);
    background: rgba(7, 21, 35, .8);
}

.admin-event-item .info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-event-item .info .title {
    color: var(--paper);
    font-size: 13px;
    font-weight: 600;
}

.admin-event-item .info .meta {
    color: var(--paper-dim);
    font-size: 11px;
    opacity: .7;
}

.admin-event-item .actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.admin-event-item .actions button {
    padding: 5px 12px;
    border: 1px solid var(--blue-700);
    border-radius: 6px;
    background: rgba(18, 48, 73, .5);
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
}

.admin-event-item .actions .edit-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.admin-event-item .actions .delete-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.admin-event-empty {
    padding: 30px 0;
    color: var(--paper-dim);
    font-size: 13px;
    text-align: center;
    opacity: .5;
}

/* ============================================================
   BADGES
   ============================================================ */

.type-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.type-badge.doc {
    background: rgba(94, 200, 234, .2);
    color: var(--cyan);
}

.type-badge.plain {
    background: rgba(169, 191, 209, .12);
    color: var(--paper-dim);
}

.type-badge.crit {
    background: rgba(224, 96, 79, .2);
    color: var(--red);
}

.type-badge.hito {
    background: rgba(227, 161, 62, .2);
    color: var(--amber);
}

.file-indicator {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(94, 200, 234, .15);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 9px;
}

/* ============================================================
   LEYENDA
   ============================================================ */

.legend {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 14px clamp(20px, 4vw, 56px);
    border-bottom: 1px solid var(--blue-700);
    background: rgba(7, 21, 35, .3);
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 11px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
}

.dot.doc {
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(94, 200, 234, 0.5);
}

.dot.plain {
    background: var(--paper-dim);
}

.dot.crit {
    background: var(--red);
    box-shadow: 0 0 12px rgba(224, 96, 79, 0.5);
}

.dot.hito {
    background: var(--amber);
    box-shadow: 0 0 12px rgba(227, 161, 62, 0.5);
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 12px 0 20px;
    padding: 48px 0 40px;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: var(--cyan) var(--blue-800);
    background: rgba(7, 21, 35, 0.2);
    backdrop-filter: blur(1px);
    border-radius: 16px;
}

.timeline-wrap::-webkit-scrollbar {
    height: 14px;
}

.timeline-wrap::-webkit-scrollbar-track {
    border: 1px solid var(--blue-700);
    border-radius: 10px;
    background: var(--blue-900);
}

.timeline-wrap::-webkit-scrollbar-thumb {
    min-width: 60px;
    border: 3px solid var(--blue-900);
    border-radius: 10px;
    background: linear-gradient(180deg, var(--cyan), #8b5cf6);
}

.timeline-wrap::-webkit-scrollbar-thumb:hover {
    background: #7fd6f0;
}

.timeline-inner {
    position: relative;
    width: var(--track-width, 3200px);
    min-width: var(--track-width, 3200px);
    height: 520px;
    margin: 0;
    padding: 0 90px;
}

/* ============================================================
   LINEA CENTRAL MEJORADA
   ============================================================ */

.axis-line {
    position: absolute;
    top: 260px;
    right: 0;
    left: 0;
    height: 3px !important;
    background: linear-gradient(90deg,
        transparent,
        var(--cyan) 4%,
        #8b5cf6 50%,
        var(--cyan) 96%,
        transparent) !important;
    z-index: 1;
    box-shadow: 0 0 20px rgba(94, 200, 234, 0.3),
                0 0 60px rgba(94, 200, 234, 0.1);
    animation: pulseLine 3s ease-in-out infinite;
}

@keyframes pulseLine {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 20px rgba(94, 200, 234, 0.3); }
    50% { opacity: 1; box-shadow: 0 0 40px rgba(94, 200, 234, 0.6), 0 0 80px rgba(139, 92, 246, 0.2); }
}

.axis-line::before,
.axis-line::after {
    content: '';
    position: absolute;
    top: -5px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--cyan-dim);
    border-radius: 50%;
    background: var(--blue-950);
}

.axis-line::before {
    left: -8px
}
.axis-line::after {
    right: -8px
}

/* ============================================================
   TICKS
   ============================================================ */

.tick {
    position: absolute;
    top: 260px;
    width: 1px;
    height: 10px;
    background: var(--blue-700);
    z-index: 1;
}

.tick-label {
    position: absolute;
    top: 276px;
    transform: translateX(-50%);
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 10px;
    white-space: nowrap;
    opacity: .5;
}

.tick.month {
    top: 254px;
    height: 16px;
    background: var(--cyan-dim);
}

.tick-label.month {
    top: 234px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    opacity: 1;
}

/* ============================================================
   CONECTORES
   ============================================================ */

.event-stem {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom,
            var(--cyan-dim),
            rgba(94, 200, 234, .05));
    pointer-events: none;
    z-index: 2;
}

/* ============================================================
   MARCADORES (BOLITAS) CON PULSO
   ============================================================ */

.marker {
    position: absolute;
    top: 260px;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    border: 2.5px solid var(--blue-950);
    border-radius: 50%;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 6;
    background-color: var(--event-color, #5EC8EA);
    border-color: var(--event-color, #5EC8EA);
    animation: markerPulse 2.5s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(94, 200, 234, 0.15), 0 0 0 8px rgba(94, 200, 234, 0.05); }
    50% { box-shadow: 0 0 0 6px rgba(94, 200, 234, 0.25), 0 0 0 12px rgba(94, 200, 234, 0.1); }
}

.marker:hover {
    transform: translate(-50%, -50%) scale(1.35);
}

.marker:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.marker.doc {
    background: var(--event-color, #5EC8EA);
    box-shadow: 0 0 0 4px rgba(94, 200, 234, 0.25), 0 0 0 8px rgba(94, 200, 234, 0.1) !important;
}

.marker.plain {
    background: var(--event-color, #8A9FB5);
    opacity: .9;
}

.marker.crit {
    width: 18px;
    height: 18px;
    background: var(--event-color, #E0604F);
    box-shadow: 0 0 0 4px rgba(224, 96, 79, 0.2), 0 0 0 8px rgba(224, 96, 79, 0.08) !important;
}

.marker.hito {
    background: var(--event-color, #F3A13E);
    box-shadow: 0 0 0 4px rgba(227, 161, 62, 0.2), 0 0 0 8px rgba(227, 161, 62, 0.08) !important;
}

/* ============================================================
   TARJETAS CON GLOW Y ANIMACIÓN DE ENTRADA
   ============================================================ */

.card {
    position: absolute;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    min-height: 170px;
    overflow: hidden;
    transform: translateX(-50%);
    border-left: 1px solid rgba(94, 200, 234, .28);
    border-right: 1px solid rgba(94, 200, 234, .28);
    border-bottom: 1px solid rgba(94, 200, 234, .28);
    border-top: 5px solid var(--event-color, #5EC8EA);
    border-radius: 12px;
    background: rgba(8, 27, 44, 0.92);
    backdrop-filter: blur(2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(94, 200, 234, 0.1);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    z-index: 5;
    animation: cardAppear 0.6s ease backwards;
}

.card.above {
    bottom: 274px
}
.card.below {
    top: 266px
}

.card:hover {
    transform: translateX(-50%) translateY(-6px) scale(1.02);
    border-color: var(--event-color);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(94, 200, 234, 0.15);
    z-index: 50;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.40s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.50s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.60s; }
.card:nth-child(13) { animation-delay: 0.65s; }
.card:nth-child(14) { animation-delay: 0.70s; }
.card:nth-child(15) { animation-delay: 0.75s; }
.card:nth-child(16) { animation-delay: 0.80s; }
.card:nth-child(17) { animation-delay: 0.85s; }
.card:nth-child(18) { animation-delay: 0.90s; }
.card:nth-child(19) { animation-delay: 0.95s; }
.card:nth-child(20) { animation-delay: 1.00s; }

/* ============================================================
   CABECERA DE TARJETA
   ============================================================ */

.card-header {
    height: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    background-color: var(--event-color, #5EC8EA) !important;
    border-color: var(--event-color, #5EC8EA) !important;
    color: var(--blue-950);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
}

.card-header .card-date {
    color: rgba(0, 0, 0, 0.85);
}

.card-header.doc {
    background-color: #5EC8EA !important;
    border-color: #5EC8EA !important;
}

.card-header.plain {
    background-color: #8A9FB5 !important;
    border-color: #8A9FB5 !important;
}

.card-header.crit {
    background-color: #E0604F !important;
    border-color: #E0604F !important;
}

.card-header.hito {
    background-color: #F3A13E !important;
    border-color: #F3A13E !important;
}

/* ============================================================
   CUERPO DE LA TARJETA
   ============================================================ */

.card-body {
    position: relative;
    min-height: 140px;
    padding: 13px 12px 32px;
    background: rgba(7, 25, 41, .72);
    color: #a9bdcc;
}

.card-body .card-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #f2f7fa;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.card-body .card-description {
    margin: 7px 0 0;
    color: #8fa6b8;
    font-size: 10.5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ============================================================
   ARCHIVO EN TARJETA
   ============================================================ */

.card-archive {
    position: absolute;
    left: 12px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: .9;
    cursor: pointer;
}

.card-archive:hover {
    color: #8bdcf4;
    opacity: 1;
}

/* ============================================================
   EVENTO SELECCIONADO
   ============================================================ */

.card.event-selected {
    z-index: 30;
    border-color: var(--amber);
    box-shadow:
        0 0 0 1px rgba(227, 161, 62, .3),
        0 10px 35px rgba(0, 0, 0, .45),
        0 0 25px rgba(227, 161, 62, .08);
}

.marker.event-selected {
    z-index: 30;
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow:
        0 0 0 4px rgba(227, 161, 62, .18),
        0 0 18px rgba(227, 161, 62, .35);
}

/* ============================================================
   HINT
   ============================================================ */

.hint {
    padding: 0 20px 24px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 12px;
    text-align: center;
    opacity: .6;
}

.hint b {
    color: var(--cyan);
}

/* ============================================================
   BOTÓN AGREGAR EVENTO (mejorado)
   ============================================================ */

.timeline-add-event-btn,
#addEventBtn,
.add-event-btn {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid #22c55e;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.1);
    transition: all 0.3s ease;
}

.timeline-add-event-btn:hover,
#addEventBtn:hover,
.add-event-btn:hover {
    background: #22c55e;
    color: var(--blue-950);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.3), 0 0 60px rgba(34, 197, 94, 0.1);
    transform: translateY(-2px) scale(1.02);
}

/* ============================================================
   MODAL DETALLE
   ============================================================ */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 5vh 16px;
    background: rgba(4, 10, 18, .8);
    backdrop-filter: blur(8px);
}

.overlay.open {
    display: flex;
}

.modal {
    width: min(880px, 100%);
    border: 1px solid var(--cyan-dim);
    border-radius: 16px;
    background: rgba(11, 32, 53, .98);
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 80px rgba(0, 0, 0, .6);
    animation: modalRise .3s ease;
}

@keyframes modalRise {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.95)
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--blue-700);
}

.modal-head .modal-date {
    margin: 0 0 6px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.modal-head h2 {
    margin: 0;
    color: var(--paper);
    font-size: 20px;
    font-weight: 600;
}

.modal-head .type-tag {
    padding: 5px 12px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 10px;
    white-space: nowrap;
}

.type-tag.doc {
    border: 1px solid var(--cyan-dim);
    background: rgba(94, 200, 234, .15);
    color: var(--cyan);
}

.type-tag.plain {
    border: 1px solid var(--blue-700);
    background: rgba(169, 191, 209, .1);
    color: var(--paper-dim);
}

.type-tag.crit {
    border: 1px solid rgba(224, 96, 79, .3);
    background: rgba(224, 96, 79, .15);
    color: var(--red);
}

.type-tag.hito {
    border: 1px solid rgba(227, 161, 62, .3);
    background: rgba(227, 161, 62, .15);
    color: var(--amber);
}

.close-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--blue-700);
    border-radius: 50%;
    background: none;
    color: var(--paper-dim);
    font-size: 18px;
    cursor: pointer;
}

.close-btn:hover {
    border-color: var(--cyan-dim);
    background: rgba(94, 200, 234, .1);
    color: var(--paper);
}

.modal-body {
    padding: 24px 28px 28px;
}

.modal-desc {
    margin: 0 0 20px;
    color: var(--paper-dim);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}

/* ============================================================
   ARCHIVOS EN MODAL
   ============================================================ */

.doc-preview {
    overflow: hidden;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(7, 21, 35, .8);
}

.doc-preview .doc-label {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--blue-700);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 10.5px;
    text-transform: uppercase;
}

.doc-preview img,
.doc-preview video,
.doc-preview iframe {
    display: block;
    width: 100%;
    max-height: 60vh;
    border: 0;
    object-fit: contain;
}

.doc-preview .file-download {
    display: inline-block;
    margin: 12px 16px;
    padding: 8px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--cyan);
    color: var(--blue-950);
    font-family: var(--mono);
    font-size: 11px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.doc-preview .file-download:hover {
    background: #7bd5ef;
}

.no-doc {
    padding: 30px;
    border: 1px dashed var(--blue-700);
    border-radius: 8px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 13px;
    text-align: center;
    opacity: .6;
}

.nav-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.nav-btn {
    padding: 9px 18px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(18, 48, 73, .5);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--cyan-dim);
    background: var(--blue-700);
}

.nav-btn:disabled {
    cursor: not-allowed;
    opacity: .3;
}

/* ============================================================
   IMPORTAR
   ============================================================ */

.import-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 10, 18, .85);
    backdrop-filter: blur(8px);
}

.import-overlay.open {
    display: flex;
}

.import-modal {
    width: min(500px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    border: 1px solid var(--cyan-dim);
    border-radius: 16px;
    background: rgba(11, 32, 53, .98);
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 80px rgba(0, 0, 0, .6);
}

.import-modal h3 {
    margin: 0 0 8px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 14px;
    text-transform: uppercase;
}

.import-modal p {
    margin-bottom: 20px;
    color: var(--paper-dim);
    line-height: 1.5;
}

.import-modal input[type=file] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(7, 21, 35, .8);
    color: var(--paper);
    cursor: pointer;
}

.import-modal .import-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.import-modal .import-actions button {
    padding: 10px 22px;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    background: rgba(18, 48, 73, .5);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
}

.import-modal .import-actions .btn-primary {
    border-color: var(--cyan);
    background: var(--cyan);
    color: var(--blue-950);
}

.import-modal .import-actions .btn-danger {
    border-color: var(--red);
    color: var(--red);
}

/* ============================================================
   VISOR DE IMAGEN
   ============================================================ */

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(4, 10, 18, .95);
    backdrop-filter: blur(10px);
}

.image-viewer.open {
    display: flex;
}

.image-viewer img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0, 0, 0, .6);
    user-select: none;
}

.close-viewer {
    position: fixed;
    top: 24px;
    right: 30px;
    z-index: 999999;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
    color: var(--paper);
    font-size: 26px;
    cursor: pointer;
    transition: .3s ease;
}

.close-viewer:hover {
    background: var(--cyan);
    color: var(--blue-950);
    transform: rotate(90deg);
}

/* ============================================================
   MASTER - GESTIÓN DE LÍNEAS DE TIEMPO
   ============================================================ */

.master-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
    background: rgba(2, 10, 18, .35);
    backdrop-filter: blur(3px);
}

.master-overlay.active {
    display: flex;
}

.master-modal {
    width: 420px;
    max-width: 92vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid #24506b;
    border-radius: 16px 0 0 16px;
    background: #081b2b;
    color: var(--paper);
    box-shadow: -20px 0 60px rgba(0, 0, 0, .45), 0 0 40px rgba(94, 200, 234, 0.05);
    animation: masterSlide .25s ease;
}

@keyframes masterSlide {
    from {
        opacity: 0;
        transform: translateX(30px)
    }
    to {
        opacity: 1;
        transform: translateX(0)
    }
}

.master-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-shrink: 0;
    padding: 22px;
    background: linear-gradient(135deg, #0b2235, #081925);
}

.master-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
}

.master-head h2 {
    margin: 0;
    color: #f3f8fc;
    font-size: 19px;
}

.master-head p {
    margin: 7px 0 0;
    color: #7892a5;
    font-size: 12px;
}

.master-close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1px solid #244b65;
    border-radius: 8px;
    background: #0c263b;
    color: #8fa9ba;
    cursor: pointer;
}

.master-close:hover {
    border-color: var(--cyan);
    color: #fff;
}

.master-current {
    flex-shrink: 0;
    padding: 16px 20px 14px;
}

.master-label {
    display: block;
    margin-bottom: 9px;
    color: #66869a;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1.5px;
}

.master-current-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 14px;
    border: 1px solid #1d5878;
    border-radius: 10px;
    background: #0c2539;
}

.master-current-item strong {
    display: block;
    color: #eaf5fb;
    font-size: 14px;
}

.master-current-item small {
    display: block;
    margin-top: 5px;
    color: #66899d;
    font-family: var(--mono);
    font-size: 10px;
}

.master-badge,
.timeline-master-current {
    flex: none;
    padding: 5px 9px;
    border: 1px solid rgba(64, 199, 235, .35);
    border-radius: 20px;
    background: rgba(64, 199, 235, .12);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 8px;
}

.master-divider {
    height: 1px;
    margin: 0 20px;
    background: #173b55;
}

.master-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 16px 20px 10px;
}

.master-list-head .master-label {
    margin: 0;
}

.master-new-btn {
    padding: 9px 13px;
    border: 1px solid #2a718f;
    border-radius: 8px;
    background: #0c2b40;
    color: #62ccef;
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
}

.master-new-btn:hover {
    border-color: var(--cyan);
    background: #123c55;
}

.master-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.master-list::-webkit-scrollbar {
    width: 7px;
}

.master-list::-webkit-scrollbar-track {
    background: #071724;
}

.master-list::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #24506b;
}

.timeline-master-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 12px 13px;
    border: 1px solid #173d57;
    border-radius: 10px;
    background: #0a2032;
    color: var(--paper);
    text-align: left;
    cursor: pointer;
    transition: .2s ease;
}

.timeline-master-item:hover {
    border-color: #2a718f;
    background: #0d293e;
    transform: translateX(-2px);
}

.timeline-master-item.active {
    border-color: var(--cyan);
    background: rgba(86, 199, 235, .09);
    box-shadow: inset 3px 0 0 var(--cyan);
}

.timeline-master-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(86, 199, 235, .1);
    color: var(--cyan);
}

.timeline-master-info {
    flex: 1;
    min-width: 0;
}

.timeline-master-info strong {
    display: block;
    overflow: hidden;
    color: #e8f3f8;
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.timeline-master-info small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #718b9d;
    font-family: var(--mono);
    font-size: 9.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.master-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid #173b55;
    background: #071724;
    color: #526f82;
    font-size: 10px;
}

/* ============================================================
   NUEVA LÍNEA DE TIEMPO
   ============================================================ */

#newTimelineOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 12, 22, .78);
    backdrop-filter: blur(6px);
}

#newTimelineOverlay.active {
    display: flex;
}

#newTimelineOverlay .new-timeline-modal {
    width: min(720px, calc(100% - 40px));
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    border: 1px solid #1b5575;
    border-radius: 18px;
    background: #071b2b;
    color: #e8f3f8;
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 90px rgba(0, 0, 0, .65);
}

#newTimelineOverlay .new-timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid #173b55;
}

#newTimelineOverlay .new-timeline-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .14em;
}

#newTimelineOverlay .new-timeline-head h2 {
    margin: 0;
    color: #eaf5fa;
    font-size: 22px;
}

#newTimelineOverlay .new-timeline-head p {
    margin: 7px 0 0;
    color: #718b9d;
    font-size: 12px;
}

#newTimelineOverlay .new-timeline-close {
    width: 34px;
    height: 34px;
    border: 1px solid #214b65;
    border-radius: 8px;
    background: #0a2032;
    color: #718b9d;
    cursor: pointer;
}

#newTimelineOverlay .new-timeline-close:hover {
    border-color: var(--cyan);
    color: #fff;
}

#newTimelineOverlay .new-timeline-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 26px 28px;
}

#newTimelineOverlay .new-timeline-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #9bb2c1;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

#newTimelineOverlay .new-timeline-form label.full {
    grid-column: 1 / -1;
}

#newTimelineOverlay .new-timeline-form input,
#newTimelineOverlay .new-timeline-form textarea {
    width: 100%;
    border: 1px solid #214b65;
    border-radius: 9px;
    outline: none;
    background: #061522;
    color: #e8f3f8;
    font-family: var(--sans);
    font-size: 13px;
}

#newTimelineOverlay .new-timeline-form input {
    height: 44px;
    padding: 0 13px;
}

#newTimelineOverlay .new-timeline-form textarea {
    min-height: 100px;
    padding: 12px 13px;
    resize: vertical;
}

#newTimelineOverlay .new-timeline-form input:focus,
#newTimelineOverlay .new-timeline-form textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(86, 199, 235, .1);
}

#newTimelineOverlay .new-timeline-form input[type=date] {
    color-scheme: dark;
}

#newTimelineOverlay .new-timeline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px 24px;
    border-top: 1px solid #173b55;
}

#newTimelineOverlay .new-timeline-actions button {
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
}

#newTimelineOverlay .new-timeline-cancel {
    border: 1px solid #29485b;
    background: #0a2032;
    color: #8199a8;
}

#newTimelineOverlay .new-timeline-save {
    border: 1px solid #2d91b5;
    background: #0c3349;
    color: #62ccef;
}

#newTimelineOverlay .new-timeline-save:hover {
    border-color: var(--cyan);
    background: #10435b;
    color: #fff;
}

/* ============================================================
   EDITOR DE EVENTO
   ============================================================ */

#eventEditor {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 30px !important;
    background: rgba(2, 10, 18, .96) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    overflow-y: auto !important;
}

#eventEditor.active,
#eventEditor.open {
    display: flex !important;
}

#eventEditor::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 45%, rgba(20, 72, 105, .12), transparent 55%),
        #020b14;
    pointer-events: none;
}

#eventEditor>* {
    position: relative;
    z-index: 1;
}

#eventEditor .event-editor-inner {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: #071a2b;
    border: 1px solid #214d6d;
    border-radius: 18px;
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 90px rgba(0, 0, 0, .75);
    animation: eventEditorIn .22s ease;
}

@keyframes eventEditorIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.event-editor-open {
    overflow: hidden !important;
}

/* ============================================================
   EDITOR - GRID INTERNO
   ============================================================ */

.event-editor-inner {
    display: grid;
    grid-template-columns: 170px minmax(380px, 1.15fr) minmax(320px, 1fr) 260px;
}

/* ============================================================
   EDITOR - COLUMNA FECHA
   ============================================================ */

.editor-date {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border-right: 1px solid rgba(227, 161, 62, .25);
    text-align: center;
}

.editor-date::after {
    content: '';
    position: absolute;
    top: 26px;
    right: -2px;
    width: 2px;
    height: calc(100% - 52px);
    border-radius: 2px;
    background: var(--amber);
    box-shadow: 0 0 12px rgba(227, 161, 62, .3);
}

.editor-date-day {
    color: var(--amber);
    font-size: 46px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.04em;
}

.editor-date-month {
    margin-top: 10px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .08em;
}

.editor-date-year {
    margin-top: 4px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: .12em;
}

.editor-type-badge {
    margin-top: 24px;
    padding: 7px 11px;
    border: 1px solid rgba(227, 161, 62, .4);
    border-radius: 6px;
    background: rgba(227, 161, 62, .08);
    color: var(--amber);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ============================================================
   EDITOR - COLUMNA PRINCIPAL
   ============================================================ */

.editor-main {
    padding: 26px 24px;
    border-right: 1px solid var(--blue-700);
}

.editor-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.editor-field label {
    color: var(--paper-dim);
    font-size: 11px;
    font-weight: 500;
}

.editor-field input,
.editor-field select,
.editor-field textarea {
    width: 100%;
    border: 1px solid var(--blue-700);
    border-radius: 8px;
    outline: none;
    background: rgba(4, 15, 26, .75);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 13px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.editor-field input,
.editor-field select {
    height: 40px;
    padding: 0 12px;
}

.editor-field textarea {
    min-height: 112px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.5;
}

.editor-field input:hover,
.editor-field select:hover,
.editor-field textarea:hover {
    border-color: rgba(94, 200, 234, .35);
}

.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
    border-color: var(--cyan);
    background: rgba(4, 15, 26, .95);
    box-shadow: 0 0 0 3px rgba(94, 200, 234, .08);
}

.editor-field select {
    cursor: pointer;
}

.editor-field select option {
    background: var(--blue-900);
    color: var(--paper);
}

.editor-title-field {
    margin-bottom: 18px;
}

.editor-title-field input {
    height: 46px;
    font-size: 15px;
    font-weight: 500;
}

.editor-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.editor-row:last-child {
    grid-template-columns: 1fr 1fr;
}

/* ============================================================
   EDITOR - COLUMNA CONTENIDO
   ============================================================ */

.editor-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 26px 24px;
    border-right: 1px solid var(--blue-700);
}

.editor-section-title {
    margin-bottom: 9px;
    color: var(--paper);
    font-size: 12px;
    font-weight: 600;
}

.editor-section-title span {
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 400;
}

.editor-documents {
    min-height: 100px;
}

.editor-document-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 120px;
    overflow-y: auto;
}

.editor-document-list::-webkit-scrollbar {
    width: 5px;
}

.editor-document-list::-webkit-scrollbar-track {
    background: rgba(7, 21, 35, .5);
}

.editor-document-list::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: var(--blue-700);
}

.editor-document-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--blue-700);
    border-radius: 7px;
    background: rgba(7, 21, 35, .6);
}

.editor-document-item .document-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 5px;
    background: rgba(224, 96, 79, .12);
    color: var(--red);
    font-size: 12px;
}

.editor-document-item .document-info {
    flex: 1;
    min-width: 0;
}

.editor-document-item .document-name {
    display: block;
    overflow: hidden;
    color: var(--paper);
    font-size: 10.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.editor-document-item .document-size {
    display: block;
    margin-top: 2px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 8px;
}

.editor-document-item .document-actions {
    display: flex;
    gap: 5px;
}

.editor-document-item button {
    width: 27px;
    height: 27px;
    border: 1px solid var(--blue-700);
    border-radius: 5px;
    background: transparent;
    color: var(--paper-dim);
    cursor: pointer;
}

.editor-document-item button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.editor-document-item button.delete:hover {
    border-color: var(--red);
    color: var(--red);
}

.editor-empty-documents {
    padding: 22px 12px;
    border: 1px dashed var(--blue-700);
    border-radius: 7px;
    color: var(--paper-dim);
    font-family: var(--mono);
    font-size: 9px;
    text-align: center;
    opacity: .55;
}

/* ============================================================
   EDITOR - COLUMNA COLOR
   ============================================================ */

.editor-color {
    display: flex;
    flex-direction: column;
    padding: 26px 20px;
}

.editor-color .editor-section-title {
    margin-bottom: 5px;
}

.editor-color>p {
    margin: 0 0 20px;
    color: var(--paper-dim);
    font-size: 10px;
    line-height: 1.5;
}

.color-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.event-color-option {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--event-color);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 0 2px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: .2s ease;
}

.event-color-option:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), 0 0 16px rgba(94, 200, 234, .18);
}

.event-color-option.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08), 0 0 18px rgba(94, 200, 234, .25);
    transform: scale(1.08);
}

.event-color-option.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.editor-custom-color {
    display: grid;
    grid-template-columns: 1fr 76px;
    gap: 7px;
    margin-top: auto;
}

.editor-custom-color label {
    grid-column: 1 / -1;
    color: var(--paper-dim);
    font-size: 10px;
}

.editor-custom-color input[type=color] {
    width: 100%;
    height: 38px;
    padding: 3px;
    border: 1px solid var(--blue-700);
    border-radius: 7px;
    background: var(--blue-950);
    cursor: pointer;
}

.editor-custom-color input[type=text] {
    width: 100%;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--blue-700);
    border-radius: 7px;
    outline: none;
    background: rgba(4, 15, 26, .8);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
}

.editor-custom-color input[type=text]:focus {
    border-color: var(--cyan);
}

/* ============================================================
   EDITOR - ACCIONES
   ============================================================ */

.editor-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 17px 22px;
    border-top: 1px solid var(--blue-700);
    background: rgba(4, 15, 26, .28);
    flex-wrap: wrap;
}

.editor-actions button {
    min-width: 130px;
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    transition: .2s ease;
}

.editor-delete {
    border: 1px solid var(--red);
    background: rgba(224, 96, 79, .08);
    color: var(--red);
    margin-right: auto;
}

.editor-delete:hover {
    background: var(--red);
    color: #fff;
    box-shadow: 0 0 20px rgba(224, 96, 79, .2);
    transform: translateY(-1px);
}

.editor-cancel {
    border: 1px solid var(--blue-700);
    background: rgba(18, 48, 73, .35);
    color: var(--paper-dim);
}

.editor-cancel:hover {
    border-color: var(--paper-dim);
    color: var(--paper);
    background: rgba(18, 48, 73, .7);
}

.editor-save {
    border: 1px solid #1875c8;
    background: #0868b8;
    color: #fff;
    box-shadow: 0 5px 18px rgba(8, 104, 184, .18);
}

.editor-save:hover {
    border-color: #3296e8;
    background: #0b78d1;
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgba(8, 104, 184, .28);
}

.editor-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.editor-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 7px rgba(85, 201, 138, .4);
}

/* ============================================================
   RESPONSIVE - EDITOR
   ============================================================ */

@media(max-width:1250px) {
    .event-editor-inner {
        grid-template-columns: 145px minmax(330px, 1fr) minmax(300px, 1fr);
    }
    .editor-color {
        grid-column: 2 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px 30px;
        border-top: 1px solid var(--blue-700);
    }
    .editor-color>p {
        grid-column: 1 / -1;
        margin: 0;
    }
    .color-options {
        margin: 0;
    }
    .editor-custom-color {
        margin: 0;
        align-self: center;
    }
}

@media(max-width:950px) {
    .event-editor-inner {
        grid-template-columns: 130px 1fr;
    }
    .editor-main {
        border-right: 0;
    }
    .editor-content {
        grid-column: 1 / -1;
        border-top: 1px solid var(--blue-700);
        border-right: 0;
        display: grid;
        grid-template-columns: 1.3fr 1fr;
    }
    .editor-color {
        grid-column: 1 / -1;
        border-top: 1px solid var(--blue-700);
    }
}

@media(max-width:700px) {
    #eventEditor {
        padding: 15px !important;
    }
    #eventEditor .event-editor-inner {
        max-height: calc(100vh - 30px);
        border-radius: 14px;
    }
    .event-editor-inner {
        grid-template-columns: 1fr;
    }
    .editor-date {
        min-height: 190px;
        border-right: 0;
        border-bottom: 1px solid var(--blue-700);
    }
    .editor-date::after {
        top: auto;
        right: auto;
        bottom: -2px;
        left: 25px;
        width: calc(100% - 50px);
        height: 2px;
    }
    .editor-main {
        padding: 20px 18px;
    }
    .editor-row {
        grid-template-columns: 1fr;
    }
    .editor-row:last-child {
        grid-template-columns: 1fr;
    }
    .editor-content {
        grid-column: auto;
        grid-template-columns: 1fr;
        padding: 20px 18px;
    }
    .editor-color {
        grid-column: auto;
        display: block;
        padding: 20px 18px;
    }
    .editor-custom-color {
        margin-top: 20px;
    }
    .editor-actions {
        flex-direction: column-reverse;
        padding: 15px 18px 18px;
    }
    .editor-actions button {
        width: 100%;
        min-width: unset;
    }
    .editor-delete {
        margin-right: 0;
    }
}

/* ============================================================
   MODAL NUEVO EVENTO
   ============================================================ */

.event-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.event-modal.active {
    display: flex;
}

.event-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 10, 17, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.event-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(1100px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #061522;
    border: 1px solid var(--cyan-dim);
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 100px rgba(0, 0, 0, .65);
}

.event-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 25px 28px;
    border-bottom: 1px solid #17384d;
}

.event-modal-kicker {
    display: block;
    margin-bottom: 7px;
    color: #38bdf8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

.event-modal-header h2 {
    margin: 0;
    color: #f1f5f9;
    font-size: 24px;
}

.event-modal-header p {
    margin: 7px 0 0;
    color: #70879a;
    font-size: 12px;
}

.event-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid #214861;
    border-radius: 8px;
    background: #081b2a;
    color: #8ca5b8;
    font-size: 22px;
    cursor: pointer;
    transition: .2s;
}

.event-modal-close:hover {
    color: #fff;
    border-color: #38bdf8;
    background: #0b2638;
}

#newEventForm {
    display: flex;
    flex-direction: column;
}

.new-event-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.new-event-main {
    padding: 26px 28px;
}

.new-event-side {
    padding: 26px;
    border-left: 1px solid #17384d;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label,
.new-custom-color-label {
    display: block;
    margin-bottom: 7px;
    color: #8ca5b8;
    font-size: 11px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #17415c;
    border-radius: 7px;
    background: #04111d;
    color: #e6edf3;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: .2s;
}

.form-group input,
.form-group select {
    height: 42px;
}

.form-group textarea {
    min-height: 125px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, .08);
}

.new-event-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.new-event-color-title {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 700;
}

.new-event-side>p {
    margin: 7px 0 20px;
    color: #71889b;
    font-size: 11px;
    line-height: 1.6;
}

.new-event-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-bottom: 30px;
}

.new-color-option {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 50%;
    background: var(--event-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 0 0 1px rgba(0, 0, 0, .4);
    cursor: pointer;
    transition: .2s;
}

.new-color-option:hover {
    transform: scale(1.08);
}

.new-color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--event-color), 0 0 15px color-mix(in srgb, var(--event-color) 45%, transparent);
}

.new-custom-color-label {
    margin-bottom: 8px;
}

.new-custom-color {
    display: flex;
    gap: 8px;
}

.new-custom-color input[type="color"] {
    width: 55px;
    height: 42px;
    padding: 3px;
    border: 1px solid #17415c;
    border-radius: 7px;
    background: #04111d;
    cursor: pointer;
}

.new-custom-color input[type="text"] {
    width: 90px;
    height: 42px;
    box-sizing: border-box;
    border: 1px solid #17415c;
    border-radius: 7px;
    background: #04111d;
    color: #dbeafe;
    padding: 0 10px;
    font-family: monospace;
    font-size: 11px;
    text-transform: uppercase;
}

.new-file-group {
    margin-top: 35px;
}

.new-file-group small {
    display: block;
    margin-top: 7px;
    color: #526b7d;
    font-size: 10px;
    line-height: 1.5;
}

.new-event-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px;
    border-top: 1px solid #17384d;
}

.event-btn {
    height: 42px;
    padding: 0 20px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.event-btn-cancel {
    border: 1px solid #214861;
    background: #071a29;
    color: #8ca5b8;
}

.event-btn-cancel:hover {
    border-color: #52748a;
    color: #fff;
}

.event-btn-save {
    border: 1px solid #1687d4;
    background: #0877c9;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 119, 201, .2);
}

.event-btn-save:hover {
    background: #0b8bdd;
    transform: translateY(-1px);
}

/* ============================================================
   RESPONSIVE - MODAL NUEVO EVENTO
   ============================================================ */

@media(max-width:800px) {
    .event-modal {
        padding: 15px;
    }
    .new-event-grid {
        grid-template-columns: 1fr;
    }
    .new-event-side {
        border-left: 0;
        border-top: 1px solid #17384d;
    }
    .new-event-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ============================================================
   RESPONSIVE - GENERAL
   ============================================================ */

@media(max-width:768px) {
    .titleblock {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 16px 12px;
    }
    .stamp {
        width: 100%;
        text-align: left;
    }
    .admin-toggle-wrap {
        justify-content: flex-start;
        padding: 8px 16px 0;
    }
    .admin-panel {
        margin: 12px 16px;
        padding: 16px 18px;
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .admin-event-item {
        flex-wrap: wrap;
    }
    .timeline-inner {
        height: 500px;
    }
    .card {
        width: 175px;
        min-width: 175px;
        max-width: 175px;
    }
    .master-modal {
        width: 100%;
        max-width: 100%;
        border-left: 0;
        border-radius: 0;
    }
    #newTimelineOverlay .new-timeline-modal {
        width: calc(100% - 24px);
    }
    #newTimelineOverlay .new-timeline-form {
        grid-template-columns: 1fr;
        padding: 22px;
    }
    #newTimelineOverlay .new-timeline-form label.full {
        grid-column: auto;
    }
    #newTimelineOverlay .new-timeline-actions {
        flex-direction: column-reverse;
        padding: 16px 22px 20px;
    }
    #newTimelineOverlay .new-timeline-actions button {
        width: 100%;
    }
}

@media(max-width:600px) {
    .timeline-inner {
        height: 480px;
    }
    .timeline-wrap {
        padding-top: 35px;
    }
    .card {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }
    .card-body {
        padding: 9px 9px 27px;
    }
    .card-body .card-title {
        font-size: 11px;
    }
}

/* ============================================================
   MODAL DE ERROR DE ARCHIVO
   ============================================================ */

.file-error-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    animation: fileErrorIn .3s ease;
}

.file-error-modal.active {
    display: flex;
}

.file-error-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 10, 17, .85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.file-error-dialog {
    position: relative;
    z-index: 2;
    width: min(480px, 100%);
    padding: 40px 32px 32px;
    background: #0a1f31;
    border: 1px solid #e0604f;
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 80px rgba(0, 0, 0, .7);
    text-align: center;
    animation: fileErrorSlide .35s ease;
}

@keyframes fileErrorIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fileErrorSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.file-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.file-error-dialog h3 {
    margin: 0 0 12px;
    color: #f1f5f9;
    font-size: 22px;
    font-weight: 700;
}

.file-error-dialog p {
    margin: 0 0 6px;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
}

.file-error-dialog p strong {
    color: #f97373;
}

.file-error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.file-error-btn {
    padding: 10px 24px;
    border: 1px solid #38bdf8;
    border-radius: 8px;
    background: #0b263b;
    color: #38bdf8;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

.file-error-btn:hover {
    background: #38bdf8;
    color: #0b1a28;
}

.file-error-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid #e0604f;
    border-radius: 8px;
    background: rgba(224, 96, 79, .08);
    color: #e0604f;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s ease;
}

.file-error-link:hover {
    background: #e0604f;
    color: #fff;
}

@media (max-width: 600px) {
    .file-error-dialog {
        padding: 30px 20px 24px;
    }
    .file-error-dialog h3 {
        font-size: 19px;
    }
    .file-error-actions {
        flex-direction: column;
    }
    .file-error-btn,
    .file-error-link {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   MODAL DE CONFIRMACIÓN
   ============================================================ */

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 99999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    animation: confirmIn .25s ease;
}

.confirm-modal.active {
    display: flex;
}

.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 10, 17, .8);
    backdrop-filter: blur(8px);
}

.confirm-dialog {
    position: relative;
    z-index: 2;
    width: min(420px, 100%);
    padding: 40px 32px 32px;
    background: #0a1f31;
    border: 1px solid var(--cyan-dim);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(94, 200, 234, 0.05), 0 30px 80px rgba(0, 0, 0, .7);
    text-align: center;
    animation: confirmSlide .3s ease;
}

@keyframes confirmIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes confirmSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-icon {
    font-size: 44px;
    margin-bottom: 10px;
}

.confirm-dialog h3 {
    margin: 0 0 8px;
    color: #f1f5f9;
    font-size: 20px;
    font-weight: 700;
}

.confirm-dialog p {
    margin: 0 0 24px;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.confirm-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
    min-width: 110px;
}

.confirm-btn.cancel {
    border: 1px solid var(--blue-700);
    background: rgba(18, 48, 73, .5);
    color: var(--paper-dim);
}

.confirm-btn.cancel:hover {
    border-color: var(--paper-dim);
    background: rgba(18, 48, 73, .7);
    color: var(--paper);
}

.confirm-btn.danger {
    border: 1px solid var(--red);
    background: rgba(224, 96, 79, .08);
    color: var(--red);
}

.confirm-btn.danger:hover {
    background: var(--red);
    color: #fff;
    box-shadow: 0 0 20px rgba(224, 96, 79, .2);
}

@media (max-width: 600px) {
    .confirm-dialog {
        padding: 30px 20px 24px;
    }
    .confirm-actions {
        flex-direction: column;
    }
    .confirm-btn {
        width: 100%;
    }
}

/* ============================================================
   OVERLAY DE CARGA
   ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(2, 10, 18, .85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(94, 200, 234, .15);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: var(--paper);
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: .1em;
}

/* ============================================================
   VALIDACIÓN DE CAMPOS
   ============================================================ */

.field-helper {
    font-size: 12px;
    margin-top: 6px;
    color: var(--paper-dim);
    opacity: 0.7;
    transition: color 0.2s ease, opacity 0.2s ease;
    font-family: var(--sans);
}

.field-helper.error {
    color: var(--red);
    opacity: 1;
}

textarea.is-invalid {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 2px rgba(224, 96, 79, 0.15) !important;
}

.editor-field .field-helper {
    font-size: 11px;
    margin-top: 4px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.timeline-notifications {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.timeline-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    background: rgba(7, 27, 43, 0.95);
    border: 1px solid rgba(94, 200, 234, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    color: #eef3f6;
    font-family: var(--sans);
    font-size: 14px;
    max-width: 100%;
    min-width: 240px;
}

.timeline-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.timeline-notification.success {
    border-left: 4px solid #22c55e;
}

.timeline-notification.success .notification-icon {
    color: #22c55e;
}

.timeline-notification.error {
    border-left: 4px solid #ef4444;
}

.timeline-notification.error .notification-icon {
    color: #ef4444;
}

.timeline-notification .notification-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    font-size: 16px;
    font-weight: 700;
}

.timeline-notification .notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .timeline-notifications {
        top: 70px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    .timeline-notification {
        padding: 12px 14px;
        font-size: 13px;
        min-width: unset;
    }
}
/* ============================================================
   MINELYSISS — MEJORAS VISUALES ADICIONALES
   (Complemento - agregar al final del CSS existente)
   ============================================================ */

/* ===== FONDO TECNOLÓGICO MEJORADO ===== */
body {
    position: relative;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(94, 200, 234, .04) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, .04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 100, 180, .03) 0%, transparent 70%),
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
        #050d18 !important;
    min-height: 100vh;
    animation: bodyGlowShift 20s ease-in-out infinite;
}

/* Animación sutil del fondo */
@keyframes bodyGlowShift {
    0%, 100% {
        background-position: 0% 50%, 0% 50%, 0% 50%, 0 0, 0 0, 0 0;
    }
    50% {
        background-position: 0% 50%, 0% 50%, 0% 50%, 8px 8px, 8px 8px, 0 0;
    }
}

/* Overlay de partículas */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(94, 200, 234, .5), transparent),
        radial-gradient(1px 1px at 25% 60%, rgba(94, 200, 234, .4), transparent),
        radial-gradient(1.5px 1.5px at 40% 15%, rgba(255, 255, 255, .3), transparent),
        radial-gradient(1px 1px at 55% 75%, rgba(94, 200, 234, .45), transparent),
        radial-gradient(1.5px 1.5px at 70% 35%, rgba(139, 92, 246, .35), transparent),
        radial-gradient(1px 1px at 85% 55%, rgba(94, 200, 234, .4), transparent),
        radial-gradient(1px 1px at 92% 80%, rgba(255, 255, 255, .25), transparent),
        radial-gradient(1.5px 1.5px at 15% 85%, rgba(94, 200, 234, .35), transparent),
        radial-gradient(1px 1px at 45% 45%, rgba(255, 255, 255, .2), transparent),
        radial-gradient(1px 1px at 65% 90%, rgba(94, 200, 234, .3), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(139, 92, 246, .3), transparent),
        radial-gradient(1.5px 1.5px at 5% 45%, rgba(94, 200, 234, .4), transparent);
    background-size: 300px 300px;
    animation: particleDrift 30s linear infinite;
    opacity: 0.6;
}

@keyframes particleDrift {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 300px 300px, -200px 150px, 100px -250px, -150px -200px, 250px 100px, -100px 250px, 200px -150px, -250px -100px, 150px 200px, -200px -250px, 250px -200px, -150px 100px;
    }
}

/* ===== MEJORA LÍNEA CENTRAL ===== */
.axis-line {
    position: absolute;
    top: 260px;
    right: 0;
    left: 0;
    height: 3px !important;
    background: linear-gradient(90deg,
        transparent,
        rgba(94, 200, 234, .6) 5%,
        rgba(94, 200, 234, .8) 30%,
        rgba(139, 92, 246, .7) 50%,
        rgba(94, 200, 234, .8) 70%,
        rgba(94, 200, 234, .6) 95%,
        transparent) !important;
    z-index: 1;
    box-shadow: 
        0 0 20px rgba(94, 200, 234, 0.4),
        0 0 60px rgba(94, 200, 234, 0.15),
        0 0 100px rgba(139, 92, 246, 0.08);
    animation: axisPulse 3s ease-in-out infinite;
}

@keyframes axisPulse {
    0%, 100% { 
        opacity: 0.85; 
        box-shadow: 0 0 20px rgba(94, 200, 234, 0.4), 0 0 60px rgba(94, 200, 234, 0.15);
    }
    50% { 
        opacity: 1; 
        box-shadow: 0 0 35px rgba(94, 200, 234, 0.6), 0 0 80px rgba(139, 92, 246, 0.2);
    }
}

/* Línea decorativa superior e inferior */
.axis-line::before,
.axis-line::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(94, 200, 234, 0.15) 30%,
        rgba(139, 92, 246, 0.15) 50%,
        rgba(94, 200, 234, 0.15) 70%,
        transparent);
    pointer-events: none;
}

.axis-line::before {
    top: -8px;
}

.axis-line::after {
    bottom: -8px;
}

/* ===== MEJORA MARCADORES (NODOS) ===== */
.marker {
    position: absolute;
    top: 260px;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    border: 2px solid #0a1626;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 6;
    background-color: var(--event-color, #5EC8EA);
    animation: markerPulseGlow 2.5s ease-in-out infinite;
    box-shadow: 
        0 0 0 4px rgba(94, 200, 234, 0.2),
        0 0 0 8px rgba(94, 200, 234, 0.08),
        0 0 20px rgba(94, 200, 234, 0.4);
}

@keyframes markerPulseGlow {
    0%, 100% {
        box-shadow: 
            0 0 0 4px rgba(94, 200, 234, 0.2),
            0 0 0 8px rgba(94, 200, 234, 0.08),
            0 0 20px rgba(94, 200, 234, 0.4);
    }
    50% {
        box-shadow: 
            0 0 0 6px rgba(94, 200, 234, 0.3),
            0 0 0 12px rgba(94, 200, 234, 0.12),
            0 0 35px rgba(94, 200, 234, 0.6);
    }
}

.marker:hover {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 
        0 0 0 6px rgba(94, 200, 234, 0.35),
        0 0 0 12px rgba(94, 200, 234, 0.15),
        0 0 40px rgba(94, 200, 234, 0.7);
    z-index: 10;
}

/* Colores específicos para marcadores */
.marker.doc {
    background: #5EC8EA;
    animation: markerPulseCyan 2.5s ease-in-out infinite;
}

@keyframes markerPulseCyan {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(94, 200, 234, 0.25), 0 0 0 8px rgba(94, 200, 234, 0.1), 0 0 25px rgba(94, 200, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(94, 200, 234, 0.35), 0 0 0 12px rgba(94, 200, 234, 0.15), 0 0 40px rgba(94, 200, 234, 0.7);
    }
}

.marker.crit {
    background: #E0604F;
    animation: markerPulseRed 2.5s ease-in-out infinite;
}

@keyframes markerPulseRed {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(224, 96, 79, 0.25), 0 0 0 8px rgba(224, 96, 79, 0.1), 0 0 25px rgba(224, 96, 79, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(224, 96, 79, 0.35), 0 0 0 12px rgba(224, 96, 79, 0.15), 0 0 40px rgba(224, 96, 79, 0.7);
    }
}

.marker.hito {
    background: #F3A13E;
    animation: markerPulseAmber 2.5s ease-in-out infinite;
}

@keyframes markerPulseAmber {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(243, 161, 62, 0.25), 0 0 0 8px rgba(243, 161, 62, 0.1), 0 0 25px rgba(243, 161, 62, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(243, 161, 62, 0.35), 0 0 0 12px rgba(243, 161, 62, 0.15), 0 0 40px rgba(243, 161, 62, 0.7);
    }
}

/* ===== MEJORA CONECTORES ===== */
.event-stem {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom,
        var(--event-color, var(--cyan)),
        rgba(94, 200, 234, .1));
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 8px rgba(94, 200, 234, 0.3);
    animation: stemPulse 3s ease-in-out infinite;
}

@keyframes stemPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ===== MEJORA TARJETAS ===== */
.card {
    position: absolute;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    min-height: 170px;
    overflow: hidden;
    transform: translateX(-50%);
    border-left: 1px solid rgba(94, 200, 234, .3);
    border-right: 1px solid rgba(94, 200, 234, .3);
    border-bottom: 1px solid rgba(94, 200, 234, .3);
    border-top: 5px solid var(--event-color, #5EC8EA);
    border-radius: 12px;
    background: rgba(8, 27, 44, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(94, 200, 234, 0.12),
        0 0 20px rgba(94, 200, 234, 0.08);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 5;
    animation: cardAppear 0.6s ease backwards;
}

/* Glow específico por tipo */
.card.doc {
    border-top-color: #5EC8EA;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(94, 200, 234, 0.15),
        0 0 25px rgba(94, 200, 234, 0.1);
}

.card.crit {
    border-top-color: #E0604F;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(224, 96, 79, 0.15),
        0 0 25px rgba(224, 96, 79, 0.1);
}

.card.hito {
    border-top-color: #F3A13E;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(243, 161, 62, 0.15),
        0 0 25px rgba(243, 161, 62, 0.1);
}

.card:hover {
    transform: translateX(-50%) translateY(-8px) scale(1.03);
    z-index: 50;
}

.card.doc:hover {
    box-shadow: 
        0 18px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(94, 200, 234, 0.3),
        0 0 40px rgba(94, 200, 234, 0.2);
}

.card.crit:hover {
    box-shadow: 
        0 18px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(224, 96, 79, 0.3),
        0 0 40px rgba(224, 96, 79, 0.2);
}

.card.hito:hover {
    box-shadow: 
        0 18px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(243, 161, 62, 0.3),
        0 0 40px rgba(243, 161, 62, 0.2);
}

/* ===== MEJORA BOTÓN VER DETALLE ===== */
.card-body .card-detail-btn,
.card-body .ver-detalle {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(94, 200, 234, 0.08);
    border: 1px solid rgba(94, 200, 234, 0.2);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-body .card-detail-btn::after,
.card-body .ver-detalle::after {
    content: '→';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.card-body .card-detail-btn:hover,
.card-body .ver-detalle:hover {
    background: var(--cyan);
    color: var(--blue-950);
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(94, 200, 234, 0.4);
}

.card-body .card-detail-btn:hover::after,
.card-body .ver-detalle:hover::after {
    transform: translateX(3px);
}

/* ===== CONEXIÓN TARJETA-NODO ===== */
.card::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    width: 1px;
    height: 14px;
    background: linear-gradient(to bottom,
        var(--event-color, #5EC8EA),
        transparent);
    opacity: 0.8;
}

.card.above::after {
    bottom: -14px;
}

.card.below::after {
    bottom: auto;
    top: -14px;
    background: linear-gradient(to top,
        var(--event-color, #5EC8EA),
        transparent);
}

/* ===== MEJORA RESPONSIVE ===== */
@media(max-width: 768px) {
    .card {
        width: 175px;
        min-width: 175px;
        max-width: 175px;
    }
    
    .marker {
        width: 14px;
        height: 14px;
    }
}

@media(max-width: 600px) {
    .card {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }
    
    .marker {
        width: 12px;
        height: 12px;
    }
}
/* ============================================================
   PANEL DE OPCIONES DE EVENTO
   ============================================================ */

.event-options-panel {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.event-options-panel.active {
    display: flex;
}

.event-options-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 10, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: optionsBackdropIn 0.3s ease;
}

@keyframes optionsBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.event-options-dialog {
    position: relative;
    z-index: 2;
    width: min(420px, 100%);
    background: #0a1f31;
    border: 1px solid rgba(94, 200, 234, 0.25);
    border-radius: 16px;
    box-shadow: 
        0 0 40px rgba(94, 200, 234, 0.08),
        0 30px 80px rgba(0, 0, 0, 0.6);
    animation: optionsDialogIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

@keyframes optionsDialogIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.event-options-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(94, 200, 234, 0.1);
    background: linear-gradient(135deg, rgba(94, 200, 234, 0.05), transparent);
}

.event-options-kicker {
    display: block;
    margin-bottom: 6px;
    color: #5EC8EA;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.8;
}

.event-options-header h3 {
    margin: 0;
    color: #f1f5f9;
    font-size: 18px;
    font-weight: 600;
}

.event-options-header p {
    margin: 5px 0 0;
    color: #718b9d;
    font-size: 12px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.event-options-close {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid rgba(94, 200, 234, 0.2);
    border-radius: 8px;
    background: rgba(7, 21, 35, 0.5);
    color: #8ca5b8;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-options-close:hover {
    border-color: #5EC8EA;
    color: #fff;
    background: rgba(94, 200, 234, 0.1);
}

.event-options-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(94, 200, 234, 0.15);
    border-radius: 12px;
    background: rgba(7, 25, 41, 0.6);
    color: #e8f3f8;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

.event-option-btn:hover {
    border-color: rgba(94, 200, 234, 0.4);
    background: rgba(94, 200, 234, 0.08);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(94, 200, 234, 0.1);
}

.event-option-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(94, 200, 234, 0.1);
    font-size: 20px;
}

.event-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.event-option-text strong {
    font-size: 14px;
    font-weight: 600;
    color: #e8f3f8;
}

.event-option-text small {
    color: #718b9d;
    font-size: 11px;
}

.event-option-arrow {
    font-size: 18px;
    color: #718b9d;
    transition: all 0.2s ease;
}

.event-option-btn:hover .event-option-arrow {
    transform: translateX(3px);
    color: #5EC8EA;
}


/* ============================================================
   ICONO DE ARCHIVO EN HEADER DE TARJETA
   ============================================================ */

.card-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 11px;
}

.card-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
    font-size: 11px;
    animation: fileIconPulse 2s ease-in-out infinite;
}

@keyframes fileIconPulse {
    0%, 100% { 
        opacity: 0.8;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}


/* ============================================================
   ANIMACIÓN MEJORADA DEL EDITOR
   ============================================================ */

#eventEditor {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 30px !important;
    background: rgba(2, 10, 18, 0.92) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    overflow-y: auto !important;
    opacity: 0;
    transition: opacity 0.35s ease;
}

#eventEditor.active,
#eventEditor.open {
    display: flex !important;
    opacity: 1;
}

#eventEditor::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 45%, rgba(20, 72, 105, 0.15), transparent 55%),
        radial-gradient(circle at 30% 60%, rgba(94, 200, 234, 0.05), transparent 40%),
        radial-gradient(circle at 70% 40%, rgba(139, 92, 246, 0.05), transparent 40%),
        #020b14;
    pointer-events: none;
    animation: editorBgGlow 4s ease-in-out infinite;
}

@keyframes editorBgGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

#eventEditor .event-editor-inner {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: #071a2b;
    border: 1px solid #214d6d;
    border-radius: 18px;
    box-shadow: 
        0 0 40px rgba(94, 200, 234, 0.08),
        0 0 80px rgba(94, 200, 234, 0.04),
        0 30px 90px rgba(0, 0, 0, 0.75);
    animation: editorPanelIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes editorPanelIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ============================================================
   ANIMACIÓN DE ENTRADA SECUENCIAL PARA TARJETAS
   ============================================================ */

.card {
    position: absolute;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    min-height: 170px;
    overflow: hidden;
    transform: translateX(-50%);
    border-left: 1px solid rgba(94, 200, 234, .3);
    border-right: 1px solid rgba(94, 200, 234, .3);
    border-bottom: 1px solid rgba(94, 200, 234, .3);
    border-top: 5px solid var(--event-color, #5EC8EA);
    border-radius: 12px;
    background: rgba(8, 27, 44, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(94, 200, 234, 0.12),
        0 0 20px rgba(94, 200, 234, 0.08);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 5;
    
    /* Animación con delay dinámico */
    animation: cardAppearSequential 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--animation-delay, 0s);
}

@keyframes cardAppearSequential {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Marcadores con animación secuencial */
.marker {
    position: absolute;
    top: 260px;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    border: 2px solid #0a1626;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 6;
    background-color: var(--event-color, #5EC8EA);
    box-shadow: 
        0 0 0 4px rgba(94, 200, 234, 0.2),
        0 0 0 8px rgba(94, 200, 234, 0.08),
        0 0 20px rgba(94, 200, 234, 0.4);
    
    /* Animación con delay dinámico */
    animation: markerAppearSequential 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--animation-delay, 0s);
}

@keyframes markerAppearSequential {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Tallos con animación secuencial */
.event-stem {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom,
        var(--event-color, var(--cyan)),
        rgba(94, 200, 234, .1));
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 8px rgba(94, 200, 234, 0.3);
    
    /* Animación con delay dinámico */
    animation: stemAppearSequential 0.5s ease backwards;
    animation-delay: var(--animation-delay, 0s);
}

@keyframes stemAppearSequential {
    from {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: center;
    }
    to {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: center;
    }
}

/* Hover de tarjetas */
.card:hover {
    transform: translateX(-50%) translateY(-8px) scale(1.03);
    z-index: 50;
}

.card.doc:hover {
    box-shadow: 
        0 18px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(94, 200, 234, 0.3),
        0 0 40px rgba(94, 200, 234, 0.2);
}

.card.crit:hover {
    box-shadow: 
        0 18px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(224, 96, 79, 0.3),
        0 0 40px rgba(224, 96, 79, 0.2);
}

.card.hito:hover {
    box-shadow: 
        0 18px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(243, 161, 62, 0.3),
        0 0 40px rgba(243, 161, 62, 0.2);
}


/* ============================================================
   BOTÓN VER DETALLE
   ============================================================ */

.card-body .card-detail-btn {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(94, 200, 234, 0.08);
    border: 1px solid rgba(94, 200, 234, 0.2);
    color: #5EC8EA;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-body .card-detail-btn:hover {
    background: #5EC8EA;
    color: #071523;
    border-color: #5EC8EA;
    box-shadow: 0 0 20px rgba(94, 200, 234, 0.4);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media(max-width: 768px) {
    .card {
        width: 175px;
        min-width: 175px;
        max-width: 175px;
    }
    
    .marker {
        width: 14px;
        height: 14px;
    }
    
    .event-options-dialog {
        width: min(380px, 100%);
    }
}

@media(max-width: 600px) {
    .card {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }
    
    .marker {
        width: 12px;
        height: 12px;
    }
    
    .event-options-panel {
        padding: 15px;
    }
    
    .event-options-dialog {
        width: 100%;
    }
    
    .event-options-header {
        padding: 20px 18px 14px;
    }
    
    .event-options-body {
        padding: 12px;
    }
    
    .event-option-btn {
        padding: 14px;
    }
}

/* ============================================================
   NAVEGADOR CRONOLÓGICO VISUAL
   ============================================================ */

.timeline-navigator {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px clamp(20px, 4vw, 56px) 20px;
    padding: 8px 16px;
    background: rgba(7, 21, 35, 0.5);
    border: 1px solid rgba(94, 200, 234, 0.15);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    user-select: none;
    -webkit-user-select: none;
}

/* Flechas de navegación */
.navigator-arrow {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(94, 200, 234, 0.25);
    border-radius: 50%;
    background: rgba(18, 48, 73, 0.6);
    color: #5EC8EA;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.navigator-arrow:hover {
    background: rgba(94, 200, 234, 0.2);
    border-color: #5EC8EA;
    box-shadow: 0 0 20px rgba(94, 200, 234, 0.3);
    transform: scale(1.1);
}

.navigator-arrow:active {
    transform: scale(0.95);
}

/* Contenedor del track */
.navigator-track {
    position: relative;
    flex: 1;
    height: 40px;
    cursor: pointer;
    overflow: hidden;
}

/* Línea base del navegador */
.navigator-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(90deg,
        rgba(94, 200, 234, 0.15),
        rgba(94, 200, 234, 0.4) 30%,
        rgba(139, 92, 246, 0.4) 50%,
        rgba(94, 200, 234, 0.4) 70%,
        rgba(94, 200, 234, 0.15)
    );
    border-radius: 2px;
}

/* Zona visible resaltada */
.navigator-viewport {
    position: absolute;
    top: 50%;
    height: 28px;
    transform: translateY(-50%);
    background: rgba(94, 200, 234, 0.08);
    border: 1px solid rgba(94, 200, 234, 0.25);
    border-radius: 14px;
    box-shadow: 
        0 0 15px rgba(94, 200, 234, 0.1),
        inset 0 0 15px rgba(94, 200, 234, 0.05);
    transition: left 0.15s ease, width 0.15s ease;
    pointer-events: none;
    z-index: 1;
}

/* Contenedor de puntos */
.navigator-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

/* Puntos individuales */
.navigator-dot {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(7, 21, 35, 0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 
        0 0 0 3px rgba(94, 200, 234, 0.15),
        0 0 8px rgba(94, 200, 234, 0.3);
    z-index: 3;
}

.navigator-dot:hover {
    transform: translate(-50%, -50%) scale(1.6);
    box-shadow: 
        0 0 0 4px rgba(94, 200, 234, 0.25),
        0 0 15px rgba(94, 200, 234, 0.5);
    z-index: 5;
}

/* Punto activo/seleccionado */
.navigator-dot.active {
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 
        0 0 0 5px rgba(94, 200, 234, 0.3),
        0 0 0 10px rgba(94, 200, 234, 0.1),
        0 0 25px rgba(94, 200, 234, 0.6);
    z-index: 6;
    animation: dotActivePulse 2s ease-in-out infinite;
}

@keyframes dotActivePulse {
    0%, 100% {
        box-shadow: 
            0 0 0 5px rgba(94, 200, 234, 0.3),
            0 0 0 10px rgba(94, 200, 234, 0.1),
            0 0 25px rgba(94, 200, 234, 0.6);
    }
    50% {
        box-shadow: 
            0 0 0 7px rgba(94, 200, 234, 0.4),
            0 0 0 14px rgba(94, 200, 234, 0.15),
            0 0 35px rgba(94, 200, 234, 0.8);
    }
}

/* Tooltip del punto */
.navigator-dot-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(11, 32, 53, 0.95);
    border: 1px solid rgba(94, 200, 234, 0.3);
    color: #eef3f6;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 9px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.navigator-dot:hover .navigator-dot-tooltip {
    opacity: 1;
}

/* Responsive */
@media(max-width: 768px) {
    .timeline-navigator {
        margin: 12px 16px 16px;
        padding: 6px 10px;
        gap: 8px;
    }
    
    .navigator-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .navigator-track {
        height: 32px;
    }
    
    .navigator-dot {
        width: 8px;
        height: 8px;
    }
    
    .navigator-dot.active {
        width: 13px;
        height: 13px;
    }
}

@media(max-width: 600px) {
    .timeline-navigator {
        margin: 10px 10px 14px;
        padding: 4px 8px;
    }
    
    .navigator-arrow {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    .navigator-track {
        height: 28px;
    }
}

/* Ocultar scrollbar nativa */
.timeline-wrap {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.timeline-wrap::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

