/* ===== Tema hijau natural — Absensi Kerja Pertamanan ===== */
:root {
    --bg: #F2F7F0;
    --ink: #14322B;
    --muted: #5C7A70;
    --pri1: #059669;
    --pri2: #10B981;
    --pri3: #0D9488;
    --amber: #D97706;
    --rose: #E11D48;
    --sky: #0369A1;
    --violet: #7C3AED;
    --card: rgba(255, 255, 255, 0.62);
    --border: rgba(255, 255, 255, 0.7);
    --shadow: 0 12px 32px rgba(18, 75, 55, 0.14);
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Elemen dengan atribut hidden WAJIB disembunyikan — mencegah modal/lightbox tampil
   meskipun rule lain (mis. .modal/.lb display:flex) mencoba menimpa. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(900px 560px at 88% -12%, rgba(52, 211, 153, 0.30), transparent 60%),
        radial-gradient(760px 520px at -12% 22%, rgba(163, 230, 53, 0.16), transparent 60%),
        radial-gradient(640px 520px at 52% 112%, rgba(45, 212, 191, 0.20), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.55;
}
.bgblobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

a { color: var(--pri3); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ===== Nav grup & submenu (base) ===== */
.nav-group { position: relative; }
.nav-group-btn {
    list-style: none; cursor: pointer;
    padding: 10px 14px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(20, 50, 43, 0.12);
    font: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.nav-group-btn::-webkit-details-marker { display: none; }
.nav-group-btn::marker { content: ''; display: none; }
.nav-group-btn:hover { background: #fff; box-shadow: 0 4px 14px rgba(18, 75, 55, 0.14); }
.nav-group-btn:active { transform: scale(0.97); }
.nav-group.on > .nav-group-btn {
    background: linear-gradient(135deg, var(--pri1), var(--pri2));
    color: #fff; border-color: transparent;
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.32);
}
.caret { font-size: 11px; transition: transform .2s ease; opacity: .8; }
.nav-group[open] > .nav-group-btn .caret { transform: rotate(180deg); }
.nav-group-menu {
    display: none;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(20, 50, 43, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(10, 40, 30, 0.22);
    padding: 8px;
}
.nav-group[open] > .nav-group-menu { display: flex; flex-direction: column; gap: 3px; }
.nav-group.open > .nav-group-menu { display: flex; flex-direction: column; gap: 3px; }
/* Dropdown tombol (Spreadsheet dll) — <details> native, tampil menarik di semua mode */
.dd-btn { position: relative; display: inline-block; }
.dd-btn summary {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--rose), #F43F5E);
    color: #fff; font-weight: 700; font-size: 15px;
    padding: 12px 20px; border: 0; border-radius: 12px;
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.25);
}
.dd-btn summary::-webkit-details-marker { display: none; }
.dd-btn summary::marker { content: ''; }
.dd-btn summary:hover { filter: brightness(1.05); }
.dd-btn .dd-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 320;
    min-width: 240px; background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px); border: 1px solid rgba(20,50,43,0.12);
    border-radius: 14px; box-shadow: 0 18px 44px rgba(10,40,30,0.22); padding: 8px;
}
.dd-btn[open] .dd-menu { display: flex; flex-direction: column; gap: 3px; }
.nav-more-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 10px; color: var(--ink);
    font-weight: 600; font-size: 13.5px; text-decoration: none;
    transition: background .12s ease, transform .1s ease;
}
.nav-more-item:hover { background: rgba(5, 150, 105, 0.08); transform: translateX(2px); text-decoration: none; }
.nav-more-item.on {
    background: linear-gradient(135deg, var(--pri1), var(--pri2));
    color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}
.nav-more-item .nav-badge { margin-left: auto; }

