/* ==========================================================================
   Exam & Grading Module Stylesheet
   MediCall BD / SaaS Institutional Design System
   Matches Academic, Staff, and Attendance Modules
   ========================================================================== */

:root {
    --exam-bg-canvas: #f8fafc;
    --exam-card-bg: #ffffff;
    --exam-border: #e2e8f0;
    --exam-text-primary: #0f172a;
    --exam-text-muted: #64748b;
    --exam-navy: #1e3a8a;
    --exam-navy-hover: #172554;
    --exam-amber: #f59e0b;
    --exam-amber-hover: #d97706;
    --exam-amber-light: #fef3c7;
    --exam-emerald: #10b981;
    --exam-emerald-light: #ecfdf5;
    --exam-rose: #ef4444;
    --exam-rose-light: #fef2f2;
    --exam-indigo: #6366f1;
    --exam-indigo-light: #eef2ff;
    --exam-radius: 12px;
    --exam-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --exam-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.exam-module-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin-bottom: 32px;
    color: var(--exam-text-primary);
    box-sizing: border-box;
}

/* Page Header */
.exam-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.exam-header-info {
    max-width: 680px;
}

.exam-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--exam-navy);
    margin-bottom: 4px;
}

.exam-page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--exam-text-primary);
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.exam-page-header p {
    font-size: 14px;
    color: var(--exam-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Primary Amber Button (+ Create Exam) */
.btn-exam-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--exam-amber);
    color: #0f172a;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
    transition: all 0.15s ease;
    touch-action: manipulation;
    white-space: nowrap;
    min-height: 44px;
}

/* ========================================================
   Ultra-Premium Step Action Buttons (Modern Gradients & Crisp White Typography)
   ======================================================== */
.btn-premium-step1 {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #2563EB 100%) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
    font-size: 13.5px !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap !important;
}
.btn-premium-step1 span,
.btn-premium-step1 i {
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}
.btn-premium-step1:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.5) !important;
    filter: brightness(1.1) !important;
}

.btn-premium-step2 {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #3B82F6 100%) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
    font-size: 13.5px !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap !important;
}
.btn-premium-step2 span,
.btn-premium-step2 i {
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}
.btn-premium-step2:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5) !important;
    filter: brightness(1.1) !important;
}

.btn-premium-step3 {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #6D28D9 0%, #7C3AED 50%, #8B5CF6 100%) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
    font-size: 13.5px !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap !important;
}
.btn-premium-step3 span,
.btn-premium-step3 i {
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}
.btn-premium-step3:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5) !important;
    filter: brightness(1.1) !important;
}

.btn-exam-primary:hover {
    background: var(--exam-amber-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.btn-exam-primary:active {
    transform: scale(0.98);
}

/* Secondary Button */
.btn-exam-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: var(--exam-text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid var(--exam-border);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 40px;
}

.btn-exam-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--exam-navy);
}

/* Danger Button */
.btn-exam-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--exam-rose);
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-exam-danger:hover {
    background: var(--exam-rose-light);
    border-color: var(--exam-rose);
}

/* Sub-Navigation Strip (Exams / Grading / Exam Attendance) */
.exam-tabs-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 6px 8px;
    border-radius: var(--exam-radius);
    border: 1px solid var(--exam-border);
    box-shadow: var(--exam-shadow);
    overflow-x: auto;
    scrollbar-width: thin;
}

.exam-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--exam-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 40px;
}

.exam-tab-item i {
    font-size: 14px;
    color: #64748b;
    transition: color 0.15s ease;
}

.exam-tab-item:hover {
    color: var(--exam-text-primary);
    background: #f1f5f9;
}

