/* ==========================================================
   CERCA INTELIGENCIA · V1
========================================================== */

.ci-page {
    --ci-bg: #06090f;
    --ci-surface: rgba(15, 22, 33, .88);
    --ci-surface-2: rgba(20, 30, 44, .82);
    --ci-border: rgba(126, 231, 255, .10);
    --ci-cyan: #5ce7ff;
    --ci-cyan-soft: rgba(92, 231, 255, .12);
    --ci-text: #f4f8fb;
    --ci-muted: #8492a6;

    min-height: 100%;
    padding:
        max(18px, env(safe-area-inset-top))
        16px
        calc(110px + env(safe-area-inset-bottom));

    background:
        radial-gradient(
            circle at 92% 3%,
            rgba(50, 169, 255, .13),
            transparent 28%
        ),
        radial-gradient(
            circle at 4% 22%,
            rgba(117, 74, 255, .09),
            transparent 30%
        ),
        var(--ci-bg);

    color: var(--ci-text);
    overflow-x: hidden;
}


/* HEADER */

.ci-header {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    position: relative;
    margin-bottom: 22px;
}

.ci-back {
    width: 42px;
    height: 42px;
    border: 1px solid var(--ci-border);
    border-radius: 14px;

    background: rgba(255,255,255,.045);
    color: #fff;

    font-size: 29px;
    line-height: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    backdrop-filter: blur(16px);
    cursor: pointer;
}

.ci-header-copy {
    flex: 1;
    min-width: 0;
}

.ci-eyebrow,
.ci-section-label {
    display: block;

    color: var(--ci-cyan);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.ci-header h1 {
    margin: 4px 0 2px;

    font-size: 25px;
    line-height: 1.05;
    font-weight: 850;

    letter-spacing: -.8px;
}

.ci-header h1 span {
    color: var(--ci-cyan);
}

.ci-header p {
    margin: 5px 0 0;

    color: var(--ci-muted);

    font-size: 12px;
    line-height: 1.45;
}

.ci-live {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 7px 9px;

    border-radius: 999px;
    border: 1px solid rgba(92,231,255,.14);

    background: rgba(92,231,255,.06);

    color: #aaf3ff;

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
}

.ci-live span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--ci-cyan);

    box-shadow:
        0 0 0 4px rgba(92,231,255,.09),
        0 0 12px rgba(92,231,255,.8);
}


/* RANGO */

.ci-range-shell {
    position: relative;
    margin-bottom: 17px;
}

.ci-range-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    padding: 4px;

    border: 1px solid rgba(255,255,255,.055);
    border-radius: 17px;

    background: rgba(255,255,255,.035);

    backdrop-filter: blur(18px);
}

.ci-range-btn {
    min-height: 38px;

    border: 0;
    border-radius: 13px;

    background: transparent;
    color: #7f8ca0;

    font-size: 11px;
    font-weight: 750;

    cursor: pointer;

    transition:
        .22s background,
        .22s color,
        .22s box-shadow;
}

.ci-range-btn.active {
    background:
        linear-gradient(
            135deg,
            rgba(92,231,255,.18),
            rgba(71,150,255,.10)
        );

    color: #e9fcff;

    box-shadow:
        inset 0 0 0 1px rgba(92,231,255,.17),
        0 5px 18px rgba(0,0,0,.16);
}

.ci-calendar-btn span {
    margin-right: 3px;
}

.ci-date-picker {
    position: absolute;
    right: 0;
    top: 46px;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}


/* HERO */

.ci-hero {
    position: relative;
    overflow: hidden;

    padding: 20px;

    border: 1px solid rgba(92,231,255,.13);
    border-radius: 25px;

    background:
        linear-gradient(
            145deg,
            rgba(17,32,48,.94),
            rgba(9,15,25,.95)
        );

    box-shadow:
        0 24px 55px rgba(0,0,0,.22);

    margin-bottom: 14px;
}

.ci-hero-glow {
    position: absolute;

    width: 180px;
    height: 180px;

    right: -65px;
    top: -90px;

    border-radius: 50%;

    background: rgba(62,208,255,.22);

    filter: blur(45px);
    pointer-events: none;
}

.ci-hero-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;

    position: relative;
    z-index: 1;
}

.ci-hero h2 {
    margin: 5px 0;

    font-size: 22px;
    line-height: 1.1;

    letter-spacing: -.5px;
}

.ci-hero p {
    margin: 0;

    color: var(--ci-muted);

    font-size: 11px;
}

.ci-total-ring {
    flex: 0 0 auto;

    width: 82px;
    height: 82px;

    border-radius: 50%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle,
            #101b27 57%,
            transparent 59%
        ),
        conic-gradient(
            var(--ci-cyan),
            #447cff,
            rgba(255,255,255,.07) 70%
        );

    box-shadow:
        0 0 32px rgba(92,231,255,.10);
}

