/**
 * AI Analytics Admin Panel Styles
 * Dashboard module for AI usage analytics.
 * Design system: Dark theme (#0F2A2A), green accent (#8BFF22)
 */

/* ========================================
   SECTION LAYOUT
======================================== */
.ai-analytics-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-analytics-section .section-header h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #fff;
}

.ai-analytics-section .header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-analytics-period-select {
    padding: 8px 14px;
    background: rgba(13, 79, 79, 0.6);
    color: #c0e8d0;
    border: 1px solid rgba(139, 255, 34, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.ai-analytics-period-select:focus {
    outline: none;
    border-color: #8BFF22;
}

/* ========================================
   OVERVIEW CARDS
======================================== */
.ai-analytics-overview {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ai-stat-card {
    background: rgba(13, 79, 79, 0.4);
    border: 1px solid rgba(139, 255, 34, 0.12);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.ai-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 255, 34, 0.3);
}

.ai-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.ai-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #8BFF22;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.ai-stat-label {
    font-size: 0.8rem;
    color: rgba(192, 232, 208, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   GRID LAYOUT (2 columns)
======================================== */
.ai-analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ========================================
   CARDS
======================================== */
.ai-analytics-card {
    background: rgba(13, 79, 79, 0.3);
    border: 1px solid rgba(139, 255, 34, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.ai-analytics-card h3 {
    margin: 0 0 16px 0;
    color: #e0f5e0;
    font-size: 1.1rem;
}

.ai-analytics-full {
    width: 100%;
}

/* ========================================
   TABLES
======================================== */
.ai-analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ai-analytics-table thead th {
    text-align: left;
    padding: 10px 12px;
    color: rgba(192, 232, 208, 0.8);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(139, 255, 34, 0.15);
}

.ai-analytics-table tbody td {
    padding: 10px 12px;
    color: #c0e8d0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-analytics-table tbody tr:hover {
    background: rgba(139, 255, 34, 0.04);
}

.ai-analytics-table code {
    background: rgba(139, 255, 34, 0.1);
    color: #8BFF22;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.ai-table-loading,
.ai-table-empty {
    text-align: center;
    color: rgba(192, 232, 208, 0.5);
    padding: 20px !important;
    font-style: italic;
}

/* ========================================
   BADGES
======================================== */
.ai-action-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(139, 255, 34, 0.1);
    color: #8BFF22;
    text-transform: capitalize;
}

.ai-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-status-badge.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.ai-status-badge.status-past-due {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.ai-status-badge.status-other {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* ========================================
   BAR CHART
======================================== */
.ai-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.ai-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-bar-label {
    width: 60px;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: rgba(192, 232, 208, 0.7);
    text-align: right;
}

.ai-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
}

.ai-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8BFF22, #0D4F4F);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.ai-bar-value {
    width: 150px;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: rgba(192, 232, 208, 0.6);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1200px) {
    .ai-analytics-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-analytics-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-analytics-grid {
        grid-template-columns: 1fr;
    }

    .ai-bar-value {
        display: none;
    }
}

@media (max-width: 480px) {
    .ai-analytics-overview {
        grid-template-columns: 1fr;
    }

    .ai-stat-value {
        font-size: 1.4rem;
    }
}