/* ===== Topbar desktop: 3 baris (Logo / Menu / Profil-Nama-Notif-Keluar) ===== */
@media (min-width: 901px) {
    .topbar-in {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 14px 22px 12px;
    }
    /* Baris 1: logo aplikasi (di tengah) */
    .brand { justify-content: center; }
    .brand-logo { height: 46px; }
    .brand span { display: none; }
    /* Baris 2: menu (grup + submenu) */
    .nav-row {
        display: flex; align-items: center; justify-content: center; gap: 4px;
        width: 100%;
    }
    .nav { gap: 2px; flex-wrap: nowrap; justify-content: center; }
    .nav-link { padding: 9px 12px; font-size: 13px; white-space: nowrap; }
    .nav-group { flex-shrink: 0; }
    .nav-group-btn { font-size: 13px; padding: 10px 14px; }
    .nav-group-menu { position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 8px); min-width: 240px; z-index: 300; }
    .nav-profile-mobile { display: none; }
    /* Baris 3: profil, nama, notifikasi, keluar */
    .top-user { gap: 12px; justify-content: center; }
    .top-profile { font-size: 16px; padding: 9px 12px; }
    .top-name { font-weight: 700; font-size: 14px; max-width: none; }
    .top-user .chip { font-size: 11.5px; padding: 4px 9px; }
}

/* ===== Notifikasi (bell) ===== */
.notif-bell { position: relative; }
.bell-btn { position: relative; font-size: 16px; }
.bell-badge {
    position: absolute; top: -4px; right: -6px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--rose); color: #fff; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.notif-drop {
    position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, 90vw);
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(20px);
    border: 1px solid rgba(20, 50, 43, 0.12); border-radius: 14px;
    box-shadow: 0 18px 44px rgba(10, 40, 30, 0.2); z-index: 300; overflow: hidden;
}
.notif-drop-h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px dashed rgba(20, 50, 43, 0.12);
}
.notif-drop-h a { font-size: 13px; font-weight: 700; }
.notif-drop-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.notif-drop-f { padding: 8px 10px; border-top: 1px dashed rgba(20, 50, 43, 0.12); }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
    display: flex; gap: 10px; background: rgba(255, 255, 255, 0.55);
    border-radius: 12px; padding: 10px 12px; border: 1px solid rgba(20, 50, 43, 0.06);
}
.notif-item.unread { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.25); }
.notif-foto { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.notif-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif-body b { font-size: 13.5px; }
.notif-body p { font-size: 12.5px; color: var(--muted); }
.notif-body .btn { align-self: flex-start; }

/* ===== Bulk action ===== */
.bulk-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 14px; padding: 12px 14px;
    background: rgba(5, 150, 105, 0.06); border-radius: 12px;
    border: 1px dashed rgba(5, 150, 105, 0.3);
}
.bulk-bar select { width: auto; min-width: 180px; }

/* ===== Profil ===== */
.profil-avatar {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden; margin-bottom: 14px;
    background: linear-gradient(135deg, var(--pri1), var(--pri2));
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #fff; box-shadow: 0 6px 16px rgba(18, 75, 55, 0.2);
}
.profil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profil-avatar .avatar-initial { color: #fff; font-weight: 800; font-size: 40px; }

/* ===== Preview sebagai pekerja ===== */
.preview-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: linear-gradient(135deg, #B45309, #D97706); color: #fff;
    padding: 10px 20px; font-size: 14px; font-weight: 600;
}
.preview-bar .btn { box-shadow: none; background: #fff; color: #B45309; }

/* ===== Topbar ===== */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.75);
}
.topbar-in { display: flex; align-items: center; gap: 22px; padding: 12px 20px; flex-wrap: wrap; }
/* ===== Logo & brand ===== */
.brand { font-weight: 800; font-size: 17px; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-logo { height: 34px; width: auto; border-radius: 8px; }
.brand:hover { text-decoration: none; }

/* ===== Login ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-wrap { width: min(440px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card { padding: 34px 32px; }
.login-brand { text-align: center; }
.login-brand img { height: 96px; width: auto; border-radius: 16px; box-shadow: 0 10px 26px rgba(18, 75, 55, 0.18); }
.login-title { text-align: center; font-size: 21px; font-weight: 800; margin-top: 14px; line-height: 1.35; }
.login-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 20px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12.5px; }
.login-reg { text-align: center; margin-top: 14px; font-size: 14px; }
.login-closed { text-align: center; padding: 12px 0 18px; }
.login-closed .qi { font-size: 40px; display: block; margin-bottom: 8px; }
.login-closed p { margin-bottom: 6px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-link {
    padding: 9px 14px; border-radius: 12px; color: var(--muted);
    font-weight: 600; font-size: 14px; position: relative;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink); text-decoration: none; }
.nav-link.on {
    background: linear-gradient(135deg, var(--pri1), var(--pri2));
    color: #fff; box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
    border-radius: 999px; background: var(--rose); color: #fff; font-size: 11px; font-weight: 700;
}
.top-user { display: flex; align-items: center; gap: 10px; }
.top-name { font-weight: 700; font-size: 14px; }

/* ===== Layout utama ===== */
.main { padding: 30px 20px 60px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); margin-top: 4px; font-size: 15px; }

