.ci-report {
    --hd-fg: #18181b;
    --hd-fg-muted: #52525b;
    --hd-fg-subtle: #71717a;
    --hd-border: #e4e4e7;
    --hd-border-strong: #d4d4d8;
    --hd-bg-raised: #ffffff;
    --hd-bg-deep: #f4f4f5;
    --hd-bg-muted: #e4e4e7;
    --hd-accent: #0ea5e9;
    --hd-chart-1: #0ea5e9;
    --hd-chart-2: #6366f1;
    --hd-chart-3: #a3b3ff;
    --hd-alert-critical: #b42323;
    --hd-alert-medium: #d86242;
    --hd-alert-low: #d58b2a;
    --ci-bg: #ffffff;
}

.dark .ci-report {
    --hd-fg: #f4f4f5;
    --hd-fg-muted: #a1a1aa;
    --hd-fg-subtle: #8b8b94;
    --hd-border: #2f3036;
    --hd-border-strong: #3f4047;
    --hd-bg-raised: #18181b;
    --hd-bg-deep: #0f0f12;
    --hd-bg-muted: #27272a;
    --hd-chart-1: #38bdf8;
    --hd-chart-2: #818cf8;
    --hd-chart-3: #a5b4fc;
    --hd-alert-critical: #ef6a6a;
    --ci-bg: #18181b;
}

.ci-report .ci-card {
    border: 1px solid var(--hd-border);
    border-radius: 0.75rem;
    background: var(--hd-bg-raised);
    padding: 0.875rem 1rem;
}

.ci-report .ci-card.ci-lvl-critical { box-shadow: inset 3px 0 0 var(--hd-alert-critical); }
.ci-report .ci-card.ci-lvl-medium { box-shadow: inset 3px 0 0 var(--hd-alert-medium); }
.ci-report .ci-card.ci-lvl-low { box-shadow: inset 3px 0 0 var(--hd-alert-low); }

.ci-report .ci-banner {
    border: 1px dashed var(--hd-border-strong);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--hd-fg-muted);
}

.ci-report .ci-semaphore,
.ci-report .ci-kpis,
.ci-report .ci-figures,
.ci-report .ci-chain {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ci-report .ci-kpis { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.ci-report .ci-sem { display: flex; align-items: center; gap: 0.75rem; }
.ci-report .ci-sem-icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; color: var(--hd-fg-subtle); }
.ci-report .ci-sem.ci-lvl-critical .ci-sem-icon { color: var(--hd-alert-critical); }
.ci-report .ci-sem.ci-lvl-medium .ci-sem-icon { color: var(--hd-alert-medium); }
.ci-report .ci-sem.ci-lvl-low .ci-sem-icon { color: var(--hd-alert-low); }
.ci-report .ci-sem-name { font-weight: 700; color: var(--hd-fg); font-size: 0.875rem; }
.ci-report .ci-sem-detail { font-size: 0.75rem; color: var(--hd-fg-muted); }

.ci-report .ci-kpi-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; color: var(--hd-fg-muted); }
.ci-report .ci-kpi-value { margin-top: 0.25rem; font-size: 1.5rem; font-weight: 700; color: var(--hd-fg); line-height: 1.2; }
.ci-report .ci-figure-value,
.ci-report .ci-chain-main { margin-top: 0.25rem; font-size: 1rem; font-weight: 700; color: var(--hd-fg); }
.ci-report .ci-kpi-sub { margin-top: 0.25rem; font-size: 0.75rem; color: var(--hd-fg-muted); }

.ci-report .ci-dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; background: var(--hd-border-strong); flex-shrink: 0; }
.ci-report .ci-dot.ci-lvl-critical { background: var(--hd-alert-critical); }
.ci-report .ci-dot.ci-lvl-medium { background: var(--hd-alert-medium); }
.ci-report .ci-dot.ci-lvl-low { background: var(--hd-alert-low); }

.ci-report .ci-alert { display: flex; gap: 0.75rem; }
.ci-report .ci-alert-icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; color: var(--hd-fg-subtle); }
.ci-report .ci-alert.ci-lvl-critical .ci-alert-icon { color: var(--hd-alert-critical); }
.ci-report .ci-alert.ci-lvl-medium .ci-alert-icon { color: var(--hd-alert-medium); }
.ci-report .ci-alert.ci-lvl-low .ci-alert-icon { color: var(--hd-alert-low); }
.ci-report .ci-alert-title { font-weight: 700; color: var(--hd-fg); font-size: 0.875rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ci-report .ci-alert-text { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--hd-fg-muted); }

