/* ==========================================================================
   Altas · estilos propios sobre Filament
   Paleta: azul red #0B6BCB · navy #0A1A2F · cian acento #22D3EE
   ========================================================================== */

:root {
    --ak-navy: #0a1a2f;
    --ak-navy-2: #0f2744;
    --ak-azul: #0b6bcb;
    --ak-cian: #22d3ee;
    --ak-borde: rgb(226 232 240);
    --ak-fondo-col: rgb(241 245 249);
    --ak-texto-suave: rgb(100 116 139);
    --ak-card: #ffffff;
}

.dark {
    --ak-borde: rgb(255 255 255 / 0.08);
    --ak-fondo-col: rgb(255 255 255 / 0.03);
    --ak-texto-suave: rgb(148 163 184);
    --ak-card: rgb(15 23 42);
}

/* ---------- Fondo general ---------- */

.fi-body {
    background:
        radial-gradient(1200px 500px at 100% -10%, rgb(11 107 203 / 0.07), transparent 60%),
        radial-gradient(900px 400px at -10% 110%, rgb(34 211 238 / 0.06), transparent 60%),
        rgb(248 250 252);
}

.dark .fi-body {
    background:
        radial-gradient(1200px 500px at 100% -10%, rgb(11 107 203 / 0.18), transparent 60%),
        radial-gradient(900px 400px at -10% 110%, rgb(34 211 238 / 0.08), transparent 60%),
        rgb(2 6 23);
}

/* ---------- Barra lateral oscura ---------- */

.fi-sidebar {
    background: linear-gradient(180deg, var(--ak-navy) 0%, var(--ak-navy-2) 100%) !important;
    border-right: 1px solid rgb(255 255 255 / 0.06);
}

.fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
    --tw-ring-color: transparent !important;
}

.fi-sidebar .fi-logo {
    content: url('/images/logo-dark.svg');
}

.fi-sidebar-group-label,
.fi-sidebar-group-button .fi-sidebar-group-label {
    color: rgb(148 163 184 / 0.8) !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.7rem !important;
}

.fi-sidebar-group-collapse-button,
.fi-sidebar-group-button svg {
    color: rgb(148 163 184 / 0.7) !important;
}

.fi-sidebar-item-button {
    border-radius: 0.6rem !important;
    transition: background-color 120ms ease, transform 120ms ease;
}

.fi-sidebar-item-label {
    color: rgb(203 213 225) !important;
}

.fi-sidebar-item-icon {
    color: rgb(148 163 184) !important;
}

.fi-sidebar-item-button:hover {
    background: rgb(255 255 255 / 0.06) !important;
}

.fi-sidebar-item-button:hover .fi-sidebar-item-label,
.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-button,
.fi-sidebar-item-active .fi-sidebar-item-button {
    background: linear-gradient(90deg, rgb(11 107 203 / 0.95), rgb(11 107 203 / 0.65)) !important;
    box-shadow: 0 6px 18px -8px rgb(11 107 203 / 0.9), inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-icon,
.fi-sidebar-item-active .fi-sidebar-item-label,
.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar .fi-badge {
    background: rgb(34 211 238 / 0.15) !important;
    color: var(--ak-cian) !important;
    --tw-ring-color: rgb(34 211 238 / 0.3) !important;
}

/* ---------- Barra superior ---------- */

.fi-topbar > nav {
    background: rgb(255 255 255 / 0.75) !important;
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
}

.dark .fi-topbar > nav {
    background: rgb(2 6 23 / 0.7) !important;
}

/* ---------- Tarjetas, secciones y tablas ---------- */

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart > .fi-section {
    border-radius: 0.9rem !important;
}

.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--ak-azul), var(--ak-cian));
}

.fi-header-heading {
    letter-spacing: -0.02em;
}

/* ---------- Login ---------- */

.fi-simple-layout {
    background:
        radial-gradient(900px 600px at 15% 10%, rgb(34 211 238 / 0.25), transparent 60%),
        radial-gradient(900px 600px at 90% 90%, rgb(11 107 203 / 0.45), transparent 60%),
        linear-gradient(135deg, #06111f 0%, #0a1a2f 50%, #0f2744 100%) !important;
}

.fi-simple-layout::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}

.fi-simple-main {
    border-radius: 1.25rem !important;
    box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6) !important;
    position: relative;
}

/* ---------- Recorrido de etapas (ficha) ---------- */

.ak-recorrido {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 1rem 1.25rem;
    border-radius: 0.9rem;
    background: var(--ak-card);
    border: 1px solid var(--ak-borde);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.ak-paso {
    position: relative;
    flex: 1 1 0;
    min-width: 7.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
}

.ak-paso + .ak-paso::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 50%;
    width: 100%;
    height: 3px;
    background: var(--ak-borde);
    z-index: 0;
}

