body::before {
    content: '';
    position: fixed;
    top: -250px;
    left: 0;
    right: 0;
    height: 60vh;
    background: url('/static/images/hero-sky.jpg') center top / cover no-repeat;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}

.admin-container {
    max-width: 600px;
    margin-top: 20vh;
}

.login-section {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.github-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #172036;
    color: #e8e0d6;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #2a3548;
}

.github-login-btn:hover {
    background: #1e2a43;
    border-color: #f59e0b;
}

.github-icon {
    flex-shrink: 0;
}

.login-hint {
    margin-top: 20px;
    color: #8a8070;
    font-size: 14px;
}

.member-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.notice-icon {
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: #0c1222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.notice-content h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #e8e0d6;
}

.notice-content p {
    margin: 0;
    font-size: 14px;
    color: #8a8070;
}

.upgrade-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

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

.upgrade-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #0c1222;
}

.upgrade-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(12, 18, 34, 0.85);
}

.upgrade-btn {
    background: #0c1222;
    color: #f59e0b;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.upgrade-btn:hover {
    background: #131b2e;
}

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

.billing-section {
    background: #172036;
    border-radius: 6px;
    padding: 20px;
    margin-top: 24px;
}

.billing-section h3 {
    margin-bottom: 8px;
    font-size: 16px;
    color: #e8e0d6;
}

.role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.role-badge.admin {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.you-badge {
    font-size: 12px;
    color: #8a8070;
    font-weight: normal;
    margin-left: 4px;
}

.user-card.readonly {
    opacity: 0.8;
}

.user-card.readonly .topic-chip {
    cursor: default;
}

.topic-chip.disabled {
    cursor: default;
    opacity: 0.6;
}

.topic-chip.disabled:hover {
    border-color: #2a3548;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logout-btn {
    background: #172036;
    border: 1px solid #2a3548;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #e8e0d6;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #1e2a43;
    border-color: #f59e0b;
}

.login-form {
    max-width: 400px;
    margin: 0 auto;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #2a3548;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    background: #172036;
    color: #e8e0d6;
}

.form-group input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-group input::placeholder {
    color: #8a8070;
}

.hint {
    margin-top: 6px;
    font-size: 12px;
    color: #8a8070;
}

.error-inline {
    background: rgba(215, 58, 73, 0.15);
    color: #f97316;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid rgba(215, 58, 73, 0.3);
}

.config-section h2 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a3548;
    color: #e8e0d6;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-label {
    font-size: 12px;
    font-weight: 600;
    color: #8a8070;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-value {
    font-size: 16px;
    color: #e8e0d6;
}

.api-key-section {
    background: #172036;
    border-radius: 6px;
    padding: 20px;
}

.api-key-section h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: #e8e0d6;
}

.api-key-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a3548;
}

.api-key-value {
    font-family: monospace;
}

.api-key-value.configured {
    color: #f97316;
}

.api-key-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-key-form .form-group {
    margin-bottom: 0;
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.message.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.message.error {
    background: rgba(215, 58, 73, 0.15);
    color: #d73a49;
    border: 1px solid rgba(215, 58, 73, 0.3);
}

.topics-section {
    background: #172036;
    border-radius: 6px;
    padding: 20px;
    margin-top: 24px;
}

.topics-section h3 {
    margin-bottom: 8px;
    font-size: 16px;
    color: #e8e0d6;
}

.section-description {
    color: #8a8070;
    font-size: 14px;
    margin-bottom: 20px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.user-card {
    background: #131b2e;
    border: 1px solid #2a3548;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #e8e0d6;
}

.quiz-toggle {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.quiz-enabled-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background: #2a3548;
    border-radius: 10px;
    transition: background 0.2s;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8a8070;
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background 0.2s;
}

.quiz-enabled-checkbox:checked + .toggle-switch {
    background: #f97316;
}

.quiz-enabled-checkbox:checked + .toggle-switch::before {
    transform: translateX(20px);
    background: #0c1222;
}

.toggle-text {
    font-size: 12px;
    font-weight: 600;
    color: #e8e0d6;
}

.user-topics {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #2a3548;
    background: #131b2e;
    color: #8a8070;
}

.topic-chip.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #0c1222;
}

.topic-chip:hover {
    border-color: #f59e0b;
}

.topic-chip input {
    display: none;
}

.save-user-btn {
    background: #22c55e;
    color: #0c1222;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

.save-user-btn:hover {
    background: #16a34a;
}

.save-user-btn:disabled {
    background: #2a3548;
    color: #8a8070;
    cursor: not-allowed;
}

.bulk-actions {
    background: #172036;
    border: 1px solid #2a3548;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.bulk-actions h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: #e8e0d6;
}

.bulk-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.submit-btn.secondary {
    background: #172036;
    color: #e8e0d6;
    border: 1px solid #2a3548;
}

.submit-btn.secondary:hover {
    background: #1e2a43;
    border-color: #f59e0b;
}

.no-users {
    color: #8a8070;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.seat-usage {
    background: #172036;
    border: 1px solid #2a3548;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.seat-usage-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.seat-usage-text {
    font-size: 14px;
    font-weight: 600;
    color: #e8e0d6;
    white-space: nowrap;
}

.seat-usage-bar {
    flex: 1;
    height: 8px;
    background: #2a3548;
    border-radius: 4px;
    overflow: hidden;
}

.seat-usage-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.seat-usage-fill.at-limit {
    background: #d73a49;
}

.seat-limit-hint {
    display: block;
    font-size: 11px;
    color: #d73a49;
    margin-top: 4px;
}

.quiz-toggle.at-limit .toggle-switch {
    opacity: 0.5;
}

.upgrade-hint {
    display: block;
    width: 100%;
    font-size: 11px;
    color: #f59e0b;
    margin-top: 8px;
    font-style: italic;
}

.topic-chip.upgrade-required {
    opacity: 0.5;
    cursor: not-allowed;
}

.topic-chip.upgrade-required:hover {
    border-color: #2a3548;
}

@media (max-width: 500px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

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

    .logout-btn {
        align-self: flex-end;
    }

    .seat-usage-content {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}
