.pb-onboarding,
.pb-dashboard {
    max-width: 1100px;
    margin: 30px auto;
    font-family: inherit;
}

.pb-onboarding form,
.pb-dashboard-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.pb-onboarding label,
.pb-dashboard-form label {
    display: block;
    margin: 0 0 16px;
    font-weight: 600;
}

.pb-onboarding input,
.pb-onboarding select,
.pb-dashboard-form input,
.pb-section-heading input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.pb-onboarding button,
.pb-dashboard button {
    border: 0;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
}

.pb-onboarding button,
.pb-dashboard-form button {
    background: #2563eb;
    color: #fff;
}

.pb-secondary-button,
.pb-pagination button {
    background: #f3f4f6;
    color: #111827;
}

.pb-message {
    margin-top: 12px;
    min-height: 20px;
}

.pb-message.success { color: #15803d; }
.pb-message.error,
.pb-dashboard-error { color: #b91c1c; }

.pb-dashboard-header,
.pb-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.pb-dashboard-header h2,
.pb-dashboard-section h3 {
    margin: 0 0 6px;
}

.pb-dashboard-header p,
.pb-section-heading p {
    margin: 0;
    color: #6b7280;
}

.pb-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.pb-dashboard-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    background: #f9fafb;
}

.pb-dashboard-card strong {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
}

.pb-dashboard-card span {
    color: #6b7280;
}

.pb-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pb-class-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pb-class-row strong,
.pb-class-row small {
    display: block;
}

.pb-class-row small {
    color: #6b7280;
    margin-top: 3px;
}

.pb-switch input {
    display: none;
}

.pb-switch span {
    display: block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    cursor: pointer;
}

.pb-switch span::after {
    content: '';
    width: 18px;
    height: 18px;
    position: absolute;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}

.pb-switch input:checked + span {
    background: #2563eb;
}

.pb-switch input:checked + span::after {
    transform: translateX(18px);
}

.pb-table-wrap {
    overflow-x: auto;
}

.pb-dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.pb-dashboard-table th,
.pb-dashboard-table td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.pb-dashboard-table th {
    background: #f9fafb;
}

.pb-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: capitalize;
}

.pb-status-active { background: #dcfce7; color: #166534; }
.pb-status-pending { background: #fef3c7; color: #92400e; }

.pb-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
}

.pb-pagination button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

@media (max-width: 800px) {
    .pb-dashboard-cards,
    .pb-form-grid {
        grid-template-columns: 1fr;
    }

    .pb-dashboard-header,
    .pb-section-heading {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Phase 3: school management */
.pb-manage-button {
    border: 0;
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font-weight: 600;
}

.pb-modal[hidden] {
    display: none !important;
}

.pb-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.pb-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.pb-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.pb-management-form label {
    display: block;
    margin-bottom: 14px;
}

.pb-management-form input,
.pb-management-form select {
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
}

.pb-assignment-class {
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

.pb-assignment-class h5 {
    margin: 0 0 10px;
    font-size: 16px;
}

.pb-assignment-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 14px 8px 0;
}

.pb-assignment-option input {
    width: auto;
    margin: 0;
}

.pb-assignment-panel {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.pb-status-disabled {
    opacity: .65;
}

/* Phase 4 — Teacher Dashboard */
#pb-teacher-dashboard .pb-form-full { grid-column: 1 / -1; }
#pb-teacher-dashboard textarea { width: 100%; min-height: 100px; box-sizing: border-box; }
#pb-teacher-dashboard .pb-dashboard-table small { opacity: .75; }
#pb-teacher-dashboard .pb-secondary-button { cursor: pointer; }
#pb-teacher-dashboard .pb-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; }
#pb-teacher-dashboard .pb-section-heading input[type="search"] { min-width:260px; }
#pb-teacher-dashboard .pb-dashboard-form button { cursor:pointer; }

/* Phase 5 — Question Bank & Game Engine */
#pb-teacher-question-bank #pb-question-options-wrap { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#pb-teacher-question-bank .pb-form-full { grid-column:1 / -1; }
#pb-teacher-question-bank textarea { width:100%; box-sizing:border-box; }
#pb-game-dashboard .pb-game-top { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; font-weight:600; }
#pb-game-dashboard .pb-game-question-text { font-size:1.35rem; line-height:1.5; margin-bottom:22px; }
#pb-game-dashboard .pb-game-answer-area { display:grid; gap:12px; margin-bottom:20px; }
#pb-game-dashboard .pb-game-option { text-align:left; padding:14px 16px; border:1px solid #ddd; border-radius:8px; background:#fff; cursor:pointer; }
#pb-game-dashboard .pb-game-option.is-selected { border-width:2px; }
#pb-game-dashboard .pb-game-progress-row { display:flex; justify-content:space-between; gap:16px; padding:12px 0; border-bottom:1px solid #eee; }
#pb-game-dashboard .pb-game-result { text-align:center; padding:36px; }
@media (max-width:700px) { #pb-teacher-question-bank #pb-question-options-wrap { grid-template-columns:1fr; } #pb-game-dashboard .pb-game-progress-row { flex-direction:column; } }
