/* AI Dashboard — Admin Only */

.ai-dash-container {
    padding: 24px 32px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
}

/* Header */
.ai-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.ai-dash-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.ai-dash-header h1 i {
    margin-right: 8px;
    color: #6366f1;
}

.ai-dash-header-actions {
    display: flex;
    gap: 8px;
}

.ai-dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-dash-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ai-dash-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-dash-btn-logout {
    color: #dc2626;
    border-color: #fca5a5;
}

.ai-dash-btn-logout:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* Summary Cards */
.ai-dash-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ai-dash-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

.ai-dash-card-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ai-dash-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.ai-dash-card-sub {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Cost Card Editor */
.ai-dash-cost-card .ai-dash-card-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-dash-cost-edit-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s;
}

.ai-dash-cost-edit-btn:hover {
    color: #3b82f6;
}

.ai-dash-cost-editor {
    margin-top: 8px;
    flex-direction: column;
    gap: 6px;
}

.ai-dash-cost-editor[hidden] {
    display: none;
}

.ai-dash-cost-editor:not([hidden]) {
    display: flex;
}

.ai-dash-cost-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ai-dash-cost-row label {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

.ai-dash-cost-row input {
    width: 80px;
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: right;
    font-family: 'Calibri', 'Roboto', sans-serif;
}

.ai-dash-cost-row input:focus {
    outline: none;
    border-color: #3b82f6;
}

.ai-dash-cost-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.ai-dash-cost-save,
.ai-dash-cost-cancel {
    flex: 1;
    padding: 3px 0;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #d1d5db;
    font-family: 'Calibri', 'Roboto', sans-serif;
    transition: all 0.15s;
}

.ai-dash-cost-save {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.ai-dash-cost-save:hover {
    background: #2563eb;
}

.ai-dash-cost-cancel {
    background: #fff;
    color: #6b7280;
}

.ai-dash-cost-cancel:hover {
    background: #f3f4f6;
}

/* Badges */
.ai-dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ai-dash-badge-green {
    color: #065f46;
}

.ai-dash-badge-red {
    color: #991b1b;
}

.ai-dash-badge-yellow {
    color: #92400e;
}

.ai-dash-badge-gray {
    color: #6b7280;
}

/* Side-by-side row */
.ai-dash-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.ai-dash-row .ai-dash-section {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* Sections */
.ai-dash-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.ai-dash-section h2 {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 14px;
}

.ai-dash-section-sub {
    font-weight: 400;
    color: #9ca3af;
    font-size: 13px;
}

.ai-dash-empty {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

/* List Tables */
.ai-dash-list {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Calibri', 'Roboto', sans-serif;
}

.ai-dash-list-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.ai-dash-list-header .ai-dash-col {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-dash-list-body {
    display: flex;
    flex-direction: column;
}

.ai-dash-list-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.ai-dash-list-row:last-child {
    border-bottom: none;
}

.ai-dash-list-row:hover {
    background-color: #f8fafc;
}

.ai-dash-col {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

/* Skeleton loading */
.skeleton-pulse {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

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

/* Responsive */
@media (max-width: 900px) {
    .ai-dash-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-dash-row {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .ai-dash-cards {
        grid-template-columns: 1fr;
    }

    .ai-dash-container {
        padding: 16px;
    }

    .ai-dash-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
