@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }

body.light-dashboard {
    background: linear-gradient(rgba(244, 248, 251, 0.404), rgba(244, 248, 251, 0.452)), url('ksop.jpg') center/cover no-repeat fixed;
    color: #1d3557;
    padding: 20px 15px 110px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Class ini sekarang hanya alias — latar ksop.jpg sudah berlaku untuk semua halaman
   ber-class "light-dashboard" (user, admin, riwayat, profil) lewat aturan di atas. */
body.light-dashboard.user-bg-image {
    background: linear-gradient(rgba(244, 248, 251, 0.404), rgba(244, 248, 251, 0.452)), url('ksop.jpg') center/cover no-repeat fixed;
}

.main-container { width: 100%; max-width: 850px; margin: 0 auto; }

.top-header-luxury {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(rgba(11, 37, 69, 0.85), rgba(11, 37, 69, 0.90)), url('LOGO_KEMENTERIAN_PERHUBUNGAN-removebg-preview.png') center/cover no-repeat;
    padding: 24px;
    border-radius: 20px;
    color: #ffffff;
    box-shadow: 0 10px 30px -10px rgba(11, 37, 69, 0.3);
    margin-bottom: 24px;
    border-left: 6px solid #0096c7;
    position: relative;
    overflow: hidden;
    gap: 20px;
    flex-wrap: wrap;
}

.header-left-group h1 { font-size: 20px; font-weight: 700; margin-bottom: 2px; color: #ffffff; }
.header-left-group p { font-size: 11px; color: #cbd5e1; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.header-clock-live {
    font-size: 12px; font-weight: 700; color: #ffffff;
    background: rgba(0, 150, 199, 0.85); padding: 4px 10px;
    border-radius: 6px; display: inline-block; margin-top: 8px;
}

.header-right-wrapper { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-right-profile {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.12); padding: 6px 14px 6px 6px;
    border-radius: 50px; border: 1px solid rgba(255, 255, 255, 0.2); text-decoration: none;
}
.profile-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid #0096c7; }
.profile-info-text { text-align: left; }
.profile-name { font-size: 13px; font-weight: 700; color: #ffffff; line-height: 1.2; display: block; }
.profile-role { font-size: 10px; color: #94a3b8; display: block; }

.btn-header-logout {
    background: rgba(230, 57, 70, 0.25); color: #ff8787;
    border: 1px solid rgba(230, 57, 70, 0.4); padding: 10px 14px;
    border-radius: 12px; font-size: 12px; font-weight: 700; text-decoration: none;
    display: flex; align-items: center; gap: 6px;
}
.btn-header-logout:hover { background: #e63946; color: #ffffff; }
.btn-header-logout svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.absen-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.absen-card-luxury {
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px;
    padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); text-align: center;
}

.card-indicator-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.card-header-title { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.time-box-large { font-size: 32px; font-weight: 800; color: #0b2545; margin-bottom: 16px; }

.btn-luxury-action {
    background: #0b2545; color: #ffffff; border: none; width: 100%; padding: 12px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 15px rgba(11,37,69,0.2);
}
.btn-luxury-action:hover { background: #134074; }
.btn-luxury-pulang { background: #0096c7; box-shadow: 0 4px 15px rgba(0,150,199,0.25); }
.btn-luxury-pulang:hover { background: #0077b6; }

.dashboard-map-section { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); margin-bottom: 24px; }
.map-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.map-title-row h3 { font-size: 14px; font-weight: 700; color: #0b2545; display: flex; align-items: center; gap: 8px; }
#dashboardMap { width: 100%; height: 240px; border-radius: 14px; border: 1px solid #cbd5e1; }

.card-section-luxury { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); margin-bottom: 24px; }

.bottom-nav-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); border-top: 1px solid #e2e8f0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 20px; box-shadow: 0 -10px 30px rgba(0,0,0,0.08); z-index: 1000; width: 100%; max-width: 550px; border-radius: 20px 20px 0 0;
}
.nav-item { text-align: center; text-decoration: none; color: #64748b; font-size: 11px; font-weight: 600; padding: 6px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav-item.active { background: #eef4f8; color: #0096c7; }
.nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(11, 37, 69, 0.75); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 15px; }
.modal-card { background: #ffffff; width: 100%; max-width: 540px; border-radius: 20px; padding: 24px; box-shadow: 0 25px 60px rgba(0,0,0,0.3); text-align: center; border: 1px solid #cbd5e1; max-height: 90vh; overflow-y: auto; }
.modal-grid-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; }
.preview-box-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 10px; text-align: center; }
.preview-box-title { font-size: 10px; font-weight: 700; color: #64748b; margin-bottom: 8px; text-transform: uppercase; }

/* KELAS KAMERA UNTUK KEJELASAN GAMBAR TINGGI */
.webcam-preview { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; background: #000; transform: scaleX(-1); border: 2px solid #0096c7; image-rendering: -webkit-optimize-contrast; }
#verificationMap { width: 100%; height: 180px; border-radius: 10px; border: 2px solid #cbd5e1; }

.validation-status-box { background: #eef4f8; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 14px; margin-bottom: 15px; text-align: left; font-size: 12px; font-weight: 500; }
.val-item { display: flex; align-items: center; gap: 8px; margin: 4px 0; }

.auth-body { 
    display: flex; justify-content: center; align-items: center; min-height: 100vh; 
    background: linear-gradient(rgba(70, 141, 228, 0.75), rgba(19, 64, 116, 0.85)), url('ksop.jpg') center/cover no-repeat; 
    width: 100vw; margin: 0; padding: 15px; 
}
.auth-card { background: #ffffff; padding: 30px; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); width: 100%; max-width: 500px; border-top: 6px solid #0096c7; }
.auth-card h2 { color: #0b2545; font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.auth-card p { color: #64748b; font-size: 12px; text-align: center; margin-bottom: 20px; font-weight: 500; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group-luxury { margin-bottom: 15px; text-align: left; }
.form-group-luxury label { display: block; font-size: 11px; color: #1d3557; margin-bottom: 5px; font-weight: 700; text-transform: uppercase; }
.form-group-luxury input, .form-group-luxury select, .form-group-luxury textarea {
    width: 100%; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 14px; color: #0b2545; font-size: 13px; font-weight: 500;
}
.btn-submit-luxury {
    background: #0b2545; color: white; border: none; width: 100%; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 4px 15px rgba(11,37,69,0.2); margin-top: 8px;
}
.btn-submit-luxury:hover { background: #134074; }

.light-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.light-table th { color: #64748b; font-weight: 700; padding: 12px 10px; border-bottom: 2px solid #e2e8f0; text-transform: uppercase; font-size: 10px; }
.light-table td { padding: 14px 10px; border-bottom: 1px solid #f1f5f9; color: #1d3557; font-weight: 500; }
.badge-pill { padding: 5px 12px; border-radius: 20px; font-size: 10px; font-weight: 700; display: inline-block; }
.badge-hadir { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.badge-izin { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.badge-sakit { background: #fffde7; color: #f57f17; border: 1px solid #fff9c4; }

.alert-error { background: #ffebee; color: #c62828; padding: 10px; border-radius: 8px; text-align: center; margin-bottom: 15px; font-size: 12px; font-weight: 600; }

/* TAB KATEGORI MAGANG - untuk mengelompokkan tampilan peserta & riwayat per jenis pemagangan */
.kategori-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.kategori-tab-btn {
    background: #f8fafc; border: 1px solid #cbd5e1; color: #64748b; font-size: 11px; font-weight: 700;
    padding: 8px 14px; border-radius: 50px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.3px;
    display: flex; align-items: center; gap: 6px; transition: all 0.15s ease;
}
.kategori-tab-btn .tab-count {
    background: rgba(100,116,139,0.15); color: #64748b; font-size: 9px; font-weight: 800;
    padding: 1px 6px; border-radius: 20px;
}
.kategori-tab-btn:hover { border-color: #0096c7; color: #0096c7; }
.kategori-tab-btn.active { background: #0b2545; border-color: #0b2545; color: #ffffff; }
.kategori-tab-btn.active .tab-count { background: rgba(255,255,255,0.2); color: #ffffff; }

.search-input-luxury {
    width: 100%; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px;
    padding: 10px 14px 10px 34px; color: #0b2545; font-size: 13px; font-weight: 500;
}
.search-input-wrapper { position: relative; }
.search-input-wrapper svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; stroke: #64748b; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* =========================================================
   RESPONSIVE - HALAMAN BERANDA/DASHBOARD USER (semua perangkat)
   Pendekatan mobile-first: aturan dasar di atas untuk desktop,
   lalu disesuaikan bertahap di breakpoint tablet & HP.
   ========================================================= */

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, video, iframe { max-width: 100%; }

/* Ukuran teks fluid supaya menyesuaikan lebar layar tanpa patah-patah antar breakpoint */
.header-left-group h1 { font-size: clamp(16px, 4vw, 20px); }
.time-box-large { font-size: clamp(24px, 7vw, 32px); }
.auth-card h2 { font-size: clamp(18px, 5vw, 22px); }

/* ---- Tablet & HP besar (<= 768px) ---- */
@media (max-width: 768px) {
    body.light-dashboard { padding: 14px 10px 110px 10px; }
    .main-container { max-width: 100%; }

    .top-header-luxury { padding: 18px; border-radius: 16px; gap: 14px; }
    .header-right-wrapper { width: 100%; justify-content: space-between; }
    .header-right-profile { flex: 1; min-width: 0; }
    .profile-info-text { min-width: 0; }
    .profile-name, .profile-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .absen-grid-2 { grid-template-columns: 1fr; gap: 14px; }
    .absen-card-luxury { padding: 18px; border-radius: 16px; }

    .dashboard-map-section, .card-section-luxury { padding: 16px; border-radius: 16px; }
    #dashboardMap { height: 200px; }

    .modal-card { padding: 18px; border-radius: 16px; }
    .modal-grid-preview { gap: 10px; }
    .webcam-preview, #verificationMap { height: 150px; }

    .bottom-nav-bar { max-width: 100%; padding: 8px 12px; border-radius: 16px 16px 0 0; }
}

/* ---- HP kecil (<= 480px) ---- */
@media (max-width: 480px) {
    body.light-dashboard { padding: 10px 8px 105px 8px; }

    .top-header-luxury { padding: 14px; gap: 10px; }
    .header-left-group p { font-size: 10px; }
    .header-clock-live { font-size: 11px; padding: 3px 8px; }

    .header-right-profile { padding: 5px 10px 5px 5px; gap: 8px; }
    .profile-avatar-img { width: 30px; height: 30px; }
    .profile-role { display: none; } /* hemat ruang, nama tetap terlihat */

    .btn-header-logout { padding: 8px 10px; }
    .btn-header-logout span { display: none; } /* ikon saja di layar sangat sempit */

    .absen-card-luxury { padding: 14px; }
    .btn-luxury-action { font-size: 12px; padding: 11px; }

    .modal-grid-preview { grid-template-columns: 1fr; }
    .webcam-preview, #verificationMap { height: 170px; }
    .modal-card { padding: 14px; }

    .card-section-luxury h3 { font-size: 14px; }
    .form-group-luxury textarea, .form-group-luxury input, .form-group-luxury select { font-size: 12px; padding: 9px 12px; }

    .nav-item { font-size: 10px; }
    .nav-item svg { width: 18px; height: 18px; }
}

/* ---- HP sangat kecil / lipat (<= 340px) ---- */
@media (max-width: 340px) {
    .header-left-group h1 { font-size: 15px; }
    .time-box-large { font-size: 22px; }
    #dashboardMap { height: 170px; }
    .webcam-preview, #verificationMap { height: 140px; }
}

/* ---- Tablet besar & layar lebar (>= 900px) : beri sedikit lagi ruang napas ---- */
@media (min-width: 900px) {
    .main-container { max-width: 900px; }
    #dashboardMap { height: 280px; }
}

/* =========================================================
   RESPONSIVE - HALAMAN LOGIN & REGISTER (.auth-body/.auth-card)
   ========================================================= */

.auth-body { padding: 30px 15px; }

@media (max-width: 600px) {
    .auth-body { padding: 20px 12px; align-items: flex-start; }
    .auth-card { margin-top: 14px; padding: 22px 18px; border-radius: 16px; }
}

@media (max-width: 480px) {
    .auth-body { padding: 14px 8px; }
    .auth-card { padding: 18px 14px; border-radius: 14px; border-top-width: 4px; }
    .auth-card p { font-size: 12px; margin-bottom: 14px; }

    /* Dua kolom form (mis. Nama Depan/Belakang) ditumpuk jadi satu kolom agar tidak sempit */
    .form-grid-2 { grid-template-columns: 1fr; gap: 10px; }

    .form-group-luxury { margin-bottom: 11px; }
    .form-group-luxury label { font-size: 10px; margin-bottom: 4px; }
    /* Font input dijaga 16px (batas minimum) agar Safari iOS tidak auto-zoom saat fokus, tapi padding dipadatkan */
    .form-group-luxury input,
    .form-group-luxury select,
    .form-group-luxury textarea { font-size: 16px; padding: 10px 12px; border-radius: 9px; }

    .btn-submit-luxury { font-size: 14px; padding: 11px; margin-top: 4px; }
}

@media (max-width: 340px) {
    .auth-card { padding: 16px 12px; }
    .auth-card h2 { font-size: 16px; }
}