/* Hadira — Aplikasi Absensi Mobile UYM (CSP: tanpa gaya inline). */
:root {
    /* Palet Resmi Universitas Yatsi Madani (UYM) */
    --uym-navy: #0b224b;
    --uym-navy-2: #132f63;
    --uym-navy-dark: #071633;
    --brand: #2737c9;
    --brand-hover: #202da8;
    --brand-soft: #eeeffc;
    --brand-border: #c7cef7;
    --uym-gold: #feae37;

    /* Permukaan & Tipografi Netral (Terverifikasi WCAG AA) */
    --ink: #0f172a;
    --muted: #475569;
    --placeholder: #64748b;
    --border-ctrl: #7c8ba1;
    --line: #e2e8f0;
    --bg: #f4f6fa;
    --card: #ffffff;

    /* Status Semantik */
    --ok: #007a5a;
    --ok-hover: #006147;
    --ok-bg: #dcfce7;
    --ok-ink: #065f46;
    --warn: #9a3412;
    --warn-bg: #fef3c7;
    --bad: #b91c1c;
    --bad-bg: #ffe4e6;
    --bad-ink: #9f1239;
    --info-ink: #1e3a8a;
    --info-bg: #e0e7ff;

    /* Skala Radius & Elevasi Terkendali */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-sheet: 20px;
    --shadow-card: 0 1px 2px rgba(11, 34, 75, 0.05);
    --shadow-sheet: 0 -8px 28px rgba(11, 34, 75, 0.18);
    --tabbar: 62px;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

body {
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.noscroll { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

/* Aksesibilitas & Affordance Dasar */
button, a, select, input[type="checkbox"], summary { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

input, select, textarea { scroll-margin-bottom: 110px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.lg { width: 26px; height: 26px; }

/* Tombol & Komponen Dasar */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 11px 16px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; }

.btn.primary {
    width: 100%;
    background: var(--brand);
    color: #ffffff;
}
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }

.btn.danger {
    width: 100%;
    background: var(--card);
    color: var(--bad);
    border-color: #fecdd3;
    margin-top: 6px;
}
.btn.danger:hover:not(:disabled) { background: #fff1f2; border-color: #fda4af; }

.btn.sm {
    width: auto;
    min-height: 44px;
    padding: 9px 14px;
    font-size: 13.5px;
    border-radius: var(--r-sm);
}
.btn.sm .ico { width: 17px; height: 17px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.18); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

.icon-btn.dark {
    background: var(--bg);
    border-color: var(--line);
    color: var(--ink);
}
.icon-btn.dark:hover { background: #e8edf5; }
.icon-btn.dark:focus-visible { outline: 2px solid var(--brand); }

.link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}
.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); margin-left: auto; }

.alert {
    border-radius: var(--r-md);
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    margin: 0 0 12px;
    border: 1px solid transparent;
}
.alert.error { background: var(--bad-bg); color: var(--bad-ink); border-color: #fecdd3; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.alert.info { background: var(--info-bg); color: var(--info-ink); border-color: var(--brand-border); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--r-sm);
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 700;
    font-style: normal;
    white-space: nowrap;
}
.pill.good { background: var(--ok-bg); color: var(--ok-ink); }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.mute { background: #edf1f7; color: var(--muted); }

/* ------------------------------------------------------------ Halaman Masuk (Login) */
body.login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--uym-navy);
}

.login-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    color: #ffffff;
    padding: max(28px, env(safe-area-inset-top)) 20px 24px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.logo-tile {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #ffffff;
    border: 2px solid var(--uym-gold);
    padding: 4px;
    flex: none;
}

.logo-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-meta {
    display: grid;
    gap: 2px;
}

.brand-org {
    font-size: 12px;
    font-weight: 600;
    color: #dbeafe;
}

.login-hero h1 {
    font-size: clamp(1.65rem, 6vw, 2.2rem);
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
}

.login-hero > p {
    margin: 0 0 14px;
    color: #dbeafe;
    font-size: 14px;
    line-height: 1.5;
}

.feat {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feat li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: var(--r-sm);
    background: var(--uym-navy-2);
    border: 1px solid rgba(219, 234, 254, 0.2);
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}
.feat .ico { width: 15px; height: 15px; color: var(--uym-gold); }

.login-card {
    flex: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.login-card h2 {
    font-size: clamp(1.25rem, 5vw, 1.45rem);
    font-weight: 800;
    color: var(--ink);
}

.login-sub {
    margin: 4px 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.in-field {
    display: grid;
    gap: 6px;
}

.in-field .lbl {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.in-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-ctrl);
    background: #ffffff;
    border-radius: var(--r-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.in-wrap > .ico {
    position: absolute;
    left: 13px;
    color: var(--muted);
    pointer-events: none;
}

.in-wrap input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    border: 0;
    background: transparent;
    padding: 12px 14px 12px 42px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    border-radius: var(--r-md);
}
.in-wrap input:focus { outline: none; }
.in-wrap input::placeholder { color: var(--placeholder); }
.in-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(39, 55, 201, 0.16);
}
.in-wrap:focus-within > .ico { color: var(--brand); }

.eye {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-right: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: var(--r-sm);
}
.eye:hover { background: var(--bg); color: var(--ink); }
.eye.on { color: var(--brand); }

.caps {
    margin: -4px 2px 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--warn);
}

.login-btn {
    margin-top: 4px;
    min-height: 50px;
    font-size: 15.5px;
}
.login-btn.loading { opacity: 0.78; pointer-events: none; }

.hint {
    font-size: 12.5px;
    color: var(--muted);
    margin: 16px 0 0;
    line-height: 1.55;
}

.pwa-login { margin-top: 14px; }

.pwa-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--brand-border);
    background: var(--brand-soft);
    color: var(--brand);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
}
.pwa-chip:hover { background: #e2e5fb; }
.pwa-chip .ico { width: 18px; height: 18px; }

.pwa-ios {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
}
.pwa-ios .ico { width: 15px; height: 15px; vertical-align: -3px; color: var(--brand); }

.login-foot {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.secure {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}
.secure .ico { width: 16px; height: 16px; color: var(--ok); flex: none; }

/* Tablet & Desktop Split Login (serasi dengan ekosistem UYM) */
@media (min-width: 760px) {
    body.login {
        display: grid;
        grid-template-columns: minmax(320px, 1fr) minmax(380px, 460px);
        background: var(--bg);
    }
    .login-hero {
        max-width: none;
        background: var(--uym-navy);
        padding: 48px clamp(32px, 6vw, 64px);
        justify-content: center;
        border-right: 4px solid var(--uym-gold);
    }
    .login-hero > p { max-width: 380px; font-size: 15px; }
    .login-card {
        max-width: none;
        border-radius: 0;
        justify-content: center;
        padding: 48px 40px;
    }
    .login-foot { margin-top: 24px; }
}

/* ------------------------------------------------------------ Shell Aplikasi Mobile */
body.app {
    background: var(--bg);
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 20px);
}

/* Header Aplikasi UYM Navy (Ringkas & Native Mobile) */
.hero {
    background: var(--uym-navy);
    color: #ffffff;
    padding: max(14px, env(safe-area-inset-top)) 16px 64px;
    border-bottom: 3px solid var(--uym-gold);
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
}

.avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--uym-navy);
    font-weight: 800;
    font-size: 15px;
    flex: none;
    border: 2px solid var(--uym-gold);
}

