* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 24px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

/* Header Section */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="10" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="90" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="15" r="1" fill="rgba(255,255,255,0.08)"/><circle cx="30" cy="60" r="1.2" fill="rgba(255,255,255,0.08)"/><circle cx="75" cy="75" r="0.8" fill="rgba(255,255,255,0.08)"/></svg>'),
                radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    25% { 
        transform: translateY(-10px) rotate(45deg);
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-15px) rotate(180deg);
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-5px) rotate(270deg);
        opacity: 0.7;
    }
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -2px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

/* Dashboard Section */
.dashboard {
    padding: 48px;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 32px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 12px 32px rgba(102, 126, 234, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 48px rgba(102, 126, 234, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h3 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    letter-spacing: -2px;
}

.stat-card p {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Filters Section */
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 48px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(233, 236, 239, 0.6) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.filter-group select,
.filter-group input {
    padding: 16px 20px;
    border: 2px solid rgba(229, 231, 235, 0.8);
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 1);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.15),
        0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.filter-group input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Action Buttons */
.action-btn {
    padding: 16px 28px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.export-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
}

.refresh-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.4);
}

.action-btn:active {
    transform: translateY(-1px);
}

/* Table Section */
.attendance-table {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.table-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 32px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.table-header h2 {
    color: #334155;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

th {
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
    font-weight: 700;
    color: #475569;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(226, 232, 240, 0.8);
}

tbody tr {
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.7);
}

tbody tr:hover {
    background: rgba(102, 126, 234, 0.04);
    transform: scale(1.001);
}

tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

tbody tr:nth-child(even):hover {
    background: rgba(102, 126, 234, 0.04);
}

/* Status Badges */
.status-present {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.status-absent {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.subject-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .filters {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
    }
    
    .filters .filter-group:nth-child(4),
    .filters .filter-group:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .dashboard {
        padding: 24px;
    }
    
    .header {
        padding: 32px 24px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 32px;
    }
    
    .filters {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px;
    }
    
    .stat-card {
        padding: 32px 24px;
    }
    
    .stat-card h3 {
        font-size: 3rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    table {
        min-width: 700px;
    }
    
    th, td {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .dashboard {
        padding: 16px;
    }
    
    .filters {
        padding: 20px;
    }
    
    .stat-card h3 {
        font-size: 2.5rem;
    }
    
    .action-btn {
        min-width: 120px;
        padding: 14px 20px;
        font-size: 0.9rem;
    }
}

/* Hide subject stats completely */
.subject-stats {
    display: none !important;
}