.ai-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 32px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.stat-label {
    font-size: 14px;
    color: #718096;
}

.ai-dashboard-actions {
    margin-bottom: 30px;
}

.ai-dashboard-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
}

.ai-button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.ai-button:hover {
    background: #006ba1;
}

.ai-button-primary {
    background: #007cba;
}

.ai-button-warning {
    background: #d63638;
}

.ai-button-warning:hover {
    background: #b92e30;
}

.ai-button-small {
    padding: 4px 8px;
    font-size: 12px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ai-codes-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.ai-codes-stats .stat {
    background: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ai-codes-stats .stat-value {
    font-size: 28px;
    font-weight: bold;
}

.ai-codes-stats .stat-value.unused {
    color: #28a745;
}

.ai-codes-stats .stat-value.used {
    color: #dc3545;
}

.ai-codes-stats .stat-label {
    font-size: 14px;
    color: #718096;
}

.ai-codes-generate,
.ai-users-add {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.ai-codes-generate h2,
.ai-users-add h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.ai-backend-status {
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
}

.status-dot.running {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-dot.stopped {
    background: #dc3545;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.ai-backend-actions {
    margin-bottom: 30px;
}

.ai-backend-info,
.ai-backend-logs {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.ai-backend-info h2,
.ai-backend-logs h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.logs-container {
    background: #1a1a2e;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    min-height: 200px;
    font-family: monospace;
    font-size: 12px;
}

.ai-redeem-form {
    max-width: 400px;
    margin: 0 auto;
}

.ai-redeem-form h3 {
    margin-bottom: 10px;
}

.ai-redeem-form p {
    color: #666;
    margin-bottom: 20px;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
}

.ai-table th,
.ai-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.ai-table th {
    background: #f0f0f0;
    font-weight: bold;
}

.ai-membership {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ai-membership h3 {
    margin-top: 0;
}

.ai-membership ul {
    list-style: none;
    padding: 0;
}

.ai-membership li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.ai-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