.avatar.lg {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 19px;
    background: var(--uym-navy);
    color: #ffffff;
    border: 2px solid var(--uym-gold);
}

.hello {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 1px;
}
.hello span { font-size: 12px; color: #dbeafe; font-weight: 500; }
.hello strong { font-size: 16px; font-weight: 700; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello small { font-size: 12px; color: #dbeafe; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero form { margin: 0; }

.clock-card {
    max-width: 520px;
    margin: 20px auto 0;
    text-align: center;
}

#clock-time {
    font-size: clamp(2.6rem, 12vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

#clock-date {
    margin: 6px 0 12px;
    color: #dbeafe;
    font-size: 13.5px;
    font-weight: 500;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    background: var(--uym-navy-2);
    border: 1px solid rgba(219, 234, 254, 0.24);
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff;
}
.chip .ico { width: 15px; height: 15px; color: var(--uym-gold); }

/* Tab Selain Beranda: Header Bar Ringkas */
body.tab-other .hero { padding-bottom: 16px; }
body.tab-other .clock-card { display: none; }
body.tab-other .wrap { margin-top: 0; padding-top: 16px; }

.wrap {
    position: relative;
    z-index: 2;
    max-width: 520px;
    margin: -46px auto 0;
    padding: 0 14px 20px;
}

.view-title {
    font-size: clamp(1.25rem, 4.8vw, 1.45rem);
    font-weight: 800;
    color: var(--ink);
    margin: 0 2px 2px;
}
.view-sub { margin: 0 2px 14px; }
#view-profile .view-title { margin-bottom: 14px; }

/* Kartu Permukaan Datar & Hairline */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}
.card p { margin: 4px 0; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.card-head h2 {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--ink);
}

/* Kartu Setup (Daftar Wajah / Perangkat) */
.setup {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1.5px solid var(--brand-border);
    background: #f8f9ff;
}
.setup.pending {
    border-color: #f59e0b;
    background: #fffdf5;
}
.setup-ico {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--brand);
    flex: none;
}
.setup.pending .setup-ico { background: var(--warn-bg); color: var(--warn); }
.setup-ico .ico { width: 22px; height: 22px; }
.setup h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; color: var(--ink); }
.setup p { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.45; }

