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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 5px solid #667eea;
    color: #1a365d;
    padding: 30px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.header img {
    max-height: 100px;
    width: auto;
    border-radius: 8px;
}

.header h1 {
    margin: 0;
    font-size: 2.2em;
    color: #1a365d;
}

.header p {
    margin: 5px 0 0 0;
    opacity: 1;
    font-size: 0.95em;
    color: #4a5568;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.control-group input,
.control-group select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background-color: #48bb78;
    color: white;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-primary {
    background-color: #4299e1;
    color: white;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-info {
    background-color: #2196f3;
    color: white;
}

.btn-info:hover {
    background-color: #1976d2;
}

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

.btn-danger:hover {
    background-color: #e53e3e;
}

.btn-secondary {
    background-color: #cbd5e0;
    color: #2d3748;
}

.btn-secondary:hover {
    background-color: #a0aec0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 500;
}

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

.btn-warning:hover {
    background-color: #dd6b20;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 15px 25px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: #999;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-button:hover {
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Attendance Table Styles */
.table-wrapper {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    color: #2d3748;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background-color: #f9fafb;
}

tr:last-child td {
    border-bottom: none;
}

.checkbox-cell {
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Daily Attendance Status Cell */
.status-cell {
    text-align: center;
    padding: 8px 0 !important;
}

.status-cell select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
    min-width: 100px;
    transition: border-color 0.3s;
}

.status-cell select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.status-cell select:hover {
    border-color: #667eea;
}

/* Status Select Option Styles */
.status-cell select option[value="hadir"] {
    background-color: #c6f6d5;
    color: #22543d;
}

.status-cell select option[value="sakit"] {
    background-color: #feebc8;
    color: #7c2d12;
}

.status-cell select option[value="izin"] {
    background-color: #bee3f8;
    color: #2c5282;
}

.status-cell select option[value="alpa"] {
    background-color: #fed7d7;
    color: #742a2a;
}

/* Status Badge in Daily View */
.daily-attendance-row.marked .status-cell {
    background-color: #f0fdf4;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.status-hadir {
    background-color: #c6f6d5;
    color: #22543d;
}

.status-sakit {
    background-color: #feebc8;
    color: #7c2d12;
}

.status-izin {
    background-color: #bee3f8;
    color: #2c5282;
}

.status-alpa {
    background-color: #fed7d7;
    color: #742a2a;
}

/* Import Status Messages */
#importStatus {
    background-color: #f0f9ff;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    padding: 15px;
}

#importStatus.success {
    background-color: #f0fdf4;
    border-left-color: #48bb78;
}

#importStatus.error {
    background-color: #fef2f2;
    border-left-color: #f56565;
}

#importStatus.warning {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
}

#importStatusContent {
    font-size: 0.95em;
    line-height: 1.6;
}

#importStatusContent .success-msg {
    color: #15803d;
    font-weight: 600;
    margin-bottom: 8px;
}

#importStatusContent .error-msg {
    color: #991b1b;
    margin: 5px 0;
}

#importStatusContent .warning-msg {
    color: #92400e;
    margin: 5px 0;
}

#importStatusContent ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.status-alpa {
    background-color: #fed7d7;
    color: #742a2a;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: slideDown 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.modal-body {
    margin: 20px 0;
    padding: 15px 0;
}

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background-color: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-error {
    background-color: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert-info {
    background-color: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

.statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .value {
    font-size: 2.5em;
    font-weight: bold;
}

.stat-card.hadir {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.stat-card.sakit {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.stat-card.izin {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.stat-card.alpa {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-data p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.date-range-display {
    background-color: #edf2f7;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 600;
    color: #2d3748;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .tabs {
        flex-direction: column;
    }
}
