/* ── Instructor Portal Layout ────────────────── */
#instructor-portal {
    display: flex;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f5fc;
    overflow: hidden;
    z-index: 99;
}

/* ── Sidebar ─────────────────────────────────── */
.ip-sidebar {
    width: 220px;
    min-width: 220px;
    height: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.ip-sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ip-sidebar-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
    letter-spacing: 0.3px;
}

.ip-sidebar-header .ip-course-code {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.ip-sidebar-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ip-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    flex-shrink: 0;
}

.ip-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.ip-nav-item.active {
    background: rgba(138, 43, 226, 0.25);
    color: #fff;
}

.ip-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ip-sidebar-footer {
    padding: 12px 8px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ip-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.ip-back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.ip-back-btn svg {
    width: 16px;
    height: 16px;
}

/* ── Main Content ────────────────────────────── */
.ip-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 28px 32px 60px;
}

.ip-panel {
    display: none;
}

.ip-panel.active {
    display: block;
}

#ip-panel-peer-feedback.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#ip-peer-feedback-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#ip-panel-individual-contribution.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#ip-panel-team-cp.active, #ip-panel-student-cp.active, #ip-panel-individual-eval.active, #ip-panel-final-assessment.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#ip-fa-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#ip-scp-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 0;
}

#ip-ie-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#ip-cp-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 24px 0;
}

#ip-panel-code.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#ip-code-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 24px 0;
}

#ip-panel-presentation.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#ip-pres-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 24px 0;
}

#ip-ic-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 28px 32px 0;
}

.ip-panel-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px;
}

/* ── Enrollment Panel ────────────────────────── */
.ip-enrollment-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.ip-roster-card,
.ip-add-student-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ip-add-student-card {
    align-self: flex-start;
}

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

.ip-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.ip-card-body {
    padding: 16px 20px;
}

/* Roster table */
.ip-roster-table {
    width: 100%;
    border-collapse: collapse;
}

.ip-roster-table th,
.ip-roster-table td {
    text-align: left;
    padding: 10px 12px;
    font-size: 13px;
}

.ip-roster-table th {
    background: #f7f7f8;
    color: #666;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
    position: sticky;
    top: 0;
}

.ip-roster-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}

.ip-roster-table tbody tr:hover {
    background: #f9f5ff;
}

.ip-roster-table .ip-cb-cell {
    width: 36px;
    text-align: center;
}

.ip-roster-table tbody tr .ip-edit-btn {
    opacity: 0;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border: none;
    background: none;
    color: #888;
    transition: opacity 0.15s, color 0.15s;
}

.ip-roster-table tbody tr:hover .ip-edit-btn {
    opacity: 1;
}

.ip-roster-table tbody tr .ip-edit-btn:hover {
    color: #8A2BE2;
}

.ip-roster-scroll {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.ip-roster-count {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* Drop button */
.ip-drop-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ip-drop-btn:hover {
    background: #c0392b;
}

.ip-drop-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Add student form */
.ip-add-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ip-add-form input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.15s;
    box-sizing: border-box;
    width: 100%;
}

.ip-add-form input:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.1);
}

.ip-add-form .ip-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ip-add-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #8A2BE2, #6B1FA1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ip-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.ip-add-btn:disabled {
    background: #ccc;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.ip-form-result {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.ip-form-result.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.ip-form-result.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-style: italic;
}

/* Spinner */
.ip-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ipSpin 0.6s linear infinite;
}

@keyframes ipSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Teams Panel ─────────────────────────────── */
.ip-teams-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    height: calc(100vh - 120px);
}

.ip-team-viewer {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ip-team-viewer #ip-team-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Team navigation */
.ip-team-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.ip-team-nav-pages {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ip-team-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #555;
}

.ip-team-nav-btn:hover:not(:disabled) {
    background: #f4f0ff;
    border-color: #8A2BE2;
    color: #8A2BE2;
}

.ip-team-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ip-team-nav-btn svg {
    width: 16px;
    height: 16px;
}

.ip-team-label {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    min-width: 80px;
    text-align: center;
}

.ip-team-member-count {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* Team members table */
.ip-team-table {
    width: 100%;
    border-collapse: collapse;
}

.ip-team-table th,
.ip-team-table td {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    word-break: break-word;
}

.ip-team-table th {
    background: #f7f7f8;
    color: #666;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
}

.ip-team-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}

.ip-team-table tbody tr:hover {
    background: #f9f5ff;
}

.ip-team-table .ip-actions-cell {
    width: 80px;
    text-align: right;
    white-space: nowrap;
}

.ip-action-icon {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    color: #888;
}

.ip-action-icon:hover {
    background: #f0f0f0;
}

.ip-action-icon.edit:hover {
    color: #8A2BE2;
    background: #f4f0ff;
}

.ip-action-icon.delete:hover {
    color: #e74c3c;
    background: #fef2f2;
}

.ip-action-icon svg {
    width: 15px;
    height: 15px;
}

/* Team no-members state */
.ip-team-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Team footer: Add member + settings */
.ip-team-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ip-team-add-row {
    display: flex;
    gap: 8px;
}

.ip-team-add-row button {
    padding: 8px 16px;
    background: #8A2BE2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.ip-team-add-row button:hover {
    background: #7B1FA2;
}

/* Settings row */
.ip-team-settings {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 14px 20px;
    margin-top: 12px;
}

.ip-team-settings h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 14px;
}

