/* ============================================================================
   Grades Component
   Styles for grades management, bulk grading, and grade reports
   ============================================================================ */

/* ============================================================================
   Grades Header
   ============================================================================ */
.grades-header {
    background: linear-gradient(135deg, #004135 0%, #11684d 50%, #00a86b 100%);
    border-radius: 0;
    padding: 2rem;
    color: white;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grades-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.grades-header .header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Bulk Grade Header */
.bulk-grade-header {
    background: linear-gradient(135deg, #004135 0%, #11684d 50%, #00a86b 100%);
    border-radius: 0;
    padding: 2rem;
    color: white;
}

.bulk-grade-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

/* ============================================================================
   Header Action Buttons
   ============================================================================ */
.filter-toggle-btn,
.btn-back,
.btn-bulk-grade,
.btn-bulk-publish {
    background: white;
    color: #003829;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.filter-toggle-btn:hover,
.btn-back:hover,
.btn-bulk-grade:hover,
.btn-bulk-publish:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #003829;
    text-decoration: none;
}

.btn-start-bulk-grading {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0.6rem 1.2rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-decoration: none !important;
}

.btn-start-bulk-grading:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

/* ============================================================================
   Filter Section
   ============================================================================ */
.grades-index .search-filter-container {
    background: white;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.grades-index .search-filter-container.collapsed {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.grades-index .search-content {
    padding: 1.5rem;
    display: none;
}

.grades-index .search-content.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form-modern .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-form-modern .form-group {
    margin-bottom: 0;
}

.search-form-modern label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.search-form-modern label i {
    margin-right: 0.5rem;
    color: #00b377;
    font-size: 0.95rem;
}

.search-form-modern .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.search-form-modern .form-control:focus {
    border-color: #00b377;
    box-shadow: 0 0 0 0.2rem rgba(0, 179, 119, 0.15);
}

.search-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-search-modern {
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-search-primary {
    background: linear-gradient(135deg, #003829 0%, #00563d 100%);
    color: white;
}

.btn-search-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 179, 119, 0.4);
}

.btn-search-secondary {
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: none;
}

.btn-search-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
    color: #6b7280;
    text-decoration: none;
}

.btn-search-icon {
    background: linear-gradient(135deg, #003829 0%, #00563d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    min-width: 48px;
}

.btn-search-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 179, 119, 0.4);
}

/* Filter Section Card */
.filter-section-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ============================================================================
   Subject Cards Grid
   ============================================================================ */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.subject-card {
    background: linear-gradient(135deg, #004135 0%, #00563d 100%);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 179, 119, 0.3);
    border-color: #00b377;
}

.subject-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    color: white;
}

.subject-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.subject-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

.subject-count i {
    font-size: 1rem;
}

/* ============================================================================
   Grades Section & Table
   ============================================================================ */
.grades-section {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-top: 1.5rem;
}

.grades-section-header {
    background: linear-gradient(135deg, #004135 0%, #00563d 100%);
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grades-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white !important;
}

.grades-section-title i {
    color: white;
}

.grades-table-container {
    padding: 2rem;
}

.grades-table-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.grades-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.grades-table thead th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
    position: sticky;
    top: 0;
}

.grades-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.grades-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.grades-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.grades-table tbody tr:hover {
    background: #f0fdf4 !important;
}

.grades-table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
}

.grades-table th {
    white-space: nowrap;
}

.grades-table td {
    border: 1px solid #e5e7eb;
}

/* Sticky columns shadow effect */
.grades-table th[style*="position: sticky"],
.grades-table td[style*="position: sticky"] {
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Compact table styles */
.compact-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.compact-table thead th {
    font-size: 0.75rem;
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
}

.compact-table tbody td {
    padding: 0.75rem 0.5rem;
    border: 1px solid #e5e7eb;
}

.compact-table tbody tr:hover {
    background: #f0fdf4 !important;
}

.compact-table th[style*="position: sticky"],
.compact-table td[style*="position: sticky"] {
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Student Info Display
   ============================================================================ */
.student-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a86b 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.student-details .student-name {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.student-details .student-ic {
    color: #6b7280;
    font-size: 0.8rem;
}

.marks-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: #059669;
}

.marks-absent {
    color: #6b7280;
    font-size: 1.1rem;
}

/* ============================================================================
   Grade Badges
   ============================================================================ */
.grade-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

.grade-A {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.grade-B {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.grade-C {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.grade-D {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.grade-E {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.grade-F,
.grade-TH {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

/* ============================================================================
   Grades Status Badges
   NOTE: Base .status-badge is in status-badges.css (single source of truth)
   These are grades-specific status variants
   ============================================================================ */
.status-published {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-draft {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
}

/* ============================================================================
   Action Buttons
   ============================================================================ */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

.grades-index .btn-action {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.grades-index .btn-view {
    background: #3b82f6;
    color: white;
}

.grades-index .btn-view:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.grades-index .btn-edit {
    background: #f59e0b;
    color: white;
}

.grades-index .btn-edit:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.grades-index .btn-delete {
    background: #ef4444;
    color: white;
}

.grades-index .btn-delete:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ============================================================================
   Empty State
   NOTE: Base .empty-state is in empty-states.css (single source of truth)
   ============================================================================ */

/* ============================================================================
   Stats Container (for grades)
   ============================================================================ */
.grades-index .stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grades-index .stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 2px solid #f3f4f6;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hide the default top bar from stat-cards.css */
.grades-index .stat-card::before {
    display: none !important;
}

.grades-index .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #00b377;
}

.grades-index .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #00b377;
    margin: 0;
}

.grades-index .stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   Grading Window Status Banner
   ============================================================================ */
.grading-window-status {
    margin: 0;
    padding: 0;
}

.window-status-open,
.window-status-closed,
.window-status-not-found {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 3px solid;
}

.window-status-open {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-bottom-color: #10b981;
}

.window-status-closed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-bottom-color: #ef4444;
}

.window-status-not-found {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom-color: #f59e0b;
}

.status-icon {
    font-size: 3rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.window-status-open .status-icon {
    background: #10b981;
    color: white;
}

.window-status-closed .status-icon {
    background: #ef4444;
    color: white;
}

.window-status-not-found .status-icon {
    background: #f59e0b;
    color: white;
}

.status-content h5 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.window-status-open .status-content h5 {
    color: #065f46;
}

.window-status-closed .status-content h5 {
    color: #991b1b;
}

.window-status-not-found .status-content h5 {
    color: #92400e;
}

.status-content p {
    margin: 0.25rem 0;
    font-size: 1rem;
}

.window-status-open .status-content p {
    color: #047857;
}

.window-status-closed .status-content p {
    color: #b91c1c;
}

.window-status-not-found .status-content p {
    color: #78350f;
}

/* ============================================================================
   View Page Styles
   ============================================================================ */
.grades-view .view-header {
    background: linear-gradient(135deg, #004135 0%, #11684d 50%, #00a86b 100%);
    border-radius: 0;
    padding: 2.5rem;
    color: white;
}

.grades-view .view-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.grades-view .view-subtitle {
    opacity: 0.9;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grades-content {
    padding: 2rem;
}

.grades-view .action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.grades-view .btn-action {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-action-edit {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-action-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
    color: white;
}

.btn-action-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-action-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    color: white;
}

.btn-action-back {
    background: #e5e7eb;
    color: #374151;
}

.btn-action-back:hover {
    background: #d1d5db;
    transform: translateY(-2px);
    color: #111827;
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.student-info-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid #e5e7eb;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.section-title i {
    color: #00a86b;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grades-view .info-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.grades-view .info-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grade-card {
    background: linear-gradient(135deg, #004135 0%, #00a86b 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 168, 107, 0.3);
    height: fit-content;
}

.grade-card .grade-label {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.grade-card .grade-value {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.grade-card .marks-display {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    font-size: inherit;
    color: white;
}

.grade-card .marks-label {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.grade-card .marks-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.session-info-section {
    background: #f9fafb;
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid #e5e7eb;
}

.session-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* ============================================================================
   My Child Grades (Parent View)
   ============================================================================ */
.my-child-grades .grades-header {
    padding: 2.5rem;
}

.my-child-grades .grades-header h3 {
    font-size: 2rem;
    margin: 0 0 1rem 0;
}

.filter-section {
    background: white;
    padding: 1.5rem 2rem;
    margin-bottom: 0;
    border-bottom: 2px solid #e5e7eb;
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.filter-form .form-group {
    flex: 1;
    margin: 0;
}

.filter-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.filter-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.filter-form select:focus {
    outline: none;
    border-color: #004135;
}

.btn-filter {
    background: linear-gradient(135deg, #004135 0%, #00a86b 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 65, 53, 0.3);
}

.multiple-children-container {
    padding: 2rem;
    background: #f9fafb;
}

.student-section {
    background: white;
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e5e7eb;
}

.student-section:last-child {
    margin-bottom: 0;
}

.student-section-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 2px solid #e5e7eb;
}

.student-section-header:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.student-info-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.my-child-grades .student-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a86b 0%, #004135 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 65, 53, 0.3);
}

.student-details h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.student-details p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

.collapse-icon {
    font-size: 1.5rem;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.student-section-body {
    display: none;
    padding: 2rem;
    background: white;
}

.student-section-body.show {
    display: block;
}

/* ============================================================================
   Grading Table Section (Bulk Grade)
   ============================================================================ */
.grading-table-section {
    background: white;
    padding: 2rem;
    border-radius: 0 0 16px 16px;
}

.grading-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.grading-table thead th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.grading-table tbody tr {
    height: 70px;
}

.grading-table tbody td {
    padding: 0.75rem !important;
    border: 1px solid #e5e7eb;
    text-align: center;
}

/* ============================================================================
   Pagination Styles
   ============================================================================ */
.grades-index .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.grades-index .pagination li {
    margin: 0;
}

.grades-index .pagination li a,
.grades-index .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.grades-index .pagination li a:hover {
    background: #f9fafb;
    border-color: #00b377;
    color: #00b377;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 179, 119, 0.2);
}

.grades-index .pagination li.active span {
    background: linear-gradient(135deg, #00a86b 0%, #059669 100%);
    border-color: #00a86b;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 179, 119, 0.3);
}

.grades-index .pagination li.disabled span,
.grades-index .pagination li.disabled a {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================================
   Responsive Styles
   ============================================================================ */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .session-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grades-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .grades-header .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .grades-index .stats-container {
        grid-template-columns: 1fr;
    }

    .grades-index .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .grades-index .pagination li a,
    .grades-index .pagination li span {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .filter-form {
        flex-direction: column;
    }
}

/* ============================================================================
   Admin View Grades (Completion Status)
   ============================================================================ */
.admin-view-grades .grades-header {
    background: linear-gradient(135deg, #004135 0%, #11684d 50%, #00a86b 100%);
    border-radius: 0;
    padding: 2rem;
    color: white;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-view-grades .grades-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.btn-publish-all {
    background: white;
    color: #10b981;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-publish-all:hover:not(:disabled) {
    background: #f0f0f0;
    color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-publish-all:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.overall-status {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.overall-status.complete {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
}

.overall-status.incomplete {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
}

.overall-status h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.overall-status p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

.class-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #004135;
    transition: all 0.3s ease;
}

.class-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.class-card.complete {
    border-left-color: #10b981;
}

.class-card.incomplete {
    border-left-color: #ef4444;
}

.class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.class-info h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.class-info .teacher-name {
    color: #6b7280;
    font-size: 0.875rem;
}

.completion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
}

.completion-badge.complete {
    background: #d1fae5;
    color: #065f46;
}

.completion-badge.incomplete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-publish-class {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-publish-class:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-published {
    background: #e5e7eb;
    color: #6b7280;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: not-allowed;
}

.class-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.progress-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.progress-item {
    flex: 1;
    min-width: 200px;
}

.progress-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.progress-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.subjects-detail {
    margin-top: 1rem;
}

.subjects-detail h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.subject-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.subject-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.875rem;
}

.subject-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subject-item .icon.complete {
    color: #10b981;
}

.subject-item .icon.incomplete {
    color: #ef4444;
}

.subject-item .name {
    flex: 1;
    font-weight: 500;
}

.subject-item .count {
    color: #6b7280;
    font-size: 0.75rem;
}

/* ============================================================================
   My Child Grades Additional Styles
   ============================================================================ */
.academic-performance-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    text-align: center;
}

.academic-performance-summary h5 {
    margin: 0 0 1rem 0;
    color: #065f46;
    font-size: 1.125rem;
    font-weight: 700;
}

.performance-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.performance-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.performance-stat .label {
    color: #6b7280;
}

.performance-stat .value {
    color: #059669;
    font-weight: 700;
}

.btn-view-slip {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-view-slip:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.current-filter-display {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
}

.no-label {
    width: 60px;
    text-align: center !important;
}

/* ============================================================================
   Bulk Grade Additional Styles
   ============================================================================ */
.grade-input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.grade-input:focus {
    border-color: #00a86b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

.grade-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.total-display {
    font-weight: 700;
    font-size: 1.1rem;
    color: #059669;
    padding: 0.5rem;
    background: #f0fdf4;
    border-radius: 8px;
    min-width: 80px;
    display: inline-block;
}

.grade-display {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-block;
    min-width: 60px;
}

/* Grade display variants for bulk grade (light background) */
.bulk-grade-page .grade-A {
    background: #d1fae5;
    color: #065f46;
}

.bulk-grade-page .grade-B {
    background: #dbeafe;
    color: #1e40af;
}

.bulk-grade-page .grade-C {
    background: #fed7aa;
    color: #92400e;
}

.bulk-grade-page .grade-D {
    background: #fee2e2;
    color: #991b1b;
}

.bulk-grade-page .grade-E {
    background: #fecaca;
    color: #7f1d1d;
}

.bulk-grade-page .grade-TH {
    background: #e5e7eb;
    color: #374151;
}

.btn-save-grades {
    background: linear-gradient(135deg, #004135 0%, #00a86b 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-save-grades:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 168, 107, 0.4);
}

.info-banner {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-banner i {
    font-size: 1.5rem;
    color: #d97706;
}

.info-banner-text {
    color: #92400e;
    font-weight: 600;
}

.btn-back-header:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #003829 !important;
}

/* NOTE: Empty state for admin-view-grades uses empty-states.css (single source of truth) */