.ak-paso.is-hecha + .ak-paso::before,
.ak-paso.is-hecha + .ak-paso.is-actual::before,
.ak-paso.is-hecha + .ak-paso.is-espera::before,
.ak-paso.is-hecha + .ak-paso.is-fin::before {
    background: linear-gradient(90deg, #10b981, var(--ak-color));
}

.ak-paso-punto {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ak-texto-suave);
    background: var(--ak-card);
    border: 2px solid var(--ak-borde);
}

.ak-paso.is-hecha .ak-paso-punto,
.ak-paso.is-fin .ak-paso-punto {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.ak-paso.is-actual .ak-paso-punto {
    background: var(--ak-color);
    border-color: var(--ak-color);
    color: #fff;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--ak-color) 22%, transparent);
    animation: ak-pulso 2.2s ease-in-out infinite;
}

.ak-paso.is-espera .ak-paso-punto {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

@keyframes ak-pulso {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ak-color) 25%, transparent); }
    50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--ak-color) 8%, transparent); }
}

.ak-paso-nombre {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--ak-texto-suave);
}

.ak-paso.is-actual .ak-paso-nombre,
.ak-paso.is-espera .ak-paso-nombre {
    color: inherit;
}

.ak-paso-rol {
    font-size: 0.7rem;
    color: var(--ak-texto-suave);
    opacity: 0.8;
}

.ak-recorrido.is-cancelada {
    opacity: 0.55;
    filter: grayscale(0.8);
}

/* ---------- Tablero ---------- */

.ak-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.ak-filtro-busqueda { flex: 1 1 18rem; max-width: 26rem; }
.ak-filtro-tipo { flex: 0 1 14rem; }

.ak-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.ak-filtros-resumen {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.ak-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgb(11 107 203 / 0.1);
    color: var(--ak-azul);
}

.ak-pill.is-ok {
    background: rgb(16 185 129 / 0.12);
    color: rgb(5 150 105);
}

.dark .ak-pill { color: #7cc0ff; }
.dark .ak-pill.is-ok { color: #6ee7b7; }

.ak-tablero {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(17rem, 1fr);
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scroll-snap-type: x proximity;
}

.ak-col {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    border-radius: 0.9rem;
    background: var(--ak-fondo-col);
    border: 1px solid var(--ak-borde);
    border-top: 4px solid var(--ak-color);
}

.ak-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem 0.15rem;
}

.ak-col-titulo {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.ak-col-titulo svg { color: var(--ak-color); }

.ak-col-count {
    min-width: 1.6rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    color: #fff;
    background: var(--ak-color);
}

.ak-col-sub {
    padding: 0 0.85rem 0.6rem;
    font-size: 0.72rem;
    color: var(--ak-texto-suave);
}

.ak-col-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0 0.6rem 0.75rem;
}

.ak-col-vacia {
    font-size: 0.8rem;
    color: var(--ak-texto-suave);
    text-align: center;
    padding: 1.5rem 0.5rem;
    border: 1.5px dashed var(--ak-borde);
    border-radius: 0.7rem;
}

.ak-card {
    display: block;
    padding: 0.7rem 0.8rem;
    border-radius: 0.75rem;
    background: var(--ak-card);
    border: 1px solid var(--ak-borde);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.ak-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--ak-color) 55%, transparent);
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--ak-color) 70%, transparent);
}

.ak-card.is-sla-vencido { border-left: 4px solid rgb(244 63 94); }
.ak-card.is-sla-por_vencer { border-left: 4px solid rgb(245 158 11); }
.ak-card.is-espera { opacity: 0.8; background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgb(245 158 11 / 0.05) 10px 20px); }

.ak-card-top {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.ak-card-codigo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ak-azul);
}

.dark .ak-card-codigo { color: #7cc0ff; }

.ak-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 0.35rem;
}

.ak-tag.is-urgente { background: rgb(244 63 94 / 0.15); color: rgb(225 29 72); }
.ak-tag.is-alta { background: rgb(245 158 11 / 0.18); color: rgb(180 83 9); }
.ak-tag.is-espera { background: rgb(245 158 11 / 0.18); color: rgb(180 83 9); }

.ak-card-cliente {
    margin-top: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
}

.ak-card-meta {
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--ak-texto-suave);
}

.ak-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    flex: none;
}

.ak-progreso {
    margin-top: 0.55rem;
    height: 5px;
    border-radius: 999px;
    background: var(--ak-borde);
    overflow: hidden;
}

.ak-progreso-barra {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ak-color), color-mix(in srgb, var(--ak-color) 50%, #22d3ee));
}

