/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-stats-secondary {
    margin-bottom: 24px;
}

.dashboard-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-quick-actions,
.dashboard-errors {
    margin-bottom: 24px;
}

.dashboard-ai-summary {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.dashboard-error-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.dashboard-error-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-secondary);
}

.dashboard-error-title {
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.35;
}

.dashboard-error-message {
    color: var(--accent-red);
    font-size: 0.84rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-error-details {
    margin-top: 6px;
}

.dashboard-error-details summary {
    cursor: pointer;
    color: var(--accent-blue);
    font-size: 0.78rem;
    user-select: none;
}

.dashboard-error-details[open] .dashboard-error-message {
    margin-top: 6px;
    display: block;
}

.dashboard-error-date {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.panel-loading {
    margin-top: 12px;
}

.panel-loading__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.panel-loading__bar {
    height: 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 240% 100%;
    animation: panel-loading-shimmer 1.2s ease-in-out infinite;
}

.panel-loading__bar.short {
    max-width: 60%;
}

@keyframes panel-loading-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.dashboard-lists-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.dashboard-ai-activity {
    display: grid;
    gap: 10px;
}

.dashboard-ai-activity__sparkline {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    padding: 8px 10px;
}

.dashboard-ai-activity__sparkline svg {
    width: 100%;
    height: 24px;
}

.dashboard-ai-activity__sparkline polyline {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 1.8;
}

.dashboard-ai-activity__row {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 10px;
    align-items: center;
}

.dashboard-ai-activity__day {
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dashboard-ai-activity__bars {
    display: grid;
    gap: 4px;
}

.dashboard-ai-activity__bar {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.dashboard-ai-activity__bar > div {
    height: 100%;
    border-radius: inherit;
}

.dashboard-ai-activity__bar-tokens > div {
    background: var(--accent-blue);
}

.dashboard-ai-activity__bar-requests > div {
    background: var(--accent-green);
}

.dashboard-ai-activity__meta {
    font-size: 0.82rem;
}

.badge-static-mode {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-wordpress-mode {
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