.exam-tab-item:hover i {
    color: var(--exam-navy, #1e3a8a);
}

.exam-tab-item.active {
    color: #ffffff;
    background: var(--exam-navy);
}

.exam-tab-item.active i {
    color: #ffffff !important;
}

.exam-tab-item.exam-tab-back {
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

.exam-tab-item.exam-tab-back:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.exam-tab-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

/* Stats Metric Cards */
.exam-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.exam-stat-card {
    background: #ffffff;
    border: 1px solid var(--exam-border);
    border-radius: var(--exam-radius);
    padding: 16px 20px;
    box-shadow: var(--exam-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.exam-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.exam-stat-icon.navy { background: #eff6ff; color: #1e40af; }
.exam-stat-icon.amber { background: #fef3c7; color: #b45309; }
.exam-stat-icon.emerald { background: #ecfdf5; color: #047857; }
.exam-stat-icon.indigo { background: #eef2ff; color: #4338ca; }

.exam-stat-meta .label {
    font-size: 12.5px;
    color: var(--exam-text-muted);
    font-weight: 600;
}

.exam-stat-meta .value {
    font-size: 22px;
    font-weight: 800;
    color: var(--exam-text-primary);
    line-height: 1.2;
    margin-top: 2px;
}

/* Filter Bar & Cards */
.exam-filter-bar,
.exam-filter-card {
    background: #ffffff;
    border: 1px solid var(--exam-border);
    border-radius: var(--exam-radius);
    padding: 14px 18px;
    box-shadow: var(--exam-shadow);
}

.exam-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.marks-filter-form {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr auto;
    gap: 14px;
    align-items: flex-end;
    width: 100%;
}

.marks-filter-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 5px;
}

.exam-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.exam-search-box {
    position: relative;
    min-width: 240px;
    flex: 1 1 280px;
}

.exam-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13.5px;
    pointer-events: none;
}

.exam-search-box input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 38px;
    border-radius: 9px;
    border: 1px solid var(--exam-border);
    font-size: 13.5px;
    color: var(--exam-text-primary);
    outline: none;
    transition: all 0.15s ease;
    background: #f8fafc;
    box-sizing: border-box;
}

.exam-search-box input:focus {
    border-color: var(--exam-navy);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

.exam-filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.exam-filter-select {
    height: 42px;
    padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--exam-border);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--exam-text-primary);
    background: #ffffff;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.exam-filter-select:focus {
    border-color: var(--exam-navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

.exam-filter-btns {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.exam-clear-btn {
    color: #64748B !important;
}

.exam-clear-btn:hover {
    color: #EF4444 !important;
    border-color: #FECACA !important;
    background: #FEF2F2 !important;
}

/* Table Cards */
.exam-table-card {
    background: #ffffff;
    border: 1px solid var(--exam-border);
    border-radius: var(--exam-radius);
    box-shadow: var(--exam-shadow);
    overflow: hidden;
}

.exam-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.exam-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.exam-data-table th {
    background: #f8fafc;
    color: var(--exam-text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 18px;
    border-bottom: 1px solid var(--exam-border);
}

.exam-data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--exam-border);
    color: var(--exam-text-primary);
    vertical-align: middle;
}

.exam-data-table tr:last-child td {
    border-bottom: none;
}

.exam-data-table tbody tr:hover {
    background: #f8fafc;
}

/* Table Cells & Badges */
.exam-title-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.exam-title-main {
    font-weight: 700;
    color: var(--exam-text-primary);
    font-size: 14px;
}

.exam-title-sub {
    font-size: 12px;
    color: var(--exam-text-muted);
}

.exam-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.exam-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.exam-status-badge.active { background: var(--exam-emerald-light); color: #047857; }
.exam-status-badge.draft { background: #f1f5f9; color: #475569; }
.exam-status-badge.calculated { background: #eff6ff; color: #1e40af; }
.exam-status-badge.published { background: #fdf4ff; color: #86198f; }

.exam-classes-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 260px;
}

.exam-class-chip {
    display: inline-flex;
    padding: 3px 8px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
}

.exam-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn-sm {
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    border: 1px solid var(--exam-border);
    background: #ffffff;
    color: var(--exam-text-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn-sm:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--exam-navy);
}

.action-btn-sm.primary {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.action-btn-sm.primary:hover {
    background: #dbeafe;
}

.action-btn-sm.danger {
    color: var(--exam-rose);
    border-color: #fecaca;
}

.action-btn-sm.danger:hover {
    background: var(--exam-rose-light);
}

/* Modals (Fixed Header/Footer + Internal Scroll) */
.exam-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease-out;
}

.exam-modal-backdrop[hidden] {
    display: none !important;
}

.exam-modal-backdrop.is-open,
.exam-modal-backdrop.show {
    display: flex !important;
}

.exam-modal-container {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--exam-border);
    box-shadow: var(--exam-shadow-lg);
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleUp 0.18s ease-out;
}

.exam-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--exam-border);
    background: #ffffff;
    flex-shrink: 0;
}

.exam-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--exam-text-primary);
}

.exam-modal-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    width: 36px;
    height: 36px;
}

.exam-modal-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.exam-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(88vh - 140px);
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.exam-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--exam-border);
    background: #f8fafc;
    flex-shrink: 0;
}

/* Modal Form Fields */
.exam-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exam-field-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--exam-text-primary);
}