/* Grid Masuk & Pulang Hari Ini */
.tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tile {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--bg);
    border: 1px solid var(--line);
}
.tile-ico {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: #ffffff;
    border: 1px solid var(--line);
}
.tin .tile-ico { color: var(--ok); }
.tout .tile-ico { color: var(--brand); }
.tile-lbl { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.tile strong {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink);
}
.tile .pill { justify-self: start; margin-top: 2px; }

.note { font-size: 13px; margin: 12px 2px 0 !important; line-height: 1.45; }
.note.ok { color: var(--ok); font-weight: 600; }
.note.muted { color: var(--muted); }

/* Tombol Aksi Utama Absen (Thumb-Friendly) */
.actions {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.btn.big {
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    min-height: 68px;
    padding: 14px 16px;
    border-radius: var(--r-lg);
    color: #ffffff;
    text-align: left;
}
.btn.big span { display: grid; gap: 1px; }
.btn.big b { font-size: 16.5px; font-weight: 800; }
.btn.big small { font-weight: 500; color: rgba(255, 255, 255, 0.9); font-size: 12.5px; }
.btn.big .ico {
    padding: 9px;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.16);
}
.btn.in { background: var(--ok); }
.btn.in:hover:not(:disabled) { background: var(--ok-hover); }
.btn.out { background: var(--brand); }
.btn.out:hover:not(:disabled) { background: var(--brand-hover); }
.btn.big:disabled {
    background: #e2e8f0;
    color: var(--muted);
    opacity: 1;
}
.btn.big:disabled small { color: var(--muted); }
.btn.big:disabled .ico { background: rgba(255, 255, 255, 0.7); color: var(--muted); }

/* Ringkasan 7 Hari */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stat {
    display: grid;
    justify-items: center;
    padding: 11px 6px;
    border-radius: var(--r-md);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.stat strong { font-size: 22px; font-weight: 800; color: var(--ok-ink); line-height: 1.15; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat.late { background: #fff1f2; border-color: #fecdd3; }
.stat.late strong { color: var(--bad-ink); }
.stat.early { background: #fffbeb; border-color: #fde68a; }
.stat.early strong { color: var(--warn); }

/* Riwayat Kehadiran */
.timeline { display: grid; gap: 10px; }
.tl {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow-card);
}
.tl-day {
    display: grid;
    justify-items: center;
    width: 48px;
    padding: 6px 0;
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--brand);
    flex: none;
}
.tl-day strong { font-size: 18px; line-height: 1.1; }
.tl-day span { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.tl-body { min-width: 0; display: grid; gap: 6px; }
.tl-title { font-weight: 700; font-size: 14px; text-transform: capitalize; color: var(--ink); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    font-size: 13.5px;
    line-height: 1.5;
}

/* Profil & Daftar Lokasi */
.profile { display: flex; align-items: center; gap: 14px; }
.profile > div:last-child { display: grid; gap: 2px; min-width: 0; }
.profile strong { font-size: 16.5px; color: var(--ink); }

.list { padding: 4px 16px; }
.row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row > div { display: grid; gap: 2px; min-width: 0; }
.row strong { font-size: 14px; color: var(--ink); }
.row-ico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand);
    flex: none;
}

.loc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.loc:first-child { border-top: 0; }
.loc > div { display: grid; gap: 2px; }
.dist { font-weight: 700; font-size: 13px; color: var(--brand); white-space: nowrap; }

/* Native Docked Bottom Tab Bar */
.tabbar {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    min-height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #ffffff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(11, 34, 75, 0.06);
}

.tabbar button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    transition: color 0.15s ease;
}

.tabbar button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: transparent;
}

.tabbar button.active {
    color: var(--brand);
    font-weight: 800;
}