.ci-total-ring strong {
    font-size: 25px;
    line-height: 1;
}

.ci-total-ring span {
    margin-top: 4px;

    color: #8191a5;

    font-size: 8px;
    font-weight: 700;
}

.ci-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;

    margin-top: 19px;
}

.ci-mini-stat {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 12px;

    border: 1px solid rgba(255,255,255,.055);
    border-radius: 15px;

    background: rgba(255,255,255,.035);
}

.ci-mini-icon {
    width: 28px;
    height: 28px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--ci-cyan);

    background: var(--ci-cyan-soft);
}

.ci-mini-stat small {
    display: block;

    margin-bottom: 4px;

    color: #718096;

    font-size: 8px;
}

.ci-mini-stat strong {
    display: block;

    max-width: 120px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 10px;
}


/* SKYLINE */

.ci-skyline {
    position: relative;
    overflow: hidden;

    padding: 17px;

    margin-bottom: 25px;

    border: 1px solid rgba(113,98,255,.16);
    border-radius: 21px;

    background:
        linear-gradient(
            135deg,
            rgba(55,37,102,.20),
            rgba(15,25,40,.91) 55%,
            rgba(11,24,34,.95)
        );
}

.ci-skyline-head {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 12px;
}

.ci-skyline-logo {
    width: 36px;
    height: 36px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 900;

    background:
        linear-gradient(
            135deg,
            #6549ff,
            #51dfff
        );

    box-shadow:
        0 0 23px rgba(85,118,255,.20);
}

.ci-skyline-head span {
    display: block;

    color: #d8e9ff;

    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1.2px;
}

.ci-skyline-head small {
    color: #738297;
    font-size: 9px;
}

.ci-skyline p {
    margin: 0;

    color: #d3dce7;

    font-size: 12px;
    line-height: 1.65;
}

.ci-skyline-scan {
    height: 1px;

    margin-top: 15px;

    overflow: hidden;

    background: rgba(255,255,255,.05);
}

.ci-skyline-scan span {
    display: block;

    width: 35%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            #61e8ff,
            transparent
        );

    animation: ciScan 3s infinite ease-in-out;
}

@keyframes ciScan {
    from {
        transform: translateX(-130%);
    }

    to {
        transform: translateX(380%);
    }
}


/* SECCIONES */

.ci-section {
    margin-bottom: 27px;
}

.ci-section-last {
    margin-bottom: 0;
}

.ci-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin-bottom: 13px;
}

.ci-section-head h3 {
    margin: 4px 0 0;

    font-size: 17px;
    letter-spacing: -.35px;
}

.ci-count-pill {
    padding: 5px 9px;

    border-radius: 999px;

    color: var(--ci-cyan);

    background: var(--ci-cyan-soft);

    font-size: 9px;
    font-weight: 800;
}


/* CATEGORÍAS */

.ci-category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ci-category-card {
    min-width: 0;

    padding: 12px 7px;

    text-align: center;

    border: 1px solid rgba(255,255,255,.055);
    border-radius: 17px;

    background:
        linear-gradient(
            160deg,
            rgba(255,255,255,.055),
            rgba(255,255,255,.018)
        );
}

.ci-category-icon {
    font-size: 17px;
    margin-bottom: 7px;
}

.ci-category-card strong {
    display: block;

    margin-bottom: 3px;

    font-size: 18px;
}

.ci-category-card span {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;

    color: #79879a;

    font-size: 8px;
}


/* HORAS */

.ci-hours-card {
    padding: 17px 14px 10px;

    border: 1px solid rgba(255,255,255,.055);
    border-radius: 20px;

    background: rgba(255,255,255,.025);
}

.ci-hours-chart {
    height: 95px;

    display: flex;
    align-items: flex-end;
    gap: 3px;
}

.ci-hour-bar {
    flex: 1;

    min-height: 4px;

    border-radius: 4px 4px 1px 1px;

    background:
        linear-gradient(
            to top,
            rgba(77,121,255,.35),
            rgba(92,231,255,.92)
        );

    box-shadow:
        0 -3px 12px rgba(92,231,255,.06);

    transition: height .35s ease;
}

.ci-hour-bar.zero {
    opacity: .13;
}

.ci-hours-footer {
    display: flex;
    justify-content: space-between;

    margin-top: 8px;

    color: #58667a;

    font-size: 7px;
}


/* TIMELINE */

.ci-timeline {
    position: relative;
}

.ci-timeline-item {
    display: grid;
    grid-template-columns: 55px 15px 1fr;
    gap: 7px;

    min-height: 76px;
}

.ci-timeline-time {
    padding-top: 1px;

    color: #8190a4;

    font-size: 9px;
    font-weight: 750;
}

