/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* Login */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}
.login-box .logo { text-align: center; margin-bottom: 30px; }
.login-box .logo h2 { color: #667eea; font-size: 28px; }
.login-box .logo p { color: #888; font-size: 14px; }
.login-box .info { text-align: center; margin-top: 20px; color: #888; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}
.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #5568d3; transform: translateY(-2px); }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px; font-size: 17px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Navbar */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-size: 22px;
    font-weight: 800;
    color: #667eea;
}
.nav-menu { display: flex; gap: 5px; }
.nav-menu a {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}
.nav-menu a:hover, .nav-menu a.active {
    background: #667eea;
    color: #fff;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 25px;
    overflow: hidden;
}
.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h4 { font-size: 18px; }
.card-body { padding: 25px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: center;
}
.stat-card i { font-size: 32px; margin-bottom: 10px; }
.stat-card h4 { font-size: 28px; margin-bottom: 5px; }
.stat-card span { color: #888; font-size: 14px; }
.stat-card.blue { border-top: 4px solid #667eea; }
.stat-card.blue i { color: #667eea; }
.stat-card.green { border-top: 4px solid #10b981; }
.stat-card.green i { color: #10b981; }
.stat-card.red { border-top: 4px solid #ef4444; }
.stat-card.red i { color: #ef4444; }

/* Absen Page */
.absen-container {
    max-width: 600px;
    margin: 0 auto;
}
.gps-status {
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.gps-status i { margin-right: 8px; font-size: 20px; }
.status-success { background: #d1fae5; color: #065f46; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-danger { background: #fee2e2; color: #991b1b; }

.location-info {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { font-weight: 600; color: #666; }
.info-row .value { font-weight: 700; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }

/* Camera */
.camera-section { margin: 25px 0; }
.camera-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
}
.camera-wrapper video, .camera-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.camera-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}
.face-guide {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 250px;
    border: 3px dashed rgba(255,255,255,0.6);
    border-radius: 50% 50% 45% 45%;
}
.watermark {
    position: absolute;
    bottom: 15px;
    left: 15px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.camera-controls {
    text-align: center;
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.preview-container {
    max-width: 500px;
    margin: 15px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.preview-container img { width: 100%; display: block; }

/* Alert */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Table */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #64748b;
}
.table tr:hover { background: #f8fafc; }
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-masuk { background: #dbeafe; color: #1e40af; }
.badge-pulang { background: #fce7f3; color: #9d174d; }
.badge-istirahat { background: #fef3c7; color: #92400e; }
.badge-kembali { background: #d1fae5; color: #065f46; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 600;
}
.loading i { margin-right: 10px; }

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: #888; }

/* Admin */
.admin-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: #1e293b;
    color: #fff;
    padding: 30px 0;
}
.sidebar-brand {
    padding: 0 25px 30px;
    font-size: 20px;
    font-weight: 800;
    border-bottom: 1px solid #334155;
    margin-bottom: 20px;
}
.sidebar-menu a {
    display: block;
    padding: 14px 25px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    color: #fff;
    background: #334155;
    border-left-color: #667eea;
}
.admin-content {
    padding: 30px;
    background: #f1f5f9;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 10px; padding: 15px; }
    .nav-menu { flex-wrap: wrap; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr; }
    .login-box { padding: 25px; }
    .admin-grid { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .face-guide { width: 150px; height: 190px; }
}
