* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    max-width: 450px;
    width: 100%;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.95em;
    font-weight: 400;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 1em;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom-color: #2c3e50;
}

.login-form-container {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95em;
}

.error-message {
    color: #c0392b;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* ==================== MAIN CONTAINER ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

header {
    background: #2c3e50;
    color: white;
    padding: 30px 40px;
    border-bottom: 3px solid #34495e;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

header p {
    font-size: 1em;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.class-selector {
    min-width: 250px;
}

.class-selector .input-field {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    font-size: 0.95em;
}

.class-selector .input-field option {
    background: white;
    color: #2c3e50;
}

.main-content {
    padding: 40px;
}

section {
    margin-bottom: 40px;
    padding: 25px;
    background: #ffffff;
    border-radius: 6px;
    border-left: 4px solid #34495e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8e8e8;
}

section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-field {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    font-size: 1em;
    transition: all 0.2s ease;
    background: #fafafa;
}

.input-field:focus {
    outline: none;
    border-color: #34495e;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.08);
}

.btn {
    padding: 11px 24px;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: #34495e;
    color: white;
}

.btn-primary:hover {
    background: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(44, 62, 80, 0.2);
}

.btn-secondary {
    background: #7f8c8d;
    color: white;
}

.btn-secondary:hover {
    background: #6c7a7b;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(127, 140, 141, 0.2);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(39, 174, 96, 0.2);
}

.btn-danger {
    background: #c0392b;
    color: white;
}

.btn-danger:hover {
    background: #a93226;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(192, 57, 43, 0.2);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(243, 156, 18, 0.2);
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-info:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.2);
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ==================== CLASS CARDS ==================== */
.classes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.class-card {
    background: white;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e8e8e8;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #34495e;
}

.class-card.active {
    border-color: #34495e;
    background: #f8f9fa;
    border-left: 3px solid #34495e;
}

.class-info h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.2em;
    font-weight: 600;
}

.class-info p {
    color: #7f8c8d;
    font-size: 0.9em;
    margin: 4px 0;
}

/* ==================== ATTENDANCE LIST ==================== */
.attendance-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.student-item {
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.student-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d5d5d5;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 1.1em;
}

.student-roll {
    font-size: 0.85em;
    color: #34495e;
    margin-bottom: 8px;
    font-weight: 500;
}

.student-status {
    font-size: 0.9em;
    color: #7f8c8d;
}

.attendance-buttons {
    display: flex;
    gap: 8px;
    margin-left: 15px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 4px;
}

.btn-present {
    background: #27ae60;
    color: white;
}

.btn-present:hover {
    background: #229954;
}

.btn-absent {
    background: #c0392b;
    color: white;
}

.btn-absent:hover {
    background: #a93226;
}

.btn-remove {
    background: #95a5a6;
    color: white;
    padding: 8px 12px;
}

.btn-remove:hover {
    background: #7f8c8d;
}

.empty-message {
    text-align: center;
    color: #95a5a6;
    padding: 30px;
    font-style: italic;
    font-size: 0.95em;
}

/* ==================== STATISTICS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d5d5d5;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.stat-label {
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.9em;
}

.date-display {
    color: #34495e;
    font-weight: 500;
    margin-top: 10px;
    font-size: 0.95em;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================== HISTORY ==================== */
.history-list {
    display: grid;
    gap: 15px;
}

.history-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.history-date {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.history-details {
    color: #7f8c8d;
    font-size: 0.95em;
}

.history-details strong {
    color: #34495e;
}

/* ==================== PRINT MODAL ==================== */
.print-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.print-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 1400px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8e8e8;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: #2c3e50;
    color: white;
    border-radius: 8px 8px 0 0;
    border-bottom: 3px solid #34495e;
}

.print-header h1 {
    margin: 0;
    font-size: 2em;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.print-content {
    padding: 30px;
}

.print-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #34495e;
    border: 1px solid #e8e8e8;
}

.print-info p {
    margin: 8px 0;
    color: #333;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 0.9em;
}

.print-table thead {
    background: #34495e;
    color: white;
}

.print-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
}

.print-table td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.print-table td.student-name-col {
    text-align: left;
    font-weight: 500;
}

.print-table td.roll-col {
    text-align: center;
    color: #34495e;
    font-weight: 500;
}

.date-header {
    font-size: 0.8em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}

.present-cell {
    background: #d5f4e6;
    color: #1e8449;
    font-weight: 600;
}

.absent-cell {
    background: #fadbd8;
    color: #922b21;
    font-weight: 600;
}

.unmarked-cell {
    background: #ecf0f1;
    color: #7f8c8d;
}

.total-cell {
    background: #ecf0f1;
    font-weight: 600;
    color: #2c3e50;
}

.percentage-cell {
    background: #fef5e7;
    font-weight: 600;
    color: #d68910;
}

.print-summary {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.print-summary h3 {
    color: #333;
    margin-bottom: 15px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    max-width: 600px;
}

.summary-table thead {
    background: #34495e;
    color: white;
}

.summary-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
}

.summary-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.summary-table td:first-child {
    text-align: left;
}

.print-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    border-top: 1px solid #e8e8e8;
    font-size: 0.9em;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .class-selector {
        width: 100%;
        min-width: auto;
    }
    
    .main-content {
        padding: 20px;
    }
    
    section {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-field {
        min-width: 100%;
    }
    
    .attendance-list,
    .classes-list {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls,
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .attendance-buttons {
        flex-direction: column;
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .class-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.4em;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    .login-header h1 {
        font-size: 1.6em;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
    }
    
    .print-modal {
        position: static;
        background: white;
    }
    
    .print-modal-content {
        max-width: 100%;
        max-height: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    
    .print-footer {
        display: none;
    }
    
    .print-header {
        border-radius: 0;
    }
    
    .print-table {
        page-break-inside: avoid;
    }
    
    .print-summary {
        page-break-inside: avoid;
    }
}
