* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cbc-color: #3498db;
    --cambridge-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.app-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.app-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.app-badge.cbc {
    background: var(--cbc-color);
    color: white;
}

.app-badge.cambridge {
    background: var(--cambridge-color);
    color: white;
}

.app-badge.active {
    border-color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.admin-bar {
    background: #f8f9fa;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.current-app-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-indicator {
    padding: 6px 12px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.app-indicator.cbc {
    background: var(--cbc-color);
}

.app-indicator.cambridge {
    background: var(--cambridge-color);
}

.user-info {
    font-weight: 500;
    color: #2c3e50;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
}

.status-dot.connected {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-dot.error {
    background: #dc3545;
}

.status-text {
    font-weight: 500;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons-small {
    display: flex;
    gap: 5px;
}

.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.nav-tab {
    padding: 15px 30px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-tab.active {
    color: #2c3e50;
    border-bottom-color: currentColor;
    background: white;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.login-form {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
}

.select-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #219653 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d35400 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-cbc {
    background: linear-gradient(135deg, var(--cbc-color) 0%, #2980b9 100%);
    color: white;
}

.btn-cambridge {
    background: linear-gradient(135deg, var(--cambridge-color) 0%, #c0392b 100%);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tr:hover {
    background: #f8f9fa;
}

.status-active {
    color: var(--success-color);
    font-weight: 500;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: 500;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background: var(--warning-color);
    color: white;
}

.badge-user {
    background: #6c757d;
    color: white;
}

.badge-cbc {
    background: var(--cbc-color);
    color: white;
}

.badge-cambridge {
    background: var(--cambridge-color);
    color: white;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid;
}

.stat-card.cbc {
    border-left-color: var(--cbc-color);
}

.stat-card.cambridge {
    border-left-color: var(--cambridge-color);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
}

.creation-details {
    margin-top: 15px;
}

.creation-details p {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.creation-details p:last-child {
    border-bottom: none;
}

code {
    font-family: 'Courier New', Courier, monospace;
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .app-selector {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }
    
    .admin-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .current-app-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        padding: 10px 15px;
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}