/* ============================================
   BKLOG - Analytics Dashboard
   ============================================ */

/* Analytics View */
.analytics-view {
    display: none;
}

.analytics-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Summary Cards Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.summary-card {
    background: linear-gradient(135deg, var(--ocean-surface) 0%, var(--ocean-mid) 100%);
    border: 1px solid var(--ocean-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
}

.summary-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.summary-card.total .summary-card-icon {
    background: rgba(91, 141, 184, 0.2);
    color: var(--accent-blue);
}

.summary-card.borrador .summary-card-icon {
    background: rgba(246, 173, 85, 0.2);
    color: var(--warning);
}

.summary-card.completado .summary-card-icon {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.summary-card.error .summary-card-icon {
    background: rgba(252, 129, 129, 0.2);
    color: var(--error);
}

.summary-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--steel-400);
    margin-bottom: var(--space-xs);
}

.summary-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--steel-100);
    line-height: 1;
}

.summary-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--space-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.summary-card-change.positive {
    color: var(--success);
}

.summary-card-change.negative {
    color: var(--error);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Chart Card */
.chart-card {
    background: var(--ocean-surface);
    border: 1px solid var(--ocean-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--steel-100);
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--steel-500);
    margin-top: 2px;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.bar-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.bar-label {
    width: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--steel-300);
    text-align: right;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-container {
    flex: 1;
    height: 28px;
    background: var(--ocean-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    transition: width 0.5s ease;
}

.bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar-fill.purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.bar-fill.cyan { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.bar-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Donut Chart */
.donut-chart {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.donut-svg {
    flex-shrink: 0;
}

.donut-segment {
    fill: none;
    stroke-width: 20;
    transform-origin: center;
    transition: all 0.5s ease;
}

.donut-segment:hover {
    stroke-width: 24;
}

.donut-center {
    text-anchor: middle;
    dominant-baseline: middle;
}

.donut-center-value {
    font-size: 24px;
    font-weight: 700;
    fill: var(--steel-100);
}

.donut-center-label {
    font-size: 10px;
    fill: var(--steel-500);
    text-transform: uppercase;
}

.donut-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--ocean-light);
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-color.borrador { background: var(--warning); }
.legend-color.completado { background: var(--success); }
.legend-color.error { background: var(--error); }

.legend-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--steel-300);
}

.legend-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--steel-100);
}

.legend-percent {
    font-size: 0.75rem;
    color: var(--steel-500);
    margin-left: 4px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--ocean-dark);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: var(--ocean-mid);
}

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

.activity-icon.created {
    background: rgba(91, 141, 184, 0.2);
    color: var(--accent-blue);
}

.activity-icon.completed {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.activity-icon.error {
    background: rgba(252, 129, 129, 0.2);
    color: var(--error);
}

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

.activity-title {
    font-size: 0.875rem;
    color: var(--steel-200);
    margin-bottom: 2px;
}

.activity-title strong {
    color: var(--steel-100);
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--steel-500);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--steel-500);
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .donut-chart {
        flex-direction: column;
    }

    .bar-label {
        width: 80px;
    }
}