.ci-timeline-line {
    position: relative;
}

.ci-timeline-line::after {
    content: "";

    position: absolute;

    top: 12px;
    bottom: -4px;
    left: 6px;

    width: 1px;

    background:
        linear-gradient(
            to bottom,
            rgba(92,231,255,.32),
            rgba(92,231,255,.025)
        );
}

.ci-timeline-item:last-child
.ci-timeline-line::after {
    display: none;
}

.ci-timeline-dot {
    position: relative;
    z-index: 2;

    width: 13px;
    height: 13px;

    border-radius: 50%;

    border: 3px solid #12202d;

    background: var(--ci-cyan);

    box-shadow:
        0 0 0 2px rgba(92,231,255,.12),
        0 0 13px rgba(92,231,255,.25);
}

.ci-timeline-card {
    padding: 0 0 16px;
}

.ci-timeline-category {
    display: inline-block;

    margin-bottom: 4px;

    color: var(--ci-cyan);

    font-size: 8px;
    font-weight: 850;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.ci-timeline-card h4 {
    margin: 0 0 5px;

    color: #e8edf4;

    font-size: 12px;
    line-height: 1.4;
}

.ci-timeline-card p {
    margin: 0;

    color: #718096;

    font-size: 9px;
    line-height: 1.45;
}


/* ZONAS */

.ci-zones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ci-zone-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;

    padding: 12px;

    border: 1px solid rgba(255,255,255,.05);
    border-radius: 15px;

    background: rgba(255,255,255,.025);
}

.ci-zone-rank {
    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    color: var(--ci-cyan);

    background: var(--ci-cyan-soft);

    font-size: 9px;
    font-weight: 850;
}

.ci-zone-info {
    min-width: 0;
}

.ci-zone-info strong {
    display: block;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 11px;
}

.ci-zone-bar {
    height: 3px;

    margin-top: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(255,255,255,.05);
}

.ci-zone-bar span {
    display: block;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #5275ff,
            var(--ci-cyan)
        );
}

.ci-zone-total {
    color: #93a2b5;

    font-size: 10px;
    font-weight: 750;
}


/* VACÍOS */

.ci-empty {
    padding: 35px 18px;

    text-align: center;

    border: 1px dashed rgba(255,255,255,.07);
    border-radius: 18px;

    color: #6e7c90;
}

.ci-empty div {
    margin-bottom: 7px;

    color: var(--ci-cyan);

    font-size: 25px;
}

.ci-empty strong {
    display: block;

    margin-bottom: 5px;

    color: #a8b3c1;

    font-size: 12px;
}

.ci-empty p {
    margin: 0;
    font-size: 9px;
}

.ci-empty-small {
    padding: 18px;

    text-align: center;

    border-radius: 15px;

    background: rgba(255,255,255,.025);

    color: #69778a;

    font-size: 9px;
}


/* MÓVIL */

@media (max-width: 370px) {

    .ci-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ci-header h1 {
        font-size: 22px;
    }

    .ci-live {
        display: none;
    }

    .ci-category-card {
        padding-left: 4px;
        padding-right: 4px;
    }

}

/* ==========================================================
   CERCA INTELIGENCIA · CALENDARIO V1
========================================================== */

.ci-calendar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding:
        20px
        14px
        calc(20px + env(safe-area-inset-bottom));

    background:
        rgba(2, 6, 12, .72);

    backdrop-filter: blur(14px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .24s ease,
        visibility .24s ease;
}


.ci-calendar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* CARD */

.ci-calendar-card {
    position: relative;
    overflow: hidden;

    width: 100%;
    max-width: 440px;

    padding: 19px;

    border:
        1px solid
        rgba(92, 231, 255, .13);

    border-radius: 27px;

    background:
        radial-gradient(
            circle at 100% 0%,
            rgba(46, 199, 255, .13),
            transparent 32%
        ),
        radial-gradient(
            circle at 0% 100%,
            rgba(111, 74, 255, .10),
            transparent 32%
        ),
        linear-gradient(
            160deg,
            rgba(17, 27, 41, .98),
            rgba(7, 12, 20, .99)
        );

    box-shadow:
        0 -20px 65px rgba(0,0,0,.45),
        0 0 45px rgba(68, 190, 255, .05);

    transform:
        translateY(35px)
        scale(.97);

    transition:
        transform .28s
        cubic-bezier(.2,.8,.2,1);
}


.ci-calendar-overlay.show
.ci-calendar-card {
    transform:
        translateY(0)
        scale(1);
}


/* LÍNEA SUPERIOR */

.ci-calendar-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 25%;
    right: 25%;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(92,231,255,.85),
            transparent
        );

    box-shadow:
        0 0 15px
        rgba(92,231,255,.5);
}


/* HEADER */

