/**
 * Step Ahead IELTS - Teacher Admin Panel & Login Shield Stylesheet
 */

/* Locked test card styles */
.test-card.locked-card {
    position: relative !important;
    opacity: 0.7;
    border-color: #cbd5e1 !important;
    background-color: #f1f5f9 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.test-card.locked-card::before {
    content: '🔒 Locked Test';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #cbd5e1;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 30px;
    text-transform: uppercase;
}

.test-card.locked-card .start-btn {
    background-color: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: white !important;
    cursor: not-allowed !important;
}

.test-card.locked-card .sol-card-btn {
    display: none !important;
}

/* Locked modal warning */
.lock-warning-alert {
    background-color: var(--warning-light);
    border: 1px solid #fef3c7;
    color: #b45309;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Auth Screen Cover overlay */
.auth-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* phones: track the browser-chrome-visible viewport */
    background: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Tall cards (e.g. the register tab) must scroll instead of clipping
       when the on-screen keyboard opens or the viewport is short. */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 10000;
    font-family: var(--font-body, 'Public Sans', sans-serif);
    color: #f1f5f9;
}

.auth-dialog-card {
    background: #1B2740;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 460px;
    max-width: 90%;
    padding: 3rem 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    text-align: center;
    animation: dialogEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    /* margin:auto keeps the card centered when it fits and lets the overlay
       scroll from the TOP when the card is taller than the viewport (plain
       align-items:center would clip the card's top and make it unreachable). */
    margin: auto;
}

/* Short phone screens / open keyboard: shrink the card so it fits and the
   focused input never ends up off-screen. */
@media (max-height: 720px) {
    .auth-dialog-card {
        padding: 1.5rem 1.25rem;
    }
    .auth-dialog-card .auth-header-icon {
        margin-bottom: 0.9rem;
    }
    .auth-dialog-card p.auth-subtitle {
        margin-bottom: 1rem;
    }
    .auth-fields-form {
        gap: 0.9rem;
    }
}

/* Phones: stack the two register columns so inputs are full-width and the
   focused field stays visible while typing. */
@media (max-width: 480px) {
    .auth-fields-form .register-row {
        grid-template-columns: 1fr;
    }
}

@keyframes dialogEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-header-icon {
    width: 56px;
    height: 56px;
    background: var(--primary, #14213D);
    color: white;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin: 0 auto 1.5rem auto;
    box-shadow: var(--glow-shadow);
}

.auth-dialog-card h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: #E5EAF3;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-dialog-card p.auth-subtitle {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

.auth-fields-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
}