.ak-card-pie {
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ak-sla {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.ak-sla.is-ok { background: rgb(16 185 129 / 0.12); color: rgb(5 150 105); }
.ak-sla.is-por_vencer { background: rgb(245 158 11 / 0.15); color: rgb(180 83 9); }
.ak-sla.is-vencido { background: rgb(244 63 94 / 0.14); color: rgb(225 29 72); }
.dark .ak-sla.is-ok { color: #6ee7b7; }
.dark .ak-sla.is-por_vencer { color: #fcd34d; }
.dark .ak-sla.is-vencido { color: #fda4af; }

.ak-avatar {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--ak-azul), var(--ak-cian));
}

/* ---------- Reportes ---------- */

.ak-texto-suave {
    color: var(--ak-texto-suave);
    font-size: 0.85rem;
}

.ak-tabla-wrap {
    overflow-x: auto;
}

.ak-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ak-tabla th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ak-texto-suave);
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--ak-borde);
    white-space: nowrap;
}

.ak-tabla td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--ak-borde);
    white-space: nowrap;
}

.ak-tabla td .ak-dot {
    display: inline-block;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.ak-tabla tbody tr:hover {
    background: rgb(11 107 203 / 0.04);
}

.ak-tabla .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ak-cumple {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 9rem;
}

.ak-cumple-barra {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--ak-borde);
    overflow: hidden;
}

.ak-cumple-barra > div {
    height: 100%;
    border-radius: 999px;
}

.ak-cumple span {
    font-weight: 700;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ak-cumple.is-ok .ak-cumple-barra > div { background: #10b981; }
.ak-cumple.is-medio .ak-cumple-barra > div { background: #f59e0b; }
.ak-cumple.is-mal .ak-cumple-barra > div { background: #f43f5e; }
.ak-cumple.is-ok span { color: rgb(5 150 105); }
.ak-cumple.is-medio span { color: rgb(180 83 9); }
.ak-cumple.is-mal span { color: rgb(225 29 72); }

.ak-card-meta.is-atrasada {
    color: rgb(225 29 72);
    font-weight: 600;
}

/* ---------- Agenda ---------- */

.ak-semana-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ak-semana-titulo {
    font-weight: 700;
    min-width: 11rem;
    text-align: center;
}

.ak-agenda {
    display: grid;
    grid-template-columns: repeat(7, minmax(9.5rem, 1fr));
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.ak-dia {
    display: flex;
    flex-direction: column;
    min-height: 20rem;
    border-radius: 0.9rem;
    background: var(--ak-fondo-col);
    border: 1px solid var(--ak-borde);
}

.ak-dia.is-finde {
    opacity: 0.8;
}

.ak-dia.is-hoy {
    border: 2px solid var(--ak-azul);
    box-shadow: 0 8px 24px -14px rgb(11 107 203 / 0.8);
}

.ak-dia-head {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--ak-borde);
}

.ak-dia-nombre {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ak-texto-suave);
}

.ak-dia-num {
    font-size: 1.25rem;
    font-weight: 800;
}

.ak-dia.is-hoy .ak-dia-num {
    color: var(--ak-azul);
}

.ak-dia-head .ak-col-count {
    margin-left: auto;
}

.ak-dia-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.ak-dia-vacio {
    text-align: center;
    color: var(--ak-texto-suave);
    padding: 1rem 0;
    font-size: 0.8rem;
}

.ak-turno {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: 0.65rem;
    background: var(--ak-card);
    border: 1px solid var(--ak-borde);
    border-left: 4px solid var(--ak-color);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.ak-turno:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--ak-color) 80%, transparent);
}

.ak-turno.is-hecha {
    opacity: 0.6;
}

.ak-turno-hora {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ak-azul);
}

.ak-turno-cliente {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    margin-top: 0.1rem;
}

.ak-pendientes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.7rem;
}

.ak-card-meta.is-accion {
    color: var(--ak-azul);
    font-weight: 600;
    margin-top: 0.4rem;
}

.dark .ak-turno-hora,
.dark .ak-card-meta.is-accion {
    color: #7cc0ff;
}

/* ---------- Mapa ---------- */

.ak-mapa {
    height: 68vh;
    min-height: 26rem;
    border-radius: 0.9rem;
    border: 1px solid var(--ak-borde);
    overflow: hidden;
    z-index: 0;
}

.ak-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--ak-texto-suave);
}

.ak-leyenda > span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ak-pill.is-aviso {
    background: rgb(245 158 11 / 0.15);
    color: rgb(180 83 9);
}

.ak-popup {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.8rem;
    line-height: 1.45;
    min-width: 12rem;
}

.ak-popup-codigo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    color: #0b6bcb;
}

.ak-popup-cliente {
    font-weight: 700;
    font-size: 0.9rem;
}

.ak-popup .ak-dot {
    display: inline-block;
}

/* ---------- Plantillas ---------- */

.ak-variables {
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--ak-texto-suave);
}

.ak-variables code {
    font-size: 0.72rem;
    padding: 0.05rem 0.3rem;
    border-radius: 0.3rem;
    background: rgb(11 107 203 / 0.1);
    color: var(--ak-azul);
}

.dark .ak-variables code {
    color: #7cc0ff;
}