.ci-calendar-head {
    display: grid;

    grid-template-columns:
        42px
        1fr
        42px;

    align-items: center;

    gap: 10px;

    margin-bottom: 20px;
}


.ci-calendar-title {
    text-align: center;
}


.ci-calendar-title small {
    display: block;

    margin-bottom: 4px;

    color: #5ce7ff;

    font-size: 8px;
    font-weight: 900;

    letter-spacing: 1.7px;
}


.ci-calendar-title strong {
    display: block;

    color: #eefaff;

    font-size: 17px;
    font-weight: 850;

    text-transform: capitalize;
}


.ci-calendar-nav {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid
        rgba(255,255,255,.07);

    border-radius: 13px;

    background:
        rgba(255,255,255,.035);

    color: #b6c4d5;

    cursor: pointer;
}


.ci-calendar-nav:active {
    transform: scale(.94);
}


/* DÍAS SEMANA */

.ci-calendar-week {
    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    margin-bottom: 7px;
}


.ci-calendar-week span {
    text-align: center;

    color: #556477;

    font-size: 8px;
    font-weight: 850;
}


/* GRID */

.ci-calendar-grid {
    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    gap: 5px;
}


.ci-calendar-day {
    position: relative;

    aspect-ratio: 1 / 1;

    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid transparent;
    border-radius: 13px;

    background: transparent;

    color: #a4b0c0;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .18s ease,
        border .18s ease,
        color .18s ease,
        transform .18s ease;
}


.ci-calendar-day:hover {
    background:
        rgba(255,255,255,.04);
}


.ci-calendar-day:active {
    transform: scale(.92);
}


/* DÍA FUERA DE MES */

.ci-calendar-day.outside {
    opacity: .17;

    pointer-events: none;
}


/* HOY */

.ci-calendar-day.today {
    border-color:
        rgba(92,231,255,.34);

    color: #dffbff;

    background:
        rgba(92,231,255,.055);
}


.ci-calendar-day.today::after {
    content: "";

    position: absolute;

    bottom: 5px;

    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: #5ce7ff;

    box-shadow:
        0 0 8px
        rgba(92,231,255,.8);
}


/* SELECCIONADO */

.ci-calendar-day.selected {
    color: #071019;

    border-color:
        rgba(123,241,255,.9);

    background:
        linear-gradient(
            135deg,
            #75ecff,
            #5dc3ff
        );

    box-shadow:
        0 6px 22px
        rgba(61,196,255,.22);
}


.ci-calendar-day.selected::after {
    display: none;
}


/* ==========================================================
   INDICADORES DE ACTIVIDAD
========================================================== */

.ci-calendar-day.has-activity::before {
    content: "";

    position: absolute;

    bottom: 5px;

    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: #5ce7ff;

    box-shadow:
        0 0 7px
        rgba(92,231,255,.55);
}


/* ACTIVIDAD MEDIA */

.ci-calendar-day.activity-medium::before {
    background: #f7bd53;

    box-shadow:
        0 0 7px
        rgba(247,189,83,.5);
}


/* ACTIVIDAD ALTA */

.ci-calendar-day.activity-high::before {
    background: #ff657b;

    box-shadow:
        0 0 9px
        rgba(255,101,123,.6);
}


.ci-calendar-day.selected::before {
    background:
        rgba(4,18,27,.75);

    box-shadow: none;
}


/* ==========================================================
   LEYENDA
========================================================== */

.ci-calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 17px;

    padding-top: 14px;

    border-top:
        1px solid
        rgba(255,255,255,.045);
}


.ci-calendar-legend span {
    display: flex;
    align-items: center;
    gap: 5px;

    color: #65758a;

    font-size: 7px;
    font-weight: 700;
}


.ci-calendar-legend i {
    width: 5px;
    height: 5px;

    border-radius: 50%;
}


.ci-calendar-legend .low {
    background: #5ce7ff;
}


.ci-calendar-legend .medium {
    background: #f7bd53;
}


.ci-calendar-legend .high {
    background: #ff657b;
}


/* ==========================================================
   ACCIONES
========================================================== */

.ci-calendar-actions {
    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 8px;

    margin-top: 17px;
}


.ci-calendar-actions button {
    min-height: 42px;

    border-radius: 13px;

    font-size: 10px;
    font-weight: 800;

    cursor: pointer;
}


.ci-calendar-today {
    border:
        1px solid
        rgba(92,231,255,.15);

    background:
        rgba(92,231,255,.07);

    color: #92efff;
}


.ci-calendar-close {
    border:
        1px solid
        rgba(255,255,255,.065);

    background:
        rgba(255,255,255,.035);

    color: #8f9caf;
}


/* ==========================================================
   DESKTOP / TABLET
========================================================== */

@media (min-width: 700px) {

    .ci-calendar-overlay {
        align-items: center;
    }

}