.auth-field-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field-row label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-text-input {
    background: rgba(2, 6, 17, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.auth-text-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(2, 6, 17, 0.8);
    box-shadow: 0 0 10px rgba(20, 33, 61, 0.35);
}

.auth-button-trigger {
    background: var(--primary, #14213D);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(20, 33, 61, 0.3);
}

.auth-button-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(20, 33, 61, 0.45);
    background: var(--primary-hover, #0D1730);
}

.auth-error-notification {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.setup-panel-trigger {
    margin-top: 1.75rem;
    font-size: 0.75rem;
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.setup-panel-trigger:hover {
    color: #cbd5e1;
    text-decoration: underline;
}

/* Supabase Credentials Setup Box style */
.db-credentials-config-box {
    display: none;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    text-align: left;
}

.db-credentials-config-box h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

/* Dynamic Admin Layout inside teacher.html */
.teacher-grid-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 1024px) {
    .teacher-grid-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Tab helper text: one-line "what this page does" hint under each tab */
.tab-help-text {
    background: var(--primary-light, #EDF1F7);
    border: 1px solid #C3CCDB;
    border-radius: 10px;
    color: #5b21b6;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.7rem 1rem;
    margin: 0 0 1.25rem;
}

/* "⋯ Manage" dropdown per student row (native <details>, no JS needed) */
.row-actions-menu {
    position: relative;
}
.row-actions-menu summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid var(--border, #e2e8f0);
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    white-space: nowrap;
}
.row-actions-menu summary::-webkit-details-marker { display: none; }
.row-actions-menu[open] summary {
    background: var(--primary-light, #eff6ff);
    color: var(--primary, #14213D);
    border-color: #bfdbfe;
}
.row-actions-menu .row-actions-box {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 50;
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    padding: 0.5rem;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.row-actions-menu .row-actions-box button {
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

/* First-login welcome / quick-start guide modal */
.onboarding-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    padding: 1rem;
}
.onboarding-card {
    background: white;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.18);
    font-family: var(--font-heading, 'Libre Franklin', sans-serif);
}
.onboarding-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    color: var(--dark, #0f172a);
}
.onboarding-card p.sub {
    color: var(--dark-muted, #64748b);
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
    line-height: 1.6;
}
.onboarding-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.onboarding-steps li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: #1e293b;
    font-size: 0.92rem;
    line-height: 1.5;
}
.onboarding-steps .step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-light, #eff6ff);
    color: var(--primary, #14213D);
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.onboarding-card button {
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    border: none;
    background: var(--primary, #14213D);
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
}
.onboard-dont-again {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--dark-muted, #64748b);
    margin: 0 0 1.25rem;
    cursor: pointer;
    user-select: none;
}
.onboard-dont-again input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #14213D);
    cursor: pointer;
}

.teacher-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.teacher-card-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
}

.teacher-card-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

/* ==========================================
   Dashboard stats strip
   ========================================== */
.teacher-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.25rem 2rem 0;
}

.teacher-stat {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.teacher-stat .stat-num {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.teacher-stat .stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--dark-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   Collapsible sidebar groups
   ========================================== */
.teacher-sidebar .teacher-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.teacher-group-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #14213D;
    color: #e2e8f0;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: var(--transition);
    text-align: left;
}

.teacher-group-head:hover {
    background: #14213D;
}

.teacher-group-title {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.teacher-group-caret {
    font-size: 0.85rem;
    color: #94a3b8;
    transition: transform var(--transition);
}

.teacher-group-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: groupOpen 0.18s ease-out;
}

@keyframes groupOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tables and logs styling in admin view */
.admin-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.admin-data-table th {
    background-color: var(--light);
    color: var(--dark-muted);
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.admin-data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
    vertical-align: middle;
}

.admin-data-table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Column toggle chips above admin tables */
.col-toggle-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.col-toggle-chip {
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--dark-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.3;
}

.col-toggle-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.col-toggle-chip.off {
    background: var(--danger-light, #fee2e2);
    border-color: #fecaca;
    color: #b91c1c;
    text-decoration: line-through;
    opacity: 0.85;
}

/* Sticky student-name column: stays visible on horizontal scroll */
.col-toggle-table th.col-sticky,
.col-toggle-table td.col-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #fff;
    box-shadow: 2px 0 0 0 var(--border);
}

.col-toggle-table th.col-sticky {
    background-color: var(--light);
}

.col-toggle-table tbody tr:hover td.col-sticky {
    background-color: var(--primary-light);
}

/* Fee status row highlights */
.admin-data-table tr.row-overdue td {
    background-color: #fef2f2;
}

.admin-data-table tr.row-overdue td.col-sticky {
    background-color: #fef2f2;
}

.admin-data-table tr.row-expiring td {
    background-color: #fffbeb;
}

.admin-data-table tr.row-expiring td.col-sticky {
    background-color: #fffbeb;
}

.action-btn-danger {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.action-btn-danger:hover {
    background-color: var(--danger-light);
}

.action-btn-primary {
    background-color: var(--primary-light);
    border: 1px solid var(--border-strong, #C3CCDB);
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    transition: var(--transition);
}

.action-btn-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Tab Layouts */
.admin-tab-group {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}

.admin-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 0.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.admin-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Dropdowns & Forms inside Admin Panel */
.teacher-form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--dark);
    background-color: var(--light);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.teacher-form-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.teacher-submit-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.teacher-submit-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--glow-shadow);
}

/* Dialog details expander */
.diagnostic-expander-tr {
    background-color: var(--light);
}

.diagnostic-detail-panel {
    padding: 1.5rem;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
    margin: 0.5rem 0;
}

/* ==========================================
   PENDING BADGE & APPROVAL STYLES
   ========================================== */
.tab-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0 4px;
    margin-left: 6px;
    animation: pulse-badge 1.5s infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}
.pending-card {
    background: var(--warning-light);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.pending-card-info { flex: 1; }
.pending-card-info strong { display: block; font-weight: 700; color: var(--dark); }
.pending-card-info span { font-size: 0.82rem; color: var(--dark-muted); }
.pending-card-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.btn-activate {
    background: #2F7D4F;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-activate:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-reject {
    background: var(--danger-light);
    color: var(--danger-text);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-reject:hover { background: #fee2e2; }

/* CSV Export Button */
.btn-export-csv {
    background: #2F7D4F;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-export-csv:hover { opacity: 0.9; transform: translateY(-1px); }

/* Password Reset button */
.action-btn-reset {
    background: none;
    border: none;
    color: var(--warning-text);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}
.action-btn-reset:hover { background: var(--warning-light); }

/* Audio once warning in exam */
.audio-once-warning {
    background: #FBF3E4;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.83rem;
    color: #92400e;
    text-align: center;
    margin-bottom: 0.75rem;
}

/* Next Wrong Answer button */
.next-wrong-btn {
    background: #B7791F;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.next-wrong-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Writing submission buttons */
.wr-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border, #D8DEE9);
    background: var(--primary, #14213D); color: #fff;
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.wr-btn:hover { background: var(--primary-hover, #0D1730); }
.wr-btn-secondary {
    background: var(--surface, #fff); color: var(--text, #14213D);
    border-color: var(--border-strong, #C3CCDB);
}
.wr-btn-secondary:hover { border-color: var(--primary, #14213D); background: var(--primary-light, #EDF1F7); }

/* Writing submission cards */
.wr-sub-card {
    border: 1px solid var(--border, #D8DEE9);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--surface, #fff);
    transition: box-shadow 0.15s;
}
.wr-sub-card:hover { box-shadow: 0 2px 8px rgba(20,33,61,0.08); }
.wr-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 8px;
    margin-bottom: 8px;
}
.wr-sub-meta { font-size: 0.72rem; color: var(--dark-muted, #64748b); }
.wr-sub-badges { display: flex; gap: 6px; }
.wr-badge {
    font-size: 0.68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
}
.wr-badge.cat { background: var(--primary-light, #EDF1F7); color: var(--primary, #14213D); }
.wr-badge.band { background: var(--success-soft, #dcfce7); color: var(--success, #16a34a); }
.wr-badge.pending { background: var(--warning-light, #fef3c7); color: var(--warning, #d97706); }
.wr-sub-question {
    font-size: 0.82rem; font-weight: 600; margin-bottom: 6px;
}
.wr-sub-essay { margin-bottom: 8px; }
.wr-sub-essay summary {
    font-size: 0.78rem; color: var(--dark-muted, #64748b); cursor: pointer;
}
.wr-sub-essay-body {
    white-space: pre-wrap; font-size: 0.82rem; line-height: 1.55;
    margin-top: 8px; padding: 12px; background: var(--light, #f8fafc);
    border-radius: 8px; max-height: 400px; overflow-y: auto;
}
.wr-sub-feedback {
    font-size: 0.82rem; background: var(--success-soft, #dcfce7);
    padding: 10px; border-radius: 8px; margin-bottom: 8px;
}
.wr-sub-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.wr-btn.ai {
    background: #2563eb; color: #fff; border-color: #2563eb;
}
.wr-btn.ai:hover { background: #1d4ed8; }
.wr-paste-area { margin-top: 8px; }
.wr-paste-textarea {
    width: 100%; min-height: 120px; border: 1px solid var(--border, #D8DEE9);
    border-radius: 8px; padding: 10px; font-size: 0.82rem; resize: vertical;
    font-family: inherit;
}
.wr-paste-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.wr-paste-status { font-size: 0.78rem; }
.wr-eval-status { padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 0.82rem; font-weight: 600; }
.wr-eval-status.success { background: var(--success-soft, #dcfce7); color: var(--success, #16a34a); }
.wr-eval-status.error { background: #fef2f2; color: #dc2626; }
.wr-eval-status.loading { background: var(--primary-light, #EDF1F7); color: var(--primary, #14213D); }

/* ==========================================
   Test list containers (Give Tests modals)
   ========================================== */
.test-list-container {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Responsive: smaller max-height on mobile/tablet */
@media (max-width: 768px) {
    .test-list-container {
        max-height: 220px;
    }
}

@media (max-width: 480px) {
    .test-list-container {
        max-height: 160px;
    }
}

/* Allocation-day chips (Auto Rules tab) */
.alloc-day-chip {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    background: var(--light, #f8fafc);
    color: var(--dark-muted, #64748b);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.alloc-day-chip:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.alloc-day-chip.active {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: #fff;
}

/* ===== Settings sub-tabs ===== */
.settings-subtabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.35rem;
    background: var(--light, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
}
.settings-subtab {
    flex: 1 1 auto;
    min-width: 110px;
    padding: 0.55rem 0.9rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--dark-muted, #64748b);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.settings-subtab:hover { background: rgba(124, 58, 237, 0.08); color: var(--primary, #2563eb); }
.settings-subtab.active {
    background: var(--primary, #2563eb);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ===== Give / Revoke segmented control ===== */
.alloc-mode-switch {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    background: var(--light, #f8fafc);
}
.alloc-mode-btn {
    padding: 0.55rem 1.4rem;
    border: none;
    background: transparent;
    color: var(--dark-muted, #64748b);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.alloc-mode-btn + .alloc-mode-btn { border-left: 1px solid var(--border, #e2e8f0); }
.alloc-mode-btn:hover { background: rgba(124, 58, 237, 0.08); }
.alloc-mode-btn.active { background: var(--primary, #2563eb); color: #fff; }
.alloc-mode-btn#alloc-mode-revoke.active { background: var(--danger, #dc2626); }

/* ===== Accordion panels ===== */
.accordion-panel .accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    margin: 0 0 0.6rem;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.accordion-panel .accordion-header h3 { margin: 0; }
.accordion-panel .accordion-caret {
    font-size: 1rem;
    color: var(--dark-muted, #64748b);
    transition: transform 0.2s;
}
.accordion-panel.collapsed .accordion-caret { transform: rotate(-90deg); }
.accordion-panel.collapsed .accordion-body { display: none; }

/* ===== Help search ===== */
.onboard-search-row { margin-top: 1rem; }
.onboard-search-row input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.onboard-help-results {
    margin-top: 0.6rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    text-align: left;
}
.onboard-help-results .help-hit {
    display: block;
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: none;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
}
.onboard-help-results .help-hit:last-child { border-bottom: none; }
.onboard-help-results .help-hit:hover { background: rgba(124, 58, 237, 0.08); }
.onboard-help-results .help-hit .hit-where { color: var(--dark-muted, #64748b); font-size: 0.75rem; }
.onboard-help-results .help-empty {
    padding: 0.7rem 0.8rem;
    color: var(--dark-muted, #64748b);
    font-size: 0.82rem;
}