.ip-settings-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ip-setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ip-setting-group label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.ip-setting-group input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.ip-setting-group input[type="number"]:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.1);
}

.ip-unlock-btn {
    padding: 8px 18px;
    background: #f39c12;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.ip-unlock-btn:hover {
    background: #e67e22;
}

.ip-unlock-btn.locked {
    background: #e74c3c;
}

.ip-unlock-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Unassigned students ─────────────────────── */
.ip-unassigned-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ip-unassigned-card .ip-card-header {
    flex-shrink: 0;
}

.ip-unassigned-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
}

.ip-unassigned-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: grab;
    transition: all 0.15s;
    background: #fafafa;
    border: 1px solid transparent;
}

.ip-unassigned-item:hover {
    background: #f4f0ff;
    border-color: #d8c8f0;
}

.ip-unassigned-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.ip-unassigned-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.ip-unassigned-github {
    font-size: 12px;
    color: #8A2BE2;
}

.ip-unassigned-skills {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    font-style: italic;
}

/* Email unassigned students button */
.ip-unassigned-email-btn-container {
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ip-email-unassigned-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

.ip-email-unassigned-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.35);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.ip-email-unassigned-btn:active {
    transform: translateY(0);
}

/* Email chip (removable recipient) */
.ip-email-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f0f0;
    padding: 3px 6px 3px 10px;
    border-radius: 14px;
    font-size: 11px;
    color: #555;
    transition: background 0.15s;
}

.ip-email-chip:hover {
    background: #e8e8e8;
}

.ip-email-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0;
    transition: all 0.15s;
}

.ip-email-chip-remove:hover {
    background: #e74c3c;
    color: #fff;
}

/* Drop zone highlight */
.ip-team-table.drag-over tbody {
    outline: 2px dashed #8A2BE2;
    outline-offset: -2px;
    background: rgba(138, 43, 226, 0.04);
}

.ip-team-drop-zone {
    padding: 24px;
    text-align: center;
    color: #bbb;
    font-size: 13px;
    border: 2px dashed transparent;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-team-drop-zone.drag-hover {
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.06);
    color: #8A2BE2;
}

/* ── Modal ───────────────────────────────────── */
.ip-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: ipFadeIn 0.15s ease;
}

.ip-modal-overlay.active {
    display: flex;
}

@keyframes ipFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ip-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: ipSlideUp 0.2s ease;
}

@keyframes ipSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ip-modal h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 18px;
}

.ip-modal-field {
    margin-bottom: 14px;
}

.ip-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.ip-modal-field input,
.ip-modal-field select,
.ip-modal-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.ip-modal-field textarea {
    resize: vertical;
    min-height: 70px;
}

.ip-modal-field input:focus,
.ip-modal-field select:focus,
.ip-modal-field textarea:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.1);
}

.ip-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.ip-modal-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}

.ip-modal-btn.primary {
    background: #8A2BE2;
    color: #fff;
}

.ip-modal-btn.primary:hover {
    background: #7B1FA2;
}

.ip-modal-btn.cancel {
    background: #f0f0f0;
    color: #555;
}

.ip-modal-btn.cancel:hover {
    background: #e0e0e0;
}

.ip-modal-btn.danger {
    background: #e74c3c;
    color: #fff;
}

.ip-modal-btn.danger:hover {
    background: #c0392b;
}

.ip-modal-btn.submit {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
}

.ip-modal-btn.submit:hover {
    background: linear-gradient(135deg, #219a52, #1a7a3e);
}

/* ── Spinner ─────────────────────────────────── */
@keyframes ipSpin {
    to {
        transform: rotate(360deg);
    }
}

.ip-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ipSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── Status Badge ────────────────────────────── */
.ip-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.ip-lock-badge.locked {
    background: #fef2f2;
    color: #991b1b;
}

.ip-lock-badge.unlocked {
    background: #f0fdf4;
    color: #166534;
}

/* ── Toast notification ──────────────────────── */
.ip-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    animation: ipToastIn 0.3s ease;
    max-width: 360px;
}