/* ===== Grid & kartu ===== */
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    background: var(--card);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-h {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 16px 22px; border-bottom: 1px dashed rgba(20, 50, 43, 0.12);
}
.card-h h2 { font-size: 16px; font-weight: 800; }
.card-b { padding: 22px; }
.sub-h { font-size: 14px; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== Statistik ===== */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.st-ok b { color: var(--pri1); }
.st-warn b { color: var(--amber); }
.st-bad b { color: var(--rose); }
.st-grey b { color: var(--muted); }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-row .stat { flex: 1; min-width: 140px; padding: 14px; background: rgba(255, 255, 255, 0.55); border-radius: 14px; }
.stat-row .stat b { font-size: 18px; }
.stat-row .stat span { font-size: 12px; }

/* ===== Tombol ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, var(--pri1), var(--pri2));
    color: #fff; font-weight: 700; font-size: 15px;
    padding: 12px 20px; border: 0; border-radius: 12px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.30);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(5, 150, 105, 0.35); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; box-shadow: none; }
.btn-big { padding: 15px 20px; font-size: 16px; }
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: rgba(255, 255, 255, 0.75); color: var(--ink); font-weight: 600; font-size: 14px;
    padding: 10px 16px; border: 1px solid rgba(20, 50, 43, 0.14); border-radius: 11px; cursor: pointer;
    transition: background .12s ease;
    text-decoration: none;
}
.btn-ghost:hover { background: #fff; text-decoration: none; }
.btn-danger { background: linear-gradient(135deg, #E11D48, #F43F5E); box-shadow: 0 8px 20px rgba(225, 29, 72, 0.25); }

/* ===== Form ===== */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .capture-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(20, 50, 43, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    font: inherit; color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--pri2);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    background: #fff;
}
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.check input { width: auto; }