.tabbar button.active::before {
    background: var(--brand);
}

.tabbar .ico { width: 21px; height: 21px; }

@media (min-width: 560px) {
    .tabbar {
        border-left: 1px solid var(--line);
        border-right: 1px solid var(--line);
        border-radius: 14px 14px 0 0;
    }
}

/* ------------------------------------------------------------ Layar Pemindaian Wajah */
.scan {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--uym-navy-dark);
    color: #ffffff;
    padding: max(12px, env(safe-area-inset-top)) 18px 24px;
    overflow-y: auto;
}
.scan-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 420px;
    margin-bottom: 18px;
}
.scan-top strong { font-size: 17px; font-weight: 700; }
.scan-top .spacer { width: 44px; }

.viewer {
    position: relative;
    width: min(76vw, 310px);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: #000000;
    margin-top: 8px;
    border: 4px solid rgba(255, 255, 255, 0.16);
}
.viewer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.guide {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 5px solid rgba(219, 234, 254, 0.45);
    transition: border-color 0.2s ease;
}
.guide.ok { border-color: #10b981; }
.guide.warn { border-color: var(--uym-gold); }
.guide.bad { border-color: #f43f5e; }
.guide:not(.ok):not(.warn):not(.bad) { border-style: dashed; }

.arrow {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 24px solid transparent;
    border-bottom: 24px solid transparent;
    transform: translateY(-50%);
}
.arrow.left { left: 8%; border-right: 32px solid var(--uym-gold); }
.arrow.right { right: 8%; border-left: 32px solid var(--uym-gold); }

.scan-step {
    text-align: center;
    font-size: clamp(1.1rem, 4.5vw, 1.25rem);
    font-weight: 700;
    min-height: 54px;
    max-width: 360px;
    margin: 22px 0 14px;
    line-height: 1.35;
}

.checks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 420px;
}
.checks li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 600;
}
.checks li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #93c5fd;
    flex: none;
}
.checks li.run { color: #ffffff; background: rgba(254, 174, 55, 0.22); }
.checks li.run::before {
    border-color: var(--uym-gold);
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}
.checks li.done { color: #ffffff; background: rgba(0, 122, 90, 0.35); }
.checks li.done::before { background: #10b981; border-color: #10b981; }
.checks li.fail { color: #fecdd3; background: rgba(185, 28, 28, 0.35); }
.checks li.fail::before { background: #f43f5e; border-color: #f43f5e; }
@keyframes spin { to { transform: rotate(360deg); } }

#gps-info { text-align: center; margin-top: 14px; color: #dbeafe; font-size: 13px; }

/* ------------------------------------------------------------ Cuti, Izin & Sakit */
.center { text-align: center; }
.view-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.section-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--ink);
    margin: 18px 2px 10px;
}

.balances {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(152px, 46%);
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    scrollbar-width: none;
}
.balances::-webkit-scrollbar { display: none; }

.bal {
    scroll-snap-align: start;
    display: grid;
    gap: 3px;
    padding: 14px;
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}
.bal-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bal strong { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.bal-sub { font-size: 12px; color: var(--muted); }

.bar {
    display: block;
    height: 6px;
    border-radius: 99px;
    background: #e2e8f0;
    margin-top: 8px;
    overflow: hidden;
}
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); width: 0; }
.bar i.w10 { width: 10%; } .bar i.w20 { width: 20%; } .bar i.w30 { width: 30%; } .bar i.w40 { width: 40%; } .bar i.w50 { width: 50%; }
.bar i.w60 { width: 60%; } .bar i.w70 { width: 70%; } .bar i.w80 { width: 80%; } .bar i.w90 { width: 90%; }
.bar i.w100 { width: 100%; background: var(--bad); }

.lv-list { display: grid; gap: 10px; }
.lv-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 15px;
    box-shadow: var(--shadow-card);
}
.lv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lv-head > div { display: grid; gap: 2px; min-width: 0; }
.lv-head strong { font-size: 14.5px; color: var(--ink); }
.lv-reason { margin: 8px 0 0; font-size: 13.5px; color: var(--ink); line-height: 1.45; }

.steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; }
.steps li { position: relative; display: flex; gap: 10px; padding: 0 0 12px; font-size: 12.5px; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: var(--line);
}
.steps .dot {
    flex: none;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    border-radius: 50%;
    border: 2px solid var(--border-ctrl);
    background: #ffffff;
    position: relative;
    z-index: 1;
}
.steps li > div { display: grid; gap: 1px; }
.steps b { font-size: 13px; color: var(--ink); }
.steps span { color: var(--muted); }
.steps em { color: var(--muted); font-size: 12px; }
.steps .s-approved .dot { background: var(--ok); border-color: var(--ok); }
.steps .s-rejected .dot { background: var(--bad); border-color: var(--bad); }
.steps .s-pending .dot { background: var(--brand-soft); border-color: var(--brand); }
.steps .s-skipped { opacity: 0.65; }