.ip-toast.success {
    border-left: 4px solid #4CAF50;
}

.ip-toast.error {
    border-left: 4px solid #e74c3c;
}

@keyframes ipToastIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes ipToastOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* ── Proposals Panel ─────────────────────────── */
.ip-proposals-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    height: calc(100vh - 120px);
}

.ip-proposals-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ip-proposal-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ip-proposal-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.ip-proposal-item:hover {
    background: #f5f3ff;
}

.ip-proposal-item.active {
    background: #ede9fe;
    border-left: 3px solid #8A2BE2;
}

.ip-proposal-item.graded {
    border-left: 3px solid #4CAF50;
}

.ip-proposal-item.active.graded {
    border-left: 3px solid #8A2BE2;
}

.ip-proposal-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.ip-proposal-viewer {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    min-height: 300px;
}

.ip-proposal-grading {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Two-column grading layout: roster | feedback */
.ip-grading-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.ip-grading-roster {
    border-right: 1px solid #f0f0f0;
}

.ip-grading-roster-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ip-grading-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.ip-grading-member:hover {
    background: #f4f0ff;
}

.ip-grading-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
    flex-shrink: 0;
    object-fit: cover;
}

.ip-grading-member-info {
    min-width: 0;
}

.ip-grading-member-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ip-grading-member-github {
    font-size: 11px;
    color: #8A2BE2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quill editor: fixed height so the panel stays compact */
.ip-grading-feedback .ql-editor {
    height: 80px;
    overflow-y: auto;
}

/* ── Settings Panel ──────────────────────────── */

.ip-user-settings-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.ip-user-settings-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ip-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Sidebar Section Divider ────────────────── */
.ip-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 4px;
}

.ip-nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.3);
    padding: 4px 12px 2px;
}

/* ── GitHub Panel ───────────────────────────── */
.ip-github-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    height: calc(100vh - 120px);
}

.ip-github-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ip-github-status {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ip-gh-status-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* GitHub options checkboxes */
.ip-gh-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.ip-gh-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: color 0.15s;
}

.ip-gh-checkbox:hover {
    color: #333;
}

.ip-gh-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #8A2BE2;
    cursor: pointer;
}

/* Green provision button */
.ip-gh-provision-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.3);
    width: 100%;
    margin-top: 4px;
}

.ip-gh-provision-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.ip-gh-provision-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ip-gh-provision-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ip-gh-provision-btn svg {
    flex-shrink: 0;
}

/* Status badge */
.ip-gh-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ip-gh-badge.idle {
    background: #f0f0f0;
    color: #888;
}

.ip-gh-badge.running {
    background: #fff3cd;
    color: #856404;
    animation: ipGhPulse 1.5s ease-in-out infinite;
}

.ip-gh-badge.success {
    background: #d4edda;
    color: #155724;
}

.ip-gh-badge.error {
    background: #f8d7da;
    color: #721c24;
}

/* Clear button */
.ip-gh-clear-btn {
    padding: 3px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #888;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ip-gh-clear-btn:hover {
    background: #f5f5f5;
    color: #555;
    border-color: #ccc;
}

/* Sync button */
.ip-gh-sync-btn {
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8A2BE2, #6B21A8);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ip-gh-sync-btn:hover {
    background: linear-gradient(135deg, #7B27CC, #5B1B98);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3);
}

.ip-gh-sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Confirmation modal */
.ip-gh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
}

.ip-gh-modal-overlay.visible {
    opacity: 1;
}

.ip-gh-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 440px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.ip-gh-modal-overlay.visible .ip-gh-modal {
    transform: scale(1);
}

.ip-gh-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px 12px;
}

.ip-gh-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #222;
}

.ip-gh-modal-body {
    padding: 0 24px 16px;
}

.ip-gh-modal-body p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.ip-gh-modal-body ul {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    color: #666;
    line-height: 1.7;
}

.ip-gh-modal-body li::marker {
    color: #8A2BE2;
}

.ip-gh-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 24px 20px;
    border-top: 1px solid #f0f0f0;
}

