/* Timeline de eventos — rastreo web público (colores Mandar y Servir) */
.rw-timeline-wrap {
    padding: 0.65rem 0.35rem 0.85rem;
    max-height: 560px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #90caf9 #eff6ff;
}
.rw-timeline-wrap::-webkit-scrollbar { width: 6px; }
.rw-timeline-wrap::-webkit-scrollbar-thumb { background: #90caf9; border-radius: 6px; }
.rw-timeline-wrap::-webkit-scrollbar-track { background: #eff6ff; }

.rw-timeline-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    border-radius: 12px;
    border: 1px solid #bbdefb;
    font-size: 0.84rem;
    color: #0055c1;
    font-weight: 700;
}
.rw-timeline-summary .rw-count-badge {
    background: linear-gradient(135deg, #0055c1 0%, #003d8a 100%);
    color: #fff;
    border-radius: 20px;
    padding: 0.22rem 0.7rem;
    font-size: 0.76rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 85, 193, 0.25);
}

.rw-timeline-prueba {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.9rem;
}
.rw-btn-prueba {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #0055c1 0%, #003d8a 100%);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 85, 193, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rw-btn-prueba:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 85, 193, 0.35);
    color: #fff !important;
}

.rw-timeline {
    position: relative;
    padding: 0.15rem 0 0.35rem 0;
}

.rw-timeline-item {
    display: grid;
    grid-template-columns: 72px 36px 1fr;
    gap: 0 0.7rem;
    margin-bottom: 0;
    padding-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(12px);
    animation: rwTimelineIn 0.45s ease forwards;
}
.rw-timeline-item:last-child { padding-bottom: 0.15rem; }
.rw-timeline-item:last-child .rw-timeline-line { display: none; }

@keyframes rwTimelineIn {
    to { opacity: 1; transform: translateY(0); }
}

.rw-timeline-date {
    text-align: center;
    padding-top: 0.4rem;
}
.rw-date-day {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #0055c1;
    letter-spacing: -0.02em;
}
.rw-date-mon {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1565c0;
    letter-spacing: 0.06em;
    margin-top: 0.18rem;
}
.rw-date-year {
    display: block;
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 0.12rem;
}
.rw-date-time {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.18rem 0.5rem;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.rw-date-empty .rw-date-day { font-size: 1rem; color: #94a3b8; }
.rw-date-empty .rw-date-mon { font-size: 0.65rem; color: #94a3b8; }

.rw-timeline-track {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.rw-timeline-dot {
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 85, 193, 0.14);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.rw-timeline-item:hover .rw-timeline-dot { transform: scale(1.08); }
.rw-timeline-line {
    flex: 1;
    width: 3px;
    min-height: 1.35rem;
    margin-top: 0.3rem;
    background: linear-gradient(180deg, #90caf9 0%, #e2e8f0 100%);
    border-radius: 3px;
}

.rw-timeline-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    min-width: 0;
}
.rw-timeline-item:hover .rw-timeline-card {
    box-shadow: 0 6px 18px rgba(0, 85, 193, 0.12);
    border-color: #bbdefb;
}
.rw-timeline-cat {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.14rem 0.55rem;
    border-radius: 20px;
    margin-bottom: 0.45rem;
}
.rw-timeline-title {
    margin: 0 0 0.4rem;
    font-size: 0.94rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}
.rw-timeline-desc {
    margin: 0;
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.5;
    word-break: break-word;
}
.rw-timeline-user {
    margin-top: 0.5rem;
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.rw-timeline-user i { color: #94a3b8; font-size: 0.7rem; }

/* Categorías — paleta azul Mandar y Servir + acentos útiles */
.rw-ev-registro .rw-timeline-dot { background: #e3f2fd; color: #0055c1; border: 2px solid #90caf9; }
.rw-ev-registro .rw-timeline-cat { background: #e3f2fd; color: #0055c1; }
.rw-ev-registro .rw-timeline-card { border-left: 3px solid #0055c1; }

.rw-ev-transito .rw-timeline-dot { background: #dbeafe; color: #1565c0; border: 2px solid #93c5fd; }
.rw-ev-transito .rw-timeline-cat { background: #dbeafe; color: #1565c0; }
.rw-ev-transito .rw-timeline-card { border-left: 3px solid #1565c0; }

.rw-ev-entrega .rw-timeline-dot { background: #dcfce7; color: #15803d; border: 2px solid #86efac; }
.rw-ev-entrega .rw-timeline-cat { background: #dcfce7; color: #15803d; }
.rw-ev-entrega .rw-timeline-card { border-left: 3px solid #16a34a; }

.rw-ev-novedad .rw-timeline-dot { background: #fee2e2; color: #b91c1c; border: 2px solid #fecaca; }
.rw-ev-novedad .rw-timeline-cat { background: #fee2e2; color: #b91c1c; }
.rw-ev-novedad .rw-timeline-card { border-left: 3px solid #dc2626; background: #fffbfb; }

.rw-ev-festivo .rw-timeline-dot { background: #fef3c7; color: #b45309; border: 2px solid #fde68a; }
.rw-ev-festivo .rw-timeline-cat { background: #fef3c7; color: #b45309; }
.rw-ev-festivo .rw-timeline-card { border-left: 3px solid #f59e0b; background: #fffef5; }

.rw-ev-normal .rw-timeline-dot { background: #e3f2fd; color: #0d47a1; border: 2px solid #bbdefb; }
.rw-ev-normal .rw-timeline-cat { background: #e3f2fd; color: #0d47a1; }
.rw-ev-normal .rw-timeline-card { border-left: 3px solid #0055c1; }

.rw-timeline-card .btn-ver-novedad {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    margin-top: 0.4rem;
    border-radius: 8px;
}

.rw-historial-panel {
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    padding: 0.85rem;
}
.rw-btn-eventos {
    background: linear-gradient(135deg, #0055c1 0%, #003d8a 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.4rem;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 85, 193, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rw-btn-eventos:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 85, 193, 0.35); }
.rw-btn-eventos:disabled { opacity: 0.7; transform: none; }

@media (max-width: 576px) {
    .rw-timeline-item {
        grid-template-columns: 58px 32px 1fr;
        gap: 0 0.5rem;
        padding-bottom: 1.1rem;
    }
    .rw-date-day { font-size: 1.25rem; }
    .rw-timeline-dot { width: 1.8rem; height: 1.8rem; font-size: 0.65rem; }
    .rw-timeline-card { padding: 0.7rem 0.75rem; border-radius: 12px; }
    .rw-timeline-wrap { max-height: 440px; }
}