.lv-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}
.lv-foot .link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bottom Sheet Formulir Cuti */
.sheet {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 34, 75, 0.48);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sheet-panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
    display: grid;
    gap: 12px;
    box-shadow: var(--shadow-sheet);
    transform: translateY(100%);
    transition: transform 0.22s ease;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: #cbd5e1; margin: 2px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet-head h2 { font-size: 16.5px; font-weight: 800; color: var(--ink); }

.seg {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: var(--r-md);
    background: var(--bg);
    border: 1px solid var(--line);
}
.seg button {
    min-height: 40px;
    border: 0;
    background: transparent;
    padding: 8px;
    border-radius: var(--r-sm);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--muted);
}
.seg button[aria-selected="true"] {
    background: #ffffff;
    color: var(--brand);
    box-shadow: 0 1px 2px rgba(11, 34, 75, 0.12);
}

.field {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    border: 1.5px solid var(--border-ctrl);
    background: #ffffff;
    border-radius: var(--r-md);
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(39, 55, 201, 0.16);
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 360px) { .row2 { grid-template-columns: 1fr; } }

.type-info {
    border-radius: var(--r-md);
    background: var(--info-bg);
    border: 1px solid var(--brand-border);
    padding: 10px 12px;
    font-size: 12.5px;
    color: var(--info-ink);
    display: grid;
    gap: 4px;
}
.type-info p { margin: 0; }
.type-info .rules { font-weight: 700; }
.type-info .basis { font-size: 12px; color: var(--muted); }
.type-info .remain { font-weight: 800; color: var(--brand); }

.preview { margin: -2px 2px 0; font-size: 13px; font-weight: 700; color: var(--ok); }
.preview.bad { color: var(--bad); }

.field.file { position: relative; }
.field.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 11px 13px;
    border: 1.5px dashed var(--brand);
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
}
.file-box span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field.file:focus-within .file-box { box-shadow: 0 0 0 3px rgba(39, 55, 201, 0.2); }

.toast {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: calc(100% - 28px);
    padding: 12px 16px;
    border-radius: var(--r-md);
    background: var(--uym-navy);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 10px 28px rgba(11, 34, 75, 0.28);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.ok::before { content: "✓ "; color: #34d399; }
.toast.bad { background: var(--bad); }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

/* ------------------------------------------------------------ Banner PWA & Pengingat */
.pwa-banner,
.push-card {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--brand-border);
}
.pwa-banner img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex: none;
    border: 1px solid var(--line);
}
.pwa-banner > div,
.push-card > div {
    display: grid;
    gap: 4px;
    padding-right: 36px;
}
.pwa-banner strong,
.push-card strong { font-size: 14.5px; color: var(--ink); }
.pwa-banner p,
.push-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.pwa-banner .btn,
.push-card .btn { justify-self: start; margin-top: 6px; }

.pwa-x {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
}
.pwa-x:hover { background: var(--bg); color: var(--ink); }

.push-row { align-items: center; }
.push-row > div { flex: 1; gap: 2px; }
.push-row .link { justify-self: start; min-height: 36px; margin-top: 2px; }
.push-row .link:disabled { opacity: 0.5; }

.switch {
    position: relative;
    flex: none;
    width: 50px;
    height: 30px;
    display: inline-block;
    cursor: pointer;
}
.switch input {
    position: absolute;
    inset: -7px;
    width: calc(100% + 14px);
    height: calc(100% + 14px);
    margin: 0;
    opacity: 0;
    cursor: inherit;
}
.switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--border-ctrl);
    transition: background-color 0.2s ease;
    pointer-events: none;
}
.switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(11, 34, 75, 0.25);
    transition: transform 0.2s ease;
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 3px; }
.switch input:disabled + span { opacity: 0.45; }

@media (prefers-reduced-motion: reduce) {
    .btn, .icon-btn, .sheet-panel, .sheet-backdrop, .toast, .switch span, .switch span::after { transition: none !important; }
    .checks li.run::before { animation: none !important; }
}