.ip-gh-modal-cancel {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ip-gh-modal-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.ip-gh-modal-confirm {
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8A2BE2, #6B21A8);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ip-gh-modal-confirm:hover {
    background: linear-gradient(135deg, #7B27CC, #5B1B98);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3);
}

.ip-gh-modal-confirm.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.ip-gh-modal-confirm.danger:hover {
    background: linear-gradient(135deg, #d63031, #b71c1c);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

@keyframes ipGhPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Step indicators */
.ip-gh-step-indicators {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ip-gh-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #999;
    transition: all 0.2s;
}

.ip-gh-step-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ip-gh-step.active {
    color: #f39c12;
    background: #fffcf0;
    font-weight: 600;
}

.ip-gh-step.active .ip-gh-step-icon {
    animation: ipGhPulse 1s ease-in-out infinite;
}

.ip-gh-step.complete {
    color: #27ae60;
}

.ip-gh-step.complete .ip-gh-step-icon {
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.ip-gh-step.error {
    color: #e74c3c;
}

.ip-gh-step.error .ip-gh-step-icon {
    color: #e74c3c;
    font-weight: 700;
}

/* Log container */
.ip-gh-log-container {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.ip-gh-log {
    height: 100%;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    background: #fafbfc;
}

.ip-gh-log-entry {
    padding: 2px 0;
    word-break: break-word;
}

.ip-gh-log-time {
    color: #aaa;
    margin-right: 8px;
    font-size: 11px;
}

.ip-gh-log-entry.info {
    color: #555;
}

.ip-gh-log-entry.success {
    color: #27ae60;
}

.ip-gh-log-entry.error {
    color: #e74c3c;
}

.ip-gh-log-entry.warning {
    color: #f39c12;
}

.ip-gh-log-entry.step {
    color: #8A2BE2;
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.ip-gh-log-entry.step-done {
    color: #2980b9;
    font-weight: 500;
    font-style: italic;
    padding-bottom: 4px;
}

.ip-gh-log-entry.complete {
    color: #27ae60;
    font-weight: 700;
    font-size: 13px;
    padding-top: 10px;
    border-top: 2px solid #d4edda;
    margin-top: 8px;
}

/* Summary card */
.ip-gh-summary-card {
    padding: 4px 0;
}

.ip-gh-summary-title {
    font-size: 15px;
    font-weight: 700;
    color: #155724;
    margin-bottom: 12px;
}

.ip-gh-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.ip-gh-stat {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
    transition: transform 0.15s;
}

.ip-gh-stat:hover {
    transform: translateY(-1px);
}

.ip-gh-stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #15803d;
    line-height: 1.1;
}

.ip-gh-stat-label {
    font-size: 12px;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.ip-gh-stat-detail {
    font-size: 10px;
    color: #6b7280;
    margin-top: 4px;
}


/* ── Responsive: Tablet ──────────────────────── */
@media (max-width: 1024px) {
    .instructor-portal {
        flex-direction: column;
    }

    .ip-sidebar {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        align-items: center;
        padding: 0;
        height: auto;
    }

    .ip-sidebar-header {
        padding: 10px 16px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }

    .ip-sidebar-header h2 {
        font-size: 14px;
        margin: 0;
    }

    .ip-sidebar-header .ip-course-code {
        display: none;
    }

    .ip-sidebar-nav {
        flex-direction: row;
        padding: 8px;
        gap: 4px;
    }

    .ip-nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .ip-sidebar-footer {
        margin-top: 0;
        margin-left: auto;
        padding: 8px;
        border-top: none;
    }

    .ip-back-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .ip-main {
        height: calc(100vh - 52px);
        padding: 20px;
    }

    .ip-enrollment-grid {
        grid-template-columns: 1fr;
    }

    .ip-teams-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .ip-roster-scroll {
        max-height: 50vh;
    }

    .ip-unassigned-card {
        max-height: 40vh;
    }

    .ip-proposals-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .ip-github-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .ip-proposal-viewer {
        min-height: 400px;
    }

    .ip-grading-layout {
        grid-template-columns: 1fr;
    }

    .ip-grading-roster {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* ── Responsive: Mobile ──────────────────────── */
@media (max-width: 640px) {
    .ip-sidebar-nav {
        gap: 2px;
    }

    .ip-nav-item {
        padding: 6px 8px;
        font-size: 12px;
        gap: 6px;
    }

    .ip-nav-item svg {
        width: 14px;
        height: 14px;
    }

    .ip-main {
        padding: 12px;
    }

    .ip-panel-title {
        font-size: 18px;
        margin: 0 0 12px;
    }

    .ip-card-header {
        padding: 12px 14px;
    }

    .ip-card-body {
        padding: 12px 14px;
    }

    .ip-roster-table th,
    .ip-roster-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .ip-team-table th,
    .ip-team-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .ip-add-form .ip-form-row {
        grid-template-columns: 1fr;
    }

    .ip-settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ip-modal {
        padding: 20px;
        max-width: 95%;
    }
}

/* ── Aubergine / Progress Reports ────────────── */
.ip-aubergine-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.ip-aubergine-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.ip-aubergine-tab:hover {
    color: #555;
    background: #faf5ff;
}

.ip-aubergine-tab.active {
    color: #8A2BE2;
    border-bottom-color: #8A2BE2;
}

.ip-aubergine-content {
    min-height: 200px;
}