.exam-field-group label .required {
    color: var(--exam-rose);
}

.exam-field-group input,
.exam-field-group select,
.exam-field-group textarea {
    height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--exam-border);
    font-size: 14px;
    color: var(--exam-text-primary);
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.exam-field-group textarea {
    height: 80px;
    padding: 10px 14px;
}

.exam-field-group input:focus,
.exam-field-group select:focus,
.exam-field-group textarea:focus {
    border-color: var(--exam-navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.exam-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* 2-Column Responsive Class Checkbox Grid */
.exam-classes-checklist {
    background: #f8fafc;
    border: 1px solid var(--exam-border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 6px;
}

.exam-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.exam-checklist-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--exam-text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.exam-select-all-btn {
    background: transparent;
    border: none;
    color: #2563eb;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.exam-select-all-btn:hover {
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
}

.exam-classes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.exam-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.exam-checkbox-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.exam-checkbox-item:has(input[type="checkbox"]:checked) {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.exam-checkbox-item input[type="checkbox"],
.exam-modal-backdrop input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 5px !important;
    background: #ffffff !important;
    outline: none !important;
    cursor: pointer !important;
    display: inline-grid !important;
    place-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.exam-checkbox-item input[type="checkbox"]:hover,
.exam-modal-backdrop input[type="checkbox"]:hover {
    border-color: #2563eb !important;
    background: #f8fafc !important;
}

.exam-checkbox-item input[type="checkbox"]:focus,
.exam-checkbox-item input[type="checkbox"]:focus-visible,
.exam-modal-backdrop input[type="checkbox"]:focus,
.exam-modal-backdrop input[type="checkbox"]:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
    border-color: #2563eb !important;
}

.exam-checkbox-item input[type="checkbox"]:checked,
.exam-modal-backdrop input[type="checkbox"]:checked {
    background: #2563eb !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
}

.exam-checkbox-item input[type="checkbox"]::before,
.exam-modal-backdrop input[type="checkbox"]::before {
    content: "" !important;
    width: 9px !important;
    height: 5px !important;
    border-left: 2px solid #ffffff !important;
    border-bottom: 2px solid #ffffff !important;
    transform: rotate(-45deg) translate(1px, -1px) scale(0) !important;
    transition: transform 0.12s ease-in-out !important;
}

.exam-checkbox-item input[type="checkbox"]:checked::before,
.exam-modal-backdrop input[type="checkbox"]:checked::before {
    transform: rotate(-45deg) translate(1px, -1px) scale(1) !important;
}

.exam-checkbox-item span {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--exam-text-primary);
    flex: 1;
}

/* Grading Scale Screen Components */
.grading-scale-header-card {
    background: #ffffff;
    border: 1px solid var(--exam-border);
    border-radius: var(--exam-radius);
    padding: 20px 24px;
    box-shadow: var(--exam-shadow);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.grading-scale-meta {
    max-width: 650px;
}

.grading-scale-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    color: #1e40af;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.grading-scale-meta p {
    margin: 0;
    font-size: 13.5px;
    color: var(--exam-text-muted);
    line-height: 1.5;
}

/* Institutional Rules Callout Box */
.grading-rules-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--exam-radius);
    padding: 20px 24px;
}

.grading-rules-banner h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 800;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grading-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.grading-rule-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
}

.grading-rule-card strong {
    color: #1e40af;
    display: block;
    margin-bottom: 2px;
}

/* Inline Edit Controls in Grading Table */
.tier-input {
    width: 80px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid var(--exam-border);
    padding: 0 8px;
    text-align: center;
    font-size: 14px;
    font-family: monospace;
    font-weight: 700;
    color: var(--exam-text-primary);
    background: #ffffff;
    outline: none;
    transition: all 0.15s;
    box-sizing: border-box;
}

