/* ============================================================
   OneFIS - base.css
   Reset, skala tampilan fluid, wadah aplikasi, header, tutorial
   overlay, area konten, dan utilitas global (dipakai di SEMUA
   halaman).
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Skala tampilan ----------
   Root font-size DIKUNCI (bukan ikut lebar layar lewat vw) supaya
   semua ukuran rem (teks & ikon) konsisten di HP mana pun -- baik
   HP kecil (~360px) maupun HP besar (~430px+). Sebelumnya memakai
   clamp(14px, 3.9vw, 17px): di HP asli nilai vw-nya kecil (viewport
   sempit) sehingga root font-size jatuh ke 14-16px dan semua teks +
   ikon jadi kecil, padahal di browser desktop (viewport lebar) vw-nya
   selalu kena batas atas 17px sehingga tampak normal. Dikunci 17px
   supaya tampilan di HP sungguhan sama besar seperti yang terlihat
   saat pratinjau di desktop. */
html {
    font-size: 17px;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #eef1f5;
    min-height: 100vh;
    min-height: 100dvh;
    color: #1e293b;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Wadah aplikasi (tanpa bingkai HP) ----------
   Full-bleed di semua HP asli (Chrome mobile dsb, sampai lebar
   640px — mencakup HP kecil maupun HP besar). Baru di layar
   tablet/desktop (>640px) tampilan dikecilkan & dibungkus jadi
   kartu putih rounded seukuran HP pada umumnya, supaya tidak
   melebar aneh saat dites di browser desktop. */
/* Tinggi wadah dikunci setinggi layar supaya .content yang men-scroll,
   bukan body. 100dvh dipakai agar tidak terpotong bar URL browser HP. */
.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (min-width: 641px) {
    body { padding: 2rem 0; display: flex; justify-content: center; }
    .app-container {
        max-width: 390px;
        height: calc(100vh - 4rem);
        height: calc(100dvh - 4rem);
        border-radius: 1.75rem;
        overflow: hidden;
        box-shadow: 0 20px 50px -20px rgba(15,23,42,0.25), 0 0 0 1px rgba(15,23,42,0.06);
    }
}

/* ---------- Header ---------- */
.app-header {
    height: 4rem;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    padding-top: env(safe-area-inset-top);
    height: calc(4rem + env(safe-area-inset-top));
    box-shadow: 0 2px 10px -4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    z-index: 10;
    position: relative;
    position: sticky;
    top: 0;
}
.app-header .logo img { height: 2rem; object-fit: contain; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.bell { width: 1.375rem; height: 1.375rem; color: #334155; }
.bell svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }
.badge {
    width: 1.875rem; height: 1.875rem; background: #2563eb; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}

.app-header-simple {
    height: 3.5rem;
    background: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    padding-top: env(safe-area-inset-top);
    height: calc(3.5rem + env(safe-area-inset-top));
    box-shadow: none;
    flex-shrink: 0;
    z-index: 10;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    gap: 0.25rem;
}
.back-btn {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #475569; background: transparent; border: none;
}
.back-btn:hover { background: #f1f5f9; }
.back-btn svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; }
.app-header-simple h1 {
    font-size: 1.1875rem; font-weight: 600; color: #1e293b; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header-simple.centered { justify-content: space-between; }
.app-header-simple.centered h1 { flex: 1; text-align: center; }

/* ---------- Tutorial overlay ---------- */
.tutorial {
    position: absolute;
    left: 1rem; right: 1rem;
    top: 5.875rem;
    background: #2563eb;
    color: #fff;
    padding: 1rem;
    border-radius: 1.125rem;
    box-shadow: 0 15px 30px -8px rgba(37,99,235,0.45);
    z-index: 50;
    display: flex;
    gap: 0.75rem;
    border: 1px solid #3b82f6;
}
.app-header-simple ~ .tutorial,
.tutorial.simple-offset { top: 4.875rem; }
.tutorial svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.125rem; color: #bfdbfe; fill: none; stroke: currentColor; stroke-width: 2; }
.tutorial p { font-size: 0.8125rem; font-weight: 500; line-height: 1.5; flex: 1; }
.tutorial-close {
    flex-shrink: 0; width: 1.5rem; height: 1.5rem; margin: -0.25rem -0.25rem 0 0;
    border: none; background: transparent; color: #dbeafe;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.tutorial-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.tutorial-close svg { width: 0.875rem; height: 0.875rem; margin: 0; color: currentColor; stroke-width: 2.5; }
.tutorial[hidden] { display: none; }
.tutorial::after {
    content: "";
    position: absolute;
    bottom: -0.5rem; left: 2.5rem;
    width: 1rem; height: 1rem;
    background: #2563eb;
    border-bottom: 1px solid #3b82f6;
    border-right: 1px solid #3b82f6;
    transform: rotate(45deg);
}

/* ---------- Konten ---------- */
.content {
    flex: 1 1 auto;
    min-height: 0;              /* wajib, tanpa ini flex item tidak mau scroll */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
    z-index: 1;
    background: transparent;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Gradasi latar dipasang di wadah aplikasi supaya tetap diam saat konten
   di-scroll -- sama seperti tampilan pada aplikasi aslinya. */
.app-container::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(135% 26% at 85% 0%, #d7e5fb 0%, rgba(215,229,251,0) 100%),
        radial-gradient(125% 14% at 15% 100%, #fbdde8 0%, rgba(251,221,232,0) 100%),
        #f8fafc;
}
/* Khusus halaman Daftar LO ("lo_list"): jadikan .content flex column
   supaya baris tombol "Mulai Checklist" / "Kirim" bisa didorong ke
   bawah dengan margin-top:auto secara andal, tanpa mengandalkan
   resolusi tinggi persentase (min-height:100%) bersarang yang tidak
   selalu konsisten di semua browser saat konten sedikit / pendek. */
.content.content-flex-col { display: flex; flex-direction: column; }

.content-pad { padding: 1rem; }

/* ---------- Sticky footer & spacer (global) ---------- */
.sticky-footer {
    padding: 1rem; background: #fff; border-top: 1px solid #f1f5f9;
}
.sticky-bottom-pad { height: 5.625rem; }