/* Dashboard CSS - AI Image Generator */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-modal {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.auth-modal h2 {
    margin-bottom: 24px;
    text-align: center;
    color: #667eea;
}

.auth-modal form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-modal input {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.auth-modal input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-modal button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-modal button:hover {
    background: #5568d3;
}

.auth-error {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
}

/* Dashboard */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.dashboard-header {
    background: white;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Navigation */
.dashboard-nav {
    display: flex;
    gap: 8px;
    flex: 1 1 100%;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.nav-btn {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.nav-btn:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.dashboard-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-left h1 {
    font-size: 28px;
    color: #667eea;
    margin-bottom: 4px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    color: #666;
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
}

/* Stats Section */
.stats-section,
.filters-section,
.generations-section {
    background: white;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.tests-section,
.error-analysis-section {
    background: white;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

/* Error Analysis Styles */
.error-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.error-analysis-subtitle {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

.error-analysis-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.analysis-select {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.analysis-select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-analysis {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-analysis:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.error-analysis-results {
    margin-top: 20px;
}

.error-analysis-results.hidden {
    display: none;
}

.analysis-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.analysis-summary h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.analysis-stat {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.analysis-stat strong {
    color: #667eea;
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.analysis-stat span {
    color: #666;
    font-size: 13px;
}

.error-types-list {
    margin-top: 20px;
}

.error-type-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.error-type-card h4 {
    color: #e74c3c;
    font-size: 16px;
    margin-bottom: 8px;
}

.error-type-card .count {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.error-messages {
    margin-top: 12px;
}

.error-messages li {
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

.error-rate-high {
    color: #e74c3c;
    font-weight: 600;
}

.error-rate-medium {
    color: #f39c12;
    font-weight: 600;
}

.error-rate-low {
    color: #27ae60;
    font-weight: 600;
}

/* AI Suggestions Section */
.ai-suggestions-section {
    margin-top: 32px;
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.btn-ai-suggest {
    background: white;
    color: #667eea;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-ai-suggest:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-ai-suggest:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#aiSuggestionsContainer {
    margin-top: 16px;
}

.analysis-report {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Analysis Stats Variants */
.analysis-stat.success strong {
    color: #27ae60;
}

.analysis-stat.error strong {
    color: #e74c3c;
}

.analysis-stat.warning strong {
    color: #f39c12;
}

.stats-section h2,
.filters-section h2,
.generations-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card.bemore {
    background: linear-gradient(135deg, #7B2CBF 0%, #5A189A 100%);
}

.stat-card.sposi {
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
}

.stat-card.arneis {
    background: linear-gradient(135deg, #8b151a 0%, #2596be 100%);
}

.stat-card.gelatogiusto {
    background: linear-gradient(135deg, #ff9acd 0%, #ffd28d 100%);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.tests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tests-subtitle {
    color: #666;
    font-size: 14px;
    margin-top: 6px;
}

.tests-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-test {
    background: linear-gradient(135deg, #ffb347, #ffcc33);
    color: #1f1f1f;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-test:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
}

.btn-test:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-chip {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #e0e0e0;
}

.status-chip.running {
    background: #fff7e6;
    color: #c97a00;
    border-color: #ffe0a3;
}

.status-chip.success {
    background: #e8f8f0;
    color: #1e8449;
    border-color: #bfe9d1;
}

.status-chip.error {
    background: #fdecea;
    color: #c0392b;
    border-color: #f5b7b1;
}

.test-reference {
    margin-top: 10px;
    font-size: 13px;
    color: #777;
}

.test-reference.warning {
    color: #c0392b;
    font-weight: 600;
}

.test-reference.ok {
    color: #2ecc71;
}

.test-summary {
    margin-top: 20px;
    padding: 18px;
    border-radius: 10px;
    background: #f8f9fb;
    border: 1px solid #e4e7ed;
    font-size: 14px;
    line-height: 1.6;
}

.test-results-list {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.test-result-card {
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.test-result-card.success {
    border-color: #c8e6c9;
}

.test-result-card.error {
    border-color: #f5c6cb;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 6px;
}

.result-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}

.result-error {
    color: #c0392b;
    font-size: 13px;
    margin-top: 8px;
}

.result-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
}

.result-link:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filters-bar select,
.filters-bar input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-label {
    font-size: 14px;
    color: #666;
}

.btn-filter,
.btn-reset {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-filter {
    background: #667eea;
    color: white;
}

.btn-filter:hover {
    background: #5568d3;
}

.btn-reset {
    background: #95a5a6;
    color: white;
}

.btn-reset:hover {
    background: #7f8c8d;
}

/* Generations Table */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.table-container {
    overflow-x: auto;
}

.generations-table {
    width: 100%;
    border-collapse: collapse;
}

.generations-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.generations-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.generations-table tbody tr:hover {
    background: #f8f9fa;
}

.project-badge {
    display: inline-block;
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: transparent;
}

.mini-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    color: white;
    background: #3498db;
    margin: 1px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s;
}

.thumbnail:hover {
    transform: scale(1.02);
}

/* Edit Button */
.btn-edit {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-edit:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Export Button */
.btn-export {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    margin-left: 10px;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.btn-export:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.email-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.email-status.sent {
    color: #27ae60;
}

.email-status.not-sent {
    color: #95a5a6;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #5568d3;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#pageInfo {
    font-size: 14px;
    font-weight: 600;
}

/* Loading */
.loading-row {
    text-align: center;
    padding: 40px !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px 20px;
    gap: 20px;
}

.modal-content {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-image-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 800px;
}

.modal-caption {
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-btn svg {
    width: 18px;
    height: 18px;
}

.download-btn:hover {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
}

.newtab-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
}

.copy-btn:hover {
    background: rgba(155, 89, 182, 0.3);
    border-color: #9b59b6;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        padding: 16px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar select,
    .filters-bar input,
    .filters-bar button {
        width: 100%;
    }

    .table-container {
        overflow-x: scroll;
    }
}

/* Action Button */
.action-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

/* Send Email Modal */
.modal-dialog {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.preview-container {
    margin-top: 20px;
    text-align: center;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.email-status-message {
    padding: 15px;
    margin: 15px 20px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.email-status-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.email-status-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   Invite System - Project Selection
   ======================================== */
.invite-project-selector {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.invite-project-selector h2 {
    color: #667eea;
    margin-bottom: 8px;
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.project-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.project-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.project-info h4 {
    margin: 0 0 4px 0;
    color: #333;
    font-size: 18px;
}

.project-info p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
    font-family: monospace;
}

.invite-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* AG Grid Custom Styles */
.ag-theme-alpine {
    --ag-header-background-color: #f8f9fa;
    --ag-odd-row-background-color: #ffffff;
    --ag-row-hover-color: #f0f4ff;
    --ag-selected-row-background-color: #e3f2fd;
    --ag-border-color: #e0e0e0;
    --ag-header-foreground-color: #333;
    --ag-foreground-color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ag-theme-alpine .ag-header-cell-label {
    font-weight: 600;
    font-size: 13px;
}

.ag-theme-alpine .ag-cell {
    display: flex;
    align-items: center;
    padding: 8px 12px;
}

.ag-theme-alpine .ag-row {
    border-bottom: 1px solid #f0f0f0;
}

.ag-theme-alpine .thumbnail {
    cursor: pointer;
    transition: transform 0.2s;
}

.ag-theme-alpine .thumbnail:hover {
    transform: scale(1.1);
}

.ag-theme-alpine .action-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 2px;
    transition: all 0.2s;
}

.ag-theme-alpine .action-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}
/* ========================================
   Backups Section
   ======================================== */
.backups-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.backups-section h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.section-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.backup-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.backup-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.backup-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.backup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.backup-header h3 {
    color: #333;
    font-size: 1.3em;
    margin: 0;
}

.backup-size {
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #667eea;
    font-size: 0.9em;
}

.backup-details {
    margin-bottom: 20px;
}

.backup-details p {
    color: #555;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.backup-details strong {
    color: #333;
}

.backup-actions {
    display: flex;
    gap: 10px;
}

.btn-download {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1em;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-download:active {
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.2em;
}

.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #e74c3c;
    font-size: 1.2em;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #667eea;
    font-size: 1.2em;
}

/* AG-Grid project buttons */
.ag-theme-alpine .btn-icon {
    background: #667eea;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.ag-theme-alpine .btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#projectTotals {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .backup-cards {
        grid-template-columns: 1fr;
    }
    
    #projectTotals {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================
   RATE LIMITS SECTION
   ============================================ */

.ratelimits-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ratelimit-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.ratelimit-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
}

.ratelimit-tab:hover {
    background: #f5f5f5;
    color: #333;
}

.ratelimit-tab.active {
    color: #e74c3c;
    background: #fff;
}

.ratelimit-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e74c3c;
}

.ratelimit-tab-content {
    animation: fadeIn 0.3s;
}

.btn-block {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-block:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.btn-unblock {
    background: #27ae60;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-unblock:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
}

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

.status-badge.blocked {
    background: #ffe5e5;
    color: #c0392b;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}
