:root {
    /* Palet kustom: indigo #03006B sebagai primer, hijau #1D8757 sebagai aksen */
    --primary: #03006B;
    --primary-dark: #020049;
    --hijau: #1D8757;
    --hijau-dark: #004C1E;
    --accent: #FF6B00;
    --navy: #1B3A7C;
    --indigo: #03006B;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray: #64748B;
    --bg: #F1F5F9;
    --card: #FFFFFF;
    --radius: 16px;
    --shadow-card: 0 4px 14px rgba(15, 23, 42, .08);
    --border-input: #CBD5E1;
    --border-input-hover: #94A3B8;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: #0F172A;
}

h1, h2, h3, h4, h5 { font-weight: 600; }

/* ===== Bootstrap overrides ===== */
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); }

.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

/* Bentuk form mengikuti tema Pulse; border dipertegas & warna fokus disesuaikan ke brand */
.form-control, .form-select {
    border-color: var(--border-input);
    border-width: 1.5px;
}
.form-control:hover, .form-select:hover { border-color: var(--border-input-hover); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(3, 0, 107, .15); }

.badge { border-radius: 999px; font-weight: 500; padding: .35em .8em; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; color: #fff !important; }
.bg-danger  { background-color: var(--danger) !important; }
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }

/* Pulse menyetel list-group hampir hitam (#17141F) berteks putih; kembalikan ke terang */
.list-group {
    --bs-list-group-bg: #fff;
    --bs-list-group-color: #0F172A;
    --bs-list-group-border-color: #F1F5F9;
}
.list-group-item { color: #0F172A; }
/* Pulse memaksa teks putih saat hover/focus (untuk latar gelap aslinya) */
.list-group-item:hover,
.list-group-item:focus { color: #0F172A; }

.navbar { box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.navbar-brand { font-weight: 600; color: var(--primary) !important; }

/* ===== Dashboard admin ===== */
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    box-shadow: var(--shadow-card);
}
.stat-label { font-size: .78rem; color: var(--gray); }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; color: #0F172A; }
.stat-sub { font-size: .72rem; color: var(--gray); }
.stat-ikon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
/* Kotak ikon: warna solid, ikon putih */
.stat-biru { background: var(--navy); color: #fff; }
.stat-hijau { background: #16A34A; color: #fff; }
.stat-oranye { background: var(--warning); color: #fff; }
.stat-merah { background: var(--danger); color: #fff; }

/* Latar kartu statistik: tint per status, angka tetap gelap */
.stat-card-biru { background: #B3C2E6; border: 1px solid #8FA6D9; }
.stat-card-hijau { background: #86EFAC; border: 1px solid #4ADE80; }
.stat-card-oranye { background: #FCD34D; border: 1px solid #FBBF24; }
.stat-card-merah { background: #FECACA; border: 1px solid #FCA5A5; }

/* Di atas latar sepekat itu, teks pendukung ikut digelapkan agar tetap terbaca */
.stat-card .stat-label,
.stat-card .stat-sub { color: rgba(15, 23, 42, .7); }

.seksi-judul {
    display: flex;
    align-items: center;
    font-size: 1rem;
    margin-bottom: .75rem;
}
.seksi-judul .bi { color: var(--gray); }

.avatar-inisial {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #D1F0DF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== Sidebar admin ===== */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 250px;
    /* !important: Bootstrap .offcanvas-lg memaksa background transparan di >=992px */
    /* Gradien indigo -> navy: selaras dengan primary tanpa menyamainya persis */
    background: linear-gradient(180deg, var(--indigo), var(--navy)) !important;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width .25s ease;
}
.admin-sidebar hr { border-color: rgba(255, 255, 255, .15); opacity: 1; }
.admin-sidebar .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.admin-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}
.admin-brand .bi { color: #FFC20E; } /* emas, mengikuti matahari logo */
/* Chevron menempel di tepi kanan sidebar (gaya CodingLab) */
.sidebar-toggle {
    position: absolute;
    top: 22px;
    right: -13px;
    z-index: 10;
    width: 26px; height: 26px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--indigo);
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    border: 2px solid var(--indigo);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .25);
}
.sidebar-toggle i { transition: transform .25s ease; }
.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: rgba(255, 255, 255, .72);
    border-radius: 10px;
    padding: .55rem .8rem;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    transition: background .2s ease, color .2s ease;
}
.admin-sidebar .teks { transition: opacity .2s ease; }

/* Label grup menu sidebar */
.admin-sidebar .grup-label {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255, 255, 255, .45);
    padding: .85rem .75rem .15rem;
    user-select: none;
}

/* Mode ciut (ikon saja) — hanya berlaku di desktop */
@media (min-width: 992px) {
    .admin-sidebar.sidebar-ciut { width: 78px; }
    .admin-sidebar.sidebar-ciut .teks { opacity: 0; width: 0; }
    .admin-sidebar.sidebar-ciut .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
    .admin-sidebar.sidebar-ciut .sidebar-header { justify-content: center; }
    .admin-sidebar.sidebar-ciut .sidebar-toggle i { transform: rotate(180deg); }
    .admin-sidebar.sidebar-ciut .admin-brand .bi { font-size: 1.3rem; }
    /* Saat ciut, label grup berubah jadi garis pemisah tipis */
    .admin-sidebar.sidebar-ciut .grup-label {
        padding: 0;
        margin: .5rem .9rem;
        height: 1px;
        background: rgba(255, 255, 255, .18);
    }
    .admin-sidebar.sidebar-ciut .grup-label span { display: none; }
}
.admin-sidebar .nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-sidebar .nav-link.active {
    /* Pil putih dengan teks indigo: kontras kuat tanpa warna baru */
    background: #fff;
    color: var(--indigo);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(2, 0, 73, .35);
}
.admin-sidebar .nav-link.active:hover { background: #E9EFF6; color: var(--indigo); }
.admin-sidebar .nav-link.keluar { color: #F87171; background: transparent; }
.admin-sidebar .nav-link.keluar:hover { background: rgba(239, 68, 68, .15); color: #FCA5A5; }
.admin-sidebar .nav-link i { font-size: 1.05rem; }
.admin-content { flex: 1; min-width: 0; background: #E9EFF6; }
.admin-content .card,
.admin-content .table-responsive,
.admin-content .alert { background-clip: padding-box; }

/* ===== Tabel admin ===== */
.admin-content .table {
    --bs-table-striped-bg: transparent; /* stripes diganti hover */
    background: #fff;
    box-shadow: var(--shadow-card);
    margin-bottom: 0;
}
/* Dropdown filter departemen butuh lebar minimum agar teks tidak terpotong */
.admin-content select[name="departemenId"]:not(.w-100) { min-width: 190px; width: auto; }

/* Area admin: tanpa sudut membulat (tampilan karyawan tetap membulat) */
.admin-content .card,
.admin-content .stat-card,
.admin-content .alert,
.admin-content .list-group { border-radius: 0; }
.admin-content .table thead th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #fff;
    background: var(--primary);
    border-bottom: 0;
    padding: .7rem .85rem;
    white-space: nowrap;
}
.admin-content .table tbody td {
    padding: .65rem .85rem;
    border-color: #F1F5F9;
    vertical-align: middle;
}
.admin-content .table tbody tr:last-child td { border-bottom: 0; }
.admin-content .table tbody tr:hover td { background: #F8FAFC; }
.admin-content .table img.rounded { border-radius: 10px !important; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
@media (min-width: 992px) {
    .admin-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow: visible; /* agar chevron di tepi tidak terpotong */
    }
    .admin-sidebar .sidebar-body { overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .admin-sidebar { width: 260px; }
}

/* ===== Splash screen ===== */
.splash {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: linear-gradient(160deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: opacity .4s ease;
}
.splash.splash-hilang { opacity: 0; pointer-events: none; }
.splash-logo {
    width: 88px; height: 88px;
    background: #fff;
    color: var(--primary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
    margin-bottom: 1rem;
}
.splash-nama { font-size: 1.4rem; font-weight: 700; }
.splash-sub { font-size: .85rem; opacity: .85; }
.splash-spinner {
    width: 32px; height: 32px;
    margin-top: 2.5rem;
    border: 3px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: splash-putar .8s linear infinite;
}
@keyframes splash-putar { to { transform: rotate(360deg); } }

/* Sembunyikan kotak ringkasan validasi saat tidak ada error */
.validation-summary-valid { display: none; }

/* ===== Halaman login ===== */
.login-wrap {
    min-height: calc(100vh - 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}
/* Latar gradasi lembut satu layar penuh mengikuti mockup ui/login.png */
.login-wrap::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(160deg, #F8FAFC 0%, #EEF2F8 45%, #E4EAF4 100%);
}
.login-shell {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 3rem;
    width: 100%;
    max-width: 920px;
}
.login-brand-panel {
    flex: 1 1 380px;
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 45px rgba(3, 0, 107, .25);
    animation: login-masuk .5s ease both;
}
.login-brand-content { position: relative; z-index: 1; max-width: 320px; }
.login-brand-panel .login-logo-panel { background: rgba(255, 255, 255, .14); box-shadow: none; }
.login-brand-judul {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.login-brand-tagline {
    color: rgba(255, 255, 255, .78);
    font-size: .95rem;
    line-height: 1.6;
}
.login-brand-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.login-brand-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .88rem;
    color: rgba(255, 255, 255, .92);
}
.login-brand-list i { color: #7CE0C6; font-size: 1rem; }
.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .18;
    background: #fff;
}
.login-blob-1 { width: 260px; height: 260px; top: -80px; right: -80px; }
.login-blob-2 { width: 180px; height: 180px; bottom: -60px; left: -40px; opacity: .12; }
.login-box { width: 100%; max-width: 420px; }
.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px; height: 88px;
    background: #DBE5F8;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(3, 0, 107, .12);
}
.login-logo-anim { animation: login-masuk .5s ease both; }
.login-card { animation: login-masuk .5s .08s ease both; }
@keyframes login-masuk {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .login-logo-anim, .login-card { animation: none; }
}
.login-logo img {
    width: 56px; height: 56px;
    border-radius: 12px;
}
.login-judul {
    font-size: 2rem;
    font-weight: 700;
    color: #0F172A;
}
.login-tagline {
    color: var(--gray);
    font-size: .92rem;
    line-height: 1.5;
}
.login-card {
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
}
.login-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0F172A;
}
.login-label {
    font-weight: 500;
    color: #334155;
    font-size: .88rem;
}
.login-lupa {
    font-size: .82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.login-lupa:hover { color: var(--primary-dark); text-decoration: underline; }
.login-btn {
    padding: .8rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 14px;
}
.login-btn.login-btn-loading .login-btn-label { visibility: hidden; }
.login-btn.login-btn-loading { position: relative; }
.login-btn.login-btn-loading::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 1.1rem; height: 1.1rem;
    margin: -.55rem 0 0 -.55rem;
    border: .15rem solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .6s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-input .form-control:focus-visible,
.login-input .form-control:focus,
.login-btn:focus-visible,
.login-lupa:focus-visible,
.btn-lihat:focus-visible {
    outline: .15rem solid var(--primary);
    outline-offset: 2px;
}
.login-pemisah {
    margin: 1.5rem 0 1.25rem;
    border-color: #E2E8F0;
    opacity: 1;
}
.login-footer {
    color: var(--gray);
    font-size: .82rem;
}
.login-footer a { color: var(--gray); }
.login-footer a:hover { color: var(--primary); }
@media (min-width: 992px) {
    .login-box { display: flex; flex-direction: column; }
    .login-card { flex: 1; display: flex; flex-direction: column; }
    .login-card .card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
}
.login-input .input-group-text,
.login-input .form-control,
.login-input .btn-lihat {
    border-color: var(--border-input);
    border-width: 1.5px;
}
.login-input .input-group-text {
    background: #fff;
    border-right: 0;
    color: var(--gray);
}
.login-input .form-control {
    border-left: 0;
    box-shadow: none;
}
.login-input .form-control:focus { border-color: var(--primary); }
.login-input:hover .input-group-text,
.login-input:hover .form-control,
.login-input:hover .btn-lihat {
    border-color: var(--border-input-hover);
}
.login-input:focus-within .input-group-text,
.login-input:focus-within .form-control,
.login-input:focus-within .btn-lihat {
    border-color: var(--primary);
}
.login-input:focus-within {
    box-shadow: 0 0 0 .2rem rgba(3, 0, 107, .15);
}
.login-input .btn-lihat {
    border-left: 0;
    background: #fff;
    color: var(--gray);
    cursor: pointer;
}
.login-input .btn-lihat:hover { color: var(--primary); }
.login-input .input-group-text i { transition: color .15s ease; }
.login-input:focus-within .input-group-text i { color: var(--primary); }
.login-caps-warning {
    color: #B45309;
    font-size: .78rem;
    margin-top: .4rem;
    display: flex;
    align-items: center;
}
.form-switch .form-check-input {
    width: 2.4em;
    height: 1.3em;
    margin-top: 0;
    cursor: pointer;
}
.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-switch .form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(3, 0, 107, .15);
}
.form-switch .form-check-label { cursor: pointer; padding-left: .25rem; }
@media (max-width: 991.98px) {
    .login-shell { max-width: 420px; }
}

/* Tombol "lihat password" generik (ditambahkan otomatis oleh site.js ke
   setiap input[type=password]) agar tampilannya seragam di luar form login. */
.btn-lihat {
    cursor: pointer;
    color: var(--gray);
}
.btn-lihat:hover { color: var(--primary); }

/* Tombol "buatkan password" (ditambahkan oleh site.js ke input yang punya
   atribut data-generate-password) — mengikuti gaya .btn-lihat agar seragam. */
.btn-generate {
    cursor: pointer;
    color: var(--gray);
}
.btn-generate:hover { color: var(--primary); }

/* ===== Scrollbar ===== */
/* Properti standar (Firefox, Chrome/Edge 121+); scrollbar-color diwariskan
   ke semua elemen turunan, jadi cukup di :root lalu ditimpa di area gelap. */
:root {
    scrollbar-width: thin;
    scrollbar-color: #C3CDD9 transparent;
}
/* Fallback WebKit untuk Chromium/Safari lama */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #C3CDD9;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: #A7B4C4; }

/* Sidebar gelap: thumb putih transparan agar tidak mencolok */
.admin-sidebar .sidebar-body {
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.admin-sidebar .sidebar-body::-webkit-scrollbar { width: 8px; }
.admin-sidebar .sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
    border: 0;
}
.admin-sidebar .sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .35);
}

/* ===== App shell (karyawan, gaya mobile) ===== */
.app-shell { max-width: 480px; margin: 0 auto; }
body.has-bottom-nav main { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

/* ===== Halaman absen: peta geofence, jam besar, tombol bulat ===== */
.attendance-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 1.15rem;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .28), transparent 28%),
        linear-gradient(150deg, var(--primary), var(--primary-dark));
    box-shadow: 0 18px 42px rgba(3, 0, 107, .24);
}
.attendance-hero::after {
    content: "";
    position: absolute;
    inset: auto -36px -54px auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 28px solid rgba(255, 255, 255, .08);
}
.attendance-hero-alert,
.attendance-hero-active,
.attendance-hero-info,
.attendance-hero-done {
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .28), transparent 28%),
        linear-gradient(150deg, var(--primary), var(--primary-dark));
}
.attendance-eyebrow {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .78;
}
.attendance-title {
    font-weight: 800;
    letter-spacing: -.03em;
}
.attendance-meta {
    font-size: .82rem;
    opacity: .82;
}
.attendance-status-pill {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .24);
    font-size: .72rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}
.attendance-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .55rem;
}
.attendance-hero-grid > div {
    border-radius: 16px;
    padding: .7rem .75rem;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .16);
}
.attendance-mini-label {
    font-size: .65rem;
    opacity: .72;
}
.attendance-mini-time {
    margin-top: .15rem;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.attendance-mini-small { font-size: .98rem; }

.peta-label {
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748B;
    font-weight: 600;
}
.peta-ikon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #E0E7FF;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.jam-besar {
    font-size: 2.7rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.checkin-topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.checkin-topbar-spacer {
    width: 42px;
    flex: 0 0 auto;
}
.checkin-step {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}
.checkin-step.card {
    margin-bottom: .65rem !important;
}
.checkin-step .card-body {
    padding-top: .72rem !important;
    padding-bottom: .72rem !important;
}
.checkin-step .peta-ikon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: .98rem;
}
.checkin-step .peta-label {
    font-size: .58rem;
}
.checkin-step video {
    border-radius: 18px;
    object-fit: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.checkin-clock {
    border-radius: 22px;
    padding: .75rem;
    background: linear-gradient(180deg, #fff, #F8FAFC);
    border: 1px solid #E2E8F0;
}
.checkin-clock .jam-besar {
    font-size: 2.25rem;
}
.btn-absen-bulat {
    position: relative;
    width: 155px;
    height: 155px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(160deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 16px 34px rgba(3, 0, 107, .35), inset 0 0 0 9px rgba(255, 255, 255, .12);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-weight: 700;
    letter-spacing: .06em;
    font-size: .95rem;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-absen-bulat:not(:disabled)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(3, 0, 107, .4);
    animation: absen-pulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes absen-pulse {
    0% { box-shadow: 0 0 0 0 rgba(3, 0, 107, .4); }
    70% { box-shadow: 0 0 0 22px rgba(3, 0, 107, 0); }
    100% { box-shadow: 0 0 0 22px rgba(3, 0, 107, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-absen-bulat::after,
    .aksi-card::after { animation: none; }
}
.btn-absen-bulat i { font-size: 2.3rem; }
.btn-absen-bulat:not(:disabled):hover { box-shadow: 0 18px 40px rgba(3, 0, 107, .45); }
.btn-absen-bulat:not(:disabled):active { transform: scale(.95); }
.btn-absen-bulat:disabled {
    opacity: .45;
    box-shadow: none;
    cursor: not-allowed;
}
.btn-flip-kamera {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.btn-flip-kamera:hover { background: rgba(15, 23, 42, .75); color: #fff; }

/* ===== Beranda karyawan: kartu jam & statistik bulan ===== */
.kartu-jam {
    background: linear-gradient(150deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 16px;
    padding: .9rem 1rem;
    height: 100%;
    box-shadow: 0 8px 20px rgba(3, 0, 107, .25);
}
.kartu-jam .ikon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: .6rem;
}
.kartu-jam .label { font-size: .78rem; color: rgba(255, 255, 255, .75); }
.kartu-jam .jam {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.kartu-jam .chip-status { font-size: .72rem; font-weight: 600; }
/* Warna chip status dicerahkan agar terbaca di latar gelap */
.kartu-jam .chip-status.text-success { color: #4ADE80 !important; }
.kartu-jam .chip-status.text-warning { color: #FBBF24 !important; }
.kartu-jam .chip-status.text-info { color: #7DD3FC !important; }
.kartu-jam-kosong { opacity: .6; box-shadow: none; }

.statistik-card {
    background: #fff;
    color: #0F172A;
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-card);
}
.statistik-card .judul { font-weight: 600; margin-bottom: .8rem; }
.statistik-card .angka {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.statistik-card .angka-telat { color: #B45309; } /* amber gelap: telat = peringatan */
.statistik-card .label { font-size: .74rem; color: #64748B; }
.statistik-card .sekat { border-left: 1px solid #E2E8F0; }

/* Halaman riwayat: ringkasan gaya hero + kartu log harian */
.ringkasan-riwayat .angka-hero {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
}
.ringkasan-riwayat .ikon-hero {
    position: relative;
    z-index: 1;
    font-size: 1.7rem;
    opacity: .85;
}
.ringkasan-riwayat .mini-terlambat { color: #FCD34D; }
.ringkasan-riwayat .mini-izin { color: #93C5FD; }
.ringkasan-riwayat .mini-sakit { color: #FCA5A5; }
.seksi-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
}
.riwayat-tanggal-blok {
    flex: 0 0 auto;
    width: 52px;
    text-align: center;
    background: #E0E7FF;
    color: var(--primary);
    border-radius: 12px;
    padding: .35rem 0;
}
.riwayat-tanggal-blok .bulan {
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.riwayat-tanggal-blok .hari { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.min-w-0 { min-width: 0; }
.baris-jam { font-size: .92rem; color: #0F172A; }
.baris-jam i { color: #94A3B8; font-size: .85rem; }
.baris-jam .pemisah { color: #CBD5E1; margin: 0 .15rem; }
.baris-jam .jam-telat { color: #B45309; }
.baris-hari { font-size: .74rem; color: #64748B; }
.link-lihat-lagi {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}
.link-lihat-lagi:hover { text-decoration: underline; }

/* Kartu pengumuman di beranda: putih dengan aksen kiri, agar panel gelap
   satu-satunya tetap kartu statistik */
.pengumuman-card {
    background: #fff;
    border-left: 4px solid var(--navy);
    border-radius: 16px;
    padding: .9rem 1rem;
    box-shadow: var(--shadow-card);
}
.pengumuman-card .ikon-megafon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #E0E7FF;
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.pengumuman-card .label {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748B;
    font-weight: 600;
}
.pengumuman-card .judul { font-weight: 700; color: #0F172A; }
.pengumuman-card .isi { font-size: .82rem; color: #475569; margin-top: .1rem; }

/* Halaman profil karyawan */
.avatar-profil {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 0 0 6px #E0E7FF;
}

/* Kartu status biru */
.status-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 6px 16px rgba(3, 0, 107, .3);
}
.status-card .label { font-size: .75rem; opacity: .85; }
.status-card .time { font-size: 1.9rem; font-weight: 700; line-height: 1.2; }

/* Tombol aksi Check In / Check Out (Beranda) */
.aksi-group { display: flex; gap: .6rem; }
.aksi-group .aksi-card { flex: 1; min-width: 0; gap: .6rem; padding: .8rem; }
.aksi-group-primer .aksi-card {
    border: 1px solid #E2E8F0;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.aksi-group-primer a.aksi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(3, 0, 107, .22);
}
.aksi-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: .8rem 1rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: #0F172A;
}
a.aksi-card:hover { box-shadow: 0 3px 10px rgba(3, 0, 107, .15); color: #0F172A; }
.aksi-group-primer a.aksi-card:not(.aksi-selesai) { position: relative; }
.aksi-group-primer a.aksi-card:not(.aksi-selesai)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: 0 0 0 0 rgba(3, 0, 107, .35);
    animation: aksi-pulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes aksi-pulse {
    0% { box-shadow: 0 0 0 0 rgba(3, 0, 107, .35); }
    70% { box-shadow: 0 0 0 10px rgba(3, 0, 107, 0); }
    100% { box-shadow: 0 0 0 10px rgba(3, 0, 107, 0); }
}
.aksi-card.aksi-nonaktif { opacity: .55; }
.aksi-card.aksi-selesai { background: #F8FAFC; }
.aksi-ikon {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}
.aksi-ikon.ikon-masuk { background: var(--success); }
.aksi-ikon.ikon-pulang { background: var(--primary); }

/* Halaman Check In */
.btn-back {
    color: #0F172A;
    text-decoration: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: .25rem .5rem;
}
.area-banner {
    display: flex;
    align-items: center;
    gap: .7rem;
    border-radius: 20px;
    padding: .58rem .78rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}
.area-banner .ikon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, .7);
}
.area-banner .judul {
    font-size: .9rem;
    line-height: 1.15;
}
.area-banner .sub {
    line-height: 1.2;
}
.area-banner.area-pending { background: #F1F5F9; color: var(--gray); border: 1px solid #E2E8F0; }
.area-banner.area-ok { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.area-banner.area-luar { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }

/* Chip filter riwayat */
.chip-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
    padding: .3rem .9rem;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid #E2E8F0;
    color: var(--gray);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
}
.chip:hover { color: var(--primary); border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Detail absensi */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .65rem 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: .9rem;
}

/* Kartu riwayat */
.riwayat-card { color: #0F172A; }
.riwayat-card:hover { box-shadow: 0 3px 10px rgba(3, 0, 107, .15); }
.riwayat-card .tanggal { font-weight: 600; }
.riwayat-card .jam { color: var(--gray); font-size: .8rem; }
.durasi { color: var(--gray); font-size: .8rem; }

.riwayat-detail {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    border-top: 1px solid #F1F5F9;
    padding-top: .7rem;
    font-size: .85rem;
}
.riwayat-kolom { display: flex; align-items: center; gap: .5rem; flex: 1; }
.riwayat-kolom .label { color: var(--gray); font-size: .7rem; }
.riwayat-ikon {
    width: 30px; height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.ikon-masuk-soft { background: #DCFCE7; color: #15803D; }
.ikon-pulang-soft { background: #DCE4F2; color: var(--navy); }
.ikon-durasi-soft { background: #F1F5F9; color: var(--gray); }

/* Badge lembut (soft) */
.badge-soft-success { background: #DCFCE7; color: #15803D; }
.badge-soft-warning { background: #FEF3C7; color: #B45309; }
.badge-soft-danger { background: #FEE2E2; color: #B91C1C; }
.badge-soft-info { background: #DCE4F2; color: var(--navy); }
.badge-soft-secondary { background: #E2E8F0; color: #475569; }

/* ===== Bottom navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 50%;
    width: 100%;
    max-width: 480px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: .4rem 0 max(.6rem, env(safe-area-inset-bottom));
    z-index: 1030;
}
@media (min-width: 480px) {
    .bottom-nav { border-radius: 20px 20px 0 0; }
}
.bottom-nav .nav-item-app {
    flex: 1;
    text-align: center;
    color: var(--gray);
    text-decoration: none;
    font-size: .68rem;
    background: none;
    border: none;
    padding: 0;
}
.bottom-nav .nav-item-app .ikon {
    position: relative;
    display: block;
    font-size: 1.25rem;
    line-height: 1.2;
    width: 52px;
    margin: 0 auto .1rem;
    padding: .15rem 0;
    border-radius: 999px;
    transition: background .15s ease, color .15s ease, transform .12s ease;
}
.bottom-nav .nav-item-app:active .ikon { transform: scale(.88); }
@media (hover: hover) {
    .bottom-nav .nav-item-app:not(.active):hover { color: var(--primary); }
    .bottom-nav .nav-item-app:not(.active):hover .ikon {
        background: color-mix(in srgb, var(--primary) 6%, transparent);
    }
    .bottom-nav .nav-fab:hover .lingkaran { box-shadow: 0 8px 18px rgba(3, 0, 107, .5); }
}
.nav-badge {
    position: absolute;
    top: .05rem; right: .55rem;
    width: 8px; height: 8px;
    background: #EF4444;
    border-radius: 50%;
    border: 1.5px solid #fff;
}
.bottom-nav .nav-item-app.active { color: var(--primary); font-weight: 700; }
.bottom-nav .nav-item-app.active .ikon {
    background: rgba(3, 0, 107, .1);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}
.bottom-nav .nav-fab {
    flex: 1;
    display: flex;
    justify-content: center;
    text-decoration: none;
}
.bottom-nav .nav-fab .lingkaran {
    width: 54px; height: 54px;
    margin-top: -30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 6px 14px rgba(3, 0, 107, .4);
    border: 4px solid var(--bg);
    transition: transform .15s ease, box-shadow .15s ease;
}
.bottom-nav .nav-fab:active .lingkaran { transform: scale(.92); }
.bottom-nav .nav-fab.active .lingkaran {
    box-shadow: 0 6px 14px rgba(3, 0, 107, .4), 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

/* Video kamera */
#video { border-radius: var(--radius); }

/* ===== QR Kiosk ===== */
.kiosk {
    max-width: 460px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #2647B0 0%, var(--primary) 45%, var(--primary-dark) 75%, #010030 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.kiosk > * { position: relative; z-index: 1; }
.kiosk-jam {
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.kiosk-tanggal { color: rgba(255,255,255,.65); }
.kiosk h4 { color: #fff; }
.kiosk .text-muted { color: rgba(255,255,255,.65) !important; }
.kiosk-qr {
    background: #fff;
    border-radius: calc(var(--radius) + 8px);
    padding: 1rem;
    box-shadow: 0 20px 45px rgba(2, 0, 73, .35), 0 0 0 1px rgba(255,255,255,.08);
    display: inline-block;
    width: 100%;
    max-width: 260px;
    position: relative;
}
.kiosk-qr::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: calc(var(--radius) + 12px);
    border: 2px dashed rgba(255,255,255,.35);
    pointer-events: none;
}
.kiosk-qr svg { width: 100%; height: auto; display: block; }
.kiosk-progress { height: 6px; border-radius: 999px; max-width: 420px; margin: 0 auto; background: rgba(255,255,255,.15); }
.kiosk-progress .progress-bar { background-color: var(--accent); transition: width 1s linear, background-color .3s; }
.kiosk-progress .progress-bar.kiosk-progress-habis { background-color: #fff; }
.kiosk-live {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: rgba(255,255,255,.75);
}
.kiosk-live .titik {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    animation: kiosk-pulse 1.6s ease-out infinite;
}
@keyframes kiosk-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media print {
    .no-print { display: none !important; }
    .kiosk {
        background: none;
        color: #0F172A;
        min-height: 0;
    }
    .kiosk h4, .kiosk .text-muted, .kiosk-live { color: #0F172A !important; }
    .kiosk-qr { box-shadow: none; }
    .kiosk-qr::before { display: none; }
    .kiosk-live .titik { animation: none; box-shadow: none; }
}

/* ===== Pemindai QR (karyawan) ===== */
.qr-scan-wrap { position: relative; }
.qr-scan-frame {
    position: absolute;
    inset: 12%;
    border: 3px solid rgba(255, 255, 255, .85);
    border-radius: 16px;
    pointer-events: none;
    box-shadow: 0 0 0 2000px rgba(15, 23, 42, .25);
    clip-path: inset(-2000px);
}
