/* =====================================================================
   Project Tracker - app.css
   Token desain dari PRD bagian 7. Tanpa framework CSS.
   Indikator warna SELALU disertai teks.

   Tampilan 29 Oktober 2026: minimalis, permukaan putih tipis di atas
   abu-abu dingin, kaca buram (backdrop-filter) pada bilah atas, navigasi,
   dan pop-up. Nama kelas TIDAK berubah - seluruh view lama ikut tampil
   baru tanpa disentuh satu per satu.
   ===================================================================== */

/* Plus Jakarta Sans, disimpan sendiri di public/assets/fonts (SIL OFL,
   lisensinya di folder yang sama). Bukan dari Google Fonts: CSP program ini
   sengaja melarang memuat apa pun dari luar, dan aturan itu tidak dibuka
   hanya demi huruf. */
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --ink:    #0F172A;
    --ink-2:  #475467;
    --muted:  #5D6779;
    --line:   #E4E8EF;
    --bg:     #F4F6FA;
    --accent: #2F5BEA;
    --accent-2: #2449C9;
    --green:  #16794A;
    --yellow: #D98E04;
    --red:    #C8372D;
    --purple: #7A5AF8;
    --white:  #FFFFFF;
    --soft:   #F8FAFC;

    --radius:    12px;
    --radius-lg: 18px;
    --gap:       16px;
    --shadow:    0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -18px rgba(15, 23, 42, .18);
    --ease:      cubic-bezier(.22, 1, .36, 1);
    --glass:     rgba(255, 255, 255, .72);
    --font:   "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Dua sapuan warna yang sangat tipis di pojok atas. Fungsinya bukan hiasan:
   kaca buram pada bilah atas butuh sesuatu di belakangnya untuk terlihat
   sebagai kaca, bukan sekadar putih. */
body {
    margin: 0;
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(47, 91, 234, .07), transparent 60%),
        radial-gradient(700px 380px at 100% 0%, rgba(122, 90, 248, .05), transparent 60%),
        var(--bg);
    background-repeat: no-repeat;
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

p { margin: 0 0 12px; }

/* --- Kerangka halaman ------------------------------------------------ */
.topbar {
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--ink); }

/* Emblem logo. Berlatar putih (sumbernya JPEG), jadi diberi sudut membulat
   supaya menyatu dengan bilah atas yang juga putih. */
.brand__mark {
    width: 32px;
    height: 32px;
    display: block;
    flex: 0 0 auto;
    border-radius: 8px;
    transition: transform .25s var(--ease);
}

.brand__name {
    transition: opacity .18s ease;
}
.brand__name span { color: var(--accent); }

/* Merek adalah tautan ke dashboard - beri tanggapan supaya terasa bisa
   ditekan, bukan sekadar gambar yang menempel di pojok. */
.brand:hover .brand__mark { transform: scale(1.07); }
.brand:hover .brand__name { opacity: .78; }
.brand:active .brand__mark { transform: scale(.97); }

.brand:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Di layar sempit emblemnya saja sudah cukup mengenali aplikasi. */
@media (max-width: 420px) {
    .brand__name { display: none; }
}

.topbar__spacer { flex: 1; }

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    flex-wrap: wrap;
}
.topbar__user strong { color: var(--ink); font-weight: 600; }

/* Navigasi utama: deretan pil di atas kaca, bukan garis bawah. Yang aktif
   diberi isi warna supaya posisi orang terbaca sekilas. */
.nav {
    background: rgba(255, 255, 255, .55);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, .05);
    overflow-x: auto;
}
.nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    gap: 4px;
    white-space: nowrap;
}
.nav a {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(15, 23, 42, .05); color: var(--ink); text-decoration: none; }
.nav a.is-active {
    background: rgba(47, 91, 234, .1);
    color: #2448C4;
    font-weight: 600;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    animation: muncul .45s var(--ease) both;
}

.page__head {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page__head h1 { margin: 0; }
.page__head .page__spacer { flex: 1; }
.page__sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

/* --- Kartu ----------------------------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow);
}
.card__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
}

.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: var(--gap);
}

.stat {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}
.stat__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat__value { font-size: 28px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* --- Tabel ----------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
th {
    background: var(--soft);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr td { transition: background .2s; }
tbody tr:hover td { background: #FAFBFD; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty {
    padding: 32px var(--gap);
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* --- Formulir -------------------------------------------------------- */
.form-row { margin-bottom: 14px; }
.form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.req { color: var(--red); }
.opt { color: var(--muted); font-weight: 400; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px; /* 16px-ish: cegah zoom otomatis di iOS */
    transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(47, 91, 234, .14);
}
textarea { min-height: 90px; resize: vertical; }

.check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 0;
    font-size: 14px;
}
.check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
}
.check label { margin: 0; font-weight: 400; font-size: 14px; color: var(--ink); }

/* --- Tombol ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
    transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:hover { text-decoration: none; background: var(--soft); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    box-shadow: 0 10px 24px -10px rgba(47, 91, 234, .6);
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--white); }
.btn--danger {
    background: var(--white);
    border-color: #F1B8B2;
    color: var(--red);
}
.btn--danger:hover { background: #FEF3F2; color: var(--red); border-color: var(--red); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.actions--end { justify-content: flex-end; }

.inline-form { display: inline; }

/* --- Lencana & indikator --------------------------------------------- */
/* Pil berisi titik warna DAN teks. Warnanya membantu memindai; teksnya
   yang membawa arti, sehingga tetap terbaca oleh yang buta warna. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.75;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
.badge--preparation { background: #F1F3F7; color: #475467; }
.badge--running     { background: #EAF6EF; color: #16794A; }
.badge--on_hold     { background: #F2EFFE; color: #5B3FD6; }
.badge--completed   { background: #EEF2FE; color: #2448C4; }
/* Review diberi warna peringatan, bukan warna netral: project pada tahap
   ini sedang dibuka untuk dikoreksi, dan itu keadaan yang harus terlihat
   berbeda dari Selesai. */