.ci-report .ci-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--hd-bg-muted);
    color: var(--hd-fg);
}
.ci-report .ci-pill.ci-lvl-critical { background: var(--hd-alert-critical); color: #fff; }
.ci-report .ci-pill.ci-lvl-medium { background: var(--hd-alert-medium); color: #fff; }
.ci-report .ci-pill.ci-lvl-low { background: var(--hd-alert-low); color: #1f1300; }

.ci-report .ci-tag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; border: 1px solid var(--hd-border); border-radius: 999px; padding: 0.05rem 0.5rem; white-space: nowrap; }

.ci-report .ci-label { font-size: 0.8125rem; font-weight: 600; color: var(--hd-fg); }

.ci-report .ci-legend { display: flex; flex-wrap: wrap; gap: 0.875rem; font-size: 0.75rem; color: var(--hd-fg-muted); }
.ci-report .ci-legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.ci-report .ci-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.ci-report .ci-legend i.s1 { background: var(--hd-chart-1); }
.ci-report .ci-legend i.s2 { background: var(--hd-chart-2); }
.ci-report .ci-legend i.s3,
.ci-report .ci-legend i.s3l { background: var(--hd-chart-3); }
.ci-report .ci-legend i.s3l { height: 2px; }
.ci-report .ci-legend i.lim { height: 0; border-top: 2px dashed var(--hd-fg); background: transparent; }
.ci-report .ci-legend i.prev { height: 0; border-top: 2px dashed var(--hd-chart-1); background: transparent; }
.ci-report .ci-legend i.zona { height: 10px; background: color-mix(in srgb, var(--hd-fg-subtle) 20%, transparent); }
.ci-report .ci-legend i.zd { height: 10px; background: color-mix(in srgb, var(--hd-alert-low) 30%, transparent); }
.ci-report .ci-legend i.ze { height: 10px; background: color-mix(in srgb, var(--hd-alert-critical) 26%, transparent); }

.ci-report .ci-details { border: 1px solid var(--hd-border); border-radius: 0.75rem; padding: 0.625rem 0.875rem; }
.ci-report .ci-details summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--hd-fg); }

.ci-report .ci-split { display: grid; gap: 1rem; grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; }
@media (max-width: 1100px) { .ci-report .ci-split { grid-template-columns: 1fr; } }

.ci-report .ci-steps { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); list-style: none; margin: 0; padding: 0; }
.ci-report .ci-step { border: 1px solid var(--hd-border); border-radius: 0.75rem; padding: 0.75rem; background: var(--hd-bg-raised); }
.ci-report .ci-step-title { font-weight: 700; font-size: 0.8125rem; color: var(--hd-fg); }
.ci-report .ci-step-text { margin-top: 0.25rem; font-size: 0.75rem; color: var(--hd-fg-muted); }
.ci-report .ci-step-done { box-shadow: inset 0 3px 0 var(--hd-chart-1); }
.ci-report .ci-step-now { box-shadow: inset 0 3px 0 var(--hd-alert-low); }

