/* =========================
   HAZLOIA - COMPONENTS
   ========================= */

/* HERO STRIP */
.hero-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.hero-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.5);
}

.hero-card .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.hero-card .value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.hero-card .label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.hero-card .trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    border-color: #3b3b45;
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.kpi-change {
    font-size: 12px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

/* SECTION */
.section {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* PANEL */
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

/* ACTIVITY FEED */
.activity-feed {
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3b3b45 transparent;
}

.activity-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 13.5px;
    line-height: 1.4;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* IA OPERACIONAL */
.ia-panel {
    background: linear-gradient(145deg, #18181f, #121218);
    border: 1px solid #3b3b45;
    position: relative;
    overflow: hidden;
}

.ia-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 140%;
    background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.ia-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ia-badge {
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    color: white;
    font-size: 10px;
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ia-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s ease;
}

.ia-item:hover {
    background: rgba(255,255,255,0.04);
    transform: translateX(2px);
}

.ia-item.severity-critical {
    border-left: 3px solid var(--danger);
}

.ia-item.severity-warning {
    border-left: 3px solid var(--warning);
}

.ia-item.severity-info {
    border-left: 3px solid var(--accent);
}

.ia-action {
    margin-top: 6px;
}

/* FLUJO DOCUMENTAL - TIMELINE */
.timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 20px 10px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.timeline::-webkit-scrollbar {
    display: none;
}

.timeline-step {
    flex: 1;
    min-width: 110px;
    text-align: center;
    position: relative;
}

.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 55%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.timeline-circle {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-circle.completed {
    background: var(--success);
    color: #0a0a0f;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.timeline-circle.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px var(--glow-blue), 0 0 25px var(--glow-blue);
    animation: pulse 2s infinite ease-in-out;
}

.timeline-circle.pending {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.timeline-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.timeline-status {
    font-size: 10px;
    margin-top: 4px;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--glow-blue), 0 0 25px var(--glow-blue); }
    50% { box-shadow: 0 0 0 8px var(--glow-blue), 0 0 35px var(--glow-blue); }
}

/* RIGHT PANEL SPECIFIC */
.score-circle {
    width: 92px;
    height: 92px;
    border-radius: 9999px;
    background: conic-gradient(var(--accent) 0deg 338deg, #27272f 338deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    position: relative;
}

.score-circle::before {
    content: '';
    width: 68px;
    height: 68px;
    background: var(--bg-elevated);
    border-radius: 9999px;
}

.score-value {
    position: absolute;
    font-size: 26px;
    font-weight: 700;
}

.mini-stat {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.mini-stat:last-child {
    border-bottom: none;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 6px;
}

.status-green { background: var(--success); }
.status-yellow { background: var(--warning); }
/* =========================
   SKELETON LOADERS
   ========================= */
.skeleton {
    background: linear-gradient(90deg, #1a1f28 25%, #252b36 50%, #1a1f28 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s infinite ease-in-out;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 120px;
    border-radius: 16px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-table-row {
    height: 52px;
    margin-bottom: 1px;
}

.skeleton-activity {
    height: 64px;
    margin-bottom: 8px;
    border-radius: 10px;
}

/* Transición de páginas */
#app {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#app.page-loading {
    opacity: 0.4;
    transform: translateY(6px);
    pointer-events: none;
}

#app.page-transition {
    opacity: 0;
    transform: translateY(8px);
}

#app.page-transition.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loading overlay pequeño */
.page-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.page-loading-overlay .loading-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 13px;
}