.tier-input:focus {
    border-color: var(--exam-amber);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.tier-delete-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tier-delete-btn:hover:not(:disabled) {
    color: var(--exam-rose);
    background: var(--exam-rose-light);
}

.tier-delete-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .exam-page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .exam-page-header .btn-exam-primary,
    .exam-page-header .btn-exam-secondary,
    .exam-page-header .btn-premium-step1,
    .exam-page-header .btn-premium-step2,
    .exam-page-header .btn-premium-step3 {
        width: 100% !important;
        justify-content: center !important;
    }

    .exam-classes-grid {
        grid-template-columns: 1fr !important;
    }

    .exam-field-row {
        grid-template-columns: 1fr !important;
    }

    .exam-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }

    .exam-data-table {
        min-width: 620px !important;
        white-space: nowrap !important;
    }

    .exam-marks-table th:first-child,
    .exam-marks-table td:first-child,
    .tabulation-table th:first-child,
    .tabulation-table td:first-child {
        position: sticky !important;
        left: 0 !important;
        background: #FFFFFF !important;
        z-index: 2 !important;
        box-shadow: 2px 0 5px rgba(15, 23, 42, 0.08) !important;
        min-width: 140px !important;
    }

    .exam-marks-table th:first-child,
    .tabulation-table th:first-child {
        background: #F8FAFC !important;
        z-index: 3 !important;
    }

    .exam-modal-backdrop {
        padding: 10px !important;
        z-index: 1000 !important;
    }

    .exam-modal-container {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 36px) !important;
        border-radius: 14px !important;
    }

    .exam-modal-body {
        padding: 16px 14px !important;
        max-height: calc(100dvh - 160px) !important;
    }

    .exam-modal-footer {
        padding: 12px 14px !important;
        flex-direction: column-reverse !important;
        gap: 8px !important;
    }

    .exam-modal-footer button {
        width: 100% !important;
        justify-content: center !important;
    }

    .grading-rules-grid {
        grid-template-columns: 1fr !important;
    }

    /* Metric Summary Stats 2-Column Mobile Grid */
    .exam-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .exam-stat-card {
        padding: 10px 12px !important;
        gap: 10px !important;
        border-radius: 10px !important;
    }

    .exam-stat-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }

    .exam-stat-meta .label {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .exam-stat-meta .value {
        font-size: 18px !important;
        margin-top: 1px !important;
    }

    /* Filter Card Mobile — Sleek, Compact 2-Column Responsive Layout */
    .exam-filter-card {
        padding: 12px 14px !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        border: 1px solid #E2E8F0 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
    }

    .exam-filter-form {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .exam-search-box {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        position: relative !important;
        display: block !important;
    }

    .exam-search-box input {
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 14px 0 36px !important;
        font-size: 13.5px !important;
        border-radius: 8px !important;
        background: #F8FAFC !important;
        border: 1px solid #CBD5E1 !important;
        box-sizing: border-box !important;
    }

    .exam-search-box input:focus {
        background: #FFFFFF !important;
        border-color: #1E3A8A !important;
        box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08) !important;
    }

    .exam-search-box i {
        position: absolute !important;
        left: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 13px !important;
        color: #94A3B8 !important;
    }

    .exam-filter-controls {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .exam-filter-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        border-radius: 8px !important;
        border: 1px solid #CBD5E1 !important;
        background: #FFFFFF !important;
        color: #0F172A !important;
        box-sizing: border-box !important;
        text-overflow: ellipsis !important;
    }

    .exam-filter-btns {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .exam-filter-btns button:only-child {
        grid-column: 1 / -1 !important;
    }

    .exam-filter-btns button,
    .exam-filter-btns a {
        width: 100% !important;
        height: 38px !important;
        min-height: 38px !important;
        justify-content: center !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .exam-filter-btns button {
        background: #1E3A8A !important;
        color: #FFFFFF !important;
        border: 1px solid #1E3A8A !important;
        box-shadow: 0 1px 3px rgba(30, 58, 138, 0.2) !important;
    }

    .exam-filter-btns a.exam-clear-btn {
        background: #F8FAFC !important;
        color: #64748B !important;
        border: 1px solid #CBD5E1 !important;
    }

    /* Marks Hub Filter Mobile Grid */
    .marks-filter-form {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px 10px !important;
        align-items: flex-end !important;
        width: 100% !important;
    }

    .marks-filter-exam {
        grid-column: 1 / -1 !important;
    }

    .marks-filter-reset {
        grid-column: 1 / -1 !important;
    }

    .marks-filter-reset a {
        width: 100% !important;
        height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}