.ci-report .ci-table-wrap { overflow-x: auto; }
.ci-report .ci-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.ci-report .ci-table th { text-align: left; font-weight: 600; color: var(--hd-fg-muted); padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--hd-border-strong); white-space: nowrap; }
.ci-report .ci-table td { padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--hd-border); color: var(--hd-fg); vertical-align: top; }
.ci-report .ci-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ci-report .ci-table .bad { color: var(--hd-alert-critical); font-weight: 700; }
.ci-report .ci-table tr.total td { font-weight: 700; border-top: 1px solid var(--hd-border-strong); }
.ci-report .ci-table code { font-size: 0.75rem; color: var(--hd-fg-muted); }
.ci-report .ci-table-routes td { white-space: nowrap; }
.ci-report .ci-table-routes tr.warn td { background: color-mix(in srgb, var(--hd-alert-low) 14%, transparent); }
.ci-report .ci-origins td { background: var(--hd-bg-deep); color: var(--hd-fg-muted); font-size: 0.6875rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.ci-report .ci-origins td.undefined { font-style: italic; }

.ci-report .graf { width: 100%; max-width: 960px; height: auto; display: block; overflow: visible; }
.ci-report .graf text { font-family: inherit; fill: var(--hd-fg-muted); font-size: 11px; }
.ci-report .graf .fuerte { fill: var(--hd-fg); font-weight: 700; }
.ci-report .graf .eje { stroke: var(--hd-border); stroke-width: 1; }
.ci-report .graf .flecha-n { fill: none; stroke: var(--hd-fg-muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.ci-report .graf .punta { fill: var(--hd-fg-muted); }
.ci-report .graf .limite { stroke: var(--hd-fg); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ci-report .graf .paso-caja { fill: var(--hd-bg-deep); stroke: var(--hd-border-strong); }
.ci-report .graf .banda-A,
.ci-report .graf .banda-B { fill: color-mix(in srgb, var(--hd-fg-subtle) 10%, transparent); }
.ci-report .graf .banda-B { fill: color-mix(in srgb, var(--hd-fg-subtle) 18%, transparent); }
.ci-report .graf .banda-C { fill: transparent; }
.ci-report .graf .banda-D { fill: color-mix(in srgb, var(--hd-alert-low) 22%, transparent); }
.ci-report .graf .banda-E { fill: color-mix(in srgb, var(--hd-alert-critical) 18%, transparent); }
.ci-report .graf .banda-t { font-weight: 700; fill: var(--hd-fg-subtle); }
.ci-report .graf .zona-ok { fill: color-mix(in srgb, var(--hd-fg-subtle) 12%, transparent); }
.ci-report .graf .zona-baja { fill: color-mix(in srgb, var(--hd-alert-low) 16%, transparent); }
.ci-report .graf .ic-on { fill: var(--hd-bg-raised); }
.ci-report .graf .ic-sub { fill: var(--hd-fg-subtle); }
.ci-report .graf circle.s1,
.ci-report .graf circle.s2,
.ci-report .graf circle.s3 { stroke-width: 0; }
.ci-report .s1 { fill: var(--hd-chart-1); stroke: var(--hd-chart-1); }
.ci-report .s2 { fill: var(--hd-chart-2); stroke: var(--hd-chart-2); }
.ci-report .s3 { fill: var(--hd-chart-3); stroke: var(--hd-chart-3); }

.ci-report .ci-chart-cii_trend,
.ci-report .ci-chart-cii_monthly { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(280px, 340px)); }
.ci-report .ci-mini { padding: 0; }

.ci-report .ci-matrix { display: grid; grid-template-columns: 96px repeat(8, minmax(84px, 1fr)); gap: 6px; min-width: 860px; }
.ci-report .ci-chart-matrix { overflow-x: auto; }
.ci-report .mz-h { font-size: 0.75rem; color: var(--hd-fg-muted); font-weight: 500; text-align: center; align-self: end; padding-bottom: 2px; }
.ci-report .mz-b { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.8125rem; color: var(--hd-fg); }
.ci-report .mz-b .ic { width: 1rem; height: 1rem; color: var(--hd-fg-subtle); }
.ci-report .mz { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; border-radius: 0.5rem; border: 1px solid var(--hd-border); background: var(--hd-bg-deep); font-size: 0.6875rem; color: var(--hd-fg-muted); text-align: center; }
.ci-report .mz .ic { width: 1.125rem; height: 1.125rem; color: var(--hd-fg-subtle); margin-bottom: 2px; }
.ci-report .mz b { color: var(--hd-fg); font-size: 0.75rem; }
.ci-report .mz.low { box-shadow: inset 0 0 0 2px var(--hd-alert-low); }
.ci-report .mz.low .ic { color: var(--hd-alert-low); }
.ci-report .mz.medium { box-shadow: inset 0 0 0 2px var(--hd-alert-medium); }
.ci-report .mz.medium .ic { color: var(--hd-alert-medium); }
.ci-report .mz.critical { box-shadow: inset 0 0 0 2px var(--hd-alert-critical); }
.ci-report .mz.critical .ic { color: var(--hd-alert-critical); }
.ci-report .mz.sombra { background: transparent; border: 1px dashed var(--hd-border-strong); }
.ci-report .ci-matrix svg,
.ci-report .ci-layer svg { fill: currentColor; }
.ci-report .ci-matrix .mz-b svg { width: 1rem; height: 1rem; }

.ci-report .mapa { position: relative; border-radius: 0.75rem; overflow: hidden; background: var(--hd-bg-deep); }
.ci-report .mapa svg:first-child { display: block; width: 100%; height: auto; }
.ci-report .mapa .mar { fill: var(--hd-bg-deep); }
.ci-report .mapa .tierra { fill: var(--hd-bg-muted); stroke: var(--hd-border-strong); stroke-width: 0.8; }
.ci-report .mapa .eca { fill: color-mix(in srgb, var(--hd-accent) 10%, transparent); stroke: var(--hd-accent); stroke-width: 1; stroke-dasharray: 4 3; }
.ci-report .mapa .eca2 { fill: color-mix(in srgb, var(--hd-accent) 5%, transparent); stroke: var(--hd-accent); stroke-width: 1.2; stroke-dasharray: 1.5 3; }
.ci-report .mapa .ruta { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ci-report .mapa .ruta.prev { stroke-dasharray: 5 4; stroke-width: 1.8; }
.ci-report .mapa .rumbo { stroke: none; }
.ci-report .mapa .ruta-txt { font-size: 9.5px; font-weight: 700; fill: var(--hd-fg); paint-order: stroke; stroke: var(--hd-bg-deep); stroke-width: 3px; stroke-linejoin: round; }
.ci-report .mapa .puerto { fill: var(--hd-bg-raised); stroke: var(--hd-fg); stroke-width: 1.5; }
.ci-report .mapa .pt-txt { font-size: 10.5px; fill: var(--hd-fg); font-weight: 600; }
.ci-report .mapa .z-txt,
.ci-report .mapa .z-txt2 { font-size: 9.5px; fill: var(--hd-accent); font-weight: 700; letter-spacing: 0.5px; }
.ci-report .mapa .m-alert { stroke: var(--hd-bg-raised); stroke-width: 1.5; }
.ci-report .mapa .capas { position: absolute; left: 10px; top: 10px; }
.ci-report .ci-layers { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 0.5rem; background: var(--hd-bg-raised); border: 1px solid var(--hd-border); }
.ci-report .ci-layer { width: 2rem; height: 2rem; padding: 0.4rem; border-radius: 0.375rem; color: var(--hd-fg-muted); }
.ci-report .ci-layer.is-active { background: var(--hd-bg-muted); color: var(--hd-fg); }

.ci-report .esquema { width: 100%; max-width: 900px; height: auto; display: block; }
.ci-report .esquema .casco { fill: var(--hd-bg-deep); stroke: var(--hd-border-strong); stroke-width: 1.2; }
.ci-report .esquema .pieza { fill: var(--hd-bg-raised); stroke: var(--hd-border-strong); stroke-width: 1.2; }
.ci-report .esquema .linea { stroke: var(--hd-border-strong); stroke-width: 2; fill: none; }
.ci-report .esquema text { font-size: 11px; fill: var(--hd-fg); }
.ci-report .esquema .t2 { fill: var(--hd-fg-muted); font-size: 10px; }
.ci-report .esquema .med { fill: var(--hd-chart-1); }

[x-cloak] { display: none !important; }

.ci-shore-vessel-filters,
.ci-shore-date-row {
    display: grid;
    gap: 0.75rem;
    align-items: center;
}

.ci-shore-date-row {
    position: relative;
}

.ci-shore-columns,
.ci-shore-columns > button {
    width: 100%;
}

.ci-shore-columns-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 40;
    box-sizing: border-box;
    width: min(40rem, 100%);
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #18181b;
    padding: 0.75rem 1rem;
    box-shadow: 0 12px 24px rgb(0 0 0 / 0.16);
}

.dark .ci-shore-columns-panel {
    border-color: #2f3036;
    background-color: #18181b;
    color: #f4f4f5;
}

.ci-shore-columns-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem 1rem;
}

.ci-shore-columns-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

@media (min-width: 40rem) {
    .ci-shore-vessel-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ci-shore-vessel-filters > .ci-shore-date-row {
        grid-column: 1 / -1;
    }

    .ci-shore-date-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