.badge--review      { background: #FDF4E3; color: #8A5300; }
.badge--muted       { background: #F1F3F7; color: var(--muted); }
.badge--green       { background: #EAF6EF; color: #16794A; }
.badge--yellow      { background: #FDF4E3; color: #8A5300; }
.badge--red         { background: #FEF0EE; color: #B42318; }
.badge--blue        { background: #EEF2FE; color: #2448C4; }
.badge--purple      { background: #F2EFFE; color: #5B3FD6; }
.badge--done        { background: #16794A; color: var(--white); }

/* Lencana yang sudah membawa titik sendiri (indikator kesehatan) tidak
   diberi titik kedua. */
.badge:has(> .dot)::before { content: none; }
.badge > .dot { margin-right: 0; }

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 1px;
}
.dot--green  { background: var(--green); }
.dot--yellow { background: var(--yellow); }
.dot--red    { background: var(--red); }

/* --- Notifikasi ------------------------------------------------------ */
.alert {
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    margin-bottom: var(--gap);
    font-size: 14px;
    animation: muncul .4s var(--ease) both;
}
.alert--success { background: #EAF6EF; border-color: #C9E7D5; color: #135E3A; }
.alert--error   { background: #FEF0EE; border-color: #F6CFCA; color: #912018; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert li { margin-bottom: 2px; }

/* --- Tab & filter ---------------------------------------------------- */
.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: var(--gap);
    white-space: nowrap;
    padding: 2px;
}
.tabs a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    transition: background .25s var(--ease), color .2s, border-color .2s;
}
.tabs a:hover { text-decoration: none; color: var(--ink); border-color: #CDD5E1; }
.tabs a.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}

.filters {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
}
/* Tombol saring tetap berdampingan di satu sel, walau tombolnya kini lebih
   lega - bertumpuk membuat Terapkan dan Reset tampak tak berhubungan. */
.filters .actions { flex-wrap: nowrap; gap: 8px; }
.filters .actions .btn { padding-left: 14px; padding-right: 14px; }

/* --- Daftar definisi ------------------------------------------------- */
.dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px var(--gap);
    margin: 0;
}
.dl > div { min-width: 0; }
.dl dt { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.dl dd { margin: 0; font-size: 14.5px; font-weight: 500; word-break: break-word; }


/* --- Paginasi -------------------------------------------------------- */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: var(--gap);
    font-size: 14px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    color: var(--ink);
}
.pagination .is-active { background: var(--ink); border-color: var(--ink); color: var(--white); }
.pagination .is-disabled { color: var(--muted); background: var(--soft); }

/* --- Halaman auth ---------------------------------------------------- */
.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap);
}
.auth__box {
    width: 100%;
    max-width: 400px;
    animation: muncul .5s var(--ease) both;
}
.auth__box .card {
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(170%) blur(22px);
    backdrop-filter: saturate(170%) blur(22px);
    border-color: rgba(255, 255, 255, .8);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .05);
}
/* Lockup penuh: halaman masuk punya ruang, jadi tulisannya terbaca.
   Lebarnya ditahan di bawah separuh lebar kotak supaya formulir tetap
   menjadi pusat perhatian, bukan logonya. */
.auth__logo {
    display: block;
    width: 100%;
    max-width: 168px;
    height: auto;
    margin: 0 auto 10px;
}

@media (max-width: 420px) {
    .auth__logo { max-width: 148px; }
}
.auth__tagline {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: var(--gap);
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }

/* --- Gerak ----------------------------------------------------------- */
/* Satu kurva untuk semua gerak (--ease), supaya seluruh program terasa
   bergerak dengan cara yang sama. Halaman muncul sekali saat dibuka -
   dari keadaan terlihat, tidak menunggu digulir. */
@keyframes muncul {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Responsif ------------------------------------------------------- */
@media (max-width: 640px) {
    :root { --gap: 12px; }
    body { font-size: 15px; }
    h1 { font-size: 22px; }
    .page { padding: 16px 12px 40px; }
    .card { padding: 16px; }
    .stat__value { font-size: 23px; }
    .form-grid { grid-template-columns: 1fr; }
    .actions .btn { flex: 1 1 auto; }
    .topbar__inner { padding: 9px 12px; }
    .nav__inner { padding: 6px 12px; }
}

/* =====================================================================
   Tahap 2 - progress, BoQ, laporan harian, daftar aktivitas
   ===================================================================== */

/* --- Bar progress ---------------------------------------------------- */
.bar {
    position: relative;
    height: 8px;
    background: #E9ECF2;
    border-radius: 999px;
    overflow: hidden;
    min-width: 90px;
}
.bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
}
.bar__fill--green  { background: var(--green); }
.bar__fill--yellow { background: var(--yellow); }
.bar__fill--red    { background: var(--red); }

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bar-row .bar { flex: 1 1 90px; }
.bar-row .bar-row__value {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 56px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.progress-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    margin-bottom: 10px;
}
.progress-hero__value {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.progress-hero__label { color: var(--muted); font-size: 13px; }

/* --- Daftar aktivitas berkelompok per fase --------------------------- */
.phase {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    margin-bottom: 12px;
    overflow: hidden;
}
.phase__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 14px;
    background: #F8F9FB;
    border-bottom: 1px solid var(--line);
}
.phase__name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.phase__count {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.phase__spacer { flex: 1; }

.task {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.task:last-child { border-bottom: none; }
.task__main { flex: 1 1 220px; min-width: 0; }
.task__name { font-size: 14.5px; }
.task__name--done { color: var(--muted); text-decoration: line-through; }
.task__meta {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.task__meta--late { color: var(--red); font-weight: 600; }
.task__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Panel Ubah satu aktivitas. Tersembunyi sampai tombol Ubah ditekan, supaya
   daftar tugas tetap pendek - sebuah fase bisa berisi belasan baris, dan
   menampilkan semua panelnya sekaligus membuat halaman menjulang.

   Lebar penuh di bawah barisnya sendiri, bukan di sampingnya: isian tanggal
   dan pilihan paket butuh ruang, dan menyelipkannya ke kanan akan memeras
   nama aktivitas yang sudah panjang.

   Satu panel membungkus DUA hal: formulir isian dan arsip fotonya - satu
   kartu, supaya terbaca sebagai satu tempat mengubah aktivitas, bukan dua
   kotak yang kebetulan bertetangga. */
.task__panel {
    flex: 1 1 100%;
    margin: 4px 0 10px 32px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg);
}
.task__panel[hidden] { display: none !important; }

.task__edit .form-grid { margin-bottom: 0; }
.task__edit .actions { margin-top: 12px; }

/* --- Usulan barang -----------------------------------------------------
   Kartu usulan di katalog sengaja diberi pita kuning di tepi kiri: isinya
   PEKERJAAN yang menunggu, bukan bagian dari katalog itu sendiri. */
.card--usulan { border-left: 3px solid var(--yellow, #B7791F); }

/* Bagian "usulkan barang baru" tertutup sampai dibutuhkan. Dibiarkan
   terbuka terus, ia mengundang orang mengetik nama baru padahal barangnya
   sudah ada di katalog - dan katalognya jadi penuh kembar. */
.usul {
    margin-top: 12px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.usul > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--accent);
}
.usul[open] > summary { margin-bottom: 8px; }


/* --- Lonceng pemberitahuan --------------------------------------------
   Di kepala halaman, terpisah dari widget chat di kanan bawah. Keduanya
   sengaja tidak digabung: satu pesan yang berdenting di dua tempat
   membuat keduanya kehilangan arti. */
.lonceng {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--muted);
    text-decoration: none;
    flex: 0 0 auto;
}
.lonceng:hover { background: var(--line); color: var(--ink); }
.lonceng:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lonceng.is-baru { color: var(--accent); }

/* Lencana angka menempel di sudut, bukan mendorong ikonnya - kepala
   halaman tidak boleh bergeser hanya karena ada satu pemberitahuan. */
.lonceng__jumlah {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}

/* --- Pop-up lonceng ----------------------------------------------------
   Melirik cepat, bukan membaca arsip. Yang ingin lengkap menekan "Lihat
   semua" di kakinya. */
.lonceng-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }

.lonceng-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(17, 24, 39, .14);
    overflow: hidden;
}
.lonceng-pop[hidden] { display: none; }

.lonceng-pop__kepala {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.lonceng-pop__kosong { padding: 16px 12px; color: var(--muted); font-size: 13px; }

.lonceng-pop__daftar {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}
.lonceng-pop__item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.lonceng-pop__item:last-child { border-bottom: 0; }
.lonceng-pop__item.is-baru { border-left: 3px solid var(--accent); padding-left: 9px; }

.lonceng-pop__judul {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.lonceng-pop__kaki {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: var(--bg);
}

/* Penanda jenis: pengajuan, pembaruan, penghapusan. Warnanya membedakan
   tanpa perlu dibaca - yang merah selalu penghapusan. */
.notif__jenis {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
}
.notif__jenis--pengajuan   { background: #E8EEFD; color: var(--accent); border-color: #C6D3FA; }
.notif__jenis--pembaruan   { background: #FCF3E1; color: #9A6503;       border-color: #F0DDB4; }
.notif__jenis--penghapusan { background: #FDF1F1; color: var(--red);    border-color: #F3C9C9; }

@media (max-width: 640px) {
    /* Di layar sempit pop-up menempel ke tepi kanan layar, bukan ke
       tombolnya - kalau mengikuti tombol, sebagian isinya keluar layar. */
    .lonceng-pop { position: fixed; top: 58px; right: 12px; left: 12px; width: auto; }
}


/* Baris pemberitahuan adalah TOMBOL, bukan tautan: mengkliknya mengubah
   keadaan - menyingkirkan kabarnya - lalu baru mengantar. Tautan yang
   diam-diam mengubah sesuatu akan ikut terpicu oleh pratinjau peramban. */
.notif__tombol {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.notif__tombol:hover .notif__kepala strong,
.notif__tombol:hover .lonceng-pop__judul { color: var(--accent); }
.notif__tombol:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.notif__form { margin: 0; }
.notif__kepala { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.notif__tombol .hint,
.notif__tombol .notif__rinci { display: block; }

/* --- Daftar pemberitahuan --------------------------------------------- */
.notif { list-style: none; margin: 0; padding: 0; }

.notif__item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.notif__item:last-child { border-bottom: 0; padding-bottom: 0; }
.notif__item:first-child { padding-top: 0; }

/* Yang belum dilihat diberi pita di tepi kiri, bukan latar berwarna:
   sebagian besar daftar biasanya baru semua, dan latar penuh warna
   membuat halamannya berteriak tanpa membedakan apa pun. */
.notif__item.is-baru {
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    margin-left: -13px;
}

.notif__isi { flex: 1 1 auto; min-width: 0; }

.notif__kepala {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.notif__waktu {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.notif__rinci {
    margin: 4px 0 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}


/* --- Rantai persetujuan ------------------------------------------------
   Daftar bernomor, bukan tabel: yang dibaca adalah URUTAN siapa menyetujui
   setelah siapa. Langkah yang sedang ditunggu ditandai supaya jelas di
   meja siapa pengajuan ini berhenti. */
.rantai { list-style: none; margin: 12px 0 0; padding: 0; }

.rantai__item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg);
}
.rantai__item:last-child { margin-bottom: 0; }

.rantai__no {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--line);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
.rantai__isi { flex: 1 1 auto; min-width: 0; }

.rantai__item.is-setuju  { border-color: #BFE0CC; }
.rantai__item.is-setuju  .rantai__no { background: var(--green); color: #fff; }
.rantai__item.is-tolak   { border-color: #F3C9C9; }
.rantai__item.is-tolak   .rantai__no { background: var(--red); color: #fff; }
.rantai__item.is-giliran { border-color: var(--accent); border-left-width: 3px; }
.rantai__item.is-giliran .rantai__no { background: var(--accent); color: #fff; }


/* --- Timeline pengadaan ------------------------------------------------
   Riwayat satu pengajuan, terbaru di atas. Satu kolom bertitik, bukan
   tabel: yang dibaca di sini adalah URUTAN dan siapa pelakunya, bukan
   perbandingan antar kolom. */
.timeline {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    position: relative;
}

/* Garis penghubung digambar di belakang titik-titiknya. */
.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--line);
}

.timeline__row {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 0 0 18px 0;
}
.timeline__row:last-child { padding-bottom: 0; }

.timeline__dot {
    position: relative;
    z-index: 1;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 4px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-sizing: border-box;
    box-shadow: 0 0 0 3px #fff;
}
.timeline__row--issue .timeline__dot { border-color: var(--red); }

/* Kendala yang BELUM selesai sengaja menonjol. Kendala yang tenggelam di
   tengah riwayat sama saja dengan tidak dilaporkan. */
.timeline__row.is-open .timeline__isi {
    background: linear-gradient(180deg, #FFF6F5, #FFFFFF);
    border: 1px solid #F8D4CF;
    border-radius: 14px;
    padding: 12px 14px;
}

.timeline__isi { flex: 1 1 auto; min-width: 0; }

.timeline__kepala {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.timeline__waktu {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.timeline__teks {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.timeline__selesai {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.timeline__selesai input[type="text"] { flex: 1 1 240px; }

/* Pemisah tipis di dalam kartu. */
.rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 16px 0;
}


/* --- Thumbnail katalog -------------------------------------------------
   Kotak tetap, bukan tinggi mengikuti gambar: foto barang datang dengan
   rasio apa saja, dan baris tabel yang tingginya berbeda-beda membuat
   daftarnya sulit dipindai. */
.katalog__thumb {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--line);
    display: block;
}
.katalog__kosong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 40px;
    border: 1px dashed var(--line);
    border-radius: 4px;
    color: var(--muted);
}

/* --- Foto arsip aktivitas ---------------------------------------------
   Bukti bahwa aktivitas ini benar-benar dikerjakan atau diperbarui.
   Letaknya di dalam panel Ubah, bukan di baris daftar: daftar dipakai untuk
   memindai status dengan cepat, dan deretan gambar di tiap baris membuatnya
   panjang serta sulit dibaca di ponsel. */
.task__arsip {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.task__arsip-judul {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 0 0 10px;
}
.task__arsip-isi {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}
.task__arsip .hint { margin-top: 10px; }

.arsip {
    margin: 0;
    width: 112px;
    position: relative;
}
.arsip img {
    width: 112px;
    height: 84px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    display: block;
}

/* Keterangan dibatasi tiga baris. Tanpa batas, satu keterangan panjang
   menarik seluruh baris foto memanjang ke bawah dan jajarannya rusak. */
.arsip figcaption {
    font-size: 11px;
    line-height: 1.35;
    margin-top: 4px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.arsip figcaption .muted { display: block; }

/* Tombol hapus ditumpangkan di sudut gambar, bukan diselipkan ke dalam
   teks keterangan - di dalam teks ia ikut mengalir sehingga letaknya
   berpindah pindah mengikuti panjang keterangan. */
.arsip__hapus { position: absolute; top: 4px; right: 4px; }
.arsip__x {
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(17, 24, 39, .62);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
.arsip__x:hover { background: var(--red); }

/* Pemilih berkas bawaan peramban lebarnya tidak bisa ditebak dan
   berbeda tiap sistem, jadi disembunyikan dan labelnya yang digayakan. */
.arsip__tambah {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
}
.arsip__pilih input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.arsip__pilih span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 112px;
    height: 84px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}
.arsip__pilih input:focus-visible + span { outline: 2px solid var(--accent); }
.arsip__pilih span:hover { border-color: var(--accent); color: var(--accent); }

/* Keterangan dan tombol menumpuk dalam satu kolom setinggi kotak unggah,
   sehingga ketiganya membentuk satu blok rapi - bukan tombol yang jatuh
   sendirian ke baris berikutnya. */
.arsip__isi {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    width: 230px;
}
.arsip__caption { width: 100%; }
.arsip__isi .btn { align-self: flex-start; }

@media (max-width: 640px) {
    .arsip__tambah { flex-wrap: wrap; }
    .arsip__isi { width: 100%; flex: 1 1 100%; }
}


/* =====================================================================
   Pop-up (dialog)

   Dipakai untuk formulir yang tidak layak memindahkan halaman - menambah
   item BoQ atau project baru. Memakai elemen <dialog> bawaan peramban,
   bukan div bertumpuk: penanganan Escape, jebakan fokus, dan latar gelap
   sudah disediakan peramban dan lebih benar daripada yang ditiru sendiri.

   Tanpa JavaScript, aturan di <noscript> pada masing-masing halaman
   membuat dialog ini tampil sebagai kartu biasa - jadi fiturnya tidak
   hilang, hanya tidak mengambang.
   ===================================================================== */
.modal {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 22px;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(170%) blur(28px);
    backdrop-filter: saturate(170%) blur(28px);
    color: var(--ink);
    box-shadow: 0 40px 90px -24px rgba(15, 23, 42, .38), 0 0 0 1px rgba(15, 23, 42, .05);
    overflow: hidden;
}
.modal--sm { width: min(560px, calc(100vw - 32px)); }

/* Kepala dan kaki selalu terlihat; hanya isinya yang menggulir. Dulu isi
   dibatasi tinggi tetap (100vh - 160px) - kepala + langkah + kaki formulir
   homepass lebih tinggi dari 160px, jadi tombol kirim terdorong keluar
   layar dan baru terlihat setelah di-zoom out. */
.modal[open] { display: flex; flex-direction: column; }
.modal > form,
.modal > [data-modal-remote-slot],
.modal [data-modal-remote-slot] > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal__head, .modal__foot, .hp-steps, .hp-note { flex: 0 0 auto; }

/* Halaman di belakang diburamkan, bukan sekadar digelapkan: orang tetap
   tahu ia masih di halaman yang sama, hanya sedang mengisi sesuatu di atasnya. */
.modal::backdrop {
    background: rgba(15, 23, 42, .26);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
}

/* Masuk: panel naik sedikit sambil membesar; latarnya memudar masuk.
   Keluar: kelas is-closing dipasang app.js, dialog baru ditutup sesudah
   animasinya selesai. */
.modal[open] { animation: modalMasuk .42s var(--ease) both; }
.modal[open]::backdrop { animation: latarMasuk .26s var(--ease) both; }
.modal.is-closing { animation: modalKeluar .2s ease both; }
.modal.is-closing::backdrop { animation: latarKeluar .22s ease both; }

@keyframes modalMasuk  { from { opacity: 0; transform: translateY(18px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes modalKeluar { to   { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes latarMasuk  { from { opacity: 0; } to { opacity: 1; } }
@keyframes latarKeluar { to   { opacity: 0; } }
@keyframes lembarNaik  { from { opacity: .4; transform: translateY(60px); } to { opacity: 1; transform: none; } }

.modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 14px;
}
.modal__title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.modal__sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.modal__spacer { flex: 1 1 auto; }

.modal__x {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(15, 23, 42, .05);
    color: var(--ink-2);
    font-size: 22px;
    line-height: 1;
    padding: 0;
    border-radius: 12px;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .2s, transform .15s;
}
.modal__x:hover { background: rgba(15, 23, 42, .09); color: var(--ink); }
.modal__x:active { transform: scale(.94); }
.modal__x:focus-visible { outline: 2px solid var(--accent); }

/* Isinya yang menggulir, bukan seluruh halaman di belakangnya. */
.modal__body {
    padding: 4px 24px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
}

.modal__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 24px;
    border-top: 1px solid rgba(15, 23, 42, .07);
    background: rgba(248, 250, 252, .7);
}

/* Kartu di dalam dialog tidak perlu bingkai lagi - dialognya sudah kartu. */
.modal__body > .card {
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Di ponsel pop-up menjadi lembar dari bawah - jempol sampai ke tombolnya. */
@media (max-width: 640px) {
    .modal,
    .modal--sm {
        width: 100vw;
        max-width: 100vw;
        max-height: 92vh;
        max-height: 92dvh;
        margin: auto 0 0;
        border-radius: 22px 22px 0 0;
        border: none;
    }
    .modal[open] { animation-name: lembarNaik; }
    .modal__head, .modal__body, .modal__foot { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 640px) {
    /* Di layar sempit tidak ada ruang untuk menjorok. */
    .task__panel { margin-left: 0; }
}

.mark {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line);
    font-size: 11px;
    line-height: 1;
    flex: 0 0 auto;
    margin-top: 2px;
}
.mark--done { background: var(--green); border-color: var(--green); color: #fff; }
.mark--progress { border-color: var(--accent); color: var(--accent); }

/* --- Form laporan harian (mobile-first, nyaman di 360 px) ------------ */
.qty-list { display: grid; gap: 10px; }

.qty-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--white);
}
.qty-item__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.qty-item__name { font-size: 14.5px; font-weight: 500; }
.qty-item__remain {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.qty-item__input {
    display: flex;
    align-items: center;
    gap: 10px;
}
.qty-item__input input {
    font-size: 17px;      /* cukup besar untuk jempol di layar 360 px */
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.qty-item__unit {
    color: var(--muted);
    font-size: 14px;
    min-width: 42px;
}

/* --- Galeri foto ----------------------------------------------------- */
.photos {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.photo {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}
.photo img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: #EEF1F6;
}
.photo__meta { padding: 8px 10px; font-size: 12.5px; }
.photo__caption { font-weight: 500; }
.photo__location { color: var(--muted); }

/* --- Sub-navigasi halaman project ------------------------------------ */
/* Kapsul tersegmen di atas kaca: bagian yang aktif terisi gelap. */
.subnav {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    padding: 4px;
    overflow-x: auto;
    white-space: nowrap;
    background: rgba(255, 255, 255, .7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 20px;
}
.subnav a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    transition: background .25s var(--ease), color .2s;
}
.subnav a:hover { color: var(--ink); text-decoration: none; background: rgba(15, 23, 42, .04); }
.subnav a.is-active { background: var(--ink); color: var(--white); }
.subnav .subnav__badge {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    padding: 0 6px;
    margin-left: 4px;
    vertical-align: 1px;
}

/* --- Catatan dua-angka ----------------------------------------------- */
.dual-note {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    border-left: 3px solid var(--line);
    padding: 8px 12px;
    margin-top: 12px;
}

@media (max-width: 480px) {
    .qty-item__input input { font-size: 18px; padding: 11px 12px; }
    .photos { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .progress-hero__value { font-size: 28px; }
}

/* =====================================================================
   Tahap 3 - monitoring: indikator, penanda rencana, kurva S
   ===================================================================== */

/* Penanda garis rencana di atas bar progress. */
.bar__plan {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: var(--ink);
    border-radius: 1px;
    transform: translateX(-1px);
}
.bar-row__plan-label {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

/* Kartu yang menuntut tindakan. */
/* Peringatan dibedakan dengan latar hangat dan bingkai merah muda, bukan
   bingkai merah tebal - tetap menonjol tanpa terasa seperti galat. */
.card--alert { border-color: #F8D4CF; background: linear-gradient(180deg, #FFF6F5, #FFFFFF 70%); }
.stat--alert { border-color: #F8D4CF; background: linear-gradient(180deg, #FFF6F5, #FFFFFF 70%); }
.stat--alert .stat__value { color: #B42318; }

.text-red   { color: var(--red); font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }

/* Wadah kanvas Chart.js. */
.chart {
    position: relative;
    height: 320px;
    width: 100%;
}

@media (max-width: 640px) {
    .chart { height: 260px; }
}

/* =====================================================================
   Cetak - dipakai laporan QC
   ===================================================================== */
@media print {
    .topbar, .nav, .subnav, .actions, .btn { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .page { max-width: none; padding: 0; }
    .card { border: 1px solid #999; break-inside: avoid; page-break-inside: avoid; }
    .table-wrap { overflow: visible; border: none; }
    table { font-size: 10pt; }
    a { color: inherit; text-decoration: none; }
}

/* =====================================================================
   Baris realisasi menyamping + tampilan responsif menyeluruh
   ===================================================================== */

.item-picker { margin-bottom: 14px; }
.item-picker select { font-size: 15px; }

/* Satu baris = nama pekerjaan, kolom angka, tombol keluarkan.
   Di layar sempit ketiganya menumpuk sendiri lewat flex-wrap. */
.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--white);
}
.qty-row + .qty-row { margin-top: 8px; }

.qty-row__main {
    flex: 1 1 190px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.qty-row__name {
    font-size: 14.5px;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.qty-row__meta {
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.qty-row__field {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-row__field input {
    width: 116px;
    font-size: 16px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.qty-row__unit {
    color: var(--muted);
    font-size: 13.5px;
    min-width: 40px;
}

.qty-row__drop { flex: 0 0 auto; }
.qty-row__tag  { flex: 0 0 auto; }

.qty-row--done { background: var(--bg); }
.qty-row--done .qty-row__field input {
    background: var(--bg);
    color: var(--muted);
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .qty-row { gap: 10px; }
    .qty-row__main  { flex: 1 1 100%; }
    .qty-row__field { flex: 1 1 auto; }
    .qty-row__field input { width: 100%; font-size: 17px; padding: 11px 12px; }
    .qty-row__drop { flex: 0 0 auto; }
}

/* --- Tabel di layar sempit: baris tetap mendatar ----------------------
   Sebelumnya tiap baris dipecah menjadi kartu, satu sel satu baris ke
   bawah. Pada daftar project berkolom sembilan, dua puluh project menjadi
   seratus delapan puluh baris - halamannya sangat panjang dan sulit
   dibandingkan antar-baris.

   Sekarang tabelnya tetap tabel: barisnya mendatar dan isinya digeser ke
   samping di dalam .table-wrap yang memang sudah punya overflow-x.

   Dua hal yang membuat geser-samping tetap terbaca:
     - kolom pertama dipaku di tepi kiri, sehingga identitas baris tidak
       hilang saat digeser ke kanan;
     - tabel boleh lebih lebar dari layar (width auto), sebab width 100%
       justru memeras kolom sampai teksnya membungkus dan barisnya kembali
       menjulang tinggi - persis masalah yang ingin dihindari.

   Atribut data-label di markup sengaja dibiarkan: tidak tampil lagi, tapi
   tetap ada bila suatu saat pola kartu ingin dipakai kembali. */
@media (max-width: 720px) {
    .table-stack table {
        width: auto;
        min-width: 100%;
        font-size: 13px;
    }

    .table-stack th,
    .table-stack td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* Nama project/keterangan panjang dipangkas, bukan dibiarkan menarik
       lebar tabel sampai puluhan layar. Nama utuhnya tetap ada di halaman
       detail. */
    .table-stack td .hint,
    .table-stack td .cum__name {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Kolom pertama dipaku di tepi kiri. Latarnya wajib pekat, kalau tidak
       isi kolom lain akan terlihat menembus saat digeser. */
    .table-stack th:first-child,
    .table-stack td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--white);
        box-shadow: 1px 0 0 var(--line);
    }
    .table-stack thead th:first-child {
        background: #F8F9FB;
        z-index: 2;
    }
    .table-stack tbody tr:hover td:first-child { background: #FAFBFC; }

    /* Sel yang membentang penuh (baris "hari ini", baris kosong, tfoot)
       bukan kolom identitas - memakukannya justru merusak tampilan. */
    .table-stack td[colspan]:first-child,
    .table-stack th[colspan]:first-child {
        position: static;
        box-shadow: none;
    }

    .table-stack tfoot td { border-top: 2px solid var(--line); }

    .table-stack .actions { flex-wrap: nowrap; }
    .table-stack .actions .btn { flex: 0 0 auto; }
}

/* --- Ringkasan pekerjaan hari ini pada daftar segmen ------------------ */
.today-row td {
    border-top: none;
    padding-top: 0;
}
.today {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 12.5px;
}
.today__label {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .03em;
    margin-right: 2px;
}
.today__chip {
    background: #EAF1FF;
    color: #1B3A6B;
    border-radius: 999px;
    padding: 2px 9px;
    font-variant-numeric: tabular-nums;
}
.today__none { color: var(--muted); }

@media (max-width: 720px) {
    .table-stack .today-row td { padding-top: 6px; }
}

/* --- Saklar sembunyikan nilai ---------------------------------------- */
.rp-hidden [data-rp] { display: none !important; }

/* --- Kolom realisasi kumulatif pada daftar segmen ---------------------
   Satu sel berisi daftar ringkas "item -> capaian/volume". Nama item
   dipangkas dengan ellipsis bila kolomnya sempit; nama lengkapnya tetap
   terbaca lewat atribut title. */
.cum {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.55;
}
.cum__line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}
.cum__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
}
.cum__val {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.cum__of   { color: var(--muted); font-weight: 400; }
.cum__unit { flex: 0 0 auto; min-width: 26px; color: var(--muted); }

.cum__line--done .cum__name,
.cum__line--done .cum__val { color: var(--green); }
.cum__line--done .cum__of  { color: var(--muted); }

.cum__empty { color: var(--muted); }

@media (max-width: 720px) {
    /* Bukan kartu lagi: kolomnya tetap sempit, jadi nama item dipangkas
       seperti di layar lebar. Nama lengkapnya tetap terbaca lewat title. */
    .cum { font-size: 12px; }
}

/* --- Nilai yang ditentukan sistem, bukan diketik pengguna ------------- */
.readonly-box {
    margin: 0;
    padding: 9px 12px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--muted);
    font-size: 14px;
}
.readonly-box strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

/* --- Daftar capaian pada laporan mingguan ----------------------------- */
.achievements { margin: 0; padding-left: 20px; }
.achievements li { margin-bottom: 6px; }
.achievements__name { font-weight: 500; }
.achievements__qty {
    color: var(--green);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}
.achievements__cum {
    color: var(--muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

.mb-16 { margin-bottom: 16px; }

/* --- Zona tindakan yang tidak bisa dibatalkan ------------------------- */
.card--danger {
    border-color: var(--red);
    border-left: 3px solid var(--red);
}
.card--danger .card__title { color: var(--red); }
.danger-list {
    margin: 0 0 12px;
    padding-left: 20px;
    font-size: 13px;
    color: var(--muted);
}
.danger-list strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* --- Isian angka dengan pilihan satuan -------------------------------- */
.unit-input {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.unit-input input {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.unit-input select {
    flex: 0 0 auto;
    width: auto;
    min-width: 74px;
    background-position: right 8px center;
    padding-right: 28px;
}

/* --- Kartu angka yang bisa diklik ------------------------------------- */
.stat--link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s, box-shadow .12s, transform .12s;
}
.stat--link:hover,
.stat--link:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 1px 6px rgba(20, 40, 90, .10);
    transform: translateY(-1px);
}
.stat--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat--link .stat__value { color: var(--ink); }
.stat--link.stat--alert:hover,
.stat--link.stat--alert:focus-visible { border-color: var(--red); }

/* Panah kecil sebagai tanda kartunya membuka daftar. */
.stat--link .stat__label::after {
    content: ' \2192';
    color: var(--muted);
    opacity: 0;
    transition: opacity .12s;
}
.stat--link:hover .stat__label::after,
.stat--link:focus-visible .stat__label::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .stat--link { transition: none; }
    .stat--link:hover, .stat--link:focus-visible { transform: none; }

    .brand__mark, .brand__name { transition: none; }
    .brand:hover .brand__mark, .brand:active .brand__mark { transform: none; }
}

/* --- Pemilih banyak foto pada laporan harian -------------------------- */
.photo-picker {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    margin-bottom: 14px;
    overflow: hidden;
}
.photo-picker__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.photo-picker__spacer { flex: 1 1 auto; }

/* Daftar dibatasi tingginya: 30 foto tidak boleh mendorong tombol Kirim
   sampai jauh ke bawah layar. */
.photo-picker__items {
    max-height: 420px;
    overflow-y: auto;
}
.photo-picker__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
}
.photo-picker__item + .photo-picker__item { border-top: 1px solid var(--line); }

.photo-picker__thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg);
}
.photo-picker__fields {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.photo-picker__name {
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
}
.photo-picker__fields input { font-size: 13px; padding: 6px 9px; }

@media (max-width: 560px) {
    .photo-picker__items { max-height: 340px; }
    .photo-picker__thumb { width: 44px; height: 44px; }
    .photo-picker__item { gap: 8px; padding: 8px 10px; }
}

/* --- Formulir laporan harian ------------------------------------------
   Dulu dikurung 640 px sementara halaman lain memakai 820-900 px, jadi
   terlihat sempit dan tidak sejalan dengan halaman lain.

   Di layar lebar dibagi dua kolom: kondisi hari ini di kiri (isian pendek),
   realisasi pekerjaan di kanan (bagian paling banyak isinya). Foto dan
   tombol kirim membentang penuh karena keduanya butuh ruang - daftar foto
   memuat gambar kecil beserta dua kolom keterangan.

   Urutan sumbernya tetap kondisi -> realisasi -> foto -> aksi, sehingga di
   ponsel menumpuk mengikuti cara pengawas mengisinya. */
.report-form {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 900px) {
    /* Satu kolom kiri yang mengalir dari atas ke bawah - kondisi hari ini,
       lalu foto, lalu tombol kirim - dan satu kolom kanan berisi realisasi
       pekerjaan yang paling banyak isinya. Dua kolom saja, tanpa pita
       melintang di bawahnya, sehingga halamannya lebih pendek dan tenang. */
    .report-form {
        grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
        grid-template-areas:
            "kondisi   realisasi"
            "foto      realisasi"
            "aksi      realisasi"
            ".         realisasi";

        /* Baris keempat inilah yang menahan kolom kiri tetap rapat.
           Kolom kanan membentang seluruh baris, dan tingginya dibagi ke
           baris-baris yang dilewatinya - tanpa baris penyerap ini, kartu
           kondisi, foto, dan tombol saling terdorong menjauh sejauh
           panjang daftar item di kanan. */
        grid-template-rows: auto auto auto 1fr;
    }
    .report-form__kondisi   { grid-area: kondisi; }
    .report-form__foto      { grid-area: foto; }
    .report-form__aksi      { grid-area: aksi; }
    .report-form__realisasi { grid-area: realisasi; }

    /* Kartu dalam grid tidak boleh membawa margin bawahnya sendiri -
       jaraknya sudah diatur gap, kalau tidak jadi dobel. */
    .report-form > .card { margin-bottom: 0; }

    /* Isian pendek di kolom sempit lebih terbaca menumpuk daripada
       dipaksa berdampingan. */
    .report-form__kondisi .form-grid { grid-template-columns: 1fr; }

    /* Daftar foto dipendekkan di kolom kiri supaya tombol kirim tetap
       terlihat tanpa menggulir jauh. */
    .report-form__foto .photo-picker__items { max-height: 300px; }
}

@media (min-width: 1280px) {
    .report-form { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
    .report-form__foto .photo-picker__items { max-height: 360px; }
}

/* Baris tombol bukan sebuah objek tersendiri - ia penutup kolom kiri.
   Tanpa garis dan latar kotaknya, halaman berhenti terbaca sebagai tiga
   kotak bertumpuk dan tombol Kirim jadi hal paling menonjol di sana. */
.report-form__aksi {
    background: none;
    border: none;
    padding: 0;
}
.report-form__aksi .actions .btn { flex: 1 1 auto; }
.report-form__aksi .hint { margin-top: 10px; }

@media (min-width: 900px) {
    .report-form__aksi .actions .btn--primary { flex: 2 1 auto; }
}

/* --- Gelembung percakapan --------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat__row { display: flex; }
.chat__row--me { justify-content: flex-end; }

.chat__bubble {
    max-width: min(620px, 78%);
    padding: 9px 12px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--line);
}
.chat__bubble--me { background: #EAF1FF; border-color: #CFDDF7; }

.chat__body { font-size: 14.5px; overflow-wrap: anywhere; }
.chat__meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

@media (max-width: 560px) {
    .chat__bubble { max-width: 88%; }
}

/* =====================================================================
   Panel chat mengambang (kanan bawah)

   Warnanya mengikuti token tema yang sama dengan seluruh program - biru
   aksen untuk tombolnya, garis dan latar yang sama dengan kartu. Bentuknya
   membulat: tombol lingkaran penuh, panelnya ber-radius sama seperti kartu.
   ===================================================================== */
.cw {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    display: flex;

    /* column-reverse, bukan column: tombol ditulis lebih dulu di markup
       supaya pembaca layar menemukannya duluan, tetapi harus TAMPIL di
       bawah dengan panel terbuka ke atas. */
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
}

/* --- Tombol bulat ----------------------------------------------------- */
.cw__fab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(27, 34, 51, .22);
    transition: transform .12s, box-shadow .12s, background .12s;
}
.cw__fab:hover,
.cw__fab:focus-visible {
    background: #2749C4;
    box-shadow: 0 6px 20px rgba(27, 34, 51, .28);
    transform: translateY(-1px);
}
.cw__fab:focus-visible { outline: 3px solid rgba(47, 91, 234, .35); outline-offset: 2px; }
.cw__fab-icon { width: 25px; height: 25px; display: block; }

/* Angka, bukan hanya titik: jumlahnya yang menentukan tindakan. */
.cw__fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    border: 2px solid var(--white);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --- Panel ------------------------------------------------------------ */
/* Atribut hidden HARUS menang. Aturan display apa pun pada elemen ini
   mengalahkan [hidden] { display: none } bawaan peramban - tanpa baris
   di bawah, panel tetap memakan ruang saat "tertutup" dan mendorong
   tombolnya jauh ke atas. */
.cw__panel[hidden] { display: none !important; }

.cw__panel {
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 34px rgba(27, 34, 51, .18);
    overflow: hidden;
}

.cw__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
.cw__title { font-weight: 600; font-size: 14.5px; }
.cw__spacer { flex: 1 1 auto; }

.cw__back,
.cw__new,
.cw__close {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 6px;
    cursor: pointer;
}
.cw__back:hover, .cw__new:hover, .cw__close:hover { background: var(--white); color: var(--ink); }
.cw__back:focus-visible,
.cw__new:focus-visible,
.cw__close:focus-visible { outline: 2px solid var(--accent); }

/* Memulai percakapan adalah tindakan utama di kepala panel, bukan sekadar
   pelengkap seperti tutup - jadi diberi warna aksen supaya terbaca duluan. */
.cw__new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.cw__new svg { width: 18px; height: 18px; display: block; }
.cw__new:hover { color: var(--accent); background: var(--white); }
.cw__new[hidden] { display: none !important; }

.cw__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 12px;
}
.cw__empty { color: var(--muted); font-size: 13.5px; text-align: center; margin: 24px 0; }

/* --- Pencarian penerima ------------------------------------------------
   Kotak cari menempel di atas saat daftar digulir, supaya kata kunci tetap
   terlihat dan bisa diubah tanpa menggulir balik. */
.cw__cari-wrap {
    position: sticky;
    top: -10px;
    z-index: 1;
    padding: 4px 0 8px;
    background: var(--white);
}

.cw__cari {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: inherit;
    font: inherit;
    font-size: 13.5px;
}
.cw__cari::placeholder { color: var(--muted); }
.cw__cari:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(47, 91, 234, .18);
}

/* Penanda baris terpilih lewat papan ketik. */
.cw__item--sorot {
    background: var(--bg);
    box-shadow: inset 0 0 0 2px var(--accent);
}

/* --- Daftar percakapan dan kontak ------------------------------------- */
.cw__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.cw__item:hover, .cw__item:focus-visible { background: var(--bg); }
.cw__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.cw__item-main { flex: 1 1 auto; min-width: 0; }
.cw__item-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.cw__item-sub  { font-size: 11.5px; color: var(--muted); }

.cw__item-badge {
    flex: 0 0 auto;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    line-height: 19px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cw__section {
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 10px 0 4px;
    padding: 0 10px;
}
.cw__section:first-child { margin-top: 0; }
.cw__note { font-size: 12px; color: var(--muted); padding: 0 10px 8px; }

/* --- Gelembung di dalam panel ----------------------------------------- */
.cw__msg { display: flex; margin-bottom: 8px; }
.cw__msg--me { justify-content: flex-end; }
.cw__bubble {
    max-width: 82%;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    font-size: 13.5px;
    overflow-wrap: anywhere;
}
.cw__bubble--me { background: #EAF1FF; border-color: #CFDDF7; }
.cw__bubble time { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }

/* --- Kaki panel ------------------------------------------------------- */
.cw__foot { border-top: 1px solid var(--line); background: var(--white); }
.cw__form[hidden] { display: none !important; }

.cw__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 9px 10px;
}
.cw__form textarea {
    flex: 1 1 auto;
    min-height: 38px;
    max-height: 110px;
    resize: none;
    font-size: 13.5px;
    padding: 8px 10px;
}
.cw__form .btn { flex: 0 0 auto; }

.cw__all {
    display: block;
    padding: 9px 12px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}
.cw__all:hover { background: var(--bg); text-decoration: underline; }

.cw__error {
    margin: 0;
    padding: 8px 12px;
    background: #FDECEA;
    color: var(--red);
    font-size: 12.5px;
    border-top: 1px solid var(--line);
}

/* --- Layar sempit: panel memenuhi layar -------------------------------- */
@media (max-width: 520px) {
    .cw { right: 14px; bottom: 14px; }
    .cw__panel {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        max-width: none;
        height: min(70vh, 460px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cw__fab { transition: none; }
    .cw__fab:hover, .cw__fab:focus-visible { transform: none; }
}

/* Saat dicetak, panel tidak ikut. */
@media print { .cw { display: none !important; } }

/* --- Foto bukti kendala ----------------------------------------------
   Ditempatkan di dalam sel uraian, jadi ukurannya lebih kecil daripada
   arsip foto aktivitas: tabel kendala dipakai untuk memindai banyak baris
   sekaligus, dan gambar seukuran penuh membuatnya terlalu tinggi. */
.bukti {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.arsip--kecil { width: 88px; }
.arsip--kecil img { width: 88px; height: 66px; }

/* --- Rencana mingguan: dua cara mengisi -------------------------------
   Kolom qty dan kolom persen keduanya ada di markah. Yang tampil diatur
   kelas pada form, supaya berpindah cara tidak perlu memuat ulang halaman
   dan isian yang sudah diketik tidak hilang. */
.rencana__mode {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 14px;
}
.rencana__mode label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}
.rencana__mode input { margin: 0; }

.rencana__hasil {
    display: inline-block;
    padding: 7px 0;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

/* Mode qty: persen jadi hasil hitungan, bukan isian. */
.rencana--qty .rencana__pct,
.rencana--qty .rencana__bantu-pct { display: none; }

/* Mode persen: kolom qty dan acuannya tidak dipakai sama sekali. */
.rencana--pct .rencana__kol-qty,
.rencana--pct .rencana__acuan,
.rencana--pct .rencana__hasil,
.rencana--pct .rencana__bantu-qty { display: none; }
.rencana__hasil.is-lewat { color: var(--red); font-weight: 600; }

/* =====================================================================
   Pengajuan homepass (docs/pengajuan-homepass.md)

   Tampilan mengikuti rancangan yang disetujui pemilik produk 29 Oktober
   2026: daftar dengan chip tahap, pelacak 10 langkah, dan semua formulir
   sebagai pop-up kaca di atas halaman yang diburamkan.
   ===================================================================== */
.hp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.hp-back { display: inline-block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.hp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hp-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.hp-num.is-late { color: #B42318; }
.hp-ink { color: var(--ink); }
.hp-spacer { flex: 1 1 auto; }
.hp-h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.hp-h3:first-child { margin-top: 0; }

/* Ringkasan: satu kartu dibagi empat, bukan empat kotak terpisah. */
.hp-kpi {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.hp-kpi__c { padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hp-kpi__c + .hp-kpi__c { border-left: 1px solid var(--line); }
.hp-kpi__l { font-size: 13px; color: var(--muted); font-weight: 500; }
.hp-kpi__v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hp-kpi__v small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.hp-kpi__s { font-size: 12.5px; color: var(--muted); }
.hp-kpi__c--warn .hp-kpi__v { color: #B42318; }

.hp-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.hp-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1 1 520px; min-width: 0; padding: 2px; }
.hp-chip {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .75);
    font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
    transition: background .25s var(--ease), color .25s, border-color .25s;
}
.hp-chip span { font-size: 12px; opacity: .72; font-variant-numeric: tabular-nums; }
.hp-chip:hover { border-color: #CDD5E1; color: var(--ink); text-decoration: none; }
.hp-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--white); }
.hp-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.hp-tools label { margin: 0; }
.hp-tools input, .hp-tools select { min-height: 40px; width: auto; }
.hp-search input { width: 230px; }

/* Daftar: baris grid, bukan tabel - di ponsel kolomnya bisa disusun ulang. */
.hp-list {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.hp-list__head, .hp-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, 1.15fr) minmax(0, 1fr) 80px;
    gap: 16px;
    align-items: center;
    padding: 14px 22px;
}
.hp-list__head { background: var(--soft); font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; padding-top: 12px; padding-bottom: 12px; }
.hp-row { border-top: 1px solid var(--line); transition: background .2s; }
.hp-row:hover { background: #FAFBFD; }
.hp-row.is-new { animation: muncul .45s var(--ease) both, sorot 2.6s ease .45s both; }
@keyframes sorot { from { background: #EAF0FE; } to { background: transparent; } }
.hp-row__main { display: flex; flex-direction: column; min-width: 0; }
.hp-row__code { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.hp-row__title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.hp-row__title:hover { color: var(--accent); }
.hp-row__hp, .hp-row__days { display: flex; flex-direction: column; }
.hp-row__act { text-align: right; }
.hp-mini { height: 6px; border-radius: 99px; background: #EEF1F6; overflow: hidden; max-width: 140px; margin-bottom: 5px; }
.hp-mini span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.hp-issue { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #B42318; }
.hp-issue::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #D92D20; }

@media (max-width: 900px) {
    .hp-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hp-kpi__c:nth-child(3) { border-left: 0; }
    .hp-kpi__c:nth-child(n+3) { border-top: 1px solid var(--line); }
    .hp-list__head { display: none; }
    .hp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
    .hp-row__cab, .hp-row__hp { display: none; }
    .hp-search input { width: 100%; }
}

/* --- Pop-up formulir --------------------------------------------------- */
.hp-modal { width: min(820px, calc(100vw - 32px)); }
.hp-form { display: flex; flex-direction: column; min-height: 0; }
.hp-form__body { flex: 1 1 auto; }
.hp-note {
    display: flex; flex-direction: column; gap: 2px; margin: 0 24px 14px; padding: 12px 16px;
    border-radius: 14px; background: rgba(253, 244, 227, .85); border: 1px solid #F3DDB2; font-size: 14px;
}
.hp-note strong { color: #8A5300; }
.hp-cols .hp-note, .card .hp-note { margin: 14px 0 0; }

.hp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 24px 16px; }
.hp-steps__i { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; color: var(--muted); }
.hp-steps__bar { display: block; height: 4px; border-radius: 99px; background: #E6EAF1; overflow: hidden; }
.hp-steps__bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .55s var(--ease); }
.hp-steps__i.is-done .hp-steps__bar i, .hp-steps__i.is-now .hp-steps__bar i { width: 100%; }
.hp-steps__t { font-size: 12.5px; font-weight: 600; transition: color .3s; }
.hp-steps__i.is-now .hp-steps__t, .hp-steps__i.is-done .hp-steps__t { color: var(--ink); }
.hp-form[data-wizard="langkah"] .hp-steps__i { cursor: default; }

/* Tanpa JavaScript semua bagian tampil berurutan; app.js yang menyembunyikan
   bagian lain dan menganimasikan perpindahannya. */
.hp-pane + .hp-pane { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.hp-form.is-wizard .hp-pane + .hp-pane { margin-top: 0; padding-top: 0; border-top: 0; }
.hp-pane.is-enter { animation: paneMaju .36s var(--ease) both; }
.hp-pane.is-enter-back { animation: paneMundur .36s var(--ease) both; }
@keyframes paneMaju   { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes paneMundur { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }

.hp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp-span2 { grid-column: 1 / -1; }
.hp-span-all { flex: 1 1 100%; margin: 0; }
.hp-fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.hp-fieldset legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }

/* Pilihan tersegmen dari radio sungguhan - bisa dipakai keyboard dan tetap
   jalan tanpa JavaScript. */
.hp-seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; background: #EEF1F6; border-radius: 12px; }
.hp-seg__i { position: relative; margin: 0; }
.hp-seg__i input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.hp-seg__i span {
    display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 10px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-align: center;
    transition: background .3s var(--ease), color .2s, box-shadow .3s var(--ease);
}
.hp-seg__i input:checked + span { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.hp-seg__i--neg input:checked + span { color: #B42318; }
.hp-seg__i input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.hp-tpl { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px; margin-bottom: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; }
.hp-tpl .form-row { flex: 1 1 260px; margin: 0; }
.hp-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; margin-bottom: 12px; text-align: center; border: 1.5px dashed #CDD5E1; border-radius: 16px; background: rgba(248, 250, 252, .6); }
.hp-empty[hidden] { display: none; }
.hp-mat { display: flex; flex-direction: column; }
.hp-mat__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); animation: muncul .38s var(--ease) both; }
.hp-mat__row:first-child { border-top: 0; }
.hp-mat__name { display: flex; flex-direction: column; min-width: 0; }
.hp-mat__src { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.hp-mat__f { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.hp-mat__f[hidden] { display: none; }
.hp-mat__f input, .hp-mat__f select { height: 42px; min-height: 42px; font-weight: 400; }
.hp-mat__f input { text-align: right; font-variant-numeric: tabular-nums; }
.hp-mat__info { grid-column: 1 / -1; margin: 0; }
.hp-qty { display: inline-flex; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--white); flex: 0 0 auto; }
.hp-qty button { width: 40px; height: 100%; border: 0; background: transparent; font: inherit; font-size: 19px; color: var(--ink-2); cursor: pointer; transition: background .2s; }
.hp-qty button:hover { background: var(--soft); }
.hp-qty input { width: 76px; min-height: 0; height: 100%; padding: 0 6px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.hp-qty input:focus { box-shadow: none; background: #F6F8FF; }
.hp-rm { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; transition: background .2s, color .2s; }
.hp-rm:hover { background: #FEF0EE; color: #B42318; }
.hp-add { display: flex; gap: 8px; margin-top: 12px; }
.hp-add select { flex: 1 1 auto; }

.hp-file { display: flex; gap: 12px; align-items: center; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); font-size: 14px; }
.hp-file__del { margin: 0 0 0 auto; display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--muted); }
.hp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 10px; }
.hp-thumbs--view { margin-top: 16px; }
.hp-thumb { display: flex; flex-direction: column; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--soft); font-weight: 500; }
.hp-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.hp-thumb span { display: flex; gap: 6px; align-items: center; padding: 6px 8px; font-size: 12px; color: var(--muted); }
.hp-thumb--doc { aspect-ratio: 4 / 3; justify-content: center; align-items: center; text-align: center; padding: 8px; color: var(--ink); }
.hp-thumb--doc small { color: var(--muted); font-size: 11.5px; word-break: break-all; }
.hp-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hp-sum div { background: var(--white); padding: 12px 14px; }
.hp-sum b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.hp-sum span { font-size: 12px; color: var(--muted); }
.hp-wiz-hint { color: #B42318; margin: 0 6px 0 0; }

/* --- Panel samping (review) ------------------------------------------- */
.modal--side {
    width: min(620px, 100vw);
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0 0 0 auto;
    border-radius: 0;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, .8);
    box-shadow: -30px 0 80px -30px rgba(15, 23, 42, .35);
}
.modal--side[open] { display: flex; flex-direction: column; animation-name: panelMasuk; animation-duration: .5s; }
.modal--side.is-closing { animation-name: panelKeluar; }
.modal--side > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal--side .modal__body { flex: 1 1 auto; max-height: none; }
@keyframes panelMasuk  { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes panelKeluar { to   { opacity: 0; transform: translateX(40px); } }

.hp-rv { padding: 12px 0; border-top: 1px solid var(--line); }
.hp-rv:first-of-type { border-top: 0; }
.hp-rv__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.hp-rv__row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 150px; gap: 8px; align-items: center; margin-top: 8px; }
.hp-rv__q { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 38px; }
.hp-rv__q.is-chg { border-color: #E9B44C; background: #FFFBF2; }
.hp-rv__why { margin-top: 8px; min-height: 38px; }
.hp-rv__src { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: 8px; }
.hp-rv__usul { margin: 4px 0 0; }
.hp-rv__total { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); font-size: 14px; }
.hp-short { color: #B42318; }

/* --- Halaman detail --------------------------------------------------- */
.hp-track-card { overflow-x: auto; padding: 18px 20px; }
.hp-track { list-style: none; margin: 0; padding: 4px 0 0; display: grid; grid-template-columns: repeat(10, minmax(78px, 1fr)); min-width: 860px; }
.hp-track__i { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hp-track__i::before { content: ""; position: absolute; top: 9px; right: 50%; width: 100%; height: 2px; background: var(--accent); }
.hp-track__i:first-child::before { display: none; }
.hp-track__i.is-next::before { background: #E6EAF1; }
.hp-track__d { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--white); }
.hp-track__i.is-now .hp-track__d { background: var(--green); animation: denyut 2.4s ease-in-out infinite; }
.hp-track__i.is-next .hp-track__d { background: var(--white); border: 2px solid #CDD5E1; }
.hp-track__i b { font-size: 12.5px; line-height: 1.25; }
.hp-track__i span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hp-track__i.is-now b { color: var(--green); }
.hp-track__i.is-next b { color: var(--muted); font-weight: 600; }
@keyframes denyut {
    0%, 100% { box-shadow: 0 0 0 4px var(--white), 0 0 0 8px rgba(22, 121, 74, .16); }
    50%      { box-shadow: 0 0 0 4px var(--white), 0 0 0 12px rgba(22, 121, 74, .05); }
}

.hp-act {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 20px;
    border-radius: var(--radius-lg); border: 1px solid #D9E2FC;
    background: linear-gradient(135deg, rgba(238, 242, 254, .9), rgba(255, 255, 255, .9));
    box-shadow: var(--shadow);
}
.hp-act__who { display: flex; flex-direction: column; gap: 2px; flex: 1 1 280px; min-width: 0; }
.hp-act__l { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.hp-act__warn { font-size: 13px; color: #8A5300; }

.hp-cols { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.hp-cols__main { flex: 999 1 620px; min-width: 0; }
.hp-cols__side { flex: 1 1 320px; min-width: 0; }
.hp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); padding: 0; }
.hp-stats > div { padding: 16px 20px; }
.hp-stats > div + div { border-left: 1px solid var(--line); }
.hp-stats span { font-size: 13px; color: var(--muted); }
.hp-stats b { display: block; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hp-stats small { font-size: 14px; color: var(--muted); font-weight: 500; }
.hp-laju { position: relative; height: 10px; border-radius: 99px; background: #EEF1F6; }
.hp-laju span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #16794A, #22A35F); animation: tumbuh 1.1s var(--ease) both; }
.hp-laju i { position: absolute; top: -5px; width: 2px; height: 20px; border-radius: 2px; background: var(--ink); }
@keyframes tumbuh { from { width: 0; } }
.hp-laju__ket { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; }
.hp-quote { margin: 14px 0 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--ink-2); font-size: 14px; }
.hp-kendala { padding: 16px 18px; margin-bottom: var(--gap); border-radius: var(--radius-lg); background: linear-gradient(180deg, #FFF6F5, #FFFFFF); border: 1px solid #F8D4CF; box-shadow: var(--shadow); animation: muncul .45s var(--ease) both; }
.hp-kendala__t { margin: 10px 0 4px; font-size: 14.5px; font-weight: 600; }
.hp-inline { display: flex; gap: 8px; margin-top: 10px; }
.hp-inline input { min-height: 38px; }
.hp-chg { margin-top: 4px; font-size: 12.5px; color: #8A5300; }
.hp-total td { background: var(--soft); font-weight: 700; }
.hp-odp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.hp-odp { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font-size: 12.5px; color: var(--muted); }
.hp-odp b { font-size: 14px; color: var(--ink); }
.hp-odp.is-done { background: #EEF2FE; border-color: #D3DDFB; }
.hp-odp.is-active { background: #EAF6EF; border-color: #C9E7D5; }
.hp-odp.is-active span { color: #16794A; font-weight: 600; }
.hp-odp.is-cancel { opacity: .55; text-decoration: line-through; }
.hp-day { padding: 12px 0; border-top: 1px solid var(--line); }
.hp-day:first-of-type { border-top: 0; padding-top: 0; }
.hp-day header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hp-day p { margin: 6px 0 0; }
tr.hp-fail td { background: #FFF6F5; }
.hp-ring { height: 8px; border-radius: 99px; background: #EEF1F6; overflow: hidden; margin: 4px 0 6px; }
.hp-ring span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2F5BEA, #16794A); transition: width .7s var(--ease); }
.hp-req { list-style: none; margin: 8px 0 0; padding: 0; }
.hp-req li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hp-req li > span { flex: 0 0 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.hp-req li.is-ok > span { background: #EAF6EF; color: #16794A; }
.hp-req li.is-no > span { background: #FEF0EE; color: #B42318; }
.hp-req small { display: block; color: var(--muted); font-size: 12.5px; }
.hp-done { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #EAF6EF; color: #135E3A; font-weight: 600; }

/* Isian kecil di dalam tabel dan pop-up lapangan. */
.hp-cell { width: 96px; min-height: 36px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.hp-cell--sm { width: 70px; text-align: center; }
.hp-recv { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hp-recv:first-of-type { border-top: 0; }
.hp-recv > div:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.hp-check { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; color: var(--muted); }
.hp-odp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hp-odp-pick__i { display: flex; gap: 8px; align-items: center; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer; transition: border-color .2s, background .2s; }
.hp-odp-pick__i:has(input[type="checkbox"]:checked) { border-color: var(--accent); background: #F3F6FE; }
.hp-odp-pick__i span { flex: 1 1 auto; font-weight: 700; color: var(--ink); }
.hp-gain { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: #EAF6EF; color: #16794A; font-size: 14px; }
.hp-pageform { padding: 0; overflow: hidden; }
.hp-pageform .modal__body { max-height: none; padding-top: 20px; }

@media (max-width: 640px) {
    .hp-grid { grid-template-columns: minmax(0, 1fr); }
    .hp-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hp-steps { padding-left: 16px; padding-right: 16px; }
    .hp-note { margin-left: 16px; margin-right: 16px; }
    .hp-rv__row { grid-template-columns: minmax(0, 1fr) 96px; }
    .hp-rv__row select { grid-column: 1 / -1; }
    .hp-mat__src { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hp-mat__src > .hp-mat__f:first-child { grid-column: 1 / -1; }
    .modal--side { width: 100vw; }
    .hp-stats > div + div { border-left: 0; }
}

/* --- Intip password (sandi.js) ---------------------------------------- */
.pw { position: relative; display: block; }
.pw > input { width: 100%; padding-right: 48px; }
.pw__btn {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
    transition: background .2s, color .2s;
}
.pw__btn:hover { background: rgba(15, 23, 42, .06); color: var(--ink); }
.pw__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw__btn[aria-pressed="true"] { color: var(--accent); }

/* --- Homepass di lapangan: baris ODP, tiang, aktivasi, OTDR ----------- */
/* Satu baris = satu benda. Kolomnya sama di setiap baris, jadi daftar
   panjang tetap terbaca seperti tabel tanpa menjadi tabel lebar. */
.hp-lines { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.hp-line {
    display: grid; align-items: center; gap: 8px;
    grid-template-columns: minmax(0, 1.5fr) 82px minmax(0, 1.4fr) auto 36px;
}
.hp-line.is-new { animation: muncul .32s var(--ease) both; }
.hp-line > input, .hp-line > select, .hp-line__geo input { width: 100%; min-width: 0; }
.hp-line--head { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 2px; }
.hp-line--tiang { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px; }
.hp-line--akt { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr); }
.hp-line--otdr { grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1.2fr); }
.hp-line__kode { font-variant-numeric: tabular-nums; text-transform: uppercase; }
.hp-line__kode::placeholder { text-transform: none; }
.hp-line__odp { display: flex; flex-direction: column; min-width: 0; }
.hp-line__odp b { font-size: 14px; overflow-wrap: anywhere; }
.hp-line__odp small { font-size: 12px; }
.hp-line__geo { position: relative; display: block; min-width: 0; }
.hp-line__geo input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.hp-geo {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
    display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer;
    transition: background .2s, color .2s;
}
.hp-geo:hover { background: rgba(15, 23, 42, .06); color: var(--accent); }
.hp-geo.is-busy { color: var(--accent); animation: denyut 1s ease-in-out infinite; }
@keyframes denyut { 50% { opacity: .35; } }
.hp-line__foto {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 0 12px; border: 1px dashed var(--line); border-radius: 10px;
    font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; max-width: 160px;
    transition: border-color .2s, color .2s, background .2s;
}
.hp-line__foto:hover { border-color: var(--accent); color: var(--accent); }
.hp-line__foto.is-set { border-style: solid; border-color: #BFE3CF; background: #F1FBF5; color: #17663A; }
.hp-line__foto span { overflow: hidden; text-overflow: ellipsis; }
.hp-line__foto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hp-line__foto--doc { max-width: none; width: 100%; }
.hp-line__x {
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent;
    color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.hp-line__x:hover { background: #FDECEA; color: var(--red); }

@media (max-width: 640px) {
    /* Di ponsel satu baris ODP menjadi dua: kode + splitter, lalu
       koordinat + foto + hapus. */
    .hp-line { grid-template-columns: minmax(0, 1fr) 78px; }
    .hp-line--head { display: none; }
    .hp-line__geo { grid-column: 1 / -1; }
    .hp-line > .hp-line__foto { justify-self: start; }
    .hp-line > .hp-line__x { justify-self: end; grid-column: 2; grid-row: 3; }
    .hp-line--tiang { grid-template-columns: minmax(0, 1fr) 36px; }
    .hp-line--tiang .hp-line__geo { grid-column: 1; }
    .hp-line--tiang .hp-line__x { grid-row: auto; }
    .hp-line--akt { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px 0; border-top: 1px solid var(--line); }
    .hp-line--akt .hp-line__odp { grid-column: 1 / -1; }
    .hp-line--otdr { grid-template-columns: minmax(0, 1fr) 110px; padding: 10px 0; border-top: 1px solid var(--line); }
    .hp-line--otdr .hp-line__foto { grid-column: 1 / -1; }
}

/* Daftar ODP di tab Pekerjaan dan di dalam laporan harian. */
.hp-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hp-card-head .card__title { flex: 1 1 auto; }
.hp-odpl { list-style: none; margin: 0; padding: 0; }
.hp-odpl__i {
    display: grid; align-items: center; gap: 12px; padding: 10px 2px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) 96px 44px auto;
    border-top: 1px solid var(--line);
}
.hp-odpl__i:first-child { border-top: 0; }
.hp-odpl__kode { display: flex; flex-direction: column; min-width: 0; }
.hp-odpl__kode b { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.hp-odpl__geo { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hp-odpl__i > .badge { justify-self: end; }
.hp-odpl--mini .hp-odpl__i { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 44px; padding: 7px 2px; }
.hp-day__odp { margin: 6px 0 2px; }
.hp-day__odp summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); width: max-content; }
.hp-day__odp[open] summary { margin-bottom: 4px; }
@media (max-width: 640px) {
    .hp-odpl__i { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
    .hp-odpl__geo, .hp-odpl__tgl { grid-column: 1; }
    .hp-odpl__foto { grid-column: 2; grid-row: 2; justify-self: end; }
    .hp-odpl__i > .badge { grid-column: 2; grid-row: 1; }
    .hp-odpl--mini .hp-odpl__i { grid-template-columns: minmax(0, 1fr) auto; }
}

.hp-seg--wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hp-sisa { margin-bottom: 16px; }
.hp-sisa legend { font-size: 14px; margin-bottom: 8px; }
.hp-akt td { vertical-align: top; }

/* Pratinjau berkas: foto pas di layar, PDF setinggi pop-up. */
/* --- Warna serat optik pada QC ----------------------------------------- */
.serat {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px 0 4px;
    border: 1px solid rgba(15, 23, 42, .3);
    border-radius: 50%;
}
.serat--biru   { background: #2563EB; }
.serat--oranye { background: #F97316; }
.serat--hijau  { background: #16A34A; }
.serat--coklat { background: #92400E; }
.serat--abu    { background: #94A3B8; }
.serat--putih  { background: #FFFFFF; }
.serat--merah  { background: #DC2626; }
.serat--hitam  { background: #111827; }
.serat--kuning { background: #FACC15; }
.serat--ungu   { background: #7C3AED; }
.serat--pink   { background: #F472B6; }
.serat--toska  { background: #2DD4BF; }

/* --- Pratinjau foto dan berkas ----------------------------------------- */
a[data-preview] > img { cursor: zoom-in; }
.modal--preview { width: min(1000px, calc(100vw - 32px)); }
.pratinjau__isi { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal--preview.is-penuh .pratinjau__isi { height: 100%; background: #fff; }
.pratinjau__judul { min-width: 0; }
.modal--preview .modal__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pratinjau__alat { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pratinjau__zoom { display: inline-flex; align-items: center; gap: 4px; }
.pratinjau__zoom[hidden] { display: none; }
.pratinjau__persen { min-width: 62px; justify-content: center; font-variant-numeric: tabular-nums; }
.pratinjau {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    min-height: 200px;
    margin: 0 24px 24px;
    border-radius: 12px;
    background: var(--soft);
    color: var(--muted);
    overflow: hidden;
    touch-action: none;
}
.pratinjau img { display: block; max-width: none; cursor: zoom-in; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.pratinjau.is-zoom img { cursor: grab; }
.pratinjau.is-geser img { cursor: grabbing; }
.pratinjau iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pratinjau__pesan { margin: 0; padding: 24px; text-align: center; }

.modal--preview.is-penuh {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
}
.modal--preview.is-penuh .modal__head { padding: 10px 16px; }
.modal--preview.is-penuh .pratinjau {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    background: #0B1220;
    color: #CBD5E1;
}

@media (max-width: 640px) {
    .modal--preview { width: 100vw; }
    .modal--preview .modal__head { flex-wrap: wrap; padding: 14px 16px 12px; }
    .modal--preview .modal__spacer { display: none; }
    .pratinjau__judul { flex: 1 1 0; }
    .pratinjau__alat { order: 3; flex: 1 1 100%; justify-content: space-between; }
    .pratinjau { margin: 0 12px 12px; }
}

/* --- Peta homepass ----------------------------------------------------- */
.hp-peta-card { padding: 0; overflow: hidden; }
.hp-peta-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 18px; font-size: 13px; border-bottom: 1px solid var(--line); }
.hp-peta-legend span { display: inline-flex; align-items: center; gap: 7px; }
.hp-peta { height: min(72dvh, 680px); min-height: 360px; background: #E8EDF3; }
.hp-peta-card .empty { margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); }
.hp-mk { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .2); }
.hp-mk--aktif { background: #16A34A; }
.hp-mk--pasang { background: #2563EB; }
.hp-mk--tiang { width: 8px; height: 8px; background: #94A3B8; border-width: 1px; }
.hp-mk--odc { border-radius: 3px; background: #0F172A; }
.hp-mk--peta { width: 16px !important; height: 16px !important; margin-left: -8px !important; margin-top: -8px !important; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { font-size: 13px; line-height: 1.5; }

/* Harga satuan per baris pengajuan pembelian. */
.pr-harga { display: inline-flex; gap: 6px; align-items: center; }
.pr-harga input { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }

/* --- Gudang: kartu stok per gudang ----------------------------------- */
.gd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin-bottom: 28px; }
.gd-card {
    display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius-lg);
    background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
    animation: muncul .45s var(--ease) both;
}
.gd-card:hover { transform: translateY(-2px); border-color: #C9D5EA; box-shadow: 0 18px 40px -22px rgba(15, 23, 42, .35); }
.gd-card.is-off { opacity: .6; }
.gd-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gd-card__top b { font-size: 15.5px; }
.gd-card__num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gd-card__num small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.gd-card__val { font-weight: 600; font-variant-numeric: tabular-nums; }
.gd-minus { color: var(--red); font-weight: 600; }
.gd-h2 { font-size: 16px; margin: 4px 0 12px; }
.gd-in { color: #17663A; }
.gd-out { color: var(--red); }
.gd-pakai { padding: 10px 0; border-top: 1px solid var(--line); }
.gd-pakai:first-of-type { border-top: 0; }
.gd-pakai summary { cursor: pointer; font-weight: 600; }
.gd-pakai__l { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 24px; }
.gd-pakai__l li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.gd-pakai__l b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Catatan persetujuan Project Manager di ringkasan pengajuan. */
.hp-note--ok { background: rgba(232, 247, 238, .9); border-color: #BFE3CF; }
.hp-note--ok strong { color: #17663A; }
.hp-pm-mat { margin-top: 4px; }
.hp-mk--lokasi { border-radius: 4px; background: #D97706; }
.hp-peta-card .hp-peta-ket { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); }
.hp-mk--tinggi { background: #DC2626; }

/* Posisi pengguna di peta: ungu, supaya tidak tertukar dengan titik biru ODP. */
.hp-mk--saya { background: #7C3AED; }
.hp-peta-gps { margin: 0; padding: 10px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.hp-peta-gps[data-keadaan="ok"] { color: #5B21B6; font-weight: 600; }
.hp-peta-gps[data-keadaan="gagal"] { color: #8A5300; background: rgba(253, 244, 227, .85); }
.hp-saya { border-radius: 50%; background: #7C3AED; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .45); }
.hp-saya::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: rgba(124, 58, 237, .45); z-index: -1; animation: gpsDenyut 2s var(--ease) infinite; }
@keyframes gpsDenyut { from { transform: scale(1); opacity: .9; } to { transform: scale(3); opacity: 0; } }
.hp-gps-btn { display: grid !important; place-items: center; color: #5B21B6 !important; cursor: pointer; }
@media (max-width: 640px) {
    .hp-peta { height: 68dvh; }
    .hp-peta-legend { gap: 6px 12px; padding: 10px 12px; font-size: 12px; }
    .hp-peta-gps { padding: 8px 12px; font-size: 12.5px; }
    .hp-gps-btn { width: 40px !important; height: 40px !important; line-height: 40px !important; }
}

/* --- Ringkasan project & homepass di dashboard ------------------------ */
.dash-ring { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--gap); margin-bottom: var(--gap); }
.dash-ring--satu { grid-template-columns: minmax(0, 1fr); }
.dash-ring > div { display: flex; flex-direction: column; }
.dash-ring__t { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.dash-ring__t .muted { font-weight: 500; }
.dash-ring__isi { flex: 1 1 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.dash-ring__ket { margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .dash-ring { grid-template-columns: minmax(0, 1fr); } }

/* --- Hak Akses ---------------------------------------------------------- */
.ha-peran { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gap); }
.ha-peran__i { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none; transition: background .2s, border-color .2s; }
.ha-peran__i:hover { border-color: #C9D5EA; }
.ha-peran__i.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ha-tabel .ha-sel { text-align: center; white-space: nowrap; }
.ha-cek { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; }
.ha-cek input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.ha-cek.is-beda { background: #FDF4E3; box-shadow: inset 0 0 0 1px #F3DDB2; }
.ha-kunci { font-size: 11.5px; color: var(--muted); }
.ha-pilih { min-width: 132px; font-size: 13px; }
.ha-pilih.is-beda { background: #FDF4E3; border-color: #F3DDB2; }
.ha-khusus { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ha-khusus li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ha-tabel td { vertical-align: middle; }
