/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333333;
    background-color: #f5f7fa;
}

/* Layout Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1a237e 100%);
    color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid #f5c842;
}

.logo-area h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.logo-area .subtitle {
    font-size: 12px;
    color: #f5c842;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 13px;
}

/* Sidebar & Content Layout */
.main-wrapper {
    display: flex;
    flex: 1;
    position: relative;
}

.sidebar {
    width: 250px;
    background-color: #1a237e;
    color: #ffffff;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-item {
    display: block;
    padding: 15px 25px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item.active {
    color: #ffffff;
    background-color: #0d47a1;
    border-left-color: #f5c842;
}

.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.main-footer {
    background-color: #111;
    color: #888888;
    text-align: center;
    padding: 15px;
    font-size: 12px;
    border-top: 1px solid #222;
}

/* Page Header & Grid Layouts */
.page-title {
    font-size: 24px;
    color: #1a237e;
    margin-bottom: 25px;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Cards & UI Components */
.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #eef2f6;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 5px solid #0d47a1;
}

.stat-card.hadir { border-left-color: #2e7d32; }
.stat-card.terlambat { border-left-color: #f57f17; }
.stat-card.izin { border-left-color: #00695c; }

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1a237e;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #0d47a1;
    outline: none;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #0d47a1;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1a237e;
}

.btn-accent {
    background-color: #f5c842;
    color: #333333;
}

.btn-accent:hover {
    background-color: #c9a800;
    color: #ffffff;
}

.btn-danger {
    background-color: #c62828;
    color: #ffffff;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

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

.btn-outline-gold {
    background-color: transparent;
    color: #f5c842;
    border-color: #f5c842;
}

.btn-outline-gold:hover {
    background-color: #f5c842;
    color: #1a237e;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

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

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: #ffffff;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
}

.table th {
    background-color: #f8fafc;
    color: #1a237e;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fcfdfe;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-hadir {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-terlambat {
    background-color: #fff3e0;
    color: #f57f17;
}

.badge-izin {
    background-color: #e0f2f1;
    color: #00695c;
}

/* Attendance Photo Thumbnail */
.img-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.img-thumbnail:hover {
    transform: scale(1.1);
}

/* Login Page Specific Layout */
.login-body {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 15px;
}

.login-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    padding: 30px;
    border-top: 5px solid #f5c842;
}

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

.login-header h2 {
    color: #1a237e;
    font-size: 22px;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 12px;
}

/* Glassmorphism Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

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

.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background-color: #fde8e8;
    color: #c62828;
    border: 1px solid #f8b4b4;
}

.alert-success {
    background-color: #eafaf1;
    color: #2e7d32;
    border: 1px solid #b2ecd2;
}

/* Charts Wrapper */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* RESPONSIVE LAYOUT MEDIA QUERIES */
@media (max-width: 1199px) {
    .main-content {
        max-width: 100%;
    }
}

@media (max-width: 991px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding-top: 0;
    }
    
    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
    }
    
    .sidebar-nav .nav-item {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .sidebar-nav .nav-item:hover,
    .sidebar-nav .nav-item.active {
        border-left-color: transparent;
        border-bottom-color: #f5c842;
    }
    
    .main-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .user-profile {
        flex-direction: column;
        gap: 5px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
}

/* Print styling for QR code cards */
@media print {
    body * {
        visibility: hidden;
    }
    .print-area, .print-area * {
        visibility: visible;
    }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
    }
    .print-card {
        border: 2px solid #0d47a1 !important;
        padding: 30px !important;
        border-radius: 8px !important;
        text-align: center !important;
        width: 350px !important;
    }
    .print-card img {
        width: 250px !important;
        height: 250px !important;
    }
}

/* Password toggle utility */
.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper .form-control {
    padding-right: 40px;
}
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666666;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-toggle-password:hover {
    color: #0d47a1;
}

/* Input group utility for aligning inputs and buttons inline */
.input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}
.input-group .form-control {
    flex: 1;
}
.input-group .btn {
    white-space: nowrap;
    padding: 10px 15px;
}