/* ===== Chip status ===== */
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.st-belm, .st-belum { background: #E8EDEB; color: #55655F; }
.st-hadir, .req-ok { background: #D6F5E6; color: #067A50; }
.st-terlambat { background: #FDEBC8; color: #B45309; }
.st-alpa, .req-no { background: #FDE0E5; color: #BE123C; }
.st-cuti { background: #DCEEFB; color: #075985; }
.st-izin { background: #EDE4FA; color: #6D28D9; }
.st-sakit { background: #FFE8D1; color: #C2410C; }
.st-libur { background: #D4F2F0; color: #0F766E; }
.st-piket { background: #E0F2FE; color: #0369A1; }
.mat-piket { background: #BAE6FD; color: #075985; }
.req-pending { background: #FDF3D1; color: #A16207; }
.role-admin { background: #FDEBD4; color: #B45309; }
.role-supervisor { background: #D9EBFA; color: #075985; }
.role-pekerja { background: #D6F5E6; color: #067A50; }
.sesi-pagi { background: #FEF3C7; color: #B45309; }
.sesi-siang { background: #FFE9D1; color: #C2410C; }
.sesi-piket { background: #E0F2FE; color: #0369A1; }

/* ===== Alert ===== */
.alert {
    padding: 14px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
    border: 1px solid rgba(20, 50, 43, 0.08);
}
.alert-ok { background: #D6F5E6; color: #067A50; }
.alert-bad { background: #FDE0E5; color: #BE123C; }

/* ===== Tabel ===== */
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
    text-align: left; padding: 10px 14px; color: var(--muted);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(20, 50, 43, 0.12);
    white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid rgba(20, 50, 43, 0.08); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255, 255, 255, 0.4); }
.muted { color: var(--muted); font-size: 13px; }

/* ===== Hero & quick ===== */
.hero {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.16), rgba(16, 185, 129, 0.10));
    border: 1px solid var(--border); border-radius: 18px;
    padding: 26px 28px; box-shadow: var(--shadow);
}
.hero-greet h1 { font-size: 24px; font-weight: 800; }
.hero-greet p { color: var(--muted); margin-top: 4px; }
.hero-status { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.hero-status p { font-size: 14px; }
.quick { padding: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.quick:hover { text-decoration: none; transform: translateY(-2px); }
.quick .qi { font-size: 26px; }
.quick b { font-size: 15px; }
.quick small { color: var(--muted); font-size: 12.5px; }
.mini-link { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.mini-link:hover { text-decoration: none; }
.mini-link b { font-size: 15px; }
.mini-link span { color: var(--muted); font-size: 13px; }

/* ===== Capture foto ===== */
.capture { display: flex; flex-direction: column; gap: 8px; }
.capture-col { display: flex; flex-direction: column; gap: 16px; }
.capture-preview {
    width: 100%; aspect-ratio: 4 / 3;
    border: 2px dashed rgba(20, 50, 43, 0.2);
    border-radius: 14px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.55);
}
.capture-preview .ph { color: var(--muted); font-size: 13px; }
.capture-preview img { width: 100%; height: 100%; object-fit: cover; }
.capture-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== GPS ===== */
.gps-box { display: flex; flex-direction: column; gap: 8px; }
.gps-status { font-size: 13px; color: var(--muted); }
.gps-status.ok { color: var(--pri1); font-weight: 700; }
.gps-status.warn { color: var(--amber); font-weight: 700; }
.gps-status.err { color: var(--rose); }
.gps-manual { display: flex; gap: 10px; }
.gps-manual input { flex: 1; font-size: 13px; }

/* ===== Info / aturan ===== */
.info-rule {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(20, 50, 43, 0.1);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
    font-size: 13.5px;
}
.info-rule p + p { margin-top: 6px; }
.done-msg { font-weight: 700; color: var(--pri1); margin-top: 10px; }

/* ===== Absen now ===== */
.absen-now { display: flex; flex-direction: column; margin-bottom: 16px; }
.absen-now-row {
    display: flex; align-items: center; gap: 14px; padding: 9px 0;
    border-bottom: 1px dashed rgba(20, 50, 43, 0.1);
    font-size: 14px;
}
.absen-now-row span { color: var(--muted); width: 150px; flex-shrink: 0; }
.absen-now-row b { font-weight: 700; }

/* ===== Libur list ===== */
.libur-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.libur-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.55); border-radius: 12px; padding: 12px 16px;
}
.libur-item .muted { display: block; }

/* ===== Laporan ===== */
.lapor-list { display: flex; flex-direction: column; gap: 14px; }
.lapor-item {
    background: rgba(255, 255, 255, 0.55); border-radius: 14px; padding: 16px;
    position: relative;
}
.lapor-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lapor-top .muted { margin-left: auto; }
.lapor-desc { font-size: 14px; margin-bottom: 10px; }
.lapor-del { position: absolute; top: 12px; right: 12px; }

/* ===== Foto ===== */
.img-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.img-grid-1 { grid-template-columns: repeat(1, minmax(0, 200px)); }
.img-grid-2 { grid-template-columns: repeat(2, minmax(0, 120px)); }
.img-grid-3 { grid-template-columns: repeat(3, minmax(0, 180px)); }
.img-grid-4 { grid-template-columns: repeat(4, minmax(0, 120px)); }
@media (max-width: 680px) { .img-grid-4 { grid-template-columns: repeat(2, minmax(0, 110px)); } }
.thumb {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: 10px; cursor: zoom-in;
    box-shadow: 0 4px 12px rgba(18, 75, 55, 0.12);
}

/* ===== Modal & lightbox ===== */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(10, 40, 30, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-c {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 18px; padding: 20px;
    width: min(440px, 94vw);
    max-height: 92vh; overflow-y: auto;
    box-shadow: var(--shadow);
}
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-h h3 { font-size: 17px; font-weight: 800; }
.cam-view { border-radius: 14px; overflow: hidden; background: #0A1F18; margin-bottom: 14px; }
.cam-view video, .cam-view canvas, .cam-view img { width: 100%; display: block; }
.cam-view img { object-fit: contain; }
.cam-msg { padding: 24px; text-align: center; color: #fff; font-size: 14px; }
.cam-actions { display: flex; flex-direction: column; gap: 8px; }
.lb {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(5, 20, 15, 0.88);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lb img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lb-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255, 255, 255, 0.15); color: #fff; border: 0;
    width: 42px; height: 42px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ===== Matriks Absensi Bulanan (PJLP) ===== */
.mat-tbl th { padding: 6px 4px; text-align: center; }
.mat-tbl .mat-tgl { min-width: 30px; font-size: 11px; }
.mat-tbl .mat-total { min-width: 90px; white-space: nowrap; }
.mat-idp { font-weight: 800; color: var(--pri1); vertical-align: middle; text-align: center; }
.mat-sel {
    min-width: 34px; text-align: center; font-weight: 700; font-size: 11.5px;
    border: 1px solid rgba(255, 255, 255, 0.6); cursor: default;
}
.mat-hadir { background: #A7E3C1; color: #065F46; }
.mat-terlambat { background: #FDE68A; color: #92400E; }
.mat-libur { background: #A5D8F3; color: #075985; }
.mat-tukar { background: #4FB8C9; color: #fff; }
.mat-cuti { background: #C9B8F0; color: #5B21B6; }
.mat-alpa { background: #F3A9B8; color: #881337; }
.mat-sakit { background: #FFC39A; color: #9A3412; }
.mat-izin { background: #D8DDE3; color: #475569; }
.mat-kosong { background: transparent; }
.mat-belm, .mat-belum { background: transparent; }

/* ===== Kalender absensi ===== */
.kal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.kal-head { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.kal-sel {
    border-radius: 10px; padding: 6px 4px; text-align: center;
    background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(20, 50, 43, 0.06);
    min-height: 46px; display: flex; flex-direction: column; gap: 2px; justify-content: center;
}
.kal-sel .kal-tgl { font-weight: 800; font-size: 14px; }
.kal-sel .kal-st { font-size: 10px; font-weight: 700; color: var(--muted); }
.kal-sel.st-hadir { background: #D6F5E6; border-color: rgba(6, 122, 80, .25); }
.kal-sel.st-terlambat { background: #FDEBC8; border-color: rgba(180, 83, 9, .25); }
.kal-sel.st-alpa { background: #FDE0E5; border-color: rgba(190, 18, 60, .25); }
.kal-sel.st-cuti { background: #DCEEFB; border-color: rgba(7, 89, 133, .25); }
.kal-sel.st-izin { background: #EDE4FA; border-color: rgba(109, 40, 217, .25); }
.kal-sel.st-sakit { background: #FFE8D1; border-color: rgba(194, 65, 12, .25); }
.kal-sel.st-libur { background: #D4F2F0; border-color: rgba(15, 118, 110, .25); }
.kal-sel.st-belm, .kal-sel.st-belum { background: #E8EDEB; }
.kal-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; font-size: 12px; font-weight: 600; }
.kal-legend .dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ===== Tim kerja (Tim Toping) ===== */
.tim-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tim-item {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(20, 50, 43, 0.1);
    border-radius: 10px; padding: 8px 12px; font-size: 13.5px; cursor: pointer;
}
.tim-item:hover { background: rgba(5, 150, 105, 0.06); }
.tim-item input { width: auto; }

/* ===== Pengumuman ===== */
.pengumuman-list { display: flex; flex-direction: column; gap: 10px; }
.pengumuman-item {
    background: rgba(255, 255, 255, 0.55); border-radius: 12px; padding: 12px 16px;
    display: flex; flex-direction: column; gap: 2px;
    border-left: 4px solid var(--pri1);
}
.pengumuman-item .muted { font-size: 12px; }
.pengumuman-item p { font-size: 13.5px; margin-top: 4px; }

/* ===== Presensi pekerja lain (dashboard) ===== */
.presensi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.presensi-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255, 255, 255, 0.55); border-radius: 14px; padding: 12px 14px;
}
.avatar {
    width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: linear-gradient(135deg, var(--pri1), var(--pri2));
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; box-shadow: 0 4px 10px rgba(18, 75, 55, 0.18);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.avatar-initial { color: #fff; font-weight: 800; font-size: 20px; }
.presensi-info { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.presensi-info b { font-size: 14px; }
.presensi-info .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presensi-nama { color: var(--ink); text-decoration: none; }
.presensi-nama:hover { color: var(--pri1); text-decoration: underline; }
.chart-wrap { position: relative; height: 230px; }

/* ===== Saldo cuti ===== */
.cuti-saldo { margin-bottom: 20px; }
.cuti-saldo-in {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 18px 22px; background: linear-gradient(135deg, rgba(5, 150, 105, 0.14), rgba(16, 185, 129, 0.08));
    border-radius: 14px;
}
.cuti-saldo-in .qi { font-size: 30px; }
.cuti-saldo-in b { font-size: 17px; }
.cuti-saldo-in .muted { display: block; font-size: 13px; }
.cuti-saldo-in .chip { margin-left: auto; }

/* ===== Laporan: lokasi ===== */
.lapor-loc { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ===== Peta live ===== */
#live-map { z-index: 1; }
.live-icon { background: transparent; border: 0; }
.map-legend {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    margin-top: 12px; padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(20, 50, 43, 0.1);
    border-radius: 12px; font-size: 12.5px; font-weight: 600;
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-item .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); display: inline-block; }
.live-dot {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 15px;
    border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.live-dot span { line-height: 1; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
    padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
    background: rgba(255, 255, 255, 0.6); color: var(--muted);
    border: 1px solid rgba(20, 50, 43, 0.1);
}
.tab.on { background: linear-gradient(135deg, var(--pri1), var(--pri2)); color: #fff; box-shadow: 0 6px 16px rgba(5, 150, 105, 0.3); }
.tab:hover { text-decoration: none; }

/* ===== Permintaan (persetujuan) ===== */
.req-card { margin-bottom: 0; }
.req-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.req-body { margin: 10px 0 14px; font-size: 14.5px; }
.req-actions { display: flex; gap: 10px; }

/* ===== Filter bar ===== */
.filter-bar { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; padding: 18px 22px; }
.filter-bar .field { min-width: 170px; flex: 1; }
.filter-bar .btn { align-self: flex-end; }

/* ===== Daftar pekerja (admin) ===== */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input[type="search"] { width: 240px; }
.toolbar select { width: auto; min-width: 170px; }
.tbl-workers td { vertical-align: middle; }
.tbl-workers td b { display: block; }
.col-aksi { white-space: nowrap; }
.row-aksi { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-wide { width: min(560px, 94vw); }
.grid.cols-3 { gap: 14px; }

/* ===== Kategori pekerja ===== */
.job-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.job-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(20, 50, 43, 0.12);
    border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.job-chip em { font-style: normal; font-weight: 700; color: var(--violet); font-size: 11px; }
.job-chip form.inline { display: inline-flex; }
.job-btn {
    border: 0; background: rgba(20, 50, 43, 0.06); border-radius: 50%;
    width: 22px; height: 22px; font-size: 11px; cursor: pointer; color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
}
.job-btn:hover { background: rgba(225, 29, 72, 0.12); color: var(--rose); }
.job-add { margin-top: 6px; border-top: 1px dashed rgba(20, 50, 43, 0.14); padding-top: 14px; }
.job-add .grid { align-items: end; }

/* ===== Empty ===== */
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }

/* ===== Footer ===== */
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 20px 34px; }

/* ===== Tombol hamburger (menu mobile) ===== */
.hamburger {
    display: none;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 46px; height: 46px; padding: 12px; border: 0; border-radius: 12px;
    background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(20, 50, 43, 0.12);
    cursor: pointer; flex-shrink: 0;
}
.hamburger span {
    display: block; width: 100%; height: 3px; border-radius: 3px;
    background: var(--ink); transition: transform .22s ease, opacity .18s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== Print-ready (laporan) ===== */
@media print {
    body { background: #fff !important; }
    .topbar, .hamburger, .notif-bell, .bgblobs, .foot, .btn, .filter-bar, .page-head .btn { display: none !important; }
    .main { padding: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ccc; backdrop-filter: none; background: #fff; break-inside: avoid; }
    .wrap { max-width: none; padding: 0; }
    .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .chip, .kal-sel, .stat { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Popup notifikasi mobile: full-width di bawah header agar selalu terbaca
       (bukan mengikuti posisi bell yang bisa membuatnya terpotong di kiri). */
    .notif-drop {
        position: fixed;
        left: 10px; right: 10px; top: 62px;
        width: auto; max-width: none; min-width: 0;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    /* Nav jadi drawer yang muncul dari hamburger */
    .topbar-in { gap: 8px; padding: 10px 14px; }
    .nav-row { display: contents; } /* di mobile, wadah baris menu tidak mengganggu drawer */
    .nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; gap: 6px;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(22px) saturate(1.5);
        -webkit-backdrop-filter: blur(22px) saturate(1.5);
        border-bottom: 1px solid rgba(20, 50, 43, 0.1);
        box-shadow: 0 18px 40px rgba(10, 40, 30, 0.18);
        padding: 12px 14px 16px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 120;
    }
    .nav.open { display: flex; }
    .nav-link {
        width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 700;
        border-radius: 12px; white-space: normal;
    }
    .nav-link .nav-badge { position: static; margin-left: 8px; }
    /* Grup nav di mobile = accordion (details native) */
    .nav-group { width: 100%; }
    .nav-group-btn {
        width: 100%; padding: 14px 16px; font-size: 16px;
        border-radius: 12px; background: rgba(255, 255, 255, 0.55);
        display: flex; align-items: center; justify-content: space-between;
    }
    .nav-group-btn:hover { background: rgba(255, 255, 255, 0.85); box-shadow: none; }
    .nav-group.on > .nav-group-btn { background: linear-gradient(135deg, var(--pri1), var(--pri2)); color: #fff; }
    .nav-group-menu {
        position: static; left: auto; transform: none; box-shadow: none; border: 0;
        background: transparent; padding: 4px 0 4px 8px; min-width: 0;
    }
    .nav-more-item {
        width: 100%; padding: 13px 16px; font-size: 15px;
        background: rgba(255, 255, 255, 0.5);
    }
    .nav-more-item:hover { transform: none; }
    .nav-profile-mobile { display: block; } /* profil tampil di drawer mobile */
    .hamburger { display: inline-flex; }
    .top-name { display: none; }
    .top-user .chip { display: none; }
    .top-profile { display: none; }
}
@media (max-width: 680px) {
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
    .hero { flex-direction: column; align-items: flex-start; }
    .hero-status { align-items: flex-start; }
    .main { padding: 20px 14px 48px; }
    .card-b { padding: 16px; }
    .absen-now-row span { width: 110px; }
    .img-grid-2, .img-grid-3 { grid-template-columns: repeat(2, minmax(0, 120px)); }
}
@media (max-width: 480px) {
    .brand span { display: none; }
    .top-user .btn-ghost.btn-sm { padding: 9px 12px; font-size: 13px; }
}
