/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    padding: 24px;
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== TOP BAR ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding: 16px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #4a5568;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #f7fafc;
}

.class-info h1 {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: -0.3px;
}

.class-info .meta {
    display: flex;
    gap: 20px;
    margin-top: 4px;
    font-size: 14px;
    color: #718096;
}

.class-info .meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.class-info .meta i {
    font-size: 13px;
    color: #a0aec0;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-display {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    background: #f7fafc;
    padding: 8px 16px;
    border-radius: 8px;
}

.submit-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.submit-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ===== STATS ROW ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid #48bb78;
}

.stat-card .stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-top: 2px;
}

.stat-card .stat-sub {
    font-size: 13px;
    color: #718096;
    margin-top: 2px;
}

.stat-card.absent-stat {
    border-left-color: #fc8181;
}

.stat-card.late-stat {
    border-left-color: #f6ad55;
}

.stat-card.rate-stat {
    border-left-color: #63b3ed;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-left .total-badge {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.bulk-actions {
    display: flex;
    gap: 8px;
}

.bulk-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.bulk-btn.all-present {
    color: #48bb78;
    border-color: #48bb78;
}

.bulk-btn.all-present:hover {
    background: #f0fff4;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 14px;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}

.search-box i {
    color: #a0aec0;
    font-size: 14px;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 14px;
    outline: none;
    width: 180px;
    font-family: 'Inter', sans-serif;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #4a5568;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: #63b3ed;
}

/* ===== STUDENT TABLE ===== */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
    border-bottom: 2px solid #edf2f7;
}

thead th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

thead th:first-child {
    padding-left: 24px;
}

tbody tr {
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.15s;
}

tbody tr:hover {
    background: #fafcff;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 12px 18px;
    vertical-align: middle;
    font-size: 14px;
}

tbody td:first-child {
    padding-left: 24px;
}

/* Student Info */
.student-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #4a5568;
    flex-shrink: 0;
}

.student-name {
    font-weight: 600;
    color: #2d3748;
}

.student-email {
    font-size: 13px;
    color: #a0aec0;
    margin-top: 1px;
}

.grade-badge {
    display: inline-block;
    background: #edf2f7;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
}

/* ===== STATUS TOGGLE BUTTONS ===== */
.status-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-btn {
    padding: 6px 16px;
    border: 2px solid #e2e8f0;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    color: #718096;
    min-width: 72px;
    text-align: center;
}

.status-btn:hover {
    background: #f7fafc;
}

.status-btn.present {
    border-color: #c6f6d5;
    color: #38a169;
}

.status-btn.present.active {
    background: #48bb78;
    border-color: #48bb78;
    color: white;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.25);
}

.status-btn.absent {
    border-color: #fed7d7;
    color: #e53e3e;
}

.status-btn.absent.active {
    background: #fc8181;
    border-color: #fc8181;
    color: white;
    box-shadow: 0 2px 8px rgba(252, 129, 129, 0.25);
}

.status-btn.late {
    border-color: #fef0c8;
    color: #d69e2e;
}

.status-btn.late.active {
    background: #f6ad55;
    border-color: #f6ad55;
    color: white;
    box-shadow: 0 2px 8px rgba(246, 173, 85, 0.25);
}

.status-btn.excused {
    border-color: #bee3f8;
    color: #2b6cb0;
}

.status-btn.excused.active {
    background: #63b3ed;
    border-color: #63b3ed;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 179, 237, 0.25);
}

.status-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Excuse Indicator */
.excuse-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.excuse-badge i {
    font-size: 11px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .top-bar-right {
        flex-wrap: wrap;
    }

    .class-info h1 {
        font-size: 18px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
    }

    thead th {
        font-size: 10px;
        padding: 10px 12px;
    }

    tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }

    tbody td:first-child {
        padding-left: 16px;
    }

    .status-btn {
        padding: 4px 10px;
        font-size: 11px;
        min-width: 56px;
    }

    .student-email {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .status-group {
        gap: 4px;
    }

    .status-btn {
        padding: 3px 8px;
        font-size: 10px;
        min-width: 48px;
    }

    .avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .grade-badge {
        font-size: 10px;
        padding: 1px 8px;
    }